Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70738 - in sandbox/assign_v2: boost/assign/v2/option/modifier libs/assign/v2/test/detail
From: erwann.rogard_at_[hidden]
Date: 2011-03-29 22:54:36


Author: e_r
Date: 2011-03-29 22:54:35 EDT (Tue, 29 Mar 2011)
New Revision: 70738
URL: http://svn.boost.org/trac/boost/changeset/70738

Log:
upd assign_v2
Text files modified:
   sandbox/assign_v2/boost/assign/v2/option/modifier/insert.hpp | 37 +++++++++++++++++----------------
   sandbox/assign_v2/boost/assign/v2/option/modifier/iterate.hpp | 31 +++++++++++++--------------
   sandbox/assign_v2/boost/assign/v2/option/modifier/mapped.hpp | 21 ++++++++++---------
   sandbox/assign_v2/boost/assign/v2/option/modifier/repeat.hpp | 22 +++++++++----------
   sandbox/assign_v2/boost/assign/v2/option/modifier/std.hpp | 44 +++++++++++++++------------------------
   sandbox/assign_v2/libs/assign/v2/test/detail/traits.cpp | 6 ++--
   6 files changed, 75 insertions(+), 86 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/option/modifier/insert.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/option/modifier/insert.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/option/modifier/insert.hpp 2011-03-29 22:54:35 EDT (Tue, 29 Mar 2011)
@@ -46,45 +46,46 @@
         interpreter_modifier( ignore_, ignore_ ){}
 
 #if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#define BOOST_ASSIGN_V2_arg T&& t
+#define BOOST_ASSIGN_V2_forward std::forward<T>( t )
+#else
+#define BOOST_ASSIGN_V2_arg T& t
+#define BOOST_ASSIGN_V2_forward t
+#endif
 
         template<typename C, typename T>
- void impl(C& cont, T&& t, data_tag::value )const
+ void impl(C& cont, BOOST_ASSIGN_V2_arg, data_tag::value )const
         {
- cont.insert( std::forward<T>( t ) );
- }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
-
-#else
- template<typename C, typename T>
- void impl(C& cont, T& t, data_tag::value )const
- {
- cont.insert( t );
+ cont.insert( BOOST_ASSIGN_V2_forward );
         }
-
-#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
         
         template<typename C, typename T>
         void impl(C& cont, T& t, data_tag::value_map )const
         {
- cont.insert( t );
+ cont.insert( BOOST_ASSIGN_V2_forward );
         }
 
         template<typename C, typename T>
- void impl(C& cont, T& t, data_tag::ptr )const
+ void impl(C& cont, BOOST_ASSIGN_V2_arg, data_tag::ptr )const
         {
             typedef typename container_aux::value<C>::type value_;
- cont.insert( new value_( t ) );
+ cont.insert( new value_( BOOST_ASSIGN_V2_forward ) );
         }
 
         template<typename C, typename T>
- void impl( C& cont, T& t, data_tag::ptr_map )const
+ void impl( C& cont, BOOST_ASSIGN_V2_arg, data_tag::ptr_map )const
         {
             typedef typename container_aux::key<C>::type key_;
- key_ k = t.first; // non-const necessary. See ptr_map.
+ // non-const key necessary. See ptr_map.
+ key_ k = BOOST_ASSIGN_V2_forward.first;
             typedef typename container_aux::mapped<C>::type m_;
- cont.insert( k , new m_( t.second ) );
+ cont.insert( k , new m_( BOOST_ASSIGN_V2_forward.second ) );
         }
 
- }/*->*/;
+ };
+
+#undef BOOST_ASSIGN_V2_arg
+#undef BOOST_ASSIGN_V2_forward
 
 }// interpreter_aux
 BOOST_ASSIGN_V2_OPTION_MODIFIER_KEYWORD(insert)

Modified: sandbox/assign_v2/boost/assign/v2/option/modifier/iterate.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/option/modifier/iterate.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/option/modifier/iterate.hpp 2011-03-29 22:54:35 EDT (Tue, 29 Mar 2011)
@@ -51,6 +51,14 @@
 
 }// modifier_tag
 namespace interpreter_aux{
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#define BOOST_ASSIGN_V2_arg T&& t
+#define BOOST_ASSIGN_V2_forward std::forward<T>( t )
+#else
+#define BOOST_ASSIGN_V2_arg T& t
+#define BOOST_ASSIGN_V2_forward t
+#endif
                 
     template<typename Arg>
     class interpreter_modifier< modifier_tag::iterate<Arg> >/*<-*/
@@ -70,29 +78,17 @@
         ) : ptr( new arg_( arg ) )
         {}
 
