mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 06:15:23 +02:00
adding tests to attest other views don't suffer of it either
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include <boost/mpl/list.hpp>
|
#include <boost/mpl/list.hpp>
|
||||||
#include <boost/mpl/sizeof.hpp>
|
#include <boost/mpl/sizeof.hpp>
|
||||||
#include <boost/mpl/deref.hpp>
|
#include <boost/mpl/deref.hpp>
|
||||||
|
#include <boost/mpl/equal.hpp>
|
||||||
#include <boost/mpl/aux_/test.hpp>
|
#include <boost/mpl/aux_/test.hpp>
|
||||||
|
|
||||||
#include <boost/type_traits/is_float.hpp>
|
#include <boost/type_traits/is_float.hpp>
|
||||||
@@ -26,6 +27,10 @@
|
|||||||
MPL_TEST_CASE()
|
MPL_TEST_CASE()
|
||||||
{
|
{
|
||||||
typedef mpl::list<int,float,long,float,char[50],long double,char> types;
|
typedef mpl::list<int,float,long,float,char[50],long double,char> types;
|
||||||
|
typedef mpl::list<float,float,long double> floats;
|
||||||
|
|
||||||
|
MPL_ASSERT(( equal< mpl::filter_view< types,boost::is_float<_> >::type,floats > ));
|
||||||
|
|
||||||
typedef mpl::max_element<
|
typedef mpl::max_element<
|
||||||
mpl::transform_view<
|
mpl::transform_view<
|
||||||
mpl::filter_view< types,boost::is_float<_> >
|
mpl::filter_view< types,boost::is_float<_> >
|
||||||
|
@@ -30,6 +30,7 @@ MPL_TEST_CASE()
|
|||||||
typedef range_c<int,0,15> answer;
|
typedef range_c<int,0,15> answer;
|
||||||
|
|
||||||
MPL_ASSERT(( equal<numbers,answer> ));
|
MPL_ASSERT(( equal<numbers,answer> ));
|
||||||
|
MPL_ASSERT(( equal<numbers::type,answer> ));
|
||||||
MPL_ASSERT_RELATION( size<numbers>::value, ==, 15 );
|
MPL_ASSERT_RELATION( size<numbers>::value, ==, 15 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include <boost/mpl/advance.hpp>
|
#include <boost/mpl/advance.hpp>
|
||||||
#include <boost/mpl/size.hpp>
|
#include <boost/mpl/size.hpp>
|
||||||
#include <boost/mpl/begin_end.hpp>
|
#include <boost/mpl/begin_end.hpp>
|
||||||
|
#include <boost/mpl/equal.hpp>
|
||||||
#include <boost/mpl/aux_/test.hpp>
|
#include <boost/mpl/aux_/test.hpp>
|
||||||
|
|
||||||
MPL_TEST_CASE()
|
MPL_TEST_CASE()
|
||||||
@@ -37,4 +38,6 @@ MPL_TEST_CASE()
|
|||||||
MPL_ASSERT_RELATION( (mpl::distance<last,last>::value), ==, 0 );
|
MPL_ASSERT_RELATION( (mpl::distance<last,last>::value), ==, 0 );
|
||||||
|
|
||||||
MPL_ASSERT_RELATION( size<view>::value, ==, 1 );
|
MPL_ASSERT_RELATION( size<view>::value, ==, 1 );
|
||||||
|
|
||||||
|
MPL_ASSERT(( equal< view, view::type > ));
|
||||||
}
|
}
|
||||||
|
@@ -16,12 +16,22 @@
|
|||||||
#include <boost/mpl/max_element.hpp>
|
#include <boost/mpl/max_element.hpp>
|
||||||
#include <boost/mpl/list.hpp>
|
#include <boost/mpl/list.hpp>
|
||||||
#include <boost/mpl/sizeof.hpp>
|
#include <boost/mpl/sizeof.hpp>
|
||||||
|
#include <boost/mpl/equal.hpp>
|
||||||
#include <boost/mpl/aux_/test.hpp>
|
#include <boost/mpl/aux_/test.hpp>
|
||||||
|
|
||||||
|
|
||||||
MPL_TEST_CASE()
|
MPL_TEST_CASE()
|
||||||
{
|
{
|
||||||
typedef list<int,long,char,char[50],double> types;
|
typedef list<int,long,char,char[50],double> types;
|
||||||
|
typedef list<
|
||||||
|
sizeof_<int>::type,
|
||||||
|
sizeof_<long>::type,
|
||||||
|
sizeof_<char>::type,
|
||||||
|
sizeof_<char[50]>::type,
|
||||||
|
sizeof_<double>::type
|
||||||
|
> sizes;
|
||||||
|
|
||||||
|
MPL_ASSERT(( equal< transform_view< types, sizeof_<_> >::type,sizes > ));
|
||||||
|
|
||||||
typedef max_element<
|
typedef max_element<
|
||||||
transform_view< types, sizeof_<_> >
|
transform_view< types, sizeof_<_> >
|
||||||
>::type iter;
|
>::type iter;
|
||||||
|
Reference in New Issue
Block a user