Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60021 - sandbox/statistics/detail/assign/boost/assign/auto_size/detail
From: erwann.rogard_at_[hidden]
Date: 2010-03-01 09:20:34


Author: e_r
Date: 2010-03-01 09:20:33 EST (Mon, 01 Mar 2010)
New Revision: 60021
URL: http://svn.boost.org/trac/boost/changeset/60021

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/detail/auto_size.hpp | 41 +++++++++++++++++++++++----------------
   sandbox/statistics/detail/assign/boost/assign/auto_size/detail/csv.hpp | 4 +-
   sandbox/statistics/detail/assign/boost/assign/auto_size/detail/has_copy_semantics.hpp | 17 ++++++++++++---
   3 files changed, 39 insertions(+), 23 deletions(-)

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/auto_size.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/auto_size.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/detail/auto_size.hpp 2010-03-01 09:20:33 EST (Mon, 01 Mar 2010)
@@ -13,17 +13,16 @@
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/equal_to.hpp>
+#include <boost/mpl/empty_base.hpp>
 #include <boost/type_traits.hpp>
-#include <boost/assign/list_of.hpp> // needed for assign_referene
+#include <boost/assign/list_of.hpp> // needed for assign_reference
 #include <boost/assign/auto_size/detail/assign_refence_copy.hpp>
 #include <boost/assign/auto_size/array/policy.hpp>
 
 // Creates a collection of references by deducing the number of arguments
-// a compile time.
-//
-// Requirements
-// Ref specifies a reference_wrapper
-// P is an abitrary policy, usually intended as providing a container interface
+// at compile time. The functionality is controlled by parameter Ref which
+// specifies a reference_wrapper and P, an abitrary policy, usually intended
+// to expose a container interface.
 //
 // Note:
 // In most situations, a reference wrapper that has copy rather than rebind
@@ -51,21 +50,15 @@
             
     typedef boost::mpl::void_ top_;
             
+ // ---- Policy meta classes --- //
+
     template<typename L,typename T,int N,template<typename> class Ref,
             typename P>
     struct expr;
-
- template<typename E,typename T,int N,template<typename> class Ref,
- typename P>
- struct next{
- typedef expr<E,T,N,Ref,P> expr_;
- typedef expr<expr_,T,N+1,Ref,P> type;
- };
 
         struct default_policy;
 
         struct default_policy{
-
         template<typename E,typename T,int N,template<typename> class Ref>
         struct apply{
                         typedef expr<E,T,N,Ref,default_policy> expr_;
@@ -73,16 +66,30 @@
             };
     };
 
- struct no_policy{};
+ struct no_policy{
+ template<typename E,typename T,int N,template<typename> class Ref>
+ struct apply{
+ typedef boost::mpl::empty_base type;
+ };
+ };
+
+ // ---- Collection builder ---- //
+
+ template<typename E,typename T,int N,template<typename> class Ref,
+ typename P>
+ struct next{
+ typedef expr<E,T,N,Ref,P> expr_;
+ typedef expr<expr_,T,N+1,Ref,P> type;
+ };
 
     template<
             typename E,typename T,int N,template<typename> class Ref,typename P
>
- class expr : public default_policy::apply<E,T,N,Ref>::type{
+ class expr : public P::template apply<E,T,N,Ref>::type{
         typedef boost::mpl::int_<1> int_1_;
         typedef boost::mpl::int_<N> int_n_;
         typedef typename Ref<T>::type ref_;
- typedef typename default_policy::apply<E,T,N,Ref>::type super_;
+ typedef typename P::template apply<E,T,N,Ref>::type super_;
 
         public:
 

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/csv.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/csv.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/detail/csv.hpp 2010-03-01 09:20:33 EST (Mon, 01 Mar 2010)
@@ -16,11 +16,11 @@
 #include <boost/assign/auto_size/detail/auto_size.hpp>
 #include <boost/assign/auto_size/array/wrapper.hpp>
 
-// Whereas successive unary function calls is the usual way to create a collec-
+// Whereas adjacent unary function calls is the usual way to create a collec-
 // tion in Boost.Assign, this macro provides, as an alternative, functions that
 // are overloaded on the number of arguments.
 //
-// Let n = BOOST_ASSIGN_CSV_SIZE and a1,...,an objects of type T, Ref an alias
+// Let n = BOOST_ASSIGN_CSV_SIZE and a1,...,an, objects of type T, Ref an alias
 // for BOOST_ASSIGN_CSV_ref, and w<U,N> and alias for
 // array_wrapper<U,N,BOOST_ASSIGN_CSV_ref>.
 //

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/has_copy_semantics.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/has_copy_semantics.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/detail/has_copy_semantics.hpp 2010-03-01 09:20:33 EST (Mon, 01 Mar 2010)
@@ -9,18 +9,27 @@
 #ifndef BOOST_ASSIGN_DETAIL_HAS_COPY_SEMANTICS_ER_2010_HPP
 #define BOOST_ASSIGN_DETAIL_HAS_COPY_SEMANTICS_ER_2010_HPP
 #include <boost/mpl/bool.hpp>
-#include <boost/assign/auto_size/detail/assign_refence_copy.hpp>
 
 namespace boost{
+namespace assign_detail{
+ template< class T > struct assign_reference;
+}
 namespace assign{
 namespace detail{
 
+ template<typename T> struct has_copy_semantics{};
+
+ template< class T > struct assign_reference_copy;
+
     template<typename T>
- struct has_copy_semantics : boost::mpl::bool_<false>{};
+ struct has_copy_semantics<
+ assign_detail::assign_reference<T>
+ > : boost::mpl::bool_<false>{};
 
     template<typename T>
- struct has_copy_semantics<assign_reference_copy<T> >
- : boost::mpl::bool_<true>{};
+ struct has_copy_semantics<
+ assign_reference_copy<T>
+ > : boost::mpl::bool_<true>{};
     
 }// detail
 }// assign


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