Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55923 - in sandbox/variadic_templates/libs: . mpl mpl/test
From: cppljevans_at_[hidden]
Date: 2009-08-31 12:04:13


Author: cppljevans
Date: 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
New Revision: 55923
URL: http://svn.boost.org/trac/boost/changeset/55923

Log:
Commit libs after deleting symlinks

Added:
   sandbox/variadic_templates/libs/
   sandbox/variadic_templates/libs/mpl/
   sandbox/variadic_templates/libs/mpl/README.symlinks.txt (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/
   sandbox/variadic_templates/libs/mpl/test/Jamfile (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/always.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/apply.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/apply_wrap.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/at.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/bind.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/copy.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/copy_if.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/empty.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/insert_range.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/joint_view.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/lambda.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/list.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/map.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/pair_view.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/push_front.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/remove.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/remove_if.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/replace_if.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/set.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/unpack_args.cpp (contents, props changed)
   sandbox/variadic_templates/libs/mpl/test/vector.cpp (contents, props changed)

Added: sandbox/variadic_templates/libs/mpl/README.symlinks.txt
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/README.symlinks.txt 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,35 @@
+The software in this directory was developed with unix/linux symbolic
+links "connecting" the this directory with the boost trunk directory.
+This was necessary because using -I compiler flags, although enable
+"connecting" different header directories, do not enable connecting
+different source directories. IOW, in the test directory, several
+tests had to be modified for variadic templates; however, several
+others required no modifications. Those unmodified tests are
+connected from this development test directory to the boost trunk test
+directory via symbolic links. In this directory, that symlink is
+trunk-test:
+
+ /home/evansl/prog_dev/boost-svn/ro/sandbox-rw/variadic_templates/libs/mpl:
+ total used in directory 16 available 106308828
+ drwxr-xr-x 3 evansl evansl 4096 Aug 29 05:26 .
+ drwxr-xr-x 3 evansl evansl 4096 Aug 29 05:04 ..
+ -rw-r--r-- 1 evansl evansl 85 Aug 29 05:26 README.symlinks.txt
+ drwxr-xr-x 2 evansl evansl 4096 Aug 29 05:04 test
+ lrwxrwxrwx 1 evansl evansl 37 Aug 29 05:05 trunk-test -> ../../../../boost-trunk/libs/mpl/test
+
+In the test directory, the unmodified tests are accessed indirectly
+through trunk-test, e.g.:
+
+ /home/evansl/prog_dev/boost-svn/ro/sandbox-rw/variadic_templates/libs/mpl/test:
+ total used in directory 104 available 106324628
+ drwxr-xr-x 2 evansl evansl 4096 Aug 29 05:04 .
+ drwxr-xr-x 3 evansl evansl 4096 Aug 29 05:05 ..
+ lrwxrwxrwx 1 evansl evansl 25 Aug 29 05:04 advance.cpp -> ../trunk-test/advance.cpp
+ -r--r--r-- 1 evansl evansl 1151 May 18 21:53 always.cpp
+
+Hopefully, windows and mac users have some equivalent to unix/linux
+symlinks. If not, they will have to copy the source test files from
+the boost trunk directory to the test subdirectory to run all the
+test.
+
+

Added: sandbox/variadic_templates/libs/mpl/test/Jamfile
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/Jamfile 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,95 @@
+
+ compile aux_/largest_int.cpp ;
+ compile aux_/msvc_is_class.cpp ;
+ compile aux_/template_arity.cpp ;
+ compile aux_/preprocessor/is_seq.cpp ;
+ compile aux_/preprocessor/token_equal.cpp ;
+
+ compile advance.cpp ;
+ compile always.cpp ;
+ compile apply.cpp ;
+ compile apply_wrap.cpp ;
+ compile arithmetic.cpp ;
+ compile as_sequence.cpp ;
+ compile assert.cpp ;
+ compile at.cpp ;
+ compile back.cpp ;
+ compile bind.cpp ;
+ compile bitwise.cpp ;
+ run bool.cpp ;
+ compile comparison.cpp ;
+ compile contains.cpp ;
+ compile copy.cpp ;
+ compile copy_if.cpp ;
+ compile count.cpp ;
+ compile count_if.cpp ;
+ compile deque.cpp ;
+ compile distance.cpp ;
+ compile empty.cpp ;
+ compile equal.cpp ;
+ compile erase.cpp ;
+ compile erase_range.cpp ;
+ compile eval_if.cpp ;
+ compile filter_view.cpp ;
+ compile find.cpp ;
+ compile find_if.cpp ;
+ compile fold.cpp ;
+ run for_each.cpp ;
+
+ compile front.cpp ;
+
+ compile has_xxx.cpp ;
+ compile identity.cpp ;
+ compile if.cpp ;
+ compile index_of.cpp ;
+ compile inherit.cpp ;
+ compile insert.cpp ;
+ compile insert_range.cpp ;
+ run int.cpp ;
+ run integral_c.cpp : : : <toolset>vacpp:<cxxflags>-qchars=signed ;
+ compile is_placeholder.cpp ;
+ compile is_sequence.cpp ;
+ compile iterator_tags.cpp ;
+ compile joint_view.cpp ;
+ compile lambda.cpp ;
+ compile lambda_args.cpp ;
+ compile list.cpp ;
+ compile list_c.cpp ;
+ compile logical.cpp ;
+ compile lower_bound.cpp ;
+ compile map.cpp ;
+ compile max_element.cpp ;
+ compile min_max.cpp ;
+ compile multiset.cpp ;
+ compile next.cpp ;
+ compile no_has_xxx.cpp ;
+ compile numeric_ops.cpp ;
+ compile pair_view.cpp ;
+ compile partition.cpp ;
+ compile pop_front.cpp ;
+ compile push_front.cpp ;
+ compile quote.cpp ;
+ compile range_c.cpp ;
+ compile remove.cpp ;
+ compile remove_if.cpp ;
+ compile replace.cpp ;
+ compile replace_if.cpp ;
+ compile reverse.cpp ;
+ compile same_as.cpp ;
+ compile set.cpp ;
+ compile set_c.cpp ;
+ compile single_view.cpp ;
+ compile size.cpp ;
+ run size_t.cpp ;
+ compile sizeof.cpp ;
+ compile sort.cpp ;
+ compile stable_partition.cpp ;
+ compile transform.cpp ;
+ compile transform_view.cpp ;
+ compile unique.cpp ;
+ compile unpack_args.cpp ;
+ compile upper_bound.cpp ;
+ compile vector.cpp ;
+ compile vector_c.cpp ;
+ compile zip_view.cpp ;
+

Added: sandbox/variadic_templates/libs/mpl/test/always.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/always.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,42 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/05/19 02:53:40 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/int.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+MPL_TEST_CASE()
+{
+ typedef always<true_> always_true;
+
+ MPL_ASSERT(( apply< always_true,false_ > ));
+ MPL_ASSERT(( apply< always_true,false_,false_ > ));
+ MPL_ASSERT(( apply< always_true,false_,false_,false_ > ));
+}
+
+
+MPL_TEST_CASE()
+{
+ typedef always< int_<10> > always_10;
+
+ typedef apply< always_10,int_<0> >::type res1;
+ typedef apply< always_10,int_<0>,int_<0> >::type res2;
+ typedef apply< always_10,int_<0>,int_<0>,int_<0> >::type res3;
+
+ MPL_ASSERT_RELATION( res1::value, ==, 10 );
+ MPL_ASSERT_RELATION( res2::value, ==, 10 );
+ MPL_ASSERT_RELATION( res3::value, ==, 10 );
+}

Added: sandbox/variadic_templates/libs/mpl/test/apply.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/apply.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,128 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/05/19 03:09:35 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/lambda.hpp>
+#include <boost/mpl/plus.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/aux_/test.hpp>
+
+
+template< typename T > struct std_vector
+{
+#if defined(BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS)
+ typedef std_vector type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1, std_vector, (T))
+#endif
+};
+
+
+MPL_TEST_CASE()
+{
+ typedef plus<int_<2>,int_<3> > plus1;
+ typedef lambda<plus1>::type plus2;
+ MPL_ASSERT(( is_same< plus1,plus2 > ));
+
+ typedef lambda<std_vector<int> >::type v;
+ MPL_ASSERT(( is_same< v,std_vector<int> > ));
+
+ typedef lambda<std_vector<_1> >::type make_vector;
+ typedef apply_wrap<make_vector,int>::type v_int;
+ MPL_ASSERT(( is_same< v_int,std_vector<int> > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef plus<_1,_2> plus_fun;
+ typedef apply<plus_fun,int_<2>,int_<3> >::type res;
+
+ MPL_ASSERT_RELATION( res::value, ==, 5 );
+}
+
+MPL_TEST_CASE()
+{
+ typedef apply<_1, plus<_1,_2> >::type plus_fun;
+ MPL_ASSERT(( is_same< plus_fun,plus<_1,_2> > ));
+
+ typedef apply<plus_fun,int_<2>,int_<3> >::type res;
+ MPL_ASSERT_RELATION( res::value, ==, 5 );
+}
+
+MPL_TEST_CASE()
+{
+ typedef lambda< lambda<_1> >::type make_lambda;
+ typedef apply_wrap< make_lambda,std_vector<int> >::type v;
+ MPL_ASSERT(( is_same< v,std_vector<int> > ));
+
+ typedef apply_wrap< make_lambda,std_vector<_1> >::type make_vector;
+ typedef apply_wrap< make_vector,int >::type v_int;
+ MPL_ASSERT(( is_same< v_int,std_vector<int> > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef apply< _1, std_vector<int> >::type v;
+ MPL_ASSERT(( is_same< v,std_vector<int> > ));
+
+ typedef apply< _1, std_vector<_1> >::type v_lambda;
+ typedef apply<v_lambda,int>::type v_int;
+ MPL_ASSERT(( is_same< v,std_vector<int> > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef apply< lambda<_1>, std_vector<int> >::type v;
+ MPL_ASSERT(( is_same< v,std_vector<int> > ));
+
+ typedef apply< lambda<_1>, std_vector<_1> >::type make_vector;
+ typedef apply_wrap< make_vector,int >::type v_int;
+ MPL_ASSERT(( is_same< v,std_vector<int> > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef apply< lambda<_1>, plus<_1,_2> >::type plus_fun;
+ typedef apply_wrap< plus_fun,int_<2>,int_<3> >::type res;
+
+ MPL_ASSERT_RELATION( res::value, ==, 5 );
+}
+
+MPL_TEST_CASE()
+{
+ typedef bind2<plus<>,_1,_1> b1;
+ typedef lambda<b1>::type b2;
+ MPL_ASSERT(( is_same< b1,b2 > ));
+}
+
+MPL_TEST_CASE()
+{
+#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ typedef lambda< lambda< bind2<plus<>,_1,_1> > >::type make_lambda;
+ typedef apply_wrap< make_lambda::type, int_<5> >::type res;
+ MPL_ASSERT_RELATION( res::value, ==, 10 );
+#endif
+}
+
+MPL_TEST_CASE()
+{
+ typedef apply< bind2<plus<>,_1,_1>, int_<5> >::type res;
+ MPL_ASSERT_RELATION( res::value, ==, 10 );
+}
+
+MPL_TEST_CASE()
+{
+ typedef apply<_1, lambda<plus<_1,_2> > >::type plus_fun;
+ typedef apply_wrap< plus_fun::type, int_<2>,int_<3> >::type res;
+
+ MPL_ASSERT_RELATION( res::value, ==, 5 );
+}

Added: sandbox/variadic_templates/libs/mpl/test/apply_wrap.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/apply_wrap.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,121 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/05/26 19:43:40 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/limits/arity.hpp>
+#include <boost/mpl/aux_/preprocessor/params.hpp>
+#include <boost/mpl/aux_/preprocessor/enum.hpp>
+#include <boost/mpl/aux_/test.hpp>
+
+#include <boost/preprocessor/repeat.hpp>
+#include <boost/preprocessor/comma_if.hpp>
+#include <boost/preprocessor/dec.hpp>
+#include <boost/preprocessor/if.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+# define APPLY_0_FUNC_DEF(i) \
+ struct f0 \
+ { \
+ template< typename T = int > struct apply { typedef char type; }; \
+ }; \
+/**/
+#else
+# define APPLY_0_FUNC_DEF(i) \
+ struct f0 \
+ { \
+ template< typename T > struct apply { typedef char type; }; \
+ }; \
+/**/
+#endif
+
+#define APPLY_N_FUNC_DEF(i) \
+ struct first##i \
+ { \
+ template< BOOST_MPL_PP_PARAMS(i, typename U) > \
+ struct apply { typedef U1 type; }; \
+ }; \
+ \
+ struct last##i \
+ { \
+ template< BOOST_MPL_PP_PARAMS(i, typename U) > \
+ struct apply { typedef BOOST_PP_CAT(U,i) type; }; \
+ }; \
+/**/
+
+#define APPLY_FUNC_DEF(z, i, unused) \
+ BOOST_PP_IF( \
+ i \
+ , APPLY_N_FUNC_DEF \
+ , APPLY_0_FUNC_DEF \
+ )(i) \
+/**/
+
+namespace { namespace test {
+
+BOOST_PP_REPEAT(
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+ , APPLY_FUNC_DEF
+ , unused
+ )
+
+struct g0 { struct apply { typedef char type; }; };
+
+}}
+
+#define APPLY_0_TEST(i, apply_) \
+ typedef apply_<test::f##i>::type t; \
+ { MPL_ASSERT(( boost::is_same<t, char> )); } \
+/**/
+
+#define APPLY_N_TEST(i, apply_) \
+ typedef apply_< \
+ test::first##i \
+ , char \
+ BOOST_PP_COMMA_IF(BOOST_PP_DEC(i)) \
+ BOOST_MPL_PP_ENUM(BOOST_PP_DEC(i), int) \
+ >::type t1##i; \
+ \
+ typedef apply_< \
+ test::last##i \
+ , BOOST_MPL_PP_ENUM(BOOST_PP_DEC(i), int) \
+ BOOST_PP_COMMA_IF(BOOST_PP_DEC(i)) char \
+ >::type t2##i; \
+ { MPL_ASSERT(( boost::is_same<t1##i, char> )); } \
+ { MPL_ASSERT(( boost::is_same<t2##i, char> )); } \
+/**/
+
+#define APPLY_TEST(z, i, unused) \
+ BOOST_PP_IF( \
+ i \
+ , APPLY_N_TEST \
+ , APPLY_0_TEST \
+ )(i, apply_wrap) \
+/**/
+
+
+MPL_TEST_CASE()
+{
+ BOOST_PP_REPEAT(
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+ , APPLY_TEST
+ , unused
+ )
+
+#if !defined(BOOST_MPL_CFG_NO_HAS_APPLY)
+ {
+ typedef apply_wrap<test::g0>::type t;
+ MPL_ASSERT(( boost::is_same<t, char> ));
+ }
+#endif
+}

Added: sandbox/variadic_templates/libs/mpl/test/at.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/at.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,40 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/05/23 02:39:23 $
+// $Revision: 1.3 $
+
+#define INTEGRAL_CONSTANT_WORKAROUND_GCC_BUGZILLA_BUG_40092
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/vector_c.hpp>
+#include <boost/mpl/aux_/test.hpp>
+
+template< typename Seq, int n > struct at_test
+{
+ typedef typename at_c<Seq,n>::type t;
+ MPL_ASSERT(( is_same< t, integral_c<int,9-n> > ));
+ MPL_ASSERT_RELATION( t::value, ==, 9 - n );
+};
+
+MPL_TEST_CASE()
+{
+ typedef vector_c<int,9,8,7,6,5,4,3,2,1,0> numbers;
+
+ at_test< numbers, 0 >();
+ at_test< numbers, 1 >();
+ at_test< numbers, 2 >();
+ at_test< numbers, 3 >();
+ at_test< numbers, 4 >();
+ at_test< numbers, 5 >();
+ at_test< numbers, 6 >();
+ at_test< numbers, 7 >();
+ at_test< numbers, 8 >();
+ at_test< numbers, 9 >();
+}

Added: sandbox/variadic_templates/libs/mpl/test/bind.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/bind.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,89 @@
+
+// Copyright Peter Dimov 2001-2002
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/05/23 12:40:24 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/bind.hpp>
+#include <boost/mpl/quote.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/aux_/test.hpp>
+
+#include <boost/type_traits/is_float.hpp>
+
+namespace {
+
+struct f1
+{
+ template< typename T1 > struct apply
+ {
+ typedef T1 type;
+ };
+};
+
+struct f5
+{
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ struct apply
+ {
+ typedef T5 type;
+ };
+};
+
+} // namespace
+
+MPL_TEST_CASE() // basic argument binding
+{
+ typedef apply_wrap< bind<f1,_1>, int >::type r11;
+ typedef apply_wrap< bind<f1,_5>, void,void,void,void,int >::type r12;
+ MPL_ASSERT(( boost::is_same<r11,int> ));
+ MPL_ASSERT(( boost::is_same<r12,int> ));
+
+ typedef apply_wrap< bind<f5,_1,_2,_3,_4,_5>, void,void,void,void,int >::type r51;
+ typedef apply_wrap< bind<f5,_5,_4,_3,_2,_1>, int,void,void,void,void >::type r52;
+ MPL_ASSERT(( boost::is_same<r51,int> ));
+ MPL_ASSERT(( boost::is_same<r52,int> ));
+}
+
+
+MPL_TEST_CASE() // fully bound metafunction classes
+{
+ typedef apply_wrap< bind<f1,int> >::type r11;
+ typedef apply_wrap< bind<f5,void,void,void,void,int> >::type r51;
+ MPL_ASSERT(( boost::is_same<r11,int> ));
+ MPL_ASSERT(( boost::is_same<r51,int> ));
+}
+
+
+MPL_TEST_CASE() // metafunction class composition
+{
+ typedef apply_wrap< bind<f5,_1,_2,_3,_4,bind<f1,_1> >, int,void,void,void,void >::type r51;
+ typedef apply_wrap< bind<f5,_1,_2,_3,_4,bind<f1,_5> >, void,void,void,void,int >::type r52;
+ MPL_ASSERT(( boost::is_same<r51,int> ));
+ MPL_ASSERT(( boost::is_same<r52,int> ));
+}
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
+ && !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+MPL_TEST_CASE() // if_ evaluation
+{
+ typedef bind< quote3<if_>, _1, bind< quote1<next>, _2>, _3 > f;
+ typedef apply_wrap< f,true_,int_<0>,int >::type r1;
+ typedef apply_wrap< f,false_,int,int_<0> >::type r2;
+
+ MPL_ASSERT(( boost::is_same<r1,int_<1> > ));
+ MPL_ASSERT(( boost::is_same<r2,int_<0> > ));
+}
+#endif

Added: sandbox/variadic_templates/libs/mpl/test/copy.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/copy.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,56 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright David Abrahams 2003-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/05/26 21:10:09 $
+// $Revision: 1.5 $
+
+#define USE_RANGE_C
+#ifdef USE_RANGE_C
+ #include <boost/mpl/range_c.hpp>
+#else
+ //disallow using range_c because currently
+ //(gcc-4.4-20090109) compiler buggy.
+#endif
+#include <boost/mpl/vector_c.hpp>
+#include <boost/mpl/copy.hpp>
+#include <boost/mpl/front_inserter.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/equal.hpp>
+#include <boost/mpl/aux_/test.hpp>
+
+MPL_TEST_CASE()
+{
+ typedef vector_c<int,9,8,7,6,5,4,3,2,1,0> answer;
+ typedef copy<
+ #ifdef USE_RANGE_C
+ range_c<int,0,10>
+ #else
+ vector_c<int,0,1,2,3,4,5,6,7,8,9>
+ #endif
+ , mpl::front_inserter< vector<> >
+ >::type result;
+
+ MPL_ASSERT_RELATION( size<result>::value, ==, 10 );
+ MPL_ASSERT(( equal< result,answer > ));
+}
+#ifdef USE_RANGE_C
+MPL_TEST_CASE()
+{
+ typedef vector_c<int,10,11,12,13,14,15,16,17,18,19> numbers;
+ typedef reverse_copy<
+ range_c<int,0,10>
+ , mpl::front_inserter<numbers>
+ >::type result;
+
+ MPL_ASSERT_RELATION( size<result>::value, ==, 20 );
+ MPL_ASSERT(( equal< result,range_c<int,0,20> > ));
+}
+#endif

Added: sandbox/variadic_templates/libs/mpl/test/copy_if.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/copy_if.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,53 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright David Abrahams 2003-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/23 20:20:38 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/copy_if.hpp>
+#include <boost/mpl/list_c.hpp>
+#include <boost/mpl/front_inserter.hpp>
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/equal.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/type_traits/is_float.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+MPL_TEST_CASE()
+{
+ typedef list_c<int,0,1,2,3,4,5,6,7,8,9>::type numbers;
+ typedef list_c<int,4,3,2,1,0>::type answer;
+ typedef copy_if<
+ numbers
+ , less<_,int_<5> >
+ , mpl::front_inserter< list_c<int> >
+ >::type result;
+
+ MPL_ASSERT_RELATION(size<result>::value, ==, 5);
+ MPL_ASSERT(( equal<result,answer> ));
+}
+
+
+MPL_TEST_CASE()
+{
+ typedef list<int,float,long,float,char,long,double,double>::type types;
+ typedef list<float,float,double,double>::type float_types;
+ typedef reverse_copy_if<
+ types
+ , is_float<_>
+ , mpl::front_inserter< list<> >
+ >::type result;
+
+ MPL_ASSERT_RELATION(mpl::size<result>::value, ==, 4);
+ MPL_ASSERT(( equal<result,float_types> ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/empty.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/empty.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,23 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/24 00:35:26 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/empty.hpp>
+
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/aux_/test.hpp>
+
+MPL_TEST_CASE()
+{
+ MPL_ASSERT(( empty< list<> > ));
+ MPL_ASSERT_NOT(( empty< list<char> > ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/insert_range.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/insert_range.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,35 @@
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/24 00:39:59 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/insert_range.hpp>
+#include <boost/mpl/find.hpp>
+#include <boost/mpl/vector_c.hpp>
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/equal.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+MPL_TEST_CASE()
+{
+ typedef vector_c<int,0,1,7,8,9> numbers;
+ typedef find< numbers,integral_c<int,7> >::type pos;
+ typedef insert_range< numbers,pos,range_c<int,2,7> >::type range;
+
+ MPL_ASSERT_RELATION( size<range>::value, ==, 10 );
+ MPL_ASSERT(( equal< range,range_c<int,0,10> > ));
+
+ typedef insert_range< list<>,end< list<> >::type,list<int> >::type result2;
+ MPL_ASSERT_RELATION( size<result2>::value, ==, 1 );
+}

Added: sandbox/variadic_templates/libs/mpl/test/joint_view.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/joint_view.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,55 @@
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/27 16:28:30 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/joint_view.hpp>
+
+#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/equal.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/aux_/test.hpp>
+
+
+MPL_TEST_CASE()
+{
+ typedef joint_view<
+ range_c<int,0,10>
+ , range_c<int,10,15>
+ > numbers;
+
+ typedef range_c<int,0,15> answer;
+
+ MPL_ASSERT(( equal<numbers,answer> ));
+ MPL_ASSERT_RELATION( size<numbers>::value, ==, 15 );
+}
+
+template< typename View > struct test_is_empty
+{
+ typedef typename begin<View>::type first_;
+ typedef typename end<View>::type last_;
+
+ MPL_ASSERT_RELATION( size<View>::value, ==, 0 );
+ MPL_ASSERT(( is_same< first_,last_> ));
+
+ MPL_ASSERT_INSTANTIATION( View );
+ MPL_ASSERT_INSTANTIATION( first_ );
+ MPL_ASSERT_INSTANTIATION( last_ );
+};
+
+MPL_TEST_CASE()
+{
+ test_is_empty< joint_view< list<>,list<> > >();
+ test_is_empty< joint_view< list<>,list<> > >();
+ test_is_empty< joint_view< list<>,list<> > >();
+ test_is_empty< joint_view< list<>, joint_view< list<>,list<> > > >();
+}

Added: sandbox/variadic_templates/libs/mpl/test/lambda.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/lambda.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,78 @@
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/24 01:37:07 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/logical.hpp>
+#include <boost/mpl/comparison.hpp>
+#include <boost/mpl/lambda.hpp>
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/sizeof.hpp>
+#include <boost/mpl/apply.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/is_float.hpp>
+
+struct my
+{
+ char a[100];
+};
+
+MPL_TEST_CASE()
+{
+ // !(x == char) && !(x == double) || sizeof(x) > 8
+ typedef lambda<
+ or_<
+ and_<
+ not_< boost::is_same<_1, char> >
+ , not_< boost::is_float<_1> >
+ >
+ , greater< sizeof_<_1>, mpl::size_t<8> >
+ >
+ >::type f;
+
+ MPL_ASSERT_NOT(( apply_wrap<f,char> ));
+ MPL_ASSERT_NOT(( apply_wrap<f,double> ));
+ MPL_ASSERT(( apply_wrap<f,long> ));
+ MPL_ASSERT(( apply_wrap<f,my> ));
+}
+
+MPL_TEST_CASE()
+{
+ // x == y || x == my || sizeof(x) == sizeof(y)
+ typedef lambda<
+ or_<
+ boost::is_same<_1, _2>
+ , boost::is_same<_2, my>
+ , equal_to< sizeof_<_1>, sizeof_<_2> >
+ >
+ >::type f;
+
+ MPL_ASSERT_NOT(( apply_wrap<f,double,char> ));
+ MPL_ASSERT_NOT(( apply_wrap<f,my,int> ));
+ MPL_ASSERT_NOT(( apply_wrap<f,my,char[99]> ));
+ MPL_ASSERT(( apply_wrap<f,int,int> ));
+ MPL_ASSERT(( apply_wrap<f,my,my> ));
+ MPL_ASSERT(( apply_wrap<f,signed long, unsigned long> ));
+}
+
+MPL_TEST_CASE()
+{
+ // bind <-> lambda interaction
+ typedef lambda< less<_1,_2> >::type pred;
+ typedef bind< pred, _1, int_<4> > f;
+
+ MPL_ASSERT(( apply_wrap< f,int_<3> > ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/list.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/list.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,68 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/03/24 01:19:13 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/pop_front.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/empty.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+
+MPL_TEST_CASE()
+{
+ typedef list<> l0;
+ typedef list<char> l1;
+ typedef list<char,long> l2;
+ typedef list<char,char,char,char,char,char,char,char,char> l9;
+
+ MPL_ASSERT_RELATION(size<l0>::value, ==, 0);
+ MPL_ASSERT_RELATION(size<l1>::value, ==, 1);
+ MPL_ASSERT_RELATION(size<l2>::value, ==, 2);
+ MPL_ASSERT_RELATION(size<l9>::value, ==, 9);
+
+ MPL_ASSERT(( empty<l0> ));
+ MPL_ASSERT_NOT(( empty<l1> ));
+ MPL_ASSERT_NOT(( empty<l2> ));
+ MPL_ASSERT_NOT(( empty<l9> ));
+
+ MPL_ASSERT(( is_same<front<l1>::type,char> ));
+ MPL_ASSERT(( is_same<front<l2>::type,char> ));
+ MPL_ASSERT(( is_same<front<l9>::type,char> ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef list<char,long> l2;
+
+ typedef begin<l2>::type i1;
+ typedef next<i1>::type i2;
+ typedef next<i2>::type i3;
+
+ MPL_ASSERT(( is_same<deref<i1>::type,char> ));
+ MPL_ASSERT(( is_same<deref<i2>::type,long> ));
+ MPL_ASSERT(( is_same< i3, end<l2>::type > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef list<> l0;
+
+ typedef push_front<l0,char>::type l1;
+ MPL_ASSERT(( is_same<front<l1>::type,char> ));
+
+ typedef push_front<l1,long>::type l2;
+ MPL_ASSERT(( is_same<front<l2>::type,long> ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/map.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/map.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,196 @@
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/24 17:29:56 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/map.hpp>
+#include <boost/mpl/insert.hpp>
+#include <boost/mpl/erase_key.hpp>
+#include <boost/mpl/erase_key.hpp>
+#include <boost/mpl/contains.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/clear.hpp>
+#include <boost/mpl/has_key.hpp>
+#include <boost/mpl/order.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/empty.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+
+MPL_TEST_CASE()
+{
+ typedef map<
+ mpl::pair<int,unsigned>
+ , mpl::pair<char,unsigned char>
+ > m_;
+
+ typedef erase_key<m_,char>::type m;
+
+ MPL_ASSERT_RELATION( size<m>::type::value, ==, 1 );
+ MPL_ASSERT_NOT(( empty<m> ));
+ MPL_ASSERT(( is_same< clear<m>::type,map<> > ));
+
+ MPL_ASSERT(( is_same< at<m,int>::type,unsigned > ));
+ MPL_ASSERT(( is_same< at<m,char>::type,void_ > ));
+ MPL_ASSERT(( contains< m,mpl::pair<int,unsigned> > ));
+ MPL_ASSERT_NOT(( contains< m,mpl::pair<int,int> > ));
+ MPL_ASSERT_NOT(( contains< m,mpl::pair<char,unsigned char> > ));
+
+ MPL_ASSERT_NOT(( has_key<m,char>::type ));
+ MPL_ASSERT(( has_key<m,int>::type ));
+
+ MPL_ASSERT_NOT(( is_same< order<m,int>::type, void_ > ));
+ MPL_ASSERT(( is_same< order<m,char>::type,void_ > ));
+
+ typedef begin<m>::type first;
+ typedef end<m>::type last;
+
+ MPL_ASSERT(( is_same< deref<first>::type,mpl::pair<int,unsigned> > ));
+ MPL_ASSERT(( is_same< next<first>::type,last > ));
+
+ typedef insert<m,mpl::pair<char,long> >::type m2;
+
+ MPL_ASSERT_RELATION( size<m2>::type::value, ==, 2 );
+ MPL_ASSERT_NOT(( empty<m2>::type ));
+ MPL_ASSERT(( is_same< clear<m2>::type,map<> > ));
+ MPL_ASSERT(( is_same< at<m2,int>::type,unsigned > ));
+ MPL_ASSERT(( is_same< at<m2,char>::type,long > ));
+
+ MPL_ASSERT(( contains< m2,mpl::pair<int,unsigned> > ));
+ MPL_ASSERT_NOT(( contains< m2,mpl::pair<int,int> > ));
+ MPL_ASSERT_NOT(( contains< m2,mpl::pair<char,unsigned char> > ));
+ MPL_ASSERT(( contains< m2,mpl::pair<char,long> > ));
+
+ MPL_ASSERT(( has_key<m2,char>::type ));
+ MPL_ASSERT_NOT(( has_key<m2,long>::type ));
+ MPL_ASSERT_NOT(( is_same< order<m2,int>::type, void_ > ));
+ MPL_ASSERT_NOT(( is_same< order<m2,char>::type, void_ > ));
+ MPL_ASSERT_NOT(( is_same< order<m2,char>::type, order<m2,int>::type > ));
+
+ typedef begin<m2>::type first2;
+ typedef end<m2>::type last2;
+
+ MPL_ASSERT(( is_same<deref<first2>::type,mpl::pair<int,unsigned> > ));
+ typedef next<first2>::type iter;
+ MPL_ASSERT(( is_same<deref<iter>::type,mpl::pair<char,long> > ));
+ MPL_ASSERT(( is_same< next<iter>::type,last2 > ));
+
+ typedef insert<m2,mpl::pair<int,unsigned> >::type s2_1;
+ MPL_ASSERT(( is_same<m2,s2_1> ));
+
+ typedef insert<m2,mpl::pair<long,unsigned> >::type m3;
+ MPL_ASSERT_RELATION( size<m3>::type::value, ==, 3 );
+ MPL_ASSERT(( has_key<m3,long>::type ));
+ MPL_ASSERT(( has_key<m3,int>::type ));
+ MPL_ASSERT(( has_key<m3,char>::type ));
+ MPL_ASSERT(( contains< m3,mpl::pair<long,unsigned> > ));
+ MPL_ASSERT(( contains< m3,mpl::pair<int,unsigned> > ));
+
+ typedef insert<m,mpl::pair<char,long> >::type m1;
+ MPL_ASSERT_RELATION( size<m1>::type::value, ==, 2 );
+ MPL_ASSERT(( is_same< at<m1,int>::type,unsigned > ));
+ MPL_ASSERT(( is_same< at<m1,char>::type,long > ));
+
+ MPL_ASSERT(( contains< m1,mpl::pair<int,unsigned> > ));
+ MPL_ASSERT_NOT(( contains< m1,mpl::pair<int,int> > ));
+ MPL_ASSERT_NOT(( contains< m1,mpl::pair<char,unsigned char> > ));
+ MPL_ASSERT(( contains< m1,mpl::pair<char,long> > ));
+
+ MPL_ASSERT(( is_same< m1,m2 > ));
+
+ typedef erase_key<m1,char>::type m_1;
+ MPL_ASSERT(( is_same<m,m_1> ));
+ MPL_ASSERT_RELATION( size<m_1>::type::value, ==, 1 );
+ MPL_ASSERT(( is_same< at<m_1,char>::type,void_ > ));
+ MPL_ASSERT(( is_same< at<m_1,int>::type,unsigned > ));
+
+ typedef erase_key<m3,char>::type m2_1;
+ MPL_ASSERT_RELATION( size<m2_1>::type::value, ==, 2 );
+ MPL_ASSERT(( is_same< at<m2_1,char>::type,void_ > ));
+ MPL_ASSERT(( is_same< at<m2_1,int>::type,unsigned > ));
+ MPL_ASSERT(( is_same< at<m2_1,long>::type,unsigned > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef map<> m;
+
+ MPL_ASSERT_RELATION( size<m>::type::value, ==, 0 );
+ MPL_ASSERT(( empty<m>::type ));
+
+ MPL_ASSERT(( is_same< clear<m>::type,map<> > ));
+ MPL_ASSERT(( is_same< at<m,char>::type,void_ > ));
+
+ MPL_ASSERT_NOT(( has_key<m,char>::type ));
+ MPL_ASSERT_NOT(( has_key<m,int>::type ));
+ MPL_ASSERT_NOT(( has_key<m,UDT>::type ));
+ MPL_ASSERT_NOT(( has_key<m,incomplete>::type ));
+
+ MPL_ASSERT_NOT(( has_key<m,char const>::type ));
+ MPL_ASSERT_NOT(( has_key<m,int const>::type ));
+ MPL_ASSERT_NOT(( has_key<m,UDT const>::type ));
+ MPL_ASSERT_NOT(( has_key<m,incomplete const>::type ));
+
+ MPL_ASSERT_NOT(( has_key<m,int*>::type ));
+ MPL_ASSERT_NOT(( has_key<m,UDT*>::type ));
+ MPL_ASSERT_NOT(( has_key<m,incomplete*>::type ));
+
+ MPL_ASSERT_NOT(( has_key<m,int&>::type ));
+ MPL_ASSERT_NOT(( has_key<m,UDT&>::type ));
+ MPL_ASSERT_NOT(( has_key<m,incomplete&>::type ));
+
+ typedef insert<m,mpl::pair<char,int> >::type m1;
+ MPL_ASSERT_RELATION( size<m1>::type::value, ==, 1 );
+ MPL_ASSERT(( is_same< at<m1,char>::type,int > ));
+
+ typedef erase_key<m,char>::type m0_1;
+ MPL_ASSERT_RELATION( size<m0_1>::type::value, ==, 0 );
+ MPL_ASSERT(( is_same< at<m0_1,char>::type,void_ > ));
+}
+
+// Use a template for testing so that GCC will show us the actual types involved
+template <class M>
+void test()
+{
+ MPL_ASSERT_RELATION( size<M>::value, ==, 3 );
+
+ typedef typename end<M>::type not_found;
+ BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<M,mpl::pair<int,int*> >::type,not_found> ));
+ BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<M,mpl::pair<long,long*> >::type,not_found> ));
+ BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<M,mpl::pair<char,char*> >::type,not_found> ));
+ BOOST_MPL_ASSERT(( is_same<BOOST_DEDUCED_TYPENAME find<M,int>::type,not_found> ));
+};
+
+MPL_TEST_CASE()
+{
+ typedef map< mpl::pair<int,int*> > map_of_1_pair;
+ typedef begin<map_of_1_pair>::type iter_to_1_pair;
+
+ BOOST_MPL_ASSERT((
+ is_same<
+ deref<iter_to_1_pair>::type
+ , mpl::pair<int,int*>
+ >
+ ));
+
+ typedef map<
+ mpl::pair<int,int*>
+ , mpl::pair<long,long*>
+ , mpl::pair<char,char*>
+ > mymap;
+
+ test<mymap>();
+ test<mymap::type>();
+}

Added: sandbox/variadic_templates/libs/mpl/test/pair_view.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/pair_view.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,45 @@
+
+// Copyright David Abrahams 2003-2004
+// Copyright Aleksey Gurtovoy 2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/27 16:33:21 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/pair_view.hpp>
+#include <boost/mpl/vector_c.hpp>
+#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/distance.hpp>
+#include <boost/mpl/aux_/test.hpp>
+
+
+MPL_TEST_CASE()
+{
+ typedef range_c<int,0,10> r;
+ typedef vector_c<int,9,8,7,6,5,4,3,2,1,10> v;
+
+ typedef pair_view<r,v> view;
+ typedef begin<view>::type first_;
+ typedef end<view>::type last_;
+
+ MPL_ASSERT(( is_same< first_::category, mpl::random_access_iterator_tag > ));
+
+ MPL_ASSERT(( is_same< advance_c<first_,0>::type, first_ > ));
+ MPL_ASSERT(( is_same< advance_c<last_,0>::type, last_ > ));
+ MPL_ASSERT(( is_same< advance_c<first_,10>::type, last_ > ));
+ MPL_ASSERT(( is_same< advance_c<last_,-10>::type, first_ > ));
+
+ typedef advance_c<first_,5>::type iter;
+
+ MPL_ASSERT(( is_same<
+ deref<iter>::type
+ , mpl::pair< integral_c<int,5>,integral_c<int,4> >
+ > ));
+
+}

Added: sandbox/variadic_templates/libs/mpl/test/push_front.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/push_front.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,40 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/03/28 15:38:35 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/push_back.hpp>
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/front.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+MPL_TEST_CASE()
+{
+ typedef push_front<list<>,long>::type res1;
+ typedef push_front<list<long>,int>::type res2;
+ typedef push_front<list<int,long>,char>::type res3;
+
+ MPL_ASSERT_RELATION( size<res1>::value, ==, 1 );
+ MPL_ASSERT_RELATION( size<res2>::value, ==, 2 );
+ MPL_ASSERT_RELATION( size<res3>::value, ==, 3 );
+
+ MPL_ASSERT(( is_same< front<res1>::type, long > ));
+ MPL_ASSERT(( is_same< front<res2>::type, int > ));
+ MPL_ASSERT(( is_same< front<res3>::type, char > ));
+
+ MPL_ASSERT(( has_push_front< list<> > ));
+ MPL_ASSERT(( has_push_front< list<long> > ));
+
+ MPL_ASSERT_NOT(( has_push_back< list<> > ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/remove.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/remove.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,28 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright David Abrahams 2003-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/03/28 15:50:03 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/remove.hpp>
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/equal.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+
+MPL_TEST_CASE()
+{
+ typedef vector<int,float,char,float,float,double> types;
+ typedef mpl::remove< types,float >::type result;
+ typedef vector<int,char,double> answer;
+ MPL_ASSERT(( equal< result,answer > ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/remove_if.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/remove_if.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,53 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright David Abrahams 2003-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/23 21:51:03 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/remove_if.hpp>
+
+#include <boost/mpl/list_c.hpp>
+#include <boost/mpl/front_inserter.hpp>
+#include <boost/mpl/greater.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/equal.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/type_traits/is_float.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+MPL_TEST_CASE()
+{
+ typedef list_c<int,0,1,2,3,4,5,6,7,8,9> numbers;
+ typedef list_c<int,4,3,2,1,0>::type answer;
+ typedef remove_if<
+ numbers
+ , greater<_,int_<4> >
+ , mpl::front_inserter< list_c<int> >
+ >::type result;
+
+ MPL_ASSERT_RELATION( size<result>::value, ==, 5 );
+ MPL_ASSERT(( equal<result,answer> ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef list<int,float,long,float,char,long,double,double> types;
+ typedef list<int,long,char,long>::type answer;
+ typedef reverse_remove_if<
+ types
+ , is_float<_>
+ , mpl::front_inserter< list<> >
+ >::type result;
+
+ MPL_ASSERT_RELATION( size<result>::value, ==, 4 );
+ MPL_ASSERT(( equal<result,answer> ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/replace_if.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/replace_if.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,33 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright John R. Bandela 2000-2002
+// Copyright David Abrahams 2003-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/27 17:05:12 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/replace_if.hpp>
+
+#include <boost/mpl/list_c.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/equal.hpp>
+#include <boost/mpl/greater.hpp>
+#include <boost/mpl/equal_to.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+MPL_TEST_CASE()
+{
+ typedef list_c<int,1,4,5,2,7,5,3,5>::type numbers;
+ typedef replace_if< numbers, greater<_1,int_<4> >, int_<0> >::type result;
+
+ typedef list_c<int,1,4,0,2,0,0,3,0>::type answer;
+ MPL_ASSERT(( equal< answer,result,equal_to<_1,_2> > ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/set.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/set.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,331 @@
+
+// Copyright Aleksey Gurtovoy 2003-2007
+// Copyright David Abrahams 2003-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/27 16:21:07 $
+// $Revision: 1.6 $
+
+#include <boost/mpl/set.hpp>
+#include <boost/mpl/contains.hpp>
+#include <boost/mpl/find.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/insert.hpp>
+#include <boost/mpl/erase.hpp>
+#include <boost/mpl/erase_key.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/clear.hpp>
+#include <boost/mpl/has_key.hpp>
+#include <boost/mpl/order.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/distance.hpp>
+#include <boost/mpl/empty.hpp>
+#include <boost/mpl/begin_end.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+
+// Use templates for testing so that GCC will show us the actual types involved
+
+template< typename s >
+void empty_set_test()
+{
+ MPL_ASSERT_RELATION( size<s>::value, ==, 0 );
+ MPL_ASSERT(( empty<s> ));
+
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME clear<s>::type, set<> > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,int>::type, void_ > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,char>::type, void_ > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,long>::type, void_ > ));
+
+ MPL_ASSERT_NOT(( has_key<s,int> ));
+ MPL_ASSERT_NOT(( has_key<s,char> ));
+ MPL_ASSERT_NOT(( has_key<s,long> ));
+
+ typedef BOOST_DEDUCED_TYPENAME order<s,int>::type o1;
+ typedef BOOST_DEDUCED_TYPENAME order<s,char>::type o2;
+ typedef BOOST_DEDUCED_TYPENAME order<s,long>::type o3;
+ MPL_ASSERT(( is_same< o1, void_ > ));
+ MPL_ASSERT(( is_same< o2, void_ > ));
+ MPL_ASSERT(( is_same< o3, void_ > ));
+
+ typedef BOOST_DEDUCED_TYPENAME begin<s>::type first;
+ typedef BOOST_DEDUCED_TYPENAME end<s>::type last;
+
+ MPL_ASSERT(( is_same<first, last> ));
+ MPL_ASSERT_RELATION( (distance<first, last>::value), ==, 0 );
+}
+
+
+template< typename s >
+void int_set_test()
+{
+ MPL_ASSERT_RELATION( size<s>::value, ==, 1 );
+ MPL_ASSERT_NOT(( empty<s> ));
+
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME clear<s>::type, set<> > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,int>::type, int > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,char>::type, void_ > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,long>::type, void_ > ));
+
+ MPL_ASSERT(( has_key<s,int> ));
+ MPL_ASSERT_NOT(( has_key<s,char> ));
+ MPL_ASSERT_NOT(( has_key<s,long> ));
+
+ typedef BOOST_DEDUCED_TYPENAME order<s,int>::type o1;
+ typedef BOOST_DEDUCED_TYPENAME order<s,char>::type o2;
+ typedef BOOST_DEDUCED_TYPENAME order<s,long>::type o3;
+ MPL_ASSERT_NOT(( is_same< o1, void_ > ));
+ MPL_ASSERT(( is_same< o2, void_ > ));
+ MPL_ASSERT(( is_same< o3, void_ > ));
+
+ typedef BOOST_DEDUCED_TYPENAME begin<s>::type first;
+ typedef BOOST_DEDUCED_TYPENAME end<s>::type last;
+
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME deref<first>::type, int > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME next<first>::type, last > ));
+
+ MPL_ASSERT_RELATION( (distance<first, last>::value), ==, 1 );
+ MPL_ASSERT(( contains< s, int > ));
+}
+
+
+template< typename s >
+void int_char_set_test()
+{
+ MPL_ASSERT_RELATION( size<s>::value, ==, 2 );
+ MPL_ASSERT_NOT(( empty<s> ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME clear<s>::type, set<> > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,int>::type, int > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,char>::type, char > ));
+
+ MPL_ASSERT(( has_key<s,char> ));
+ MPL_ASSERT_NOT(( has_key<s,long> ));
+
+ typedef BOOST_DEDUCED_TYPENAME order<s,int>::type o1;
+ typedef BOOST_DEDUCED_TYPENAME order<s,char>::type o2;
+ typedef BOOST_DEDUCED_TYPENAME order<s,long>::type o3;
+ MPL_ASSERT_NOT(( is_same< o1, void_ > ));
+ MPL_ASSERT_NOT(( is_same< o2, void_ > ));
+ MPL_ASSERT(( is_same< o3, void_ > ));
+ MPL_ASSERT_NOT(( is_same< o1, o2 > ));
+
+ typedef BOOST_DEDUCED_TYPENAME begin<s>::type first;
+ typedef BOOST_DEDUCED_TYPENAME end<s>::type last;
+
+ MPL_ASSERT_RELATION( (distance<first, last>::value), ==, 2 );
+
+ MPL_ASSERT(( contains< s, int > ));
+ MPL_ASSERT(( contains< s, char > ));
+}
+
+template< typename s >
+void int_char_long_set_test()
+{
+ MPL_ASSERT_RELATION( size<s>::value, ==, 3 );
+ MPL_ASSERT_NOT(( empty<s> ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME clear<s>::type, set<> > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,int>::type, int > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,char>::type, char > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME at<s,long>::type, long > ));
+
+ MPL_ASSERT(( has_key<s,long> ));
+ MPL_ASSERT(( has_key<s,int> ));
+ MPL_ASSERT(( has_key<s,char> ));
+
+ typedef BOOST_DEDUCED_TYPENAME order<s,int>::type o1;
+ typedef BOOST_DEDUCED_TYPENAME order<s,char>::type o2;
+ typedef BOOST_DEDUCED_TYPENAME order<s,long>::type o3;
+ MPL_ASSERT_NOT(( is_same< o1, void_ > ));
+ MPL_ASSERT_NOT(( is_same< o2, void_ > ));
+ MPL_ASSERT_NOT(( is_same< o3, void_ > ));
+ MPL_ASSERT_NOT(( is_same< o1, o2 > ));
+ MPL_ASSERT_NOT(( is_same< o1, o3 > ));
+ MPL_ASSERT_NOT(( is_same< o2, o3 > ));
+
+ typedef BOOST_DEDUCED_TYPENAME begin<s>::type first;
+ typedef BOOST_DEDUCED_TYPENAME end<s>::type last;
+ MPL_ASSERT_RELATION( (distance<first, last>::value), ==, 3 );
+
+ MPL_ASSERT(( contains< s, int > ));
+ MPL_ASSERT(( contains< s, char > ));
+ MPL_ASSERT(( contains< s, long > ));
+}
+
+template< typename S0, typename S1, typename S2, typename S3 >
+void basic_set_test()
+{
+ empty_set_test<S0>();
+ empty_set_test< BOOST_DEDUCED_TYPENAME erase_key<S1,int>::type >();
+ empty_set_test< BOOST_DEDUCED_TYPENAME erase_key<
+ BOOST_DEDUCED_TYPENAME erase_key<S2,int>::type
+ , char
+ >::type >();
+
+ empty_set_test< BOOST_DEDUCED_TYPENAME erase_key<
+ BOOST_DEDUCED_TYPENAME erase_key<
+ BOOST_DEDUCED_TYPENAME erase_key<S3,char>::type
+ , long
+ >::type
+ , int
+ >::type >();
+
+
+ int_set_test<S1>();
+ int_set_test< BOOST_DEDUCED_TYPENAME insert<S0,int>::type >();
+
+ int_set_test< BOOST_DEDUCED_TYPENAME erase_key<S2,char>::type >();
+ int_set_test< BOOST_DEDUCED_TYPENAME erase_key<
+ BOOST_DEDUCED_TYPENAME erase_key<S3,char>::type
+ , long
+ >::type >();
+
+ int_char_set_test<S2>();
+ int_char_set_test< BOOST_DEDUCED_TYPENAME insert<
+ BOOST_DEDUCED_TYPENAME insert<S0,char>::type
+ , int
+ >::type >();
+
+ int_char_set_test< BOOST_DEDUCED_TYPENAME insert<S1,char>::type >();
+ int_char_set_test< BOOST_DEDUCED_TYPENAME erase_key<S3,long>::type >();
+
+ int_char_long_set_test<S3>();
+ int_char_long_set_test< BOOST_DEDUCED_TYPENAME insert<
+ BOOST_DEDUCED_TYPENAME insert<
+ BOOST_DEDUCED_TYPENAME insert<S0,char>::type
+ , long
+ >::type
+ , int
+ >::type >();
+
+ int_char_long_set_test< BOOST_DEDUCED_TYPENAME insert<
+ BOOST_DEDUCED_TYPENAME insert<S1,long>::type
+ , char
+ >::type >();
+
+ int_char_long_set_test< BOOST_DEDUCED_TYPENAME insert<S2,long>::type >();
+}
+
+
+template< typename S1, typename S2 >
+void numbered_vs_variadic_set_test()
+{
+ MPL_ASSERT(( is_same< S1, BOOST_DEDUCED_TYPENAME S1::type > ));
+ MPL_ASSERT(( is_same< BOOST_DEDUCED_TYPENAME S2::type, S1 > ));
+}
+
+
+MPL_TEST_CASE()
+{
+ typedef mpl::set<> s01;
+ typedef mpl::set<> s02;
+ typedef mpl::set<int> s11;
+ typedef mpl::set<int> s12;
+ typedef mpl::set<int,char> s21;
+ typedef mpl::set<int,char> s22;
+ typedef mpl::set<char,int> s23;
+ typedef mpl::set<int,char,long> s31;
+ typedef mpl::set<int,char,long> s32;
+ typedef mpl::set<int,long,char> s33;
+ typedef mpl::set<long,char,int> s34;
+
+ numbered_vs_variadic_set_test<s01,s02>();
+ numbered_vs_variadic_set_test<s11,s12>();
+ numbered_vs_variadic_set_test<s21,s22>();
+ numbered_vs_variadic_set_test<s31,s32>();
+
+ basic_set_test<s01,s11,s21,s31>();
+ basic_set_test<s02,s12,s22,s32>();
+ basic_set_test<s01,s11,s23,s31>();
+ basic_set_test<s01,s11,s23,s33>();
+ basic_set_test<s01,s11,s23,s34>();
+}
+
+
+template< typename s >
+void empty_set_types_variety_test()
+{
+ MPL_ASSERT_NOT(( has_key<s,char> ));
+ MPL_ASSERT_NOT(( has_key<s,int> ));
+ MPL_ASSERT_NOT(( has_key<s,UDT> ));
+ MPL_ASSERT_NOT(( has_key<s,incomplete> ));
+
+ MPL_ASSERT_NOT(( has_key<s,char const> ));
+ MPL_ASSERT_NOT(( has_key<s,int const> ));
+ MPL_ASSERT_NOT(( has_key<s,UDT const> ));
+ MPL_ASSERT_NOT(( has_key<s,incomplete const> ));
+
+ MPL_ASSERT_NOT(( has_key<s,int*> ));
+ MPL_ASSERT_NOT(( has_key<s,UDT*> ));
+ MPL_ASSERT_NOT(( has_key<s,incomplete*> ));
+
+ MPL_ASSERT_NOT(( has_key<s,int&> ));
+ MPL_ASSERT_NOT(( has_key<s,UDT&> ));
+ MPL_ASSERT_NOT(( has_key<s,incomplete&> ));
+}
+
+template< typename s >
+void set_types_variety_test()
+{
+ MPL_ASSERT_RELATION( size<s>::value, ==, 8 );
+
+ MPL_ASSERT(( has_key<s,char> ));
+ MPL_ASSERT(( has_key<s,int const> ));
+ MPL_ASSERT(( has_key<s,long*> ));
+ MPL_ASSERT(( has_key<s,UDT* const> ));
+ MPL_ASSERT(( has_key<s,incomplete> ));
+ MPL_ASSERT(( has_key<s,abstract> ));
+ MPL_ASSERT(( has_key<s,incomplete volatile&> ));
+ MPL_ASSERT(( has_key<s,abstract const&> ));
+
+ MPL_ASSERT_NOT(( has_key<s,char const> ));
+ MPL_ASSERT_NOT(( has_key<s,int> ));
+ MPL_ASSERT_NOT(( has_key<s,long* const> ));
+ MPL_ASSERT_NOT(( has_key<s,UDT*> ));
+ MPL_ASSERT_NOT(( has_key<s,incomplete const> ));
+ MPL_ASSERT_NOT(( has_key<s,abstract volatile> ));
+ MPL_ASSERT_NOT(( has_key<s,incomplete&> ));
+ MPL_ASSERT_NOT(( has_key<s,abstract&> ));
+}
+
+
+MPL_TEST_CASE()
+{
+ empty_set_types_variety_test< set<> >();
+ empty_set_types_variety_test< set<>::type >();
+
+ typedef set<
+ char,int const,long*,UDT* const,incomplete,abstract
+ , incomplete volatile&,abstract const&
+ > s;
+
+ set_types_variety_test<s>();
+ set_types_variety_test<s::type>();
+}
+
+
+template <class S>
+void find_test()
+{
+ MPL_ASSERT_RELATION( size<S>::value, ==, 3 );
+
+ typedef typename end<S>::type not_found;
+ BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<S,int>::type,not_found> ));
+ BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<S,long>::type,not_found> ));
+ BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<S,char>::type,not_found> ));
+ BOOST_MPL_ASSERT(( is_same<BOOST_DEDUCED_TYPENAME find<S,char*>::type,not_found> ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef mpl::set<int,long,char> s;
+ find_test<s>();
+ find_test<s::type>();
+}

Added: sandbox/variadic_templates/libs/mpl/test/unpack_args.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/unpack_args.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,26 @@
+
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/08/27 23:59:24 $
+// $Revision: 1.8 $
+
+#include <boost/mpl/unpack_args.hpp>
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/aux_/test.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+MPL_TEST_CASE()
+{
+ MPL_ASSERT(( apply<
+ unpack_args< is_same<_1,_2> >
+ , vector<int,int>
+ > ));
+}

Added: sandbox/variadic_templates/libs/mpl/test/vector.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/vector.cpp 2009-08-31 12:04:11 EDT (Mon, 31 Aug 2009)
@@ -0,0 +1,123 @@
+
+// Copyright Aleksey Gurtovoy 2000-2005
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date: 2009/03/24 04:20:21 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/equal.hpp>
+#include <boost/mpl/push_back.hpp>
+#include <boost/mpl/pop_back.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/pop_front.hpp>
+#include <boost/mpl/back.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/empty.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+
+MPL_TEST_CASE()
+{
+ typedef vector<> v0;
+ typedef vector<char> v1;
+ typedef vector<char,long> v2;
+ typedef vector<char,char,char,char,char,char,char,char,int> v9;
+
+ MPL_ASSERT(( equal< v0,v0::type > ));
+ MPL_ASSERT(( equal< v1,v1::type > ));
+ MPL_ASSERT(( equal< v2,v2::type > ));
+ MPL_ASSERT(( equal< v9,v9::type > ));
+
+ MPL_ASSERT_RELATION( size<v0>::value, ==, 0 );
+ MPL_ASSERT_RELATION( size<v1>::value, ==, 1 );
+ MPL_ASSERT_RELATION( size<v2>::value, ==, 2 );
+ MPL_ASSERT_RELATION( size<v9>::value, ==, 9 );
+
+ MPL_ASSERT(( empty<v0> ));
+ MPL_ASSERT_NOT(( empty<v1> ));
+ MPL_ASSERT_NOT(( empty<v2> ));
+ MPL_ASSERT_NOT(( empty<v9> ));
+
+ MPL_ASSERT(( is_same< front<v1>::type,char > ));
+ MPL_ASSERT(( is_same< back<v1>::type,char > ));
+ MPL_ASSERT(( is_same< front<v2>::type,char > ));
+ MPL_ASSERT(( is_same< back<v2>::type,long > ));
+ MPL_ASSERT(( is_same< front<v9>::type,char > ));
+ MPL_ASSERT(( is_same< back<v9>::type,int > ));
+}
+
+
+MPL_TEST_CASE()
+{
+ typedef vector<char,long> v2;
+
+ typedef begin<v2>::type i1;
+ typedef next<i1>::type i2;
+ typedef next<i2>::type i3;
+
+ MPL_ASSERT(( is_same<deref<i1>::type,char> ));
+ MPL_ASSERT(( is_same<deref<i2>::type,long> ));
+ MPL_ASSERT(( is_same< i3, end<v2>::type > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef vector<> v0;
+
+ typedef push_back<v0,int>::type v1;
+ typedef push_front<v1,char>::type v2;
+ typedef push_back<v2,long>::type v3;
+
+ MPL_ASSERT(( is_same< back<v1>::type,int > ));
+ MPL_ASSERT(( is_same< back<v2>::type,int > ));
+ MPL_ASSERT(( is_same< front<v2>::type,char > ));
+ MPL_ASSERT(( is_same< back<v3>::type,long > ));
+
+ MPL_ASSERT(( equal< v1,v1::type > ));
+ MPL_ASSERT(( equal< v2,v2::type > ));
+ MPL_ASSERT(( equal< v3,v3::type > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef vector<char,bool,char,char,char,char,bool,long,int> v9;
+
+ typedef pop_back<v9>::type v8;
+ typedef pop_front<v8>::type v7;
+
+ MPL_ASSERT(( is_same< back<v9>::type,int > ));
+ MPL_ASSERT(( is_same< back<v8>::type,long > ));
+ MPL_ASSERT(( is_same< back<v7>::type,long > ));
+ MPL_ASSERT(( is_same< front<v7>::type,bool > ));
+
+ MPL_ASSERT(( equal< v9,v9::type > ));
+ MPL_ASSERT(( equal< v8,v8::type > ));
+ MPL_ASSERT(( equal< v7,v7::type > ));
+}
+
+MPL_TEST_CASE()
+{
+ typedef vector<> v0;
+ typedef vector<char> v1;
+ typedef vector<char,long> v2;
+ typedef vector<char,char,char,char,char,char,char,char,int> v9;
+
+ MPL_ASSERT(( equal< v0,v0::type > ));
+ MPL_ASSERT(( equal< v1,v1::type > ));
+ MPL_ASSERT(( equal< v2,v2::type > ));
+ MPL_ASSERT(( equal< v9,v9::type > ));
+
+ MPL_ASSERT_RELATION( size<v0>::value, ==, 0 );
+ MPL_ASSERT_RELATION( size<v1>::value, ==, 1 );
+ MPL_ASSERT_RELATION( size<v2>::value, ==, 2 );
+ MPL_ASSERT_RELATION( size<v9>::value, ==, 9 );
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk