Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64572 - sandbox/variadic_templates/boost/mpl
From: cppljevans_at_[hidden]
Date: 2010-08-03 11:18:45


Author: cppljevans
Date: 2010-08-03 11:18:44 EDT (Tue, 03 Aug 2010)
New Revision: 64572
URL: http://svn.boost.org/trac/boost/changeset/64572

Log:
replaced (I think) by other fold* files
Added:
   sandbox/variadic_templates/boost/mpl/apply_pack.hpp (contents, props changed)
Removed:
   sandbox/variadic_templates/boost/mpl/foldl_iter.hpp
   sandbox/variadic_templates/boost/mpl/foldr_iter.hpp
   sandbox/variadic_templates/boost/mpl/foldr_pack.hpp

Added: sandbox/variadic_templates/boost/mpl/apply_pack.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/mpl/apply_pack.hpp 2010-08-03 11:18:44 EDT (Tue, 03 Aug 2010)
@@ -0,0 +1,30 @@
+#ifndef BOOST_MPL_APPLY_PACK_HPP_INCLUDED
+#define BOOST_MPL_APPLY_PACK_HPP_INCLUDED
+#include <boost/mpl/package.hpp>
+#include <boost/mpl/arg.hpp>
+namespace boost
+{
+ namespace mpl
+ {
+ template
+ < typename Pack
+ , template<typename... Args>class Op
+ >
+ struct apply_pack
+ ;
+ template
+ < typename... T
+ , template<typename... Arg>class Op
+ >
+ struct apply_pack
+ < package<T...>
+ , Op
+ >
+ : Op<T...>
+ {
+ };
+
+ }//exit mpl namespace
+}//exit boost namespace
+
+#endif

Deleted: sandbox/variadic_templates/boost/mpl/foldl_iter.hpp
==============================================================================
--- sandbox/variadic_templates/boost/mpl/foldl_iter.hpp 2010-08-03 11:18:44 EDT (Tue, 03 Aug 2010)
+++ (empty file)
@@ -1,72 +0,0 @@
-#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

Deleted: sandbox/variadic_templates/boost/mpl/foldr_iter.hpp
==============================================================================
--- sandbox/variadic_templates/boost/mpl/foldr_iter.hpp 2010-08-03 11:18:44 EDT (Tue, 03 Aug 2010)
+++ (empty file)
@@ -1,68 +0,0 @@
-#ifndef BOOST_MPL_FOLDR_ITER_HPP_VARIADIC_TEMPLATES
-#define BOOST_MPL_FOLDR_ITER_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 OpIterState //Operator: (ValueIterator,State) -> State
- >
- struct
-foldr_iter
-/**@brief
- * Same as foldl_iter except association is to the right,
- * and Operator arguments are swapped.
- * IOW, the analogue result (see comments to foldl_iter.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
- */
-: apply
- < OpIterState
- , IterNow
- , typename foldr_iter
- < typename next<IterNow>::type
- , IterEnd
- , State0
- , OpIterState
- >::type
- >
-{
-};
-
- template
- < typename IterEnd
- , typename State0
- , typename OpIterState
- >
- struct
-foldr_iter
- < IterEnd
- , IterEnd
- , State0
- , OpIterState
- >
-{
- typedef
- State0
- type
- ;
-};
-
-}}//exit boost::mpl namespace
-
-#endif //include guard

Deleted: sandbox/variadic_templates/boost/mpl/foldr_pack.hpp
==============================================================================
--- sandbox/variadic_templates/boost/mpl/foldr_pack.hpp 2010-08-03 11:18:44 EDT (Tue, 03 Aug 2010)
+++ (empty file)
@@ -1,81 +0,0 @@
-#ifndef BOOST_MPL_FOLDR_PACK_HPP_VARIADIC_TEMPLATES
-#define BOOST_MPL_FOLDR_PACK_HPP_VARIADIC_TEMPLATES
-
-namespace boost { namespace mpl {
-
- template
- < typename State0 //initial State
- , template<typename Value,typename State>class OpValueState_State //Operator: (Value,State) -> State
- , typename... Values
- >
- struct
-foldr_pack
-/**@brief
- * Apply OpValueState_State to each element in Values...
- * starting with intial State, State0. Associate the applications
- * to the right.
- *
- * For example, the analogous operation on run-time-value's is:
- *
- * Assuming:
- * z == the run-time-value analogue of State0.
- * xI == the analogue of I-th element in Values...
- * F == the analogue of OpValueState_State.
- * Then the analogue of result would be:
- * 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 typename
- * b State
- * z initial State
- */
-;
- template
- < typename State0 //initial State
- , template<typename Value,typename State>class OpValueState_State
- , typename Head
- , typename... Tail
- >
- struct
-foldr_pack
- < State0
- , OpValueState_State
- , Head
- , Tail...
- >
-: OpValueState_State
- < Head
- , typename foldr_pack
- < State0
- , OpValueState_State
- , Tail...
- >::type
- >
-{
-};
- template
- < typename State0
- , template<typename Value,typename State>class OpValueState_State
- >
- struct
-foldr_pack
- < State0
- , OpValueState_State
- >
-{
- typedef
- State0
- type
- ;
-};
-
-}}//exit boost::mpl namespace
-
-#endif //include guard


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