Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55880 - in sandbox/variadic_templates/boost: . mpl mpl/aux_ mpl/list mpl/list/aux_ mpl/map mpl/map/aux_ mpl/package mpl/package/aux_ mpl/set mpl/set/aux_ mpl/vector mpl/vector/aux_
From: cppljevans_at_[hidden]
Date: 2009-08-30 15:29:51


Author: cppljevans
Date: 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
New Revision: 55880
URL: http://svn.boost.org/trac/boost/changeset/55880

Log:
initial versions
Added:
   sandbox/variadic_templates/boost/
   sandbox/variadic_templates/boost/mpl/
   sandbox/variadic_templates/boost/mpl/advance.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/apply.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/apply_wrap.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/at_fwd.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/aux_/
   sandbox/variadic_templates/boost/mpl/aux_/advance_backward.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/aux_/advance_forward.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/aux_/if_recur_fold.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/aux_/iter_apply.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/aux_/numeric_cast_utils.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/bind.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/deque.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/fold.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/foldl_iter.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/foldl_iter_if.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/foldr_iter_if.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/if_recur.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/iter_fold.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/iter_fold_if.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list/
   sandbox/variadic_templates/boost/mpl/list.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list/aux_/
   sandbox/variadic_templates/boost/mpl/list/aux_/begin_end.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list/aux_/clear.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list/aux_/item.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list/aux_/iterator.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list/aux_/list0.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list/list0.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list_c.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/list_fwd.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/logical.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/map/
   sandbox/variadic_templates/boost/mpl/map/aux_/
   sandbox/variadic_templates/boost/mpl/map/aux_/clear_impl.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/map_fwd.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/package/
   sandbox/variadic_templates/boost/mpl/package.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/package/aux_/
   sandbox/variadic_templates/boost/mpl/package/aux_/tag.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/package/package0.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/package_c.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/package_fwd.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/package_range_c.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/reverse_fold.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/set/
   sandbox/variadic_templates/boost/mpl/set.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/set/aux_/
   sandbox/variadic_templates/boost/mpl/set/aux_/begin_end_impl.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/set/aux_/clear_impl.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/set/aux_/iterator.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/set/aux_/set0.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/set/set0.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/set_c.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/set_fwd.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/unpack_args.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/vector/
   sandbox/variadic_templates/boost/mpl/vector.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/vector/aux_/
   sandbox/variadic_templates/boost/mpl/vector/aux_/clear.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/vector/aux_/item.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/vector/aux_/vector0.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/vector/vector0.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/vector_c.hpp (contents, props changed)
   sandbox/variadic_templates/boost/mpl/vector_fwd.hpp (contents, props changed)

Added: sandbox/variadic_templates/boost/mpl/advance.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/advance.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,83 @@
+
+#ifndef BOOST_MPL_ADVANCE_HPP_INCLUDED
+#define BOOST_MPL_ADVANCE_HPP_INCLUDED
+
+// 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.
+
+// $Source: /home/evansl/prog_dev/boost-cvs/ro/boost/sandbox/variadic-templates/libs/mpl/test/../../../boost/mpl/RCS/advance.hpp,v $
+// $Date: 2007/03/09 04:04:38 $
+// $Revision: 1.2 $
+//ChangeLog:
+// 2006-10-23.1203:Larry Evans
+// WHAT:
+// 1) cp'ed from corresponding file in $BOOST_ROOT/boost/mpl
+// 2) replaced all apply_wrapn with apply_wrap.
+// WHY:
+// 1-2) avoid compiler errors at use of apply_wrapn during variadic template compiles.
+
+#include <boost/mpl/advance_fwd.hpp>
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/negate.hpp>
+#include <boost/mpl/long.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/tag.hpp>
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/aux_/advance_forward.hpp>
+#include <boost/mpl/aux_/advance_backward.hpp>
+#include <boost/mpl/aux_/value_wknd.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/nttp_decl.hpp>
+
+namespace boost { namespace mpl {
+
+// default implementation for forward/bidirectional iterators
+template< typename Tag >
+struct advance_impl
+{
+ template< typename Iterator, typename N > struct apply
+ {
+ typedef typename less< N,long_<0> >::type backward_;
+ typedef typename if_< backward_, negate<N>, N >::type offset_;
+
+ typedef typename if_<
+ backward_
+ , aux::advance_backward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
+ , aux::advance_forward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
+ >::type f_;
+
+ typedef typename apply_wrap<f_,Iterator>::type type;
+ };
+};
+
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Iterator)
+ , typename BOOST_MPL_AUX_NA_PARAM(N)
+ >
+struct advance
+ : advance_impl< typename tag<Iterator>::type >
+ ::template apply<Iterator,N>
+{
+};
+
+template<
+ typename Iterator
+ , BOOST_MPL_AUX_NTTP_DECL(long, N)
+ >
+struct advance_c
+ : advance_impl< typename tag<Iterator>::type >
+ ::template apply<Iterator,long_<N> >
+{
+};
+
+BOOST_MPL_AUX_NA_SPEC(2, advance)
+
+}}
+
+#endif // BOOST_MPL_ADVANCE_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/apply.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/apply.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,61 @@
+#ifndef BOOST_MPL_APPLY_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_APPLY_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/placeholders.hpp>
+//MAINTENANCE_NOTE: 2007-01-29: Larry Evans
+// Since nothing from placeholders.hpp is used below,
+// there's no apparent need to #include it above.
+// However, some other files (e.g. mpl/aux_/insert_impl.hpp)
+// use it and are included (in some instances) after
+// this one (e.g. buy mpl/aux_/reverse_fold_impl.hpp) so,
+// the easiest workaround is to #include it here although
+// a better one would be to just included it where needed.
+#include <boost/mpl/lambda.hpp>
+namespace boost
+{
+namespace mpl
+{
+ template
+ < class F
+ , typename... Args
+ >
+ struct
+ apply
+ : apply_wrap
+ < typename lambda<F>::type
+ , Args...
+ >
+ {
+ };
+
+ template
+ < class F
+ , typename Arg0
+ >
+ struct
+ apply1
+ : apply
+ < F
+ , Arg0
+ >
+ {
+ };
+
+ template
+ < class F
+ , typename Arg0
+ , typename Arg1
+ >
+ struct
+ apply2
+ : apply
+ < F
+ , Arg0
+ , Arg1
+ >
+ {
+ };
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/apply_wrap.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/apply_wrap.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,67 @@
+#ifndef BOOST_MPL_APPLY_WRAP_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_APPLY_WRAP_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/aux_/has_apply.hpp>
+//http://www.boost.org/libs/mpl/doc/refmanual/apply-wrap.html
+//@@@TODO: Rm the following #include after all preprocessing includes
+// (i.e. those in
+// <boost/mpl/CONTAINER/aux_/preprocessed/...
+// where CONTAINER is, .e.g. list or vector or...
+// )
+// have been replaced with non-preprocessed versions.
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < class F
+ , typename... Args
+ >
+ struct
+ apply_wrap
+ {
+ typedef
+ typename F::template apply<Args...>::type
+ type
+ ;
+ };
+ namespace detail_apply_wrap
+ {
+ template
+ < class F
+ , typename has_apply_ = typename aux::has_apply<F>::type
+ >
+ struct
+ apply_wrap0
+ : F::template apply<>
+ {
+ };
+
+ template
+ < class F
+ >
+ struct
+ apply_wrap0
+ < F
+ , true_
+ >
+ : F::apply
+ {
+ };
+
+ }//exit detail_apply_wrap
+ template
+ < class F
+ >
+ struct
+ apply_wrap
+ < F
+ >
+ : detail_apply_wrap::apply_wrap0<F>
+ {
+ };
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/at_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/at_fwd.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,37 @@
+#ifndef BOOST_MPL_AT_FWD_HPP_INCLUDED
+#define BOOST_MPL_AT_FWD_HPP_INCLUDED
+//
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+//ChangeLog:
+// 2007-01-29
+// WHAT:
+// 1) Added at_impl fwd decl.Copied then modified from boost/mpl/at_fwd.hpp.
+// WHY:
+// 1) Needed by mpl/set/aux_/at_impl.hpp
+// 2006-09-30
+// WHAT:
+// 1) Copied then modified from boost/mpl/at_fwd.hpp.
+// 2) Added fwd decl for at_c from boost/mpl/at.hpp.
+// WHY:
+// 1) See ../../README.txt
+// 2) To allow at_c to be specialized in ./list.hpp
+// while still just including the at_fwd.hpp within
+// ./list.hpp.
+//
+#include <boost/mpl/aux_/nttp_decl.hpp>
+namespace boost { namespace mpl {
+
+template< typename Tag > struct at_impl;
+template< typename Sequence, typename N > struct at;
+
+template<
+ typename Sequence
+ , BOOST_MPL_AUX_NTTP_DECL(long, N)
+ >
+struct at_c
+;
+
+}}
+
+#endif // BOOST_MPL_AT_FWD_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/aux_/advance_backward.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/aux_/advance_backward.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,84 @@
+#ifndef BOOST_MPL_AUX_ADVANCE_BACKWARD_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_AUX_ADVANCE_BACKWARD_HPP_VARIADIC_TEMPLATES
+
+// 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.
+
+// $Source: /home/evansl/prog_dev/boost-cvs/ro/boost/sandbox/variadic-templates/boost/mpl/aux_/RCS/advance_backward.hpp,v $
+// $Date: 2007/03/05 23:45:03 $
+// $Revision: 1.3 $
+//ChangeLog:
+// 2006-10-23.1334:Larry Evans
+// WHAT:
+// 1) cp'ed from $BOOST_ROOT/boost/mpl/aux_/advance_backward.hpp
+// 2) replaced all code within include guards with variadic
+// version of code in:
+// $BOOST_ROOT/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp
+// WHY:
+// 1-2) avoid use of preprocessed advance_backward.hpp because
+// it uses apply_wrap1 which has been replaced with variadic template
+// version of apply_wrap, and there's no variadic template version
+// of apply_wrap1.
+
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/prior.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+
+template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
+struct advance_backward
+{
+ static long const boost_mpl_limit_unrolling=1;
+ template< typename Iterator > struct apply
+ {
+ typedef typename apply_wrap<
+ advance_backward<boost_mpl_limit_unrolling>
+ , Iterator
+ >::type chunk_result_;
+
+ typedef typename apply_wrap<
+ advance_backward<(
+ (N - boost_mpl_limit_unrolling) < 0
+ ? 0
+ : N - boost_mpl_limit_unrolling
+ )>
+ , chunk_result_
+ >::type type;
+ };
+};
+
+template<>
+struct advance_backward<0>
+{
+ template< typename Iterator > struct apply
+ {
+ //MAINTENANCE_NOTE:2006-10-23.1358
+ // The following (till };) was simply copied from
+ // boost-root/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp
+ typedef Iterator iter0;
+ typedef iter0 type;
+ };
+};
+
+template<>
+struct advance_backward<1>
+{
+ template< typename Iterator > struct apply
+ {
+ //MAINTENANCE_NOTE:2006-10-23.1358
+ // The following (till };) was simply copied from
+ // boost-root/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp
+ typedef Iterator iter0;
+ typedef typename prior<iter0>::type iter1;
+ typedef iter1 type;
+ };
+};
+
+}}}//exit boost::mpl::aux namespace
+
+#endif // BOOST_MPL_AUX_ADVANCE_BACKWARD_HPP_VARIADIC_TEMPLATES

