1
0
forked from boostorg/core
Files
boost_core/test/ref_rv_fail1.cpp

24 lines
524 B
C++
Raw Permalink Normal View History

2014-06-10 03:26:09 +03:00
//
// Test that a reference_wrapper can't be constructed from an rvalue
//
// Copyright 2014 Agustin Berge
//
2014-06-10 03:26:09 +03:00
// 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
//
2022-12-22 18:59:27 +03:00
#include <boost/core/ref.hpp>
2014-06-10 03:14:33 +03:00
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
int main()
{
2014-06-10 03:26:09 +03:00
boost::reference_wrapper<int const> r( 1 ); // this should produce an ERROR
(void)r;
}
2014-06-10 03:14:33 +03:00
#else
# error To fail, this test requires rvalue references
#endif