]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/variant/test/recursive_wrapper_move_test.cpp
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 #include "boost/config.hpp"
9 #include "boost/test/minimal.hpp"
11 #ifdef __cpp_inheriting_constructors
12 // Test is based on reported issue:
13 // https://svn.boost.org/trac/boost/ticket/12680
14 // GCC 6 crashed, trying to determine is boost::recursive_wrapper<Node>
15 // is_noexcept_move_constructible
20 #include <boost/variant.hpp>
21 #include <boost/array.hpp>
26 typedef boost::variant
<Leaf
, boost::recursive_wrapper
<Node
>> TreeBase
;
28 struct Tree
: TreeBase
{
29 using TreeBase::TreeBase
;
31 template <typename Iter
>
32 static Tree
Create(Iter
/*first*/, Iter
/*last*/) { return Leaf
{}; }
40 // Test from https://svn.boost.org/trac/boost/ticket/7120
46 using var_base
= boost::variant
<int,
47 boost::recursive_wrapper
<node1_type
<var_type
>>
52 boost::array
<Node
, 1> children
;
55 struct var_type
: var_base
{
56 using var_base::var_base
;
60 std::string input
{"abracadabra"};
61 const Tree root
= Tree::Create(input
.begin(), input
.end());
62 (void)root
; // prevents unused variable warning
68 #else // #!ifdef __cpp_inheriting_constructors
69 // if compiler does not support inheriting constructors - does nothing
73 int test_main(int , char* [])