mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-15 21:32:22 +02:00
Add tests for #3225
This commit is contained in:
@ -16,6 +16,7 @@
|
|||||||
#include <boost/mpl/equal.hpp>
|
#include <boost/mpl/equal.hpp>
|
||||||
#include <boost/mpl/int.hpp>
|
#include <boost/mpl/int.hpp>
|
||||||
#include <boost/mpl/integral_c.hpp>
|
#include <boost/mpl/integral_c.hpp>
|
||||||
|
#include <boost/mpl/is_sequence.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -148,6 +149,17 @@ test()
|
|||||||
BOOST_STATIC_ASSERT(!traits::is_sequence<char>::value);
|
BOOST_STATIC_ASSERT(!traits::is_sequence<char>::value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ // testing mpl::is_sequence
|
||||||
|
|
||||||
|
typedef map<pair<k1, int>, pair<k2, float>, pair<k3, double> > t1;
|
||||||
|
typedef map<> t2;
|
||||||
|
typedef map<pair<k1, char> > t3;
|
||||||
|
|
||||||
|
BOOST_STATIC_ASSERT(boost::mpl::is_sequence<t1>::value);
|
||||||
|
BOOST_STATIC_ASSERT(boost::mpl::is_sequence<t2>::value);
|
||||||
|
BOOST_STATIC_ASSERT(boost::mpl::is_sequence<t3>::value);
|
||||||
|
}
|
||||||
|
|
||||||
{ // testing mpl compatibility
|
{ // testing mpl compatibility
|
||||||
|
|
||||||
// test an algorithm
|
// test an algorithm
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <boost/mpl/equal.hpp>
|
#include <boost/mpl/equal.hpp>
|
||||||
#include <boost/mpl/int.hpp>
|
#include <boost/mpl/int.hpp>
|
||||||
#include <boost/mpl/integral_c.hpp>
|
#include <boost/mpl/integral_c.hpp>
|
||||||
|
#include <boost/mpl/is_sequence.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -175,6 +176,17 @@ test()
|
|||||||
BOOST_STATIC_ASSERT(!traits::is_sequence<char>::value);
|
BOOST_STATIC_ASSERT(!traits::is_sequence<char>::value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ // testing mpl::is_sequence
|
||||||
|
|
||||||
|
typedef FUSION_SEQUENCE<int, float, double> t1;
|
||||||
|
typedef FUSION_SEQUENCE<> t2;
|
||||||
|
typedef FUSION_SEQUENCE<char> t3;
|
||||||
|
|
||||||
|
BOOST_STATIC_ASSERT(boost::mpl::is_sequence<t1>::value);
|
||||||
|
BOOST_STATIC_ASSERT(boost::mpl::is_sequence<t2>::value);
|
||||||
|
BOOST_STATIC_ASSERT(boost::mpl::is_sequence<t3>::value);
|
||||||
|
}
|
||||||
|
|
||||||
{ // testing mpl compatibility
|
{ // testing mpl compatibility
|
||||||
|
|
||||||
// test begin, end, next, prior, advance, size, deref, etc.
|
// test begin, end, next, prior, advance, size, deref, etc.
|
||||||
|
@ -18,8 +18,10 @@
|
|||||||
#include <boost/fusion/iterator/next.hpp>
|
#include <boost/fusion/iterator/next.hpp>
|
||||||
#include <boost/fusion/support/pair.hpp>
|
#include <boost/fusion/support/pair.hpp>
|
||||||
#include <boost/fusion/support/category_of.hpp>
|
#include <boost/fusion/support/category_of.hpp>
|
||||||
|
#include <boost/fusion/support/is_sequence.hpp>
|
||||||
#include <boost/static_assert.hpp>
|
#include <boost/static_assert.hpp>
|
||||||
#include <boost/mpl/assert.hpp>
|
#include <boost/mpl/assert.hpp>
|
||||||
|
#include <boost/mpl/is_sequence.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -78,6 +80,28 @@ main()
|
|||||||
BOOST_TEST(at_key<int>(make_set('X', 123)) == 123);
|
BOOST_TEST(at_key<int>(make_set('X', 123)) == 123);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ // testing is_sequence
|
||||||
|
|
||||||
|
typedef set<int, float, double> t1;
|
||||||
|
typedef set<> t2;
|
||||||
|
typedef set<char> t3;
|
||||||
|
|
||||||
|
BOOST_MPL_ASSERT((traits::is_sequence<t1>));
|
||||||
|
BOOST_MPL_ASSERT((traits::is_sequence<t2>));
|
||||||
|
BOOST_MPL_ASSERT((traits::is_sequence<t3>));
|
||||||
|
}
|
||||||
|
|
||||||
|
{ // testing mpl::is_sequence
|
||||||
|
|
||||||
|
typedef set<int, float, double> t1;
|
||||||
|
typedef set<> t2;
|
||||||
|
typedef set<char> t3;
|
||||||
|
|
||||||
|
BOOST_MPL_ASSERT((boost::mpl::is_sequence<t1>));
|
||||||
|
BOOST_MPL_ASSERT((boost::mpl::is_sequence<t2>));
|
||||||
|
BOOST_MPL_ASSERT((boost::mpl::is_sequence<t3>));
|
||||||
|
}
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user