-#if BOOST_ASSIGN_V2_ENABLE_CPP0X
-
- template<typename C, typename T>
- void impl(C& cont, T&& t, data_tag::value )const
- {
- cont.at( (*this->ptr)() ) = std::forward<T>( t );
- }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
-
-#else
-
         template<typename C, typename T>
- void impl(C& cont, T& t, data_tag::value )const
+ void impl(C& cont, BOOST_ASSIGN_V2_arg, data_tag::value )const
         {
- cont.at( (*this->ptr)() ) = t;
+ cont.at( (*this->ptr)() ) = BOOST_ASSIGN_V2_forward;
         }
 
-#endif
-
         template<typename C, typename T>
- void impl(C& cont, T& t, data_tag::ptr )const
+ void impl(C& cont, BOOST_ASSIGN_V2_arg, data_tag::ptr )const
         {
             typedef typename container_aux::value<C>::type value_;
- cont.replace( (*this->ptr)(), new value_( t ) );
+ cont.replace( (*this->ptr)(), new value_( BOOST_ASSIGN_V2_forward ) );
         }
                             
         protected:
@@ -100,6 +96,9 @@
 
     }/*->*/;
 
+#undef BOOST_ASSIGN_V2_arg
+#undef BOOST_ASSIGN_V2_forward
+
 }// interpreter_aux
 BOOST_ASSIGN_V2_OPTION_MODIFIER_KEYWORD(iterate)
 BOOST_ASSIGN_V2_OPTION_MODIFIER_META_MODIFIER_TAG(iterate, modifier_tag::iterate<Arg>)

Modified: sandbox/assign_v2/boost/assign/v2/option/modifier/mapped.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/option/modifier/mapped.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/option/modifier/mapped.hpp 2011-03-29 22:54:35 EDT (Tue, 29 Mar 2011)
@@ -24,7 +24,7 @@
 namespace modifier_tag{
 
     template<
- typename Arg // Mapping applied to mapped
+ typename Arg
>
     struct mapped;
 
@@ -50,20 +50,21 @@
         {}
 
 #if BOOST_ASSIGN_V2_ENABLE_CPP0X
- template<typename C, typename T>
- void impl(C& cont, T&& key, data_tag::storage )const
- {
- cont[ key ] = (*this->ptr)( cont[ std::forward<T>( key ) ] );
- }
-
+#define BOOST_ASSIGN_V2_arg T&& t
+#define BOOST_ASSIGN_V2_forward std::forward<T>( t )
 #else
+#define BOOST_ASSIGN_V2_arg T& t
+#define BOOST_ASSIGN_V2_forward t
+#endif
 
         template<typename C, typename T>
- void impl(C& cont, T& key, data_tag::storage )const{
- cont[ key ] = (*this->ptr)( cont[ key ] );
+ void impl(C& cont, BOOST_ASSIGN_V2_arg, data_tag::storage )const
+ {
+ cont[ t/*key*/ ] = (*this->ptr)( cont[ BOOST_ASSIGN_V2_forward ] );
         }
 
-#endif
+#undef BOOST_ASSIGN_V2_arg
+#undef BOOST_ASSIGN_V2_forward
 
         private:
         ptr_ ptr;

Modified: sandbox/assign_v2/boost/assign/v2/option/modifier/repeat.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/option/modifier/repeat.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/option/modifier/repeat.hpp 2011-03-29 22:54:35 EDT (Tue, 29 Mar 2011)
@@ -47,23 +47,21 @@
         {}
 
 #if BOOST_ASSIGN_V2_ENABLE_CPP0X
- template<typename C, typename T, typename DataTag>
- void impl(C& cont, T&& t, DataTag tag )const
- {
- size_type m = this->size();\
- while(m--) this->inner_.impl( cont, std::forward<T>( t ), tag );
- }
-
+#define BOOST_ASSIGN_V2_arg T&& t
+#define BOOST_ASSIGN_V2_forward std::forward<T>( t )
 #else
-
+#define BOOST_ASSIGN_V2_arg T& t
+#define BOOST_ASSIGN_V2_forward t
+#endif
         template<typename C, typename T, typename DataTag>
- void impl(C& cont, T& t, DataTag tag )const
+ void impl(C& cont, BOOST_ASSIGN_V2_arg, DataTag tag )const
         {
- size_type m = this->size();
- while(m--) this->inner_.impl( cont, t, tag );
+ size_type m = this->size();\
+ while(m--) this->inner_.impl( cont, BOOST_ASSIGN_V2_forward, tag );
         }
 
-#endif
+#undef BOOST_ASSIGN_V2_arg
+#undef BOOST_ASSIGN_V2_forward
 
         size_type const& size()const{ return this->n_; }
 

Modified: sandbox/assign_v2/boost/assign/v2/option/modifier/std.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/option/modifier/std.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/option/modifier/std.hpp 2011-03-29 22:54:35 EDT (Tue, 29 Mar 2011)
@@ -26,45 +26,35 @@
 }// assign
 }// boost
 