Added: sandbox/variadic_templates/boost/mpl/aux_/advance_forward.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/aux_/advance_forward.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,93 @@
+#ifndef BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_VARIADIC_TEMPLATES
+
+// 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.
+
+// $Source: /home/evansl/prog_dev/boost-cvs/ro/boost/sandbox/variadic-templates/boost/mpl/aux_/RCS/advance_forward.hpp,v $
+// $Date: 2007/03/05 23:21:04 $
+// $Revision: 1.3 $
+//ChangeLog:
+// 2006-10-23.1334:Larry Evans
+// WHAT:
+// 1) cp'ed from $BOOST_ROOT/boost/mpl/aux_/advance_forward.hpp
+// 2) replaced all code within include guards with variadic
+// version of code in:
+// $BOOST_ROOT/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp
+// WHY:
+// 1-2) avoid use of preprocessed advance_forward.hpp because
+// it uses apply_wrap1 which has been replaced with variadic template
+// version of apply_wrap, and there's no variadic template version
+// of apply_wrap1
+// 2006-10-23.1418:
+// WHAT:
+// 1) added static boost_mpl_limit_unrolling.
+// 2) added specializations for <0> and <1>.
+// WHY:
+// 1) to make the similarity with cp'ed files easier.
+// 2) to terminate the template recursion. This termination
+// for non-variadic templates was provided by the
+// preprocessed/gcc/* file.
+
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/next.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+
+template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
+struct advance_forward
+{
+ static long const boost_mpl_limit_unrolling=1;
+ template< typename Iterator > struct apply
+ {
+ typedef typename apply_wrap<
+ advance_forward<boost_mpl_limit_unrolling>
+ , Iterator
+ >::type chunk_result_;
+
+ typedef typename apply_wrap<
+ advance_forward<(
+ (N - boost_mpl_limit_unrolling) < 0
+ ? 0
+ : N - boost_mpl_limit_unrolling
+ )>
+ , chunk_result_
+ >::type type;
+ };
+};
+
+template<>
+struct advance_forward<0>
+{
+ template< typename Iterator > struct apply
+ {
+ //MAINTENANCE_NOTE:2006-10-23.1358
+ // The following (till };) was simply copied from
+ // boost-root/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp
+ typedef Iterator iter0;
+ typedef iter0 type;
+ };
+};
+
+template<>
+struct advance_forward<1>
+{
+ template< typename Iterator > struct apply
+ {
+ //MAINTENANCE_NOTE:2006-10-23.1358
+ // The following (till };) was simply copied from
+ // boost-root/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp
+ typedef Iterator iter0;
+ typedef typename next<iter0>::type iter1;
+ typedef iter1 type;
+ };
+};
+
+}}}//exit boost::mpl::aux namespace
+
+#endif // BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_VARIADIC_TEMPLATES

