]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/tr1/test/test_reference_wrapper.cpp
1 // (C) Copyright John Maddock 2005.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #ifdef TEST_STD_HEADERS
9 #include <boost/tr1/functional.hpp>
12 #include <boost/static_assert.hpp>
13 #include <boost/type_traits/is_convertible.hpp>
14 #include <boost/type_traits/is_same.hpp>
18 typedef std::tr1::reference_wrapper
<int> rr_type
;
19 typedef std::tr1::reference_wrapper
<const int> crr_type
;
22 rr_type r1
= std::tr1::ref(i
);
23 crr_type r2
= std::tr1::cref(i
);
24 r1
= std::tr1::ref(j
);
28 BOOST_STATIC_ASSERT((::boost::is_convertible
<rr_type
, int&>::value
));
29 BOOST_STATIC_ASSERT((::boost::is_convertible
<crr_type
, const int&>::value
));
30 BOOST_STATIC_ASSERT((::boost::is_same
<rr_type::type
, int>::value
));
31 BOOST_STATIC_ASSERT((::boost::is_same
<crr_type::type
, const int>::value
));