mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-14 21:06:40 +02:00
Added tests for adapted empty struct.
This commit is contained in:
18
test/Jamfile
18
test/Jamfile
@ -165,24 +165,42 @@ project
|
||||
[ run sequence/repetitive_view.cpp : : : : ]
|
||||
[ run sequence/deduce_sequence.cpp : : : : ]
|
||||
[ run sequence/adapt_adt_named.cpp : : : : ]
|
||||
[ run sequence/adapt_adt_named_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_adt.cpp : : : : ]
|
||||
[ run sequence/adapt_adt_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_adt_named.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_adt_named_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_adt.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_adt_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_struct_named.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_struct_named_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_struct.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_struct_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_tpl_adt.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_tpl_adt_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_tpl_struct.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_tpl_struct_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_struct_named.cpp : : : : ]
|
||||
[ run sequence/adapt_struct_named_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_struct.cpp : : : : ]
|
||||
[ run sequence/adapt_struct_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_tpl_adt.cpp : : : : ]
|
||||
[ run sequence/adapt_tpl_adt_empty.cpp : : : : ]
|
||||
[ run sequence/adapt_tpl_struct.cpp : : : : ]
|
||||
[ run sequence/adapt_tpl_struct_empty.cpp : : : : ]
|
||||
[ run sequence/adt_attribute_proxy.cpp : : : : ]
|
||||
[ run sequence/define_struct.cpp : : : : ]
|
||||
[ run sequence/define_struct_empty.cpp : : : : ]
|
||||
[ run sequence/define_struct_inline.cpp : : : : ]
|
||||
[ run sequence/define_struct_inline_empty.cpp : : : : ]
|
||||
[ run sequence/define_assoc_struct.cpp : : : : ]
|
||||
[ run sequence/define_assoc_struct_empty.cpp : : : : ]
|
||||
[ run sequence/define_tpl_struct.cpp : : : : ]
|
||||
[ run sequence/define_tpl_struct_empty.cpp : : : : ]
|
||||
[ run sequence/define_tpl_struct_inline.cpp : : : : ]
|
||||
[ run sequence/define_tpl_struct_inline_empty.cpp : : : : ]
|
||||
[ run sequence/define_assoc_tpl_struct.cpp : : : : ]
|
||||
[ run sequence/define_assoc_tpl_struct_empty.cpp : : : : ]
|
||||
[ run sequence/std_tuple.cpp : : : : ]
|
||||
[ run sequence/std_tuple_iterator.cpp : : : : ]
|
||||
[ run sequence/ref_vector.cpp : : : : ]
|
||||
|
86
test/sequence/adapt_adt_empty.cpp
Normal file
86
test/sequence/adapt_adt_empty.cpp
Normal file
@ -0,0 +1,86 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ADT(empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt>));
|
||||
empty_adt e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_adt>::type,
|
||||
fusion::result_of::end<empty_adt>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_adt e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_adt e;
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
87
test/sequence/adapt_adt_named_empty.cpp
Normal file
87
test/sequence/adapt_adt_named_empty.cpp
Normal file
@ -0,0 +1,87 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt_named.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ADT_NAMED(::empty_adt,empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
empty_adt empty;
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_adt>));
|
||||
adapted::empty_adt e(empty);
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_adt>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_adt>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<adapted::empty_adt>::type,
|
||||
fusion::result_of::end<adapted::empty_adt>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
adapted::empty_adt e(empty);
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
adapted::empty_adt e(empty);
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_adt>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
88
test/sequence/adapt_assoc_adt_empty.cpp
Normal file
88
test/sequence/adapt_assoc_adt_empty.cpp
Normal file
@ -0,0 +1,88 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT(empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt>));
|
||||
empty_adt e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_adt>::type,
|
||||
fusion::result_of::end<empty_adt>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_adt e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(e != v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_adt e;
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
89
test/sequence/adapt_assoc_adt_named_empty.cpp
Normal file
89
test/sequence/adapt_assoc_adt_named_empty.cpp
Normal file
@ -0,0 +1,89 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt_named.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(::empty_adt,empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
empty_adt empty;
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_adt>));
|
||||
adapted::empty_adt e(empty);
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_adt>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_adt>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<adapted::empty_adt>::type,
|
||||
fusion::result_of::end<adapted::empty_adt>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
adapted::empty_adt e(empty);
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(e != v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
adapted::empty_adt e(empty);
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_adt>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_adt, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_adt, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
88
test/sequence/adapt_assoc_struct_empty.cpp
Normal file
88
test/sequence/adapt_assoc_struct_empty.cpp
Normal file
@ -0,0 +1,88 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_struct>::type,
|
||||
fusion::result_of::end<empty_struct>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
89
test/sequence/adapt_assoc_struct_named_empty.cpp
Normal file
89
test/sequence/adapt_assoc_struct_named_empty.cpp
Normal file
@ -0,0 +1,89 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(::empty_struct,empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
empty_struct empty;
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_struct>));
|
||||
adapted::empty_struct e(empty);
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_struct>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_struct>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<adapted::empty_struct>::type,
|
||||
fusion::result_of::end<adapted::empty_struct>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
adapted::empty_struct e(empty);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
adapted::empty_struct e(empty);
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_struct>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_struct, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_struct, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
89
test/sequence/adapt_assoc_tpl_adt_empty.cpp
Normal file
89
test/sequence/adapt_assoc_tpl_adt_empty.cpp
Normal file
@ -0,0 +1,89 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_ADT((T), (empty_adt)(T),)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt<void> >));
|
||||
empty_adt<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt<void> >::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt<void> >));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_adt<void> >::type,
|
||||
fusion::result_of::end<empty_adt<void> >::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_adt<void> e;
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_adt<void> e;
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt<void> >));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt<void>, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt<void>, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
89
test/sequence/adapt_assoc_tpl_struct_empty.cpp
Normal file
89
test/sequence/adapt_assoc_tpl_struct_empty.cpp
Normal file
@ -0,0 +1,89 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT((T), (empty_struct)(T),)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct<void> >));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_struct<void> >::type,
|
||||
fusion::result_of::end<empty_struct<void> >::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
86
test/sequence/adapt_struct_empty.cpp
Normal file
86
test/sequence/adapt_struct_empty.cpp
Normal file
@ -0,0 +1,86 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_STRUCT(empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_struct>::type,
|
||||
fusion::result_of::end<empty_struct>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(e != v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
87
test/sequence/adapt_struct_named_empty.cpp
Normal file
87
test/sequence/adapt_struct_named_empty.cpp
Normal file
@ -0,0 +1,87 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct_named.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED(::empty_struct,empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
empty_struct empty;
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_struct>));
|
||||
adapted::empty_struct e(empty);
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_struct>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_struct>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<adapted::empty_struct>::type,
|
||||
fusion::result_of::end<adapted::empty_struct>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
adapted::empty_struct e(empty);
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(e != v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
adapted::empty_struct e(empty);
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_struct>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
87
test/sequence/adapt_tpl_adt_empty.cpp
Normal file
87
test/sequence/adapt_tpl_adt_empty.cpp
Normal file
@ -0,0 +1,87 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_TPL_ADT((T), (empty_adt)(T),)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt<void> >));
|
||||
empty_adt<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt<void> >::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt<void> >));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_adt<void> >::type,
|
||||
fusion::result_of::end<empty_adt<void> >::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_adt<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_adt<void> e;
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt<void> >));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
87
test/sequence/adapt_tpl_struct_empty.cpp
Normal file
87
test/sequence/adapt_tpl_struct_empty.cpp
Normal file
@ -0,0 +1,87 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_TPL_STRUCT((T), (empty_struct)(T),)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct<void> >));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_struct<void> >::type,
|
||||
fusion::result_of::end<empty_struct<void> >::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
77
test/sequence/define_assoc_struct_empty.cpp
Normal file
77
test/sequence/define_assoc_struct_empty.cpp
Normal file
@ -0,0 +1,77 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_ASSOC_STRUCT(BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct>::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct>::type b;
|
||||
typedef fusion::result_of::end<empty_struct>::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
77
test/sequence/define_assoc_tpl_struct_empty.cpp
Normal file
77
test/sequence/define_assoc_tpl_struct_empty.cpp
Normal file
@ -0,0 +1,77 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT((M), BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct<void> >::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct<void> >::type b;
|
||||
typedef fusion::result_of::end<empty_struct<void> >::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
75
test/sequence/define_struct_empty.cpp
Normal file
75
test/sequence/define_struct_empty.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct>::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct>::type b;
|
||||
typedef fusion::result_of::end<empty_struct>::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
75
test/sequence/define_struct_inline_empty.cpp
Normal file
75
test/sequence/define_struct_inline_empty.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_STRUCT_INLINE(empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct>::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct>::type b;
|
||||
typedef fusion::result_of::end<empty_struct>::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
75
test/sequence/define_tpl_struct_empty.cpp
Normal file
75
test/sequence/define_tpl_struct_empty.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT((M), BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct<void> >::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct<void> >::type b;
|
||||
typedef fusion::result_of::end<empty_struct<void> >::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
75
test/sequence/define_tpl_struct_inline_empty.cpp
Normal file
75
test/sequence/define_tpl_struct_inline_empty.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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 <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE((M), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct<void> >::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct<void> >::type b;
|
||||
typedef fusion::result_of::end<empty_struct<void> >::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user