Added: sandbox/variadic_templates/boost/mpl/aux_/if_recur_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/aux_/if_recur_fold.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,331 @@
+#ifndef BOOST_MPL_AUX_IF_RECUR_FOLD_HPP_INCLUDED
+#define BOOST_MPL_AUX_IF_RECUR_FOLD_HPP_INCLUDED
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/apply.hpp>
+namespace boost{namespace mpl{namespace aux{
+namespace if_recur_fold
+/**@brief
+ * Provide helper templates to adapt if_recur template
+ * for use in folding a binary operator over elements
+ * in a sequence.
+ */
+{
+
+ template
+ < typename FoldState
+ >
+struct names_fstate
+{
+ typedef FoldState fstate;
+ typedef names_fstate type;
+};
+ template
+ < typename Stack
+ , typename FoldState
+ >
+struct names_stack_fstate
+: names_fstate<FoldState>
+{
+ typedef Stack stack;
+ typedef names_stack_fstate type;
+};
+ template
+ < typename State
+ >
+struct make_state
+/**@brief
+ * This and specializations, assure
+ * the result type has nested
+ * 'fstate' typedef.
+ */
+{
+ typedef names_fstate<State> type;
+};
+ template
+ < typename State
+ >
+struct make_state
+ < names_fstate<State>
+ >
+{
+ typedef names_fstate<State> type;
+};
+ template
+ < typename Stack
+ , typename State
+ >
+struct make_state
+ < names_stack_fstate<Stack,State>
+ >
+{
+ typedef names_stack_fstate<Stack,State> type;
+};
+ template
+ < typename State
+ , typename Iter
+ >
+struct names_state_iter
+: State //either names_fstate or names_stack_fstate
+{
+ typedef Iter iter;
+ typedef names_state_iter type;
+};
+ template
+ < typename State
+ , typename Iter
+ >
+struct make_state_iter
+{
+ typedef
+ typename make_state<State>::type
+ named_state
+ ;
+ typedef
+ names_state_iter<named_state,Iter>
+ type
+ ;
+};
+//-{--trivial metafunctions--
+// where "trivial metafunction" is defined here:
+// http://www.boost.org/doc/libs/1_38_0/libs/mpl/doc/refmanual/trivial-metafunction.html
+//
+ template
+ < typename StateIter
+ >
+struct iter
+{
+ typedef typename StateIter::iter type;
+};
+ template
+ < typename StateIter
+ >
+struct fstate
+{
+ typedef typename StateIter::fstate type;
+};
+//-}--trivial metafunctions--
+
+ template
+ < typename StateIter
+ >
+struct op_state_iter
+/**@brief
+ * Returns state with incremented iter.
+ */
+{
+ typedef
+ mpl::aux::if_recur_fold::names_state_iter
+ < mpl::aux::if_recur_fold::names_fstate<typename StateIter::fstate>
+ , typename next<typename StateIter::iter>::type
+ >
+ type
+ ;
+};
+
+ template
+ < typename StateIter
+ , typename OpStateIter
+ >
+struct op_next_fstate_iter
+/**@brief
+ * typedef's {iter,fstate}_{now,next}
+ * where X_next is update of X_now, for X in {iter,fstate}.
+ */
+{
+ typedef
+ typename StateIter::iter
+ iter_now
+ ;
+ typedef
+ typename next<iter_now>::type
+ iter_next
+ ;
+ typedef
+ typename StateIter::fstate
+ fstate_now
+ ;
+ typedef
+ typename apply<OpStateIter,fstate_now,iter_now>::type
+ fstate_next
+ ;
+};
+ template
+ < typename StackStateIter
+ , typename OpStateIter
+ >
+struct op_state_stack_fstate_iter
+/**@brief
+ * Updates stack as well as fstate and iter.
+ */
+: op_next_fstate_iter
+ < StackStateIter
+ , OpStateIter
+ >
+{
+ typedef
+ op_next_fstate_iter
+ < StackStateIter
+ , OpStateIter
+ >
+ super_op
+ ;
+ typedef
+ typename StackStateIter::stack
+ stack_now
+ ;
+ typedef
+ typename push_front
+ < stack_now
+ , typename deref<typename super_op::iter_now>::type
+ >::type
+ stack_next
+ ;
+ typedef
+ names_state_iter
+ < names_stack_fstate
+ < stack_next
+ , typename super_op::fstate_next
+ >
+ , typename super_op::iter_next
+ >
+ type
+ ;
+
+};
+
+ template
+ < typename StateIter
+ , typename OpStateIter
+ >
+struct op_state_fstate_iter
+: op_next_fstate_iter
+ < StateIter
+ , OpStateIter
+ >
+{
+ typedef
+ op_next_fstate_iter
+ < StateIter
+ , OpStateIter
+ >
+ super_op
+ ;
+ typedef
+ names_state_iter
+ < names_fstate
+ < typename super_op::fstate_next
+ >
+ , typename super_op::iter_next
+ >
+ type
+ ;
+
+};
+
+ template
+ < typename State
+ , typename StateIterOp
+ >
+struct op_state_general
+;
+
+ template
+ < typename State
+ , typename Iter
+ , typename StateIterOp
+ >
+struct op_state_general
+ < names_state_iter
+ < names_fstate<State>
+ , Iter
+ >
+ , StateIterOp
+ >
+: op_state_fstate_iter
+ < names_state_iter
+ < names_fstate<State>
+ , Iter
+ >
+ , StateIterOp
+ >
+{
+};
+
+ template
+ < typename Stack
+ , typename State
+ , typename Iter
+ , typename StateIterOp
+ >
+struct op_state_general
+ < names_state_iter
+ < names_stack_fstate<Stack,State>
+ , Iter
+ >
+ , StateIterOp
+ >
+: op_state_stack_fstate_iter
+ < names_state_iter
+ < names_stack_fstate<Stack,State>
+ , Iter
+ >
+ , StateIterOp
+ >
+{
+};
+
+ template
+ < typename StateNow
+ , typename IterLast
+ >
+struct not_iter_last
+: not_
+ < is_same
+ < typename StateNow::iter
+ , IterLast
+ >
+ >
+{
+};
+
+ template
+ < typename F
+ , typename A1NullaryMetaFun
+ , typename A2
+ >
+struct apply2_lazy1
+{
+ typedef
+ typename apply
+ < F
+ , typename A1NullaryMetaFun::type
+ , A2
+ >::type
+ type
+ ;
+};
+
+ template
+ < typename StateNow
+ , typename IterLast
+ , typename Predicate=always<true_>
+ >
+struct not_iter_last_pred
+: and_
+ < not_iter_last<StateNow,IterLast>
+ , apply2_lazy1
+ < Predicate
+ , deref<typename StateNow::iter>//lazy eval to avoid possible deref<IterLast>::type
+ , typename StateNow::fstate
+ >
+ >
+{
+};
+
+}//exit if_recur_fold namespace
+
+}}}//exit boost::mpl::aux namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/aux_/iter_apply.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/aux_/iter_apply.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,63 @@
+
+#ifndef BOOST_MPL_ITER_APPLY_HPP_INCLUDED
+#define BOOST_MPL_ITER_APPLY_HPP_INCLUDED
+
+// 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.
+
+// $Source: /home/evansl/prog_dev/boost-cvs/ro/boost/sandbox/variadic-templates/boost/mpl/aux_/RCS/iter_apply.hpp,v $
+// $Date: 2007/03/08 15:21:49 $
+// $Revision: 1.4 $
+//ChangeLog:
+// 2006-10-28.1455.CST:Larry Evans
+// WHAT:
+// 1) restore the iter_applyn name from the iter_apply name.
+// WHY:
+// 1) avoid compile error about previous def taking 2 instead of 3
+// args.
+// 2006-10-27.2148.CST:Larry Evans
+// WHAT:
+// 1) cp'ed from $BOOST_ROOT/boost/mpl/aux_/iter_apply.hpp
+// 2) replaced all applyn with apply
+// WHY:
+// 1-2) applyn has been replaced with veriadic apply.
+
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/deref.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+
+template
+ < typename F
+ , typename Iterator
+ >
+struct iter_apply1
+ : apply
+ < F
+ , typename deref<Iterator>::type
+ >
+{
+};
+
+template
+ < typename F
+ , typename Iterator1
+ , typename Iterator2
+ >
+struct iter_apply2
+ : apply
+ < F
+ , typename deref<Iterator1>::type
+ , typename deref<Iterator2>::type
+ >
+{
+};
+
+}}}
+
+#endif // BOOST_MPL_ITER_APPLY_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/aux_/numeric_cast_utils.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/aux_/numeric_cast_utils.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,84 @@
+
+#ifndef BOOST_MPL_AUX_NUMERIC_CAST_HPP_INCLUDED
+#define BOOST_MPL_AUX_NUMERIC_CAST_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 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.
+
+// $Source: /home/evansl/prog_dev/boost-cvs/ro/boost/sandbox/variadic-templates/libs/mpl/test/../../../boost/mpl/aux_/RCS/numeric_cast_utils.hpp,v $
+// $Date: 2007/03/09 04:04:38 $
+// $Revision: 1.2 $
+//ChangeLog:
+// 2006-10-23.1203:Larry Evans
+// WHAT:
+// 1) cp'ed from $BOOST_ROOT/boost/mpl/aux_/numeric_cast_utils.hpp
+// 2) replaced all apply_wrapn with apply_wrap.
+// WHY:
+// 1-2) avoid compiler errors at use of apply_wrapn during variadic template compiles.
+
+#include <boost/mpl/numeric_cast.hpp>
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/aux_/config/forwarding.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+
+template<
+ typename F
+ , typename Tag1
+ , typename Tag2
+ >
+struct cast1st_impl
+{
+ template< typename N1, typename N2 > struct apply
+#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
+ : apply_wrap<
+ F
+ , typename apply_wrap< BOOST_MPL_AUX_NUMERIC_CAST<Tag1,Tag2>,N1 >::type
+ , N2
+ >
+ {
+#else
+ {
+ typedef typename apply_wrap<
+ F
+ , typename apply_wrap< BOOST_MPL_AUX_NUMERIC_CAST<Tag1,Tag2>,N1 >::type
+ , N2
+ >::type type;
+#endif
+ };
+};
+
+template<
+ typename F
+ , typename Tag1
+ , typename Tag2
+ >
+struct cast2nd_impl
+{
+ template< typename N1, typename N2 > struct apply
+#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
+ : apply_wrap<
+ F
+ , N1
+ , typename apply_wrap< BOOST_MPL_AUX_NUMERIC_CAST<Tag2,Tag1>,N2 >::type
+ >
+ {
+#else
+ {
+ typedef typename apply_wrap<
+ F
+ , N1
+ , typename apply_wrap< BOOST_MPL_AUX_NUMERIC_CAST<Tag2,Tag1>,N2 >::type
+ >::type type;
+#endif
+ };
+};
+
+}}}
+
+#endif // BOOST_MPL_AUX_NUMERIC_CAST_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/bind.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/bind.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,551 @@
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_BIND_HPP_INCLUDED
+#define BOOST_MPL_BIND_HPP_INCLUDED
+
+// Copyright Peter Dimov 2001
+// 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/25 12:19:12 $
+// $Revision: 1.2 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/bind_fwd.hpp>
+# include <boost/mpl/placeholders.hpp>
+# include <boost/mpl/next.hpp>
+# include <boost/mpl/protect.hpp>
+# include <boost/mpl/apply_wrap.hpp>
+# include <boost/mpl/limits/arity.hpp>
+# include <boost/mpl/aux_/na.hpp>
+# include <boost/mpl/aux_/arity_spec.hpp>
+# include <boost/mpl/aux_/type_wrapper.hpp>
+# include <boost/mpl/aux_/yes_no.hpp>
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+# include <boost/type_traits/is_reference.hpp>
+# endif
+#endif
+
+#include <boost/mpl/aux_/config/bind.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# if defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+# define BOOST_MPL_PREPROCESSED_HEADER basic_bind.hpp
+# else
+# define BOOST_MPL_PREPROCESSED_HEADER bind.hpp
+# endif
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <boost/mpl/aux_/preprocessor/params.hpp>
+# include <boost/mpl/aux_/preprocessor/default_params.hpp>
+# include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
+# include <boost/mpl/aux_/preprocessor/partial_spec_params.hpp>
+# include <boost/mpl/aux_/preprocessor/ext_params.hpp>
+# include <boost/mpl/aux_/preprocessor/repeat.hpp>
+# include <boost/mpl/aux_/preprocessor/enum.hpp>
+# include <boost/mpl/aux_/preprocessor/add.hpp>
+# include <boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp>
+# include <boost/mpl/aux_/config/ctps.hpp>
+# include <boost/mpl/aux_/config/ttp.hpp>
+# include <boost/mpl/aux_/config/dtp.hpp>
+# include <boost/mpl/aux_/nttp_decl.hpp>
+
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/inc.hpp>
+
+namespace boost { namespace mpl {
+
+// local macros, #undef-ined at the end of the header
+# define AUX778076_APPLY \
+ apply_wrap \
+ /**/
+
+# if defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
+# define AUX778076_DMC_PARAM() , int dummy_
+# else
+# define AUX778076_DMC_PARAM()
+# endif
+
+# define AUX778076_BIND_PARAMS(param) \
+ BOOST_MPL_PP_PARAMS( \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
+ , param \
+ ) \
+ /**/
+
+# define AUX778076_BIND_DEFAULT_PARAMS(param, value) \
+ BOOST_MPL_PP_DEFAULT_PARAMS( \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
+ , param \
+ , value \
+ ) \
+ /**/
+
+# define AUX778076_BIND_N_PARAMS(n, param) \
+ BOOST_PP_COMMA_IF(n) BOOST_MPL_PP_PARAMS(n, param) \
+ /**/
+
+# define AUX778076_BIND_N_SPEC_PARAMS(n, param, def) \
+ BOOST_PP_COMMA_IF(n) \
+ BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(n, param, def) \
+ /**/
+
+#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+# define AUX778076_BIND_NESTED_DEFAULT_PARAMS(param, value) \
+ AUX778076_BIND_DEFAULT_PARAMS(param, value) \
+ /**/
+#else
+# define AUX778076_BIND_NESTED_DEFAULT_PARAMS(param, value) \
+ AUX778076_BIND_PARAMS(param) \
+ /**/
+#endif
+
+namespace aux {
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template<
+ typename T, AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg
+{
+ typedef T type;
+};
+
+# if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+
+template<
+ typename T
+ , typename Arg
+ >
+struct replace_unnamed_arg
+{
+ typedef Arg next;
+ typedef T type;
+};
+
+template<
+ typename Arg
+ >
+struct replace_unnamed_arg< arg<-1>,Arg >
+{
+ typedef typename Arg::next next;
+ typedef Arg type;
+};
+
+# endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
+
+template<
+ BOOST_MPL_AUX_NTTP_DECL(int, N), AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg< arg<N>,AUX778076_BIND_PARAMS(U) >
+{
+ typedef typename AUX778076_APPLY<mpl::arg<N>, AUX778076_BIND_PARAMS(U)>::type type;
+};
+
+#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+template<
+ typename F, AUX778076_BIND_PARAMS(typename T), AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg< bind<F,AUX778076_BIND_PARAMS(T)>,AUX778076_BIND_PARAMS(U) >
+{
+ typedef bind<F,AUX778076_BIND_PARAMS(T)> f_;
+ typedef typename AUX778076_APPLY<f_, AUX778076_BIND_PARAMS(U)>::type type;
+};
+#endif
+
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+// agurt, 15/jan/02: it's not a intended to be used as a function class, and
+// MSVC6.5 has problems with 'apply' name here (the code compiles, but doesn't
+// work), so I went with the 'result_' here, and in all other similar cases
+template< bool >
+struct resolve_arg_impl
+{
+ template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
+ {
+ typedef T type;
+ };
+};
+
+template<>
+struct resolve_arg_impl<true>
+{
+ template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
+ {
+ typedef typename AUX778076_APPLY<
+ T
+ , AUX778076_BIND_PARAMS(U)
+ >::type type;
+ };
+};
+
+// for 'resolve_bind_arg'
+template< typename T > struct is_bind_template;
+
+template<
+ typename T, AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg
+ : resolve_arg_impl< is_bind_template<T>::value >
+ ::template result_< T,AUX778076_BIND_PARAMS(U) >
+{
+};
+
+# if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+
+template< typename T >
+struct replace_unnamed_arg_impl
+{
+ template< typename Arg > struct result_
+ {
+ typedef Arg next;
+ typedef T type;
+ };
+};
+
+template<>
+struct replace_unnamed_arg_impl< arg<-1> >
+{
+ template< typename Arg > struct result_
+ {
+ typedef typename next<Arg>::type next;
+ typedef Arg type;
+ };
+};
+
+template< typename T, typename Arg >
+struct replace_unnamed_arg
+ : replace_unnamed_arg_impl<T>::template result_<Arg>
+{
+};
+
+# endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
+
+// agurt, 10/mar/02: the forward declaration has to appear before any of
+// 'is_bind_helper' overloads, otherwise MSVC6.5 issues an ICE on it
+template< BOOST_MPL_AUX_NTTP_DECL(int, arity_) > struct bind_chooser;
+
+aux::no_tag is_bind_helper(...);
+template< typename T > aux::no_tag is_bind_helper(protect<T>*);
+
+// overload for "main" form
+// agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload
+// in case if we use 'aux::type_wrapper< bind<...> >' here, and all
+// 'bind' instantiations form a complete type anyway
+#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+template<
+ typename F, AUX778076_BIND_PARAMS(typename T)
+ >
+aux::yes_tag is_bind_helper(bind<F,AUX778076_BIND_PARAMS(T)>*);
+#endif
+
+template< BOOST_MPL_AUX_NTTP_DECL(int, N) >
+aux::yes_tag is_bind_helper(arg<N>*);
+
+template< bool is_ref_ = true >
+struct is_bind_template_impl
+{
+ template< typename T > struct result_
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+};
+
+template<>
+struct is_bind_template_impl<false>
+{
+ template< typename T > struct result_
+ {
+ BOOST_STATIC_CONSTANT(bool, value =
+ sizeof(aux::is_bind_helper(static_cast<T*>(0)))
+ == sizeof(aux::yes_tag)
+ );
+ };
+};
+
+template< typename T > struct is_bind_template
+ : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
+ ::template result_<T>
+{
+};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+} // namespace aux
+
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/bind.hpp>))
+#include BOOST_PP_ITERATE()
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS)
+/// if_/eval_if specializations
+# define AUX778076_SPEC_NAME if_
+# define BOOST_PP_ITERATION_PARAMS_1 (3,(3, 3, <boost/mpl/bind.hpp>))
+# include BOOST_PP_ITERATE()
+
+#if !defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
+# define AUX778076_SPEC_NAME eval_if
+# define BOOST_PP_ITERATION_PARAMS_1 (3,(3, 3, <boost/mpl/bind.hpp>))
+# include BOOST_PP_ITERATE()
+#endif
+#endif
+
+// real C++ version is already taken care of
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+
+namespace aux {
+// apply_count_args
+#define AUX778076_COUNT_ARGS_PREFIX bind
+#define AUX778076_COUNT_ARGS_DEFAULT na
+#define AUX778076_COUNT_ARGS_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+#include <boost/mpl/aux_/count_args.hpp>
+}
+
+// bind
+template<
+ typename F, AUX778076_BIND_PARAMS(typename T) AUX778076_DMC_PARAM()
+ >
+struct bind
+ : aux::bind_chooser<
+ aux::bind_count_args<AUX778076_BIND_PARAMS(T)>::value
+ >::template result_< F,AUX778076_BIND_PARAMS(T) >::type
+{
+};
+
+BOOST_MPL_AUX_ARITY_SPEC(
+ BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
+ , bind
+ )
+
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(
+ BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
+ , bind
+ )
+
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+# undef AUX778076_BIND_NESTED_DEFAULT_PARAMS
+# undef AUX778076_BIND_N_SPEC_PARAMS
+# undef AUX778076_BIND_N_PARAMS
+# undef AUX778076_BIND_DEFAULT_PARAMS
+# undef AUX778076_BIND_PARAMS
+# undef AUX778076_DMC_PARAM
+# undef AUX778076_APPLY
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_BIND_HPP_INCLUDED
+
+///// iteration, depth == 1
+
+// For gcc 4.4 compatability, we must include the
+// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
+#else // BOOST_PP_IS_ITERATING
+#if BOOST_PP_ITERATION_DEPTH() == 1
+
+# define i_ BOOST_PP_FRAME_ITERATION(1)
+
+#if defined(AUX778076_SPEC_NAME)
+
+// lazy metafunction specialization
+template< template< BOOST_MPL_PP_PARAMS(i_, typename T) > class F, typename Tag >
+struct BOOST_PP_CAT(quote,i_);
+
+template< BOOST_MPL_PP_PARAMS(i_, typename T) > struct AUX778076_SPEC_NAME;
+
+template<
+ typename Tag AUX778076_BIND_N_PARAMS(i_, typename T)
+ >
+struct BOOST_PP_CAT(bind,i_)<
+ BOOST_PP_CAT(quote,i_)<AUX778076_SPEC_NAME,Tag>
+ AUX778076_BIND_N_PARAMS(i_,T)
+ >
+{
+ template<
+ AUX778076_BIND_NESTED_DEFAULT_PARAMS(typename U, na)
+ >
+ struct apply
+ {
+ private:
+ typedef mpl::arg<1> n1;
+# define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, <boost/mpl/bind.hpp>))
+# include BOOST_PP_ITERATE()
+
+ typedef typename AUX778076_SPEC_NAME<
+ typename t1::type
+ , BOOST_MPL_PP_EXT_PARAMS(2, BOOST_PP_INC(i_), t)
+ >::type f_;
+
+ public:
+ typedef typename f_::type type;
+ };
+};
+
+#undef AUX778076_SPEC_NAME
+
+#else // AUX778076_SPEC_NAME
+
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
+ >
+struct BOOST_PP_CAT(bind,i_)
+{
+ template<
+ AUX778076_BIND_NESTED_DEFAULT_PARAMS(typename U, na)
+ >
+ struct apply
+ {
+ private:
+# if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+
+ typedef aux::replace_unnamed_arg< F,mpl::arg<1> > r0;
+ typedef typename r0::type a0;
+ typedef typename r0::next n1;
+ typedef typename aux::resolve_bind_arg<a0,AUX778076_BIND_PARAMS(U)>::type f_;
+ ///
+# else
+ typedef typename aux::resolve_bind_arg<F,AUX778076_BIND_PARAMS(U)>::type f_;
+
+# endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
+
+# if i_ > 0
+# define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, <boost/mpl/bind.hpp>))
+# include BOOST_PP_ITERATE()
+# endif
+
+ public:
+
+# define AUX778076_ARG(unused, i_, t) \
+ BOOST_PP_COMMA_IF(i_) \
+ typename BOOST_PP_CAT(t,BOOST_PP_INC(i_))::type \
+/**/
+
+ typedef typename apply_wrap<
+ f_
+ BOOST_PP_COMMA_IF(i_) BOOST_MPL_PP_REPEAT(i_, AUX778076_ARG, t)
+ >::type type;
+
+# undef AUX778076_ARG
+ };
+};
+
+namespace aux {
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T), AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg<
+ BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)>,AUX778076_BIND_PARAMS(U)
+ >
+{
+ typedef BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)> f_;
+ typedef typename AUX778076_APPLY<f_, AUX778076_BIND_PARAMS(U)>::type type;
+};
+
+#else
+
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T)
+ >
+aux::yes_tag
+is_bind_helper(BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)>*);
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+} // namespace aux
+
+BOOST_MPL_AUX_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))
+
+# if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+#if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+/// primary template (not a specialization!)
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
+ >
+struct bind
+ : BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T) >
+{
+};
+#else
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
+ >
+struct bind< F AUX778076_BIND_N_SPEC_PARAMS(i_, T, na) >
+ : BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T) >
+{
+};
+#endif
+
+# else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace aux {
+
+template<>
+struct bind_chooser<i_>
+{
+ template<
+ typename F, AUX778076_BIND_PARAMS(typename T)
+ >
+ struct result_
+ {
+ typedef BOOST_PP_CAT(bind,i_)< F AUX778076_BIND_N_PARAMS(i_,T) > type;
+ };
+};
+
+} // namespace aux
+
+# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# endif // BOOST_MPL_CFG_NO_BIND_TEMPLATE
+
+#endif // AUX778076_SPEC_NAME
+
+# undef i_
+
+///// iteration, depth == 2
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+
+# define j_ BOOST_PP_FRAME_ITERATION(2)
+# if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+
+ typedef aux::replace_unnamed_arg< BOOST_PP_CAT(T,j_),BOOST_PP_CAT(n,j_) > BOOST_PP_CAT(r,j_);
+ typedef typename BOOST_PP_CAT(r,j_)::type BOOST_PP_CAT(a,j_);
+ typedef typename BOOST_PP_CAT(r,j_)::next BOOST_PP_CAT(n,BOOST_PP_INC(j_));
+ typedef aux::resolve_bind_arg<BOOST_PP_CAT(a,j_), AUX778076_BIND_PARAMS(U)> BOOST_PP_CAT(t,j_);
+ ///
+# else
+ typedef aux::resolve_bind_arg< BOOST_PP_CAT(T,j_),AUX778076_BIND_PARAMS(U)> BOOST_PP_CAT(t,j_);
+
+# endif
+# undef j_
+
+#endif // BOOST_PP_ITERATION_DEPTH()
+#endif // BOOST_PP_IS_ITERATING

