1/*
2Copyright 2017 Glen Joseph Fernandes
3(glenjofe@gmail.com)
4
5Distributed under the Boost Software License, Version 1.0.
6(http://www.boost.org/LICENSE_1_0.txt)
7*/
8
9#include <boost/core/addressof.hpp>
10
11#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
12 !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
13struct type { };
14
15inline const type function()
16{
17 return type();
18}
19
20int main()
21{
22 (void)boost::addressof(function());
23}
24#else
25#error Requires rvalue references and deleted functions
26#endif
27

source code of boost/libs/core/test/addressof_fail_rvalue.cpp