limited metafunction form support
[SVN r16632]
This commit is contained in:
1 parent
e313e912f4
commit
0d06b02ab6
28 files changed
+464
-242
No files matched your search
+2
-1
@@ -31,6 +31,7 @@ compile erase_range.cpp ;
|
||||
compile filter_view.cpp ;
|
||||
compile find.cpp ;
|
||||
compile find_if.cpp ;
|
||||
compile fold.cpp ;
|
||||
unit-test for_each : for_each.cpp : <sysinclude>$(BOOST_ROOT) ;
|
||||
compile front.cpp ;
|
||||
compile identity.cpp ;
|
||||
@@ -48,10 +49,10 @@ compile list.cpp ;
|
||||
compile list_c.cpp ;
|
||||
compile logical.cpp ;
|
||||
compile lower_bound.cpp ;
|
||||
compile meta_fun.cpp ;
|
||||
compile next.cpp ;
|
||||
compile pop_front.cpp ;
|
||||
compile push_front.cpp ;
|
||||
compile quote.cpp ;
|
||||
compile range_c.cpp ;
|
||||
compile replace.cpp ;
|
||||
compile replace_if.cpp ;
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ int main()
|
||||
|
||||
BOOST_STATIC_ASSERT((mpl::count_if< types, boost::is_float<_> >::type::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::count_if< types, boost::is_same<_,char&> >::type::value == 2));
|
||||
BOOST_STATIC_ASSERT((mpl::count_if< types, boost::is_same<_,void> >::type::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::count_if< types, boost::is_same<_,void*> >::type::value == 0));
|
||||
|
||||
BOOST_STATIC_ASSERT((mpl::count_if< values, mpl::lt<5> >::type::value == 4));
|
||||
BOOST_STATIC_ASSERT((mpl::count_if< values, mpl::eq<0> >::type::value == 2));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost mpl/test/meta_fun.cpp source file
|
||||
// boost mpl/test/quote.cpp source file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
@@ -14,18 +14,33 @@
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
|
||||
#include "boost/mpl/meta_fun.hpp"
|
||||
#include "boost/mpl/assert_is_same.hpp"
|
||||
#include "boost/mpl/quote.hpp"
|
||||
#include "boost/mpl/apply.hpp"
|
||||
#include "boost/type_traits/is_same.hpp"
|
||||
#include "boost/static_assert.hpp"
|
||||
|
||||
namespace mpl = boost::mpl;
|
||||
using namespace boost::mpl;
|
||||
|
||||
template<typename> struct f1;
|
||||
template<typename T1, typename T2, typename T3, typename T4, typename T5> struct f5;
|
||||
template< typename T > struct f1
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T1, typename T2, typename T3, typename T4, typename T5
|
||||
>
|
||||
struct f5
|
||||
{
|
||||
// no 'type' member!
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef mpl::meta_fun1<f1> fc1;
|
||||
typedef mpl::meta_fun5<f5> fc5;
|
||||
typedef apply1< quote1<f1>,int >::type t1;
|
||||
typedef apply5< quote5<f5>,char,short,int,long,float >::type t5;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same< t1, int >::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same< t5, f5<char,short,int,long,float> >::value));
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user