Added: sandbox/variadic_templates/boost/mpl/deque.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/deque.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,20 @@
+#ifndef BOOST_MPL_DEQUE_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_DEQUE_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/vector.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename... Args
+ >
+ struct
+deque
+ : vector<Args...>
+{
+};
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/fold.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,36 @@
+#ifndef BOOST_MPL_FOLD_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_FOLD_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/foldl_iter_if.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/lambda.hpp>
+
+namespace boost { namespace mpl {
+
+ template
+ < typename Sequence //sequence of Value's
+ , typename State //initial State
+ , typename OpStateVal //Operator: (State,Value) -> State
+ >
+ struct
+fold
+{
+ typedef
+ typename foldl_iter_if
+ < typename begin<Sequence>::type
+ , typename end<Sequence>::type
+ , State
+ , typename lambda<OpStateVal>::type::template
+ apply
+ < arg<1>
+ , deref<arg<2> >
+ > //Changes OpStateVal to OpStateIter: (State,Iterator) -> State
+ //where Iterator is the type of iterator over Value's.
+ >::type::fstate
+ type
+ ;
+};
+
+}}//exit boost::mpl namespace
+
+#endif //include guard

Added: sandbox/variadic_templates/boost/mpl/foldl_iter.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/foldl_iter.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,72 @@
+#ifndef BOOST_MPL_FOLD_ITER_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_FOLDL_ITER_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/apply.hpp>
+namespace boost { namespace mpl {
+
+ template
+ < typename IterNow//start Iterator on Value's, i.e. deref<IterNow>::type is a "Value".
+ , typename IterEnd//end ValueIterator.
+ , typename State0 //intial State
+ , typename OpStateIter//Operator: (State,ValueIterator) -> State
+ >
+ struct
+foldl_iter
+/**@brief
+ * Apply OpStateIter for each iterator instance between IterNow and just before
+ * InterEnd starting with intial State, State0. Associate the applications
+ * to the left.
+ *
+ * For example, the analogous operation on run-time-value's is:
+ *
+ * Assuming:
+ * z == the run-time-value analogue of State0.
+ * xI == the analogue of deref of the I-th iterator in IterNow...IterEnd.
+ * F == the analogue of OpStateIter but where 2nd arg is a Value instead of Value iterator.
+ * 3 == distance<IterNow,IterEnd>::value
+ * Then the analogue of result would be:
+ * F(F(F(z,x1),x2),x3)
+ *
+ * This template is similar to the haskell foldl described on p. 116 of:
+ *
+ * http://haskell.org/definition/haskell98-report.pdf
+ *
+ * where:
+ * haskell these_comments
+ * ------- --------------
+ * f F
+ * a State
+ * b Value
+ * z initial State
+ */
+: foldl_iter
+ < typename next<IterNow>::type
+ , IterEnd
+ , typename apply<OpStateIter,State0,IterNow>::type
+ , OpStateIter
+ >
+{
+};
+
+ template
+ < typename IterEnd
+ , typename State0
+ , typename OpStateIter
+ >
+ struct
+foldl_iter
+ < IterEnd
+ , IterEnd
+ , State0
+ , OpStateIter
+ >
+{
+ typedef
+ State0
+ type
+ ;
+};
+
+}}//exit boost::mpl namespace
+
+#endif //include guard

Added: sandbox/variadic_templates/boost/mpl/foldl_iter_if.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/foldl_iter_if.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,70 @@
+#ifndef BOOST_MPL_FOLDL_ITER_IF_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_FOLDL_ITER_IF_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/if_recur.hpp>
+#include <boost/mpl/aux_/if_recur_fold.hpp>
+namespace boost { namespace mpl {
+
+ template
+ < typename IterNow //start ValueIterator.
+ , typename IterEnd //end ValueIterator.
+ , typename State0 //initial State
+ , typename OpStateIterState //Operator: (State,ValueIterator) -> State
+ , typename OpIterBool=always<true_> //Operator: ValueIterator -> mpl::bool_
+ >
+ struct
+foldl_iter_if
+/**@brief
+ * Starting from State0, apply OpStateIterState for each iterator instance
+ * between IterNow and just before IterLast (expressed as `[IterNow...IterLast)`)
+ * where IterLast is the 1st iterator in [IterNow...IterEnd) that fails
+ * the OpIterBool test.
+ *
+ * Associate the applications to the left.
+ *
+ * For example, the analogous operation on run-time-value's is:
+ *
+ * Assuming:
+ * z == the run-time-value analogue of State0.
+ * xI == the analogue of deref of the I-th iterator in IterNow...IterEnd.
+ * F == the analogue of OpStateIterState but where 2nd arg is
+ * a Value instead of Value iterator.
+ * 3 == distance<IterNow,IterEnd>::value
+ * Then the analogue of result would be:
+ * F(F(F(z,x1),x2),x3)
+ *
+ * This template is similar to the haskell foldl described on p. 116 of:
+ *
+ * http://haskell.org/definition/haskell98-report.pdf
+ *
+ * where:
+ * haskell these_comments
+ * ------- --------------
+ * f F
+ * a State
+ * b Value
+ * z initial State
+ */
+: if_recur
+ < typename aux::if_recur_fold::make_state_iter
+ < State0
+ , IterNow
+ >::type
+ , aux::if_recur_fold::not_iter_last_pred
+ < arg<1>
+ , IterEnd
+ , typename lambda<OpIterBool>::type
+ >
+ , aux::if_recur_fold::op_state_general
+ < arg<1>
+ , typename lambda<OpStateIterState>::type
+ >
+ , arg<2>
+ , arg<1>
+ >
+{
+};
+
+}}//exit boost::mpl namespace
+
+#endif //include guard

Added: sandbox/variadic_templates/boost/mpl/foldr_iter_if.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/foldr_iter_if.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,58 @@
+#ifndef BOOST_MPL_FOLDR_ITER_IF_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_FOLDR_ITER_IF_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/if_recur.hpp>
+#include <boost/mpl/aux_/if_recur_fold.hpp>
+namespace boost { namespace mpl {
+
+ template
+ < typename IterNow //start ValueIterator.
+ , typename IterEnd //end ValueIterator.
+ , typename State0 //initial State
+ , typename OpIterStateState //Operator: (ValueIterator,State) -> State
+ , typename OpIterBool=always<true_> //Operator: ValueIterator -> mpl::bool_
+ >
+ struct
+foldr_iter_if
+/**@brief
+ * Same as foldl_iter_if except association is to the right,
+ * and Operator arguments are swapped.
+ * IOW, the analogue result (see comments to foldl_iter_if.hpp) is:
+ * F(x1,F(x2,F(x3,z)))
+ *
+ * This template is similar to the haskell foldr described on p. 117 of:
+ *
+ * http://haskell.org/definition/haskell98-report.pdf
+ *
+ * where:
+ * haskell these_comments
+ * ------- --------------
+ * f F
+ * a Value
+ * b State
+ * z initial State
+ */
+: if_recur
+ < aux::if_recur_fold::names_state_iter
+ < aux::if_recur_fold::names_fstate<State0>
+ , IterNow
+ >
+ , aux::if_recur_fold::not_iter_last_pred
+ < arg<1>
+ , IterEnd
+ , typename lambda<OpIterBool>::type
+ >
+ , aux::if_recur_fold::op_state_iter<arg<1> >
+ , typename lambda<OpIterStateState>::type::template
+ apply
+ < aux::if_recur_fold::iter<arg<1> >
+ , arg<2>
+ >
+ , aux::if_recur_fold::fstate<arg<1> >
+ >
+{
+};
+
+}}//exit boost::mpl namespace
+
+#endif //include guard

