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