/*============================================================================= Copyright (C) 2015 Kohei Takahshi 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 #include #include #include #include template class As> void test_from_sequence_rvalue() { typename As::type dst((C())); (void)dst; } template class As> void test_from_sequence_const_lvalue() { C src; typename As::type dst(src); (void)dst; } template class As> void test_from_sequence_lvalue() { const C src; typename As::type dst(src); (void)dst; } template class As> void test_from_sequence() { // the following tests do not work in all cases for C++03 #if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR) test_from_sequence_rvalue(); test_from_sequence_const_lvalue(); test_from_sequence_lvalue(); #endif } template void test_copy() { C src; C dst = src; (void)dst; } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template void test_move() { C src; C dst = std::move(src); (void)dst; } #endif template void test_all() { // as_deque and as_list do not work in C++03 or C++11 mode // test_from_sequence(); // test_from_sequence(); test_from_sequence(); test_copy(); #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) test_move(); #endif } void test() { using namespace boost::fusion; test_all > >(); test_all, int> >(); test_all > >(); test_all, float> >(); test_all > >(); test_all, int> >(); test_all > >(); test_all, float> >(); test_all > >(); test_all, int> >(); test_all > >(); test_all, float> >(); test_all, FUSION_SEQUENCE<> > >(); test_all, FUSION_SEQUENCE<> > >(); test_all, FUSION_SEQUENCE > >(); test_all< FUSION_SEQUENCE, FUSION_SEQUENCE > >(); test_all< FUSION_SEQUENCE, FUSION_SEQUENCE > >(); test_all< FUSION_SEQUENCE, FUSION_SEQUENCE > >(); test_all< FUSION_SEQUENCE< FUSION_SEQUENCE, FUSION_SEQUENCE > >(); }