Added: sandbox/variadic_templates/boost/mpl/if_recur.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/if_recur.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,99 @@
+#ifndef BOOST_MPL_IF_RECUR_HPP_INCLUDED
+#define BOOST_MPL_IF_RECUR_HPP_INCLUDED
+// Copyright Larry Evans 2009
+//
+
+// $Id$
+// $Date: 2009/04/25 03:10:01 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/arg.hpp>
+#include <boost/mpl/always.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+namespace aux
+{
+namespace if_recur
+{
+ template
+ < class F
+ , class A1
+ , class A2NullaryMetaFun
+ >
+ struct apply2_lazy2
+ {
+ typedef
+ typename apply
+ < F
+ , A1
+ , typename A2NullaryMetaFun::type
+ >::type
+ type
+ ;
+ };
+}//exit if_recur namespace
+}//exit aux namespace
+
+ //Notation:
+ // MFC_or_LE = Metafunction class or Lambda Expression
+ // (See Description on libs/mpl/doc/refmanual/apply.html)
+ //
+ // X -> Y = metafunction from "Kind" X to "Kind" Y.
+ //
+ // State = some Kind of "state"
+ //Purpose:
+ // Almost the same as section 12.5 equation 1) of:
+ // http://www.thocp.net/biographies/papers/backus_turingaward_lecture.pdf
+ // The correspondences between this and that equaton is:
+ //
+ // this equation 1)
+ // ---- -----------
+ // if_recur f
+ // mpl::not_<Recur> p
+ // ThenDown j
+ // NowUp h
+ // mpl::arg<1> i
+ // Else g
+ //
+
+ template
+ < class StateNow//nullary metafunction of Kind: -> State.
+ , class Recur=always<false_>//MFC_or_LE of Kind: State -> bool_.
+ , class ThenDown=arg<1>//MFC_or_LE of Kind: State -> State.
+ , class NowUp=arg<2>//MFC_or_LE of Kind: (State,State) -> State.
+ , class Else=arg<1>//MFC_or_LE of Kind: State -> State.
+ >
+ struct if_recur
+ {
+ typedef
+ typename StateNow::type
+ state_now
+ ;
+ typedef
+ typename eval_if
+ < typename apply<Recur,state_now>::type
+ , aux::if_recur::apply2_lazy2
+ < NowUp
+ , state_now
+ , if_recur
+ < apply<ThenDown,state_now>
+ , Recur
+ , ThenDown
+ , NowUp
+ , Else
+ >
+ >
+ , apply<Else,state_now>
+ >::type
+ type
+ ;
+ };
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/iter_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/iter_fold.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,26 @@
+#ifndef BOOST_MPL_ITER_FOLD_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_ITER_FOLD_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/foldl_iter.hpp>
+#include <boost/mpl/begin_end.hpp>
+
+namespace boost { namespace mpl {
+
+ template
+ < typename Sequence
+ , typename State
+ , typename StateIterOp
+ >
+ struct
+iter_fold
+: foldl_iter
+ < typename begin<Sequence>::type
+ , typename end<Sequence>::type
+ , State
+ , StateIterOp
+ >
+{
+};
+
+}}//exit boost::mpl namespace
+
+#endif //include guard

Added: sandbox/variadic_templates/boost/mpl/iter_fold_if.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/iter_fold_if.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,146 @@
+//variadic template version of iter_fold_if.hpp.
+#ifndef BOOST_MPL_ITER_FOLD_IF_HPP_INCLUDED
+#define BOOST_MPL_ITER_FOLD_IF_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright Eric Friedman 2003
+//
+// 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.
+
+// $Source: /home/evansl/prog_dev/boost-svn/ro/boost-vrtmp/boost/mpl/RCS/iter_fold_if.hpp,v $
+// $Date: 2009/04/08 16:19:50 $
+// $Revision: 1.6 $
+
+//ChangeLog:
+// 2009-02-04:1026
+// WHAT:
+// 1) replaced iter_apply1 with apply1.
+// WHY:
+// 1) Steve explained that iter_fold, which
+// uses this(I guess) is not supposed to
+// deref the iterator. Instead, the
+// Predicate itself is supposed to
+// deref the iterator (I guess).
+//
+// See:
+/*
+http://archives.free.net.ph/message/20090204.161237.9fc3c658.en.html
+http://www.boost.org/libs/mpl/doc/refmanual/iter-fold.html
+ */
+//
+// 2009-02-04:0910
+// WHAT:
+// 1) replaced apply with iter_apply1.
+// WHY:
+// 1) enable find.cpp compile.
+// 2007-01-29:
+// WHAT:
+// 1) cp'ed from <boost-root>/boost/mpl/iter_fold_if.hpp
+// 2) replaced all apply1 with apply.
+// WHY:
+// 2) apply1 was replaced with variadic template apply.
+
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/logical.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/pair.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/aux_/iter_fold_if_impl.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+#include <boost/mpl/aux_/config/forwarding.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace mpl {
+
+namespace aux {
+
+template< typename Predicate, typename LastIterator >
+struct iter_fold_if_pred
+{
+ template< typename State, typename Iterator > struct apply
+#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
+ : and_<
+ not_< is_same<Iterator,LastIterator> >
+ , apply1<Predicate,Iterator>
+ >
+ {
+#else
+ {
+ typedef and_<
+ not_< is_same<Iterator,LastIterator> >
+ , apply1<Predicate,Iterator>
+ > type;
+#endif
+ };
+};
+
+} // namespace aux
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Sequence)
+ , typename BOOST_MPL_AUX_NA_PARAM(State)
+ , typename BOOST_MPL_AUX_NA_PARAM(ForwardOp)
+ , typename BOOST_MPL_AUX_NA_PARAM(ForwardPredicate)
+ , typename BOOST_MPL_AUX_NA_PARAM(BackwardOp)
+ , typename BOOST_MPL_AUX_NA_PARAM(BackwardPredicate)
+ >
+struct iter_fold_if
+{
+
+ typedef typename begin<Sequence>::type first_;
+ typedef typename end<Sequence>::type last_;
+
+ typedef typename eval_if<
+ is_na<BackwardPredicate>
+ , if_< is_na<BackwardOp>, always<false_>, always<true_> >
+ , identity<BackwardPredicate>
+ >::type backward_pred_;
+
+// cwpro8 doesn't like 'cut-off' type here (use typedef instead)
+#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) && !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+ struct result_ :
+#else
+ typedef
+#endif
+ aux::iter_fold_if_impl<
+ first_
+ , State
+ , ForwardOp
+ , protect< aux::iter_fold_if_pred< ForwardPredicate,last_ > >
+ , BackwardOp
+ , backward_pred_
+ >
+#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) && !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+ { };
+#else
+ result_;
+#endif
+
+public:
+
+ typedef pair<
+ typename result_::state
+ , typename result_::iterator
+ > type;
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 6
+ , iter_fold_if
+ , (Sequence,State,ForwardOp,ForwardPredicate,BackwardOp,BackwardPredicate)
+ )
+};
+
+BOOST_MPL_AUX_NA_SPEC(6, iter_fold_if)
+
+}}
+
+#endif // BOOST_MPL_ITER_FOLD_IF_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/list.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,37 @@
+#ifndef BOOST_MPL_LIST_HPP_INCLUDED
+#define BOOST_MPL_LIST_HPP_INCLUDED
+#include <boost/mpl/list/list0.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+
+ template
+ < typename Head
+ , typename... Tail
+ >
+ struct
+list
+ < Head
+ , Tail...
+ >
+ : l_item
+ < long_<1+sizeof...(Tail)>
+ , Head
+ , list<Tail...>
+ >
+//@diff-nv-mpl:
+// This specialization corresponds to all of the listI
+// for I=1..., which are defined in non-variadic mpl in
+// one of the files:
+// boost/mpl/list/aux_/preprocessed/plain/listN.hpp
+// for some N in 10,20,...
+{
+ typedef list type;
+};
+
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/list/aux_/begin_end.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list/aux_/begin_end.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,45 @@
+
+#ifndef BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED
+
+// 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/08 22:20:07 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/begin_end_fwd.hpp>
+#include <boost/mpl/list/aux_/iterator.hpp>
+#include <boost/mpl/list/aux_/tag.hpp>
+#include <boost/mpl/list/aux_/item.hpp>
+#include <boost/mpl/list_fwd.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct begin_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ {
+ typedef l_iter<typename List::type> type;
+ };
+};
+
+template<>
+struct end_impl< aux::list_tag >
+{
+ template< typename > struct apply
+ {
+ typedef l_iter<list<> > type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/list/aux_/clear.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list/aux_/clear.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,35 @@
+
+#ifndef BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED
+
+// 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/08 22:56:39 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/clear_fwd.hpp>
+#include <boost/mpl/list/aux_/item.hpp>
+#include <boost/mpl/list/aux_/tag.hpp>
+#include <boost/mpl/list_fwd.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct clear_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ {
+ typedef list<> type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/list/aux_/item.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list/aux_/item.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,44 @@
+
+#ifndef BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED
+
+// 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/08 22:12:12 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/list/aux_/tag.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename Size
+ , typename T
+ , typename Next
+ >
+struct l_item
+{
+// agurt, 17/jul/03: to facilitate the deficient 'is_sequence' implementation
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ typedef int begin;
+#endif
+ typedef aux::list_tag tag;
+ typedef l_item type;
+
+ typedef Size size;
+ typedef T item;
+ typedef Next next;
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/list/aux_/iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list/aux_/iterator.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,77 @@
+
+#ifndef BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED
+
+// 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: 2008-10-10 04:10:26 -0500 (Fri, 10 Oct 2008) $
+// $Revision: 49239 $
+
+#include <boost/mpl/iterator_tags.hpp>
+#include <boost/mpl/next_prior.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/list/aux_/item.hpp>
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/mpl/aux_/lambda_spec.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+#include <boost/mpl/list_fwd.hpp>
+
+namespace boost { namespace mpl {
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template< typename Node >
+struct l_iter
+{
+ typedef aux::l_iter_tag tag;
+ typedef forward_iterator_tag category;
+};
+
+template< typename Node >
+struct deref< l_iter<Node> >
+{
+ typedef typename Node::item type;
+};
+
+template< typename Node >
+struct next< l_iter<Node> >
+{
+ typedef l_iter< typename Node::next > type;
+};
+
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+template< typename Node >
+struct l_iter
+{
+ typedef aux::l_iter_tag tag;
+ typedef forward_iterator_tag category;
+ typedef typename Node::item type;
+ typedef l_iter< typename mpl::next<Node>::type > next;
+};
+
+#endif
+
+
+template<> struct l_iter<list<> >
+{
+ typedef aux::l_iter_tag tag;
+ typedef forward_iterator_tag category;
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ typedef na type;
+ typedef na next;
+#endif
+};
+
+BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, l_iter)
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/list/aux_/list0.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list/aux_/list0.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,40 @@
+
+#ifndef BOOST_MPL_LIST_AUX_LIST0_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_LIST0_HPP_INCLUDED
+
+//!
+//!@nv-mpl_diff:
+//! WHAT:
+//! This replaces the list0 declaration in
+//! boost/mpl/list/list0.hpp.
+//| However, it does not replace the #include's
+//! in that file. The #include's from that
+//! file are #included in .../list0.hpp.
+//! WHY:
+//! Make consistent with the vector files.
+//!
+#include <boost/mpl/list_fwd.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+
+ template
+ <
+ >
+ struct
+list
+ <
+ >
+{
+ typedef aux::list_tag tag;
+ typedef list type;
+ typedef long_<0> size;
+};
+
+}//exit mpl namespace
+}//exit boost namespace
+
+
+#endif // BOOST_MPL_LIST_AUX_LIST0_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/list/list0.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list/list0.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,44 @@
+
+#ifndef BOOST_MPL_LIST_LIST0_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST0_HPP_INCLUDED
+
+// 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/08 17:09:17 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/long.hpp>
+#include <boost/mpl/list/aux_/push_front.hpp>
+#include <boost/mpl/list/aux_/pop_front.hpp>
+#include <boost/mpl/list/aux_/push_back.hpp>
+#include <boost/mpl/list/aux_/front.hpp>
+#include <boost/mpl/list/aux_/clear.hpp>
+#include <boost/mpl/list/aux_/O1_size.hpp>
+#include <boost/mpl/list/aux_/size.hpp>
+#include <boost/mpl/list/aux_/empty.hpp>
+#include <boost/mpl/list/aux_/begin_end.hpp>
+#include <boost/mpl/list/aux_/item.hpp>
+#include <boost/mpl/list/aux_/list0.hpp>
+//|
+//!@nv-mpl_diff
+//! The non-variadic mpl did not the above
+//! #include of aux_/list0.hpp.
+//! It also had a declaration of list0.
+//! This declaration has been moved to
+//! the aux_/list0.hpp file and renamed
+//! to list<>.
+//!
+//! The rationale for this change is to make
+//! the list directory structure as close
+//! as possible to the vector directory structure.
+//! This should make understanding the directory
+//! structure for sequences easier.
+
+#endif // BOOST_MPL_LIST_LIST0_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/list_c.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list_c.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,24 @@
+#ifndef BOOST_MPL_LIST_C_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_LIST_C_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/integral_c.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename Integral
+ , Integral... Args
+ >
+ struct
+list_c
+: list<integral_c<Integral,Args>...>
+{
+ typedef Integral value_type;
+ typedef list_c type;
+};
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/list_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/list_fwd.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,17 @@
+#ifndef BOOST_MPL_LIST_FWD_HPP_INCLUDED
+#define BOOST_MPL_LIST_FWD_HPP_INCLUDED
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename...
+ >
+ struct
+list
+;
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/logical.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/logical.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,21 @@
+
+#ifndef BOOST_MPL_LOGICAL_HPP_INCLUDED
+#define BOOST_MPL_LOGICAL_HPP_INCLUDED
+
+// 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: 2008-10-10 04:10:26 -0500 (Fri, 10 Oct 2008) $
+// $Revision: 49239 $
+
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+
+#endif // BOOST_MPL_LOGICAL_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/map/aux_/clear_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/map/aux_/clear_impl.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,36 @@
+//variadic template version of boost/mpl/map/aux_/clear_impl.hpp
+#ifndef BOOST_MPL_MAP_AUX_CLEAR_IMPL_HPP_INCLUDED
+#define BOOST_MPL_MAP_AUX_CLEAR_IMPL_HPP_INCLUDED
+
+// 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:23:25 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/clear_fwd.hpp>
+#include <boost/mpl/map_fwd.hpp>
+#include <boost/mpl/map/aux_/map0.hpp>
+#include <boost/mpl/map/aux_/tag.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct clear_impl< aux::map_tag >
+{
+ template< typename Map > struct apply
+ {
+ typedef map<> type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_MAP_AUX_CLEAR_IMPL_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/map_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/map_fwd.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,17 @@
+#ifndef BOOST_MPL_MAP_FWD_HPP_INCLUDED
+#define BOOST_MPL_MAP_FWD_HPP_INCLUDED
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename...
+ >
+ struct
+map
+;
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/package.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/package.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,46 @@
+//simple template parameter pack wrapper.
+#ifndef BOOST_MPL_PACKAGE_HPP_INCLUDED
+#define BOOST_MPL_PACKAGE_HPP_INCLUDED
+// (C) Copyright Larry Evans 2007.
+//
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
+// This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+//
+#include <boost/mpl/package/package0.hpp>
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename... Args
+ >
+ struct
+ package
+ {
+ typedef
+ aux::package_tag
+ tag
+ /**@brief
+ * Used for tag dispatching.
+ */
+ ;
+ typedef
+ package
+ < Args...
+ >
+ type
+ ;
+ typedef
+ type
+ pkg_type
+ /**@brief
+ * Used in package/package0.hpp.
+ */
+ ;
+ };
+
+}}//exit boost::mpl
+#endif
+

Added: sandbox/variadic_templates/boost/mpl/package/aux_/tag.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/package/aux_/tag.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,10 @@
+
+#ifndef BOOST_MPL_PACKAGE_AUX_TAG_HPP_INCLUDED
+#define BOOST_MPL_PACKAGE_AUX_TAG_HPP_INCLUDED
+namespace boost { namespace mpl { namespace aux {
+
+struct package_tag;
+
+}}}
+
+#endif // BOOST_MPL_PACKAGE_AUX_TAG_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/package/package0.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/package/package0.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,473 @@
+//package template "operators"
+#ifndef BOOST_MPL_PACKAGE_PACKAGE0_HPP_INCLUDED
+#define BOOST_MPL_PACKAGE_PACKAGE0_HPP_INCLUDED
+// (C) Copyright Larry Evans 2007.
+//
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
+// This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+//
+#include <boost/mpl/integral_c.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/clear.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/push_back.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/iterator_category.hpp>
+#include <boost/mpl/iterator_tags.hpp>
+#include <boost/mpl/package/aux_/tag.hpp>
+#include <boost/mpl/package_fwd.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+ namespace variadic
+ //!
+ //!@brief
+ //! Super templae classes, impl_OP, for
+ //! mpl::OP_impl::apply classes
+ //! for various values of OP
+ //! (e.g. size, front, etc.).
+ //!
+ //! These helper classes are needed because, for some reason,
+ //! specializations of mpl::OP_impl::apply, as done for
+ //! these helper classes, does not work.
+ //!
+ {
+ template
+ < typename Package
+ >
+ struct
+ impl_size
+ ;
+ template
+ < typename... Args
+ >
+ struct
+ impl_size
+ < package
+ < Args...
+ >
+ >
+ : integral_c
+ < long
+ , sizeof...(Args)
+ >
+ {
+ };
+
+ template
+ < typename Package
+ , long N
+ >
+ struct
+ impl_at_c
+ ;
+ template
+ < typename Head
+ , typename... Tail
+ , long N
+ >
+ struct
+ impl_at_c
+ < package<Head, Tail...>
+ , N
+ >
+ : impl_at_c<package<Tail...>, N-1>
+ {
+ };
+ template
+ < typename Head
+ , typename... Tail
+ >
+ struct
+ impl_at_c
+ < package<Head, Tail...>
+ , 0
+ >
+ {
+ typedef
+ Head
+ type
+ ;
+ };
+
+ template
+ < typename Package
+ >
+ struct
+ impl_front
+ ;
+ template
+ < typename Head
+ , typename... Tail
+ >
+ struct
+ impl_front
+ < package
+ < Head
+ , Tail...
+ >
+ >
+ {
+ typedef
+ Head
+ type
+ ;
+ };
+
+ template
+ < typename Package
+ , typename Head
+ >
+ struct
+ impl_push_front
+ ;
+ template
+ < typename... Tail
+ , typename Head
+ , template
+ < typename...
+ >class Package
+ >
+ struct
+ impl_push_front
+ < Package
+ < Tail...
+ >
+ , Head
+ >
+ {
+ typedef
+ Package
+ < Head
+ , Tail...
+ >
+ type
+ ;
+ };
+
+ template
+ < typename Package
+ , typename Tail
+ >
+ struct
+ impl_push_back
+ ;
+ template
+ < typename... Head
+ , typename Tail
+ , template
+ < typename...
+ >class Package
+ >
+ struct
+ impl_push_back
+ < Package
+ < Head...
+ >
+ , Tail
+ >
+ {
+ typedef
+ Package
+ < Head...
+ , Tail
+ >
+ type
+ ;
+ };
+
+ template
+ < typename Package
+ >
+ struct
+ impl_clear
+ ;
+ template
+ < typename... Args
+ >
+ struct
+ impl_clear
+ < package
+ < Args...
+ >
+ >
+ {
+ typedef
+ package<>
+ type;
+
+ };
+
+ template
+ < typename... Args
+ >
+ struct
+ iterator_fwd
+ {
+ typedef
+ forward_iterator_tag
+ category
+ ;
+ };
+ template
+ < typename Package
+ >
+ struct
+ impl_begin
+ ;
+ template
+ < typename... Args
+ >
+ struct
+ impl_begin
+ < package
+ < Args...
+ >
+ >
+ {
+ typedef
+ iterator_fwd
+ < Args...
+ >
+ type
+ ;
+ };
+ template
+ < typename Package
+ >
+ struct
+ impl_end
+ ;
+ template
+ < typename... Args
+ >
+ struct
+ impl_end
+ < package
+ < Args...
+ >
+ >
+ {
+ typedef
+ iterator_fwd
+ <
+ >
+ type
+ ;
+ };
+ }//exit variadic namespace
+
+ template
+ <
+ >
+ struct
+ size_impl
+ < aux::package_tag
+ >
+ {
+ template
+ < class Package
+ >
+ struct
+ apply
+ : variadic::impl_size
+ < typename Package::pkg_type
+ >
+ {
+ };
+ };
+
+ template
+ <
+ >
+ struct
+ at_impl
+ < aux::package_tag
+ >
+ {
+ template
+ < class Package
+ , class N
+ >
+ struct
+ apply
+ : variadic::impl_at_c
+ < typename Package::pkg_type
+ , N::value
+ >
+ {
+ };
+ };
+
+ template
+ <
+ >
+ struct
+ front_impl
+ < aux::package_tag
+ >
+ {
+ template
+ < class Package
+ >
+ struct
+ apply
+ : variadic::impl_front
+ < typename Package::pkg_type
+ >
+ {
+
+ };
+ };
+
+ template
+ <
+ >
+ struct
+ push_front_impl
+ < aux::package_tag
+ >
+ {
+ template
+ < class Package
+ , class Head
+ >
+ struct
+ apply
+ : variadic::impl_push_front
+ < Package
+ , Head
+ >
+ {
+ };
+ };
+
+ template
+ <
+ >
+ struct
+ push_back_impl
+ < aux::package_tag
+ >
+ {
+ template
+ < class Package
+ , class Tail
+ >
+ struct
+ apply
+ : variadic::impl_push_back
+ < Package
+ , Tail
+ >
+ {
+ };
+ };
+
+ template
+ <
+ >
+ struct
+ clear_impl
+ < aux::package_tag
+ >
+ {
+ template
+ < class Package
+ >
+ struct
+ apply
+ : variadic::impl_clear
+ < Package
+ >
+ {
+ };
+ };
+
+ template
+ <
+ >
+ struct
+ begin_impl
+ < aux::package_tag
+ >
+ {
+ template
+ < class Package
+ >
+ struct
+ apply
+ : variadic::impl_begin
+ < typename Package::pkg_type
+ >
+ {
+ };
+ };
+
+ template
+ <
+ >
+ struct
+ end_impl
+ < aux::package_tag
+ >
+ {
+ template
+ < class Package
+ >
+ struct
+ apply
+ : variadic::impl_end
+ < typename Package::pkg_type
+ >
+ {
+ };
+ };
+
+ template
+ < typename Head
+ , typename... Tail
+ >
+ struct
+ deref
+ < variadic::iterator_fwd
+ < Head
+ , Tail...
+ >
+ >
+ {
+ typedef
+ Head
+ type
+ ;
+ };
+ template
+ < typename Head
+ , typename... Tail
+ >
+ struct
+ next
+ < variadic::iterator_fwd
+ < Head
+ , Tail...
+ >
+ >
+ {
+ typedef
+ variadic::iterator_fwd
+ < Tail...
+ >
+ type
+ ;
+ };
+
+}}//exit boost::mpl
+#endif