-
-#define BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_IMPL_CPP03(FUN)\
- template<typename C, typename T>\
- void impl(C& cont, T& t, data_tag::value)const{\
- cont.FUN( t );\
- }\
- template<typename C, typename T>\
- void impl(C& cont, T& t, data_tag::ptr)const{\
- typedef typename container_aux::value<C>::type value_;\
- cont.FUN( new value_( t ) );\
- }\
-/**/
-
 #include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
 #if BOOST_ASSIGN_V2_ENABLE_CPP0X
 #include <utility>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_reference.hpp>
-// disable_if necessary to avoid ambiguity resolution
-#define BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_IMPL_RVALUE(FUN)\
+#define BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_IMPL(FUN)\
     template<typename C, typename T>\
- typename boost::disable_if<\
- boost::is_reference<T>,\
- void\
- >::type\
- impl(C& cont, T&& t, data_tag::value)const{\
+ void impl(C& cont, T&& t, data_tag::value)const{\
         cont.FUN( std::forward<T>( t ) );\
     }\
-/**/
-#define BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_IMPL(FUN)\
-BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_IMPL_CPP03(FUN)\
-BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_IMPL_RVALUE(FUN)\
+ template<typename C, typename T>\
+ void impl(C& cont, T&& t, data_tag::ptr)const{\
+ typedef typename container_aux::value<C>::type value_;\
+ cont.FUN( new value_( std::forward<T>( t ) ) );\
+ }\
 /**/
 #else
 #define BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_IMPL(FUN)\
-BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_IMPL_CPP03(FUN)\
+ template<typename C, typename T>\
+ void impl(C& cont, T& t, data_tag::value)const{\
+ cont.FUN( t );\
+ }\
+ template<typename C, typename T>\
+ void impl(C& cont, T& t, data_tag::ptr)const{\
+ typedef typename container_aux::value<C>::type value_;\
+ cont.FUN( new value_( t ) );\
+ }\
 /**/
 #endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
 
+
 #define BOOST_ASSIGN_V2_OPTION_STD_MODIFIER_TAG(FUN)\
 namespace boost{\
 namespace assign{\

Modified: sandbox/assign_v2/libs/assign/v2/test/detail/traits.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/detail/traits.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/detail/traits.cpp 2011-03-29 22:54:35 EDT (Tue, 29 Mar 2011)
@@ -26,15 +26,15 @@
         namespace ns = as2::container_aux;
         {
             typedef std::queue<int> v_;
- BOOST_MPL_ASSERT(( ns::has_push<v_> ));
+ BOOST_MPL_ASSERT(( ns::has_push_deduced_value<v_> ));
         }
         {
             typedef std::queue<int> v_;
- BOOST_MPL_ASSERT(( ns::has_push<v_> ));
+ BOOST_MPL_ASSERT(( ns::has_push_deduced_value<v_> ));
         }
         {
             typedef std::vector<int> v_;
- BOOST_MPL_ASSERT_NOT(( ns::has_push<v_> ));
+ BOOST_MPL_ASSERT_NOT(( ns::has_push_deduced_value<v_> ));
         }
         {
             typedef std::vector<int> inp_;


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