]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/variant/test/variant_rvalue_get_with_ampersand_test.cpp
1 //-----------------------------------------------------------------------------
2 // boost-libs variant/test/variant_get_test.cpp source file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
6 // Copyright (c) 2017-2017 Albert Sverdlov
8 // Distributed under the Boost Software License, Version 1.0. (See
9 // accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
12 #include "boost/variant/get.hpp"
13 #include "boost/variant/variant.hpp"
14 #include "boost/test/minimal.hpp"
16 #include <boost/move/move.hpp>
17 #include <boost/static_assert.hpp>
21 #define UNUSED(v) (void)(v)
25 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
26 typedef boost::variant
<int, std::string
> var_t
;
28 std::string s
= "abacaba";
31 // must spit an error at compile-time because of 'std::string&'
32 std::string new_s
= boost::strict_get
<std::string
&>(boost::move(v
));
35 BOOST_STATIC_ASSERT_MSG(false, "Dummy compile-time error to pass the test on C++03");
39 int test_main(int /*argc*/, char* /*argv*/ [])
42 return boost::exit_success
;