Added: sandbox/variadic_templates/boost/mpl/package_c.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/package_c.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,31 @@
+#ifndef BOOST_MPL_PACKAGE_C_HPP_INCLUDED
+#define BOOST_MPL_PACKAGE_C_HPP_INCLUDED
+// (C) Copyright Larry Evans 2009.
+//
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
+// This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+//
+#include <boost/mpl/package.hpp>
+#include <boost/mpl/integral_c.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename Integral
+ , Integral... Args
+ >
+ struct
+package_c
+ : package<integral_c<Integral,Args>...>
+{
+ typedef Integral value_type;
+ typedef package_c type;
+};
+
+}}//exit boost::mpl
+#endif
+

Added: sandbox/variadic_templates/boost/mpl/package_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/package_fwd.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,17 @@
+#ifndef BOOST_MPL_PACKAGE_FWD_HPP_INCLUDED
+#define BOOST_MPL_PACKAGE_FWD_HPP_INCLUDED
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename...
+ >
+ struct
+package
+;
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/package_range_c.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/package_range_c.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,130 @@
+#ifndef BOOST_MPL_PACKAGE_RANGE_C_HPP_INCLUDED
+#define BOOST_MPL_PACKAGE_RANGE_C_HPP_INCLUDED
+// (C) Copyright Larry Evans 2009.
+//
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
+// This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+//
+#include <boost/mpl/package_c.hpp>
+#include <boost/mpl/eval_if.hpp>
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename PackageC
+ , typename IntervalC
+ >
+ struct
+ package_range_forward
+ ;
+ template
+ < typename Value
+ , Value... Vals
+ , Value Start
+ , Value Finish
+ >
+ struct
+ package_range_forward
+ < package_c<Value, Vals...>
+ , package_c<Value,Start,Finish>
+ >
+ : package_range_forward
+ < package_c<Value, Finish, Vals...>
+ , package_c<Value, Start, Value(Finish-1)>
+ >
+ {
+ };
+ template
+ < typename Value
+ , Value... Vals
+ , Value Start
+ >
+ struct
+ package_range_forward
+ < package_c<Value, Vals...>
+ , package_c<Value,Start,Start>
+ >
+ {
+ typedef
+ package_c<Value, Start,Vals...>
+ type
+ ;
+ };
+ template
+ < typename PackageC
+ , typename IntervalC
+ >
+ struct
+ package_range_backward
+ ;
+ template
+ < typename Value
+ , Value... Vals
+ , Value Start
+ , Value Finish
+ >
+ struct
+ package_range_backward
+ < package_c<Value, Vals...>
+ , package_c<Value,Start,Finish>
+ >
+ : package_range_backward
+ < package_c<Value, Vals..., Finish>
+ , package_c<Value, Start, Value(Finish-1)>
+ >
+ {
+ };
+ template
+ < typename Value
+ , Value... Vals
+ , Value Start
+ >
+ struct
+ package_range_backward
+ < package_c<Value, Vals...>
+ , package_c<Value,Start,Start>
+ >
+ {
+ typedef
+ package_c<Value, Vals..., Start>
+ type
+ ;
+ };
+ template
+ < typename Value
+ , Value Start
+ , Value Finish
+ >
+ struct
+ package_range_c
+ /**@brief
+ * Produce (depending on compare of Start and Finish) either:
+ * default:
+ * package_c<Value,Start,Start+1,Start+2,...,Finish-1>
+ * else:
+ * package_c<Value,Finish-1,...,Start+2,Start+1,Start>
+ */
+ : eval_if_c
+ < Start == Finish
+ , package_c<Value>
+ , eval_if_c
+ < Start < Finish
+ , package_range_forward
+ < package_c<Value>
+ , package_c<Value,Start,Value(Finish-1)>
+ >
+ , package_range_backward
+ < package_c<Value>
+ , package_c<Value,Finish,Value(Start-1)>
+ >
+ >
+ >
+ {
+ };
+
+}}//exit boost::mpl
+#endif
+

