Update of /cvsroot/boost/boost/boost/xpressive/proto/transform
In directory 
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9388/boost/xpressive/proto/transform

Modified Files:
        construct.hpp fold_to_list.hpp 
Added Files:
        fold_tree.hpp 
Log Message:
fold_tree gets its own header, deprecate fold_to_list

--- NEW FILE: fold_tree.hpp ---
///////////////////////////////////////////////////////////////////////////////
/// \file fold_tree.hpp
/// A higher-level transform that uses the fold, and branch transforms
/// to recursively fold a tree.
//
//  Copyright 2004 Eric Niebler. 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)

#ifndef BOOST_PROTO_TRANSFORM_FOLD_TREE_HPP_EAN_06_18_2007
#define BOOST_PROTO_TRANSFORM_FOLD_TREE_HPP_EAN_06_18_2007

#include <boost/xpressive/proto/detail/prefix.hpp>
#include <boost/xpressive/proto/transform/fold.hpp>
#include <boost/xpressive/proto/transform/branch.hpp>
#include <boost/xpressive/proto/detail/suffix.hpp>

namespace boost { namespace proto { namespace transform
{

    namespace detail
    {
        template<typename Tag, typename Grammar>
        struct fold_tree_
          : or_<
                transform::fold<
                    nary_expr<Tag, vararg<fold_tree_<Tag, Grammar> > >
                >
              , Grammar
            >
        {};

        template<typename Tag, typename Grammar>
        struct reverse_fold_tree_
          : or_<
                transform::reverse_fold<
                    nary_expr<Tag, vararg<reverse_fold_tree_<Tag, Grammar> > >
                >
              , Grammar
            >
        {};
    }

    /// fold_tree
    ///
    template<typename Tag, typename Grammar, typename State = void>
    struct fold_tree
      : transform::branch<
            transform::fold<
                nary_expr<Tag, vararg<detail::fold_tree_<Tag, Grammar> > >
            >
          , State
        >
    {};

    template<typename Tag, typename Grammar>
    struct fold_tree<Tag, Grammar, void>
      : transform::fold<
            nary_expr<Tag, vararg<detail::fold_tree_<Tag, Grammar> > >
        >
    {};

    /// reverse_fold_tree
    ///
    template<typename Tag, typename Grammar, typename State = void>
    struct reverse_fold_tree
      : transform::branch<
            transform::reverse_fold<
                nary_expr<Tag, vararg<detail::reverse_fold_tree_<Tag, Grammar> 
> >
            >
          , State
        >
    {};

    template<typename Tag, typename Grammar>
    struct reverse_fold_tree<Tag, Grammar, void>
      : transform::reverse_fold<
            nary_expr<Tag, vararg<detail::reverse_fold_tree_<Tag, Grammar> > >
        >
    {};

}}}

#endif

Index: construct.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/transform/construct.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- construct.hpp       16 Jun 2007 09:21:17 -0000      1.7
+++ construct.hpp       19 Jun 2007 01:07:11 -0000      1.8
@@ -13,6 +13,7 @@
     #include <boost/xpressive/proto/detail/prefix.hpp>
     #include <boost/preprocessor/iterate.hpp>
     #include <boost/preprocessor/facilities/intercept.hpp>
+    #include <boost/preprocessor/repetition/enum.hpp>
     #include <boost/preprocessor/repetition/enum_params.hpp>
     #include <boost/preprocessor/repetition/enum_binary_params.hpp>
     #include <boost/preprocessor/repetition/enum_trailing_params.hpp>

Index: fold_to_list.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/xpressive/proto/transform/fold_to_list.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- fold_to_list.hpp    16 Jun 2007 05:46:16 -0000      1.10
+++ fold_to_list.hpp    19 Jun 2007 01:07:11 -0000      1.11
@@ -13,75 +13,13 @@
 #include <boost/xpressive/proto/detail/prefix.hpp>
 #include <boost/mpl/assert.hpp>
 #include <boost/type_traits/is_same.hpp>
-#include <boost/xpressive/proto/transform/fold.hpp>
+#include <boost/xpressive/proto/transform/fold_tree.hpp>
 #include <boost/xpressive/proto/transform/list.hpp>
-#include <boost/xpressive/proto/transform/branch.hpp>
 #include <boost/xpressive/proto/detail/suffix.hpp>
 
 namespace boost { namespace proto { namespace transform
 {
 
-    namespace detail
-    {
-        template<typename Tag, typename Grammar>
-        struct fold_tree_
-          : or_<
-                transform::fold<
-                    nary_expr<Tag, vararg<fold_tree_<Tag, Grammar> > >
-                >
-              , Grammar
-            >
-        {};
-
-        template<typename Tag, typename Grammar>
-        struct reverse_fold_tree_
-          : or_<
-                transform::reverse_fold<
-                    nary_expr<Tag, vararg<reverse_fold_tree_<Tag, Grammar> > >
-                >
-              , Grammar
-            >
-        {};
-    }
-
-    /// fold_tree
-    ///
-    template<typename Tag, typename Grammar, typename State = void>
-    struct fold_tree
-      : transform::branch<
-            transform::fold<
-                nary_expr<Tag, vararg<detail::fold_tree_<Tag, Grammar> > >
-            >
-          , State
-        >
-    {};
-
-    template<typename Tag, typename Grammar>
-    struct fold_tree<Tag, Grammar, void>
-      : transform::fold<
-            nary_expr<Tag, vararg<detail::fold_tree_<Tag, Grammar> > >
-        >
-    {};
-
-    /// reverse_fold_tree
-    ///
-    template<typename Tag, typename Grammar, typename State = void>
-    struct reverse_fold_tree
-      : transform::branch<
-            transform::reverse_fold<
-                nary_expr<Tag, vararg<detail::reverse_fold_tree_<Tag, Grammar> 
> >
-            >
-          , State
-        >
-    {};
-
-    template<typename Tag, typename Grammar>
-    struct reverse_fold_tree<Tag, Grammar, void>
-      : transform::reverse_fold<
-            nary_expr<Tag, vararg<detail::reverse_fold_tree_<Tag, Grammar> > >
-        >
-    {};
-
     /// fold_to_list
     /// TODO Find a cleaner interface
     template<typename Grammar>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to