• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Test that a reference_wrapper can't be constructed from an rvalue
3 //
4 // Copyright 2014 Agustin Berge
5 //
6 // Distributed under the Boost Software License, Version 1.0.
7 // See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt
9 //
10 
11 #include <boost/ref.hpp>
12 
13 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
14 
main()15 int main()
16 {
17     boost::reference_wrapper<int const> r( 1 ); // this should produce an ERROR
18     (void)r;
19 }
20 
21 #else
22 #  error To fail, this test requires rvalue references
23 #endif
24