Added: sandbox/variadic_templates/boost/mpl/reverse_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/reverse_fold.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,36 @@
+#ifndef BOOST_MPL_REVERSE_FOLD_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_REVERSE_FOLD_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/foldr_iter_if.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/lambda.hpp>
+
+namespace boost { namespace mpl {
+
+ template
+ < typename Sequence //sequence of Value's
+ , typename State //initial State
+ , typename OpStateVal //Operator: (State,Value) -> State
+ >
+ struct
+reverse_fold
+{
+ typedef
+ typename foldr_iter_if
+ < typename begin<Sequence>::type
+ , typename end<Sequence>::type
+ , State
+ , typename lambda<OpStateVal>::type::template
+ apply
+ < arg<2>
+ , deref<arg<1> >
+ > //Changes OpStateVal to OpIterState: (Iterator,State) -> State
+ //where Iterator is the type of iterator over Value's.
+ >::type
+ type
+ ;
+};
+
+}}//exit boost::mpl namespace
+
+#endif //include guard

Added: sandbox/variadic_templates/boost/mpl/set.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/set.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,69 @@
+//variadic template version of mpl/set.hpp
+#ifndef BOOST_MPL_SET_HPP_INCLUDED
+#define BOOST_MPL_SET_HPP_INCLUDED
+
+// 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.
+
+// $Source: /home/evansl/prog_dev/boost-svn/ro/boost-vrtmp/boost/mpl/RCS/set.hpp,v $
+// $Date: 2009/08/25 20:17:50 $
+// $Revision: 1.9 $
+
+#include <boost/mpl/aux_/value_wknd.hpp>
+#include <boost/mpl/set/set0.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+
+ template
+ < class MemberKey
+ , typename... MembersOther
+ >
+ struct
+set
+ < MemberKey
+ , MembersOther...
+ >
+: s_item
+ < MemberKey
+ , typename set
+ < MembersOther...
+ >::item_
+ >
+//!
+//!@nv-mpl_repl:
+//! This specialization corresponds to all of the setI
+//! for I=1..., which are defined in non-variadic mpl in
+//! one of the files:
+//! boost/mpl/set/aux_/preprocessed/typeof_based/setN.hpp
+//! for some N in 10,20,...
+//!
+//!@nv-mpl_diff:
+//! WHAT:
+//! Instead of adding items to s_item from the tail, items are added from
+//! head.
+//! WHY:
+//! The variadic template compiler doesn't allow parameter
+//! packs to be followed by anything else (designated here as the
+//! [PACKS_at_END_CONSTRAINT]). IOW:
+//! set<typename Head..., typename Tail>
+//! is not allowed because paramerter pack, Head..., is followed
+//! by non-pack Tail.
+//!
+{
+ typedef
+ set
+ type;
+};
+
+}//exit mpl namespace
+}//exit boost namespace
+
+#endif // BOOST_MPL_SET_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/set/aux_/begin_end_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/set/aux_/begin_end_impl.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,50 @@
+
+#ifndef BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED
+
+// 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.
+
+// $Source: /home/evansl/prog_dev/boost-svn/ro/boost-vrtmp/boost/mpl/set/aux_/RCS/begin_end_impl.hpp,v $
+// $Date: 2009/08/27 16:11:32 $
+// $Revision: 1.3 $
+//GhangeLog:
+// 2007-01-28.1246.CST Larry Evans
+// WHAT:
+// copied from corresponding boost-cvs file and renamed set0<> to set<>
+// WHY:
+// In variadic template version of library, there's no set0.
+//
+
+#include <boost/mpl/begin_end_fwd.hpp>
+#include <boost/mpl/set/aux_/iterator.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct begin_impl< aux::set_tag >
+{
+ template< typename Set > struct apply
+ : s_iter_get<Set,typename Set::item_>
+ {
+ };
+};
+
+template<>
+struct end_impl< aux::set_tag >
+{
+ template< typename Set > struct apply
+ {
+ typedef s_iter< Set,set<> > type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/set/aux_/clear_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/set/aux_/clear_impl.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,35 @@
+//variadic version of set clear_impl
+#ifndef BOOST_MPL_SET_AUX_CLEAR_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_CLEAR_IMPL_HPP_INCLUDED
+
+// 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/25 11:56:04 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/clear_fwd.hpp>
+#include <boost/mpl/set/aux_/set0.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct clear_impl< aux::set_tag >
+{
+ template< typename Set > struct apply
+ {
+ typedef set<> type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_CLEAR_IMPL_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/set/aux_/iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/set/aux_/iterator.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,98 @@
+
+#ifndef BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
+
+// 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.
+
+// $Source: /home/evansl/prog_dev/boost-svn/ro/boost-vrtmp/boost/mpl/set/aux_/RCS/iterator.hpp,v $
+// $Date: 2009/08/25 03:13:36 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/set/aux_/set0.hpp>
+#include <boost/mpl/has_key.hpp>
+#include <boost/mpl/iterator_tags.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+
+namespace boost { namespace mpl {
+
+// used by 's_iter_get'
+template< typename Set, typename Tail > struct s_iter;
+
+template< typename Set, typename Tail > struct s_iter_get
+ : eval_if<
+ has_key< Set,typename Tail::item_type_ >
+ , identity< s_iter<Set,Tail> >
+ , next< s_iter<Set,Tail> >
+ >
+{
+};
+
+template< typename Set, typename Tail > struct s_iter_impl
+{
+ typedef Tail tail_;
+ typedef forward_iterator_tag category;
+ typedef typename Tail::item_type_ type;
+
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ typedef typename s_iter_get< Set,typename Tail::base >::type next;
+#endif
+};
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template< typename Set, typename Tail >
+struct next< s_iter<Set,Tail> >
+ : s_iter_get< Set,typename Tail::base >
+{
+};
+
+template< typename Set >
+struct next< s_iter<Set,set<> > >
+{
+ typedef s_iter<Set,set<> > type;
+};
+
+template< typename Set, typename Tail > struct s_iter
+ : s_iter_impl<Set,Tail>
+{
+};
+
+template< typename Set > struct s_iter<Set, set<> >
+{
+ typedef forward_iterator_tag category;
+};
+
+#else
+
+template< typename Set >
+struct s_end_iter
+{
+ typedef forward_iterator_tag category;
+ typedef s_iter<Set,set<> > next;
+};
+
+template< typename Set, typename Tail > struct s_iter
+ : if_<
+ is_same< Tail,set<> >
+ , s_end_iter<Set>
+ , s_iter_impl<Set,Tail>
+ >::type
+{
+};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/set/aux_/set0.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/set/aux_/set0.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,70 @@
+//variadic template version of set0.hpp
+#ifndef BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED
+
+// 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/25 12:20:04 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/set_fwd.hpp>
+
+#include <boost/mpl/long.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+#include <boost/mpl/aux_/yes_no.hpp>
+#include <boost/mpl/aux_/overload_names.hpp>
+#include <boost/mpl/aux_/config/operators.hpp>
+
+#include <boost/preprocessor/cat.hpp>
+
+namespace boost { namespace mpl {
+
+#if defined(BOOST_MPL_CFG_USE_OPERATORS_OVERLOADING)
+
+# define BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T) \
+ friend R BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f)(X const&, T) \
+/**/
+
+# define BOOST_MPL_AUX_SET_OVERLOAD(R, f, X, T) \
+ BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T) \
+/**/
+
+#else
+
+# define BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T) \
+ static R BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f)(X const&, T) \
+/**/
+
+# define BOOST_MPL_AUX_SET_OVERLOAD(R, f, X, T) \
+ BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T); \
+ using Base::BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f) \
+/**/
+
+#endif
+
+template<> struct set<>
+{
+ typedef set<> item_;
+ typedef item_ type;
+ typedef aux::set_tag tag;
+ typedef void_ last_masked_;
+ typedef void_ item_type_;
+ typedef long_<0> size;
+ typedef long_<1> order;
+
+ BOOST_MPL_AUX_SET0_OVERLOAD( aux::no_tag, ORDER_BY_KEY, set<>, void const volatile* );
+ BOOST_MPL_AUX_SET0_OVERLOAD( aux::yes_tag, IS_MASKED, set<>, void const volatile* );
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/set/set0.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/set/set0.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,34 @@
+
+#ifndef BOOST_MPL_SET_SET0_HPP_INCLUDED
+#define BOOST_MPL_SET_SET0_HPP_INCLUDED
+
+// 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: 2008-10-10 04:10:26 -0500 (Fri, 10 Oct 2008) $
+// $Revision: 49239 $
+
+#include <boost/mpl/set/aux_/at_impl.hpp>
+#include <boost/mpl/set/aux_/clear_impl.hpp>
+//#include <boost/mpl/set/aux_/O1_size.hpp>
+#include <boost/mpl/set/aux_/size_impl.hpp>
+#include <boost/mpl/set/aux_/empty_impl.hpp>
+#include <boost/mpl/set/aux_/insert_impl.hpp>
+#include <boost/mpl/set/aux_/erase_impl.hpp>
+#include <boost/mpl/set/aux_/erase_key_impl.hpp>
+#include <boost/mpl/set/aux_/has_key_impl.hpp>
+#include <boost/mpl/set/aux_/key_type_impl.hpp>
+#include <boost/mpl/set/aux_/value_type_impl.hpp>
+#include <boost/mpl/set/aux_/begin_end_impl.hpp>
+#include <boost/mpl/set/aux_/iterator.hpp>
+#include <boost/mpl/set/aux_/item.hpp>
+#include <boost/mpl/set/aux_/set0.hpp>
+
+#endif // BOOST_MPL_SET_SET0_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/set_c.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/set_c.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,25 @@
+#ifndef BOOST_MPL_SET_C_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_SET_C_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/set.hpp>
+#include <boost/mpl/integral_c.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename Integral
+ , Integral... Args
+ >
+ struct
+set_c
+ : set<integral_c<Integral,Args>...>
+{
+ typedef Integral value_type;
+ typedef set_c type;
+};
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif
+

Added: sandbox/variadic_templates/boost/mpl/set_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/set_fwd.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,17 @@
+#ifndef BOOST_MPL_SET_FWD_HPP_INCLUDED
+#define BOOST_MPL_SET_FWD_HPP_INCLUDED
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename...
+ >
+ struct
+set
+;
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/unpack_args.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/unpack_args.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,65 @@
+//variadic template version of unpack_args.hpp
+#ifndef BOOST_MPL_UNPACK_ARGS_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_UNPACK_ARGS_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/aux_/lambda_spec.hpp>
+#include <boost/mpl/package_range_c.hpp>
+
+namespace boost { namespace mpl {
+namespace aux {
+
+ template
+ < typename Indices
+ , typename F
+ , typename Args
+ >
+struct unpack_args_impl;
+;
+ template
+ < long... Indices
+ , typename F
+ , typename Args
+ >
+struct unpack_args_impl
+ < package_c<long,Indices...>
+ , F
+ , Args
+ >
+: apply
+ < F
+ , typename at_c<Args,Indices>::type...
+ >
+{
+};
+
+}
+
+ template
+ < typename F
+ >
+struct unpack_args
+{
+ template
+ < typename Args
+ >
+ struct apply
+ : aux::unpack_args_impl
+ < typename package_range_c
+ < long
+ , long(0)
+ , long(size<Args>::value)
+ >::type
+ , F
+ , Args
+ >
+ {
+ };
+};
+
+BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, unpack_args)
+
+}}
+
+#endif

Added: sandbox/variadic_templates/boost/mpl/vector.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/vector.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,55 @@
+//variadic template version of vector.hpp
+#ifndef BOOST_MPL_VECTOR_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_VECTOR_HPP_VARIADIC_TEMPLATES
+//!
+//!@nv-mpl_diff:
+//! The following include
+//! indirectly #includes vector_fwd.hpp.
+//!
+#include <boost/mpl/vector/vector0.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+
+ template
+ < typename Head
+ , typename... Tail
+ >
+ struct
+vector
+ < Head
+ , Tail...
+ >
+ : v_item
+ < Head
+ , vector<Tail...>
+ >
+//!
+//!@nv-mpl_repl:
+//! This specialization corresponds to all of the vectorI
+//! for I=1..., which are defined in non-variadic mpl in
+//! one of the files:
+//! boost/mpl/vector/aux_/preprocessed/typeof_based/vectorN.hpp
+//! for some N in 10,20,...
+//!
+//!@nv-mpl_diff:
+//! WHAT:
+//! Instead of adding items from the tail, items are added from
+//! head.
+//! WHY:
+//! The variadic template compiler doesn't allow parameter
+//! packs to be followed by anything else (designated here as the
+//! [PACKS_at_END_CONSTRAINT]). IOW:
+//! vector<typename Head..., typename Tail>
+//! is not allowed because paramerter pack, Head..., is followed
+//! by non-pack Tail.
+//!
+{
+ typedef vector type;
+};
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif

Added: sandbox/variadic_templates/boost/mpl/vector/aux_/clear.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/vector/aux_/clear.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,55 @@
+
+#ifndef BOOST_MPL_VECTOR_AUX_CLEAR_HPP_INCLUDED
+#define BOOST_MPL_VECTOR_AUX_CLEAR_HPP_INCLUDED
+
+// 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/26 21:47:13 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/clear_fwd.hpp>
+#include <boost/mpl/vector/aux_/vector0.hpp>
+#include <boost/mpl/vector/aux_/tag.hpp>
+#include <boost/mpl/aux_/config/typeof.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+
+namespace boost { namespace mpl {
+
+#if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
+
+template<>
+struct clear_impl< aux::vector_tag >
+{
+ template< typename Vector > struct apply
+ {
+ typedef vector<> type;
+ };
+};
+
+#else
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template< long N >
+struct clear_impl< aux::vector_tag<N> >
+{
+ template< typename Vector > struct apply
+ {
+ typedef vector<> type;
+ };
+};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
+
+}}
+
+#endif // BOOST_MPL_VECTOR_AUX_CLEAR_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/vector/aux_/item.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/vector/aux_/item.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,123 @@
+
+#ifndef BOOST_MPL_VECTOR_AUX_ITEM_HPP_INCLUDED
+#define BOOST_MPL_VECTOR_AUX_ITEM_HPP_INCLUDED
+
+// 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/27 20:36:14 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/long.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/next_prior.hpp>
+#include <boost/mpl/aux_/type_wrapper.hpp>
+#include <boost/mpl/aux_/config/typeof.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+
+namespace boost { namespace mpl {
+
+template
+ < typename T
+ , typename Base //vector<Tail...> for some Tail...
+ , int at_front=1
+ >
+struct v_item
+//!@nv-mpl_diff:
+//! WHAT:
+//! Default for at_front=1 instead of 0.
+//! WHY:
+//! The non-variadic vectorN<T1,...,TN>,
+//! enters T values into v_iterm from TN to T1,
+//! i.e. from back to front.
+//!
+//! The variadic compiler disallows parameter packs
+//! at the beginning; hence, the last element, e.g.
+//! TN, can't be selected in a specialization such
+//! as vector<T...,TN>:v_item<TN,vector<T...> >.
+//!
+//! The workaround is to make this change.
+//! CONSEQUENCES:
+//! 1) push_front cannot be called as many
+//! times.
+//! 2) push_back can be called more times.
+;
+template
+ < typename T
+ , typename Base
+ >
+struct v_item<T,Base,0> //!extend Base at back with T.
+ : Base
+{
+ typedef typename Base::upper_bound_ index_;
+ typedef typename next<index_>::type upper_bound_;
+ typedef typename next<typename Base::size>::type size;
+ typedef Base base;
+ typedef v_item type;
+
+ // agurt 10/sep/04: MWCW <= 9.3 workaround here and below; the compiler
+ // breaks if using declaration comes _before_ the new overload
+ static aux::type_wrapper<T> item_(index_);
+ using Base::item_;
+};
+
+template
+ < typename T
+ , typename Base
+ >
+struct v_item<T,Base,1> //extend Base at front with T.
+ : Base
+{
+ typedef typename prior<typename Base::lower_bound_>::type index_;
+ typedef index_ lower_bound_;
+ typedef typename next<typename Base::size>::type size;
+ typedef Base base;
+ typedef v_item type;
+
+ static aux::type_wrapper<T> item_(index_);
+ using Base::item_;
+};
+
+// "erasure" item
+template<
+ typename Base
+ , int at_front
+ >
+struct v_mask
+ : Base
+{
+ typedef typename prior<typename Base::upper_bound_>::type index_;
+ typedef index_ upper_bound_;
+ typedef typename prior<typename Base::size>::type size;
+ typedef Base base;
+ typedef v_mask type;
+
+ static aux::type_wrapper<void_> item_(index_);
+ using Base::item_;
+};
+
+template<
+ typename Base
+ >
+struct v_mask<Base,1>
+ : Base
+{
+ typedef typename Base::lower_bound_ index_;
+ typedef typename next<index_>::type lower_bound_;
+ typedef typename prior<typename Base::size>::type size;
+ typedef Base base;
+ typedef v_mask type;
+
+ static aux::type_wrapper<void_> item_(index_);
+ using Base::item_;
+};
+
+}}
+
+#endif // BOOST_MPL_VECTOR_AUX_ITEM_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/vector/aux_/vector0.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/vector/aux_/vector0.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,110 @@
+
+#ifndef BOOST_MPL_VECTOR_AUX_VECTOR0_HPP_INCLUDED
+#define BOOST_MPL_VECTOR_AUX_VECTOR0_HPP_INCLUDED
+
+// 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/09 19:46:56 $
+// $Revision: 1.6 $
+
+#include <boost/mpl/long.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/aux_/type_wrapper.hpp>
+
+#include <boost/mpl/vector/aux_/tag.hpp>
+#include <boost/mpl/aux_/config/typeof.hpp>
+
+//!
+//!@nv-mpl_diff:
+//! WHAT:
+//! 1) Add following #include.
+//! 2) Rm'd
+//! a) #else part of
+//! #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
+//! b) #include interator.hpp
+//! WHY:
+//! 1) To allow the following vector<> specialization.
+//! 2) a) Not needed since with gcc compiler,
+//! defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
+//! b) Only needed by #else part.
+//!
+#include <boost/mpl/vector_fwd.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+
+ template
+ <
+ >
+ struct
+vector
+ <
+ >
+//!
+//!@nv-mpl_repl:
+//! This specialization replaces the vector0 template
+//! defined in non-variadic mpl file:
+//! boost/mpl/vector/aux_/vector0.hpp
+//!
+{
+ typedef aux::vector_tag tag;
+ typedef vector type;
+ static long const push_back0_index=
+ 0
+ //|
+ //!@nv-mpl_diff
+ //! The non-variadic mpl did not have this.
+ //! Instead, it just put this constant
+ //! in the following lower_bound_ typedef.
+ //!
+ //! The reason for putting it here is to
+ //! document the purpose of this number.
+ //!
+ //!@change_log:2009-03-29.Larry Evans
+ //! Also, the value is different.
+ //! In the non-variadic mpl, this value
+ //! was 32768. Since I see no reason
+ //! for this value, I just chose a less
+ //! "mysterious" value together with
+ //! a little more documentation in the
+ //! @brief below.
+ //!
+
+ /**@brief
+ * This is push_back<vector<>,T1>::type::index_::value
+ * for any typename, T1.
+ * See boost/mpl/vector/aux_/item.hpp
+ * (at specialization for at_front==1)
+ * and boost/mpl/vector/aux_/push_front.hpp.
+ *
+ * There's really not much special about the
+ * value chosen. It would be most any value.
+ * However, if push_front is called enough times,
+ * the resulting type, B, could have an underflow
+ * in B::index_ due to lower bound on long values.
+ * Likewise, if push_back is called enough times,
+ * the resulting type, F, could have an overflow
+ * in F::index_ due to upper bound on long values.
+ */
+ ;
+ typedef long_<push_back0_index> lower_bound_;
+ typedef lower_bound_ upper_bound_;
+ typedef long_<0> size;
+
+ static aux::type_wrapper<void_> item_(...);
+};
+
+}//exit mpl namespace
+}//exit boost namespace
+
+
+#endif // BOOST_MPL_VECTOR_AUX_VECTOR0_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/vector/vector0.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/vector/vector0.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,31 @@
+
+#ifndef BOOST_MPL_VECTOR_VECTOR0_HPP_INCLUDED
+#define BOOST_MPL_VECTOR_VECTOR0_HPP_INCLUDED
+
+// 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/18 17:47:39 $
+// $Revision: 1.7 $
+#include <boost/mpl/vector/aux_/front.hpp>
+#include <boost/mpl/vector/aux_/push_front.hpp>
+#include <boost/mpl/vector/aux_/pop_front.hpp>
+#include <boost/mpl/vector/aux_/push_back.hpp>
+#include <boost/mpl/vector/aux_/pop_back.hpp>
+#include <boost/mpl/vector/aux_/back.hpp>
+#include <boost/mpl/vector/aux_/clear.hpp>
+#include <boost/mpl/vector/aux_/begin_end.hpp>
+#include <boost/mpl/vector/aux_/O1_size.hpp>
+#include <boost/mpl/vector/aux_/size.hpp>
+#include <boost/mpl/vector/aux_/iterator.hpp>
+#include <boost/mpl/vector/aux_/empty.hpp>
+#include <boost/mpl/vector/aux_/item.hpp>
+#include <boost/mpl/vector/aux_/vector0.hpp>
+
+#endif // BOOST_MPL_VECTOR_VECTOR0_HPP_INCLUDED

Added: sandbox/variadic_templates/boost/mpl/vector_c.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/vector_c.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,25 @@
+#ifndef BOOST_MPL_VECTOR_C_HPP_VARIADIC_TEMPLATES
+#define BOOST_MPL_VECTOR_C_HPP_VARIADIC_TEMPLATES
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/integral_c.hpp>
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename Integral
+ , Integral... Args
+ >
+ struct
+vector_c
+ : vector<integral_c<Integral,Args>...>
+{
+ typedef Integral value_type;
+ typedef vector_c type;
+};
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif
+

Added: sandbox/variadic_templates/boost/mpl/vector_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/vector_fwd.hpp 2009-08-30 15:29:46 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,17 @@
+#ifndef BOOST_MPL_VECTOR_FWD_HPP_INCLUDED
+#define BOOST_MPL_VECTOR_FWD_HPP_INCLUDED
+
+namespace boost
+{
+namespace mpl
+{
+ template
+ < typename...
+ >
+ struct
+vector
+;
+
+}//exit mpl namespace
+}//exit boost namespace
+#endif


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