Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69929 - in sandbox/assign_v2/boost/assign/v2/put/modifier: . iterate
From: erwann.rogard_at_[hidden]
Date: 2011-03-13 10:01:45


Author: e_r
Date: 2011-03-13 10:01:40 EDT (Sun, 13 Mar 2011)
New Revision: 69929
URL: http://svn.boost.org/trac/boost/changeset/69929

Log:
upd assign_v2
Text files modified:
   sandbox/assign_v2/boost/assign/v2/put/modifier/iterate.hpp | 96 +++++++++++++++++++++++++++++++++++++++
   sandbox/assign_v2/boost/assign/v2/put/modifier/iterate/impl.hpp | 84 ----------------------------------
   sandbox/assign_v2/boost/assign/v2/put/modifier/iterate/tag.hpp | 47 -------------------
   sandbox/assign_v2/boost/assign/v2/put/modifier/lookup.hpp | 2
   sandbox/assign_v2/boost/assign/v2/put/modifier/repeat.hpp | 1
   5 files changed, 97 insertions(+), 133 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/iterate.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/iterate.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/iterate.hpp 2011-03-13 10:01:40 EDT (Sun, 13 Mar 2011)
@@ -9,8 +9,100 @@
 //////////////////////////////////////////////////////////////////////////////
 #ifndef BOOST_ASSIGN_V2_PUT_MODIFIER_ITERATE_ER_2010_HPP
 #define BOOST_ASSIGN_V2_PUT_MODIFIER_ITERATE_ER_2010_HPP
-#include <boost/assign/v2/put/modifier/iterate/impl.hpp>
-#include <boost/assign/v2/put/modifier/iterate/tag.hpp>
+#include <cstddef>
+#include <boost/assign/v2/detail/keyword/ignore.hpp>
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#include <boost/assign/v2/put/adapter/modifier.hpp>
+#include <boost/call_traits.hpp>
+#include <boost/shared_ptr.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/utility/enable_if.hpp>
+#endif
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace modifier_tag{
+
+ // TODO think of lambda expression
+ struct iterate_arg
+ {
+
+ typedef std::size_t result_type;
+
+ iterate_arg():i( 0 ){}
+ iterate_arg( result_type i_ ):i( i_ ){}
+
+ result_type operator()()const{ return this->i++; }
+
+ typedef iterate_arg type;
+
+ private:
+ mutable result_type i;
+ };
+
+
+ template<typename Arg = iterate_arg::type > struct iterate{};
+
+}// modifier_tag
+namespace put_aux{
+
+ template<typename Arg>
+ class adapter_modifier< modifier_tag::iterate<Arg> >
+ {
+
+ typedef keyword_aux::ignore ignore_;
+ typedef Arg arg_;
+ // storing a copy of lambda::something has caused pbs, hence ptr
+ typedef boost::shared_ptr<arg_> ptr_;
+
+ public:
+
+ adapter_modifier(): ptr( new arg_() ){}
+ explicit adapter_modifier(
+ ignore_,
+ typename boost::call_traits<arg_>::param_type arg
+ ) : ptr( new arg_( arg ) )
+ {}
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ template<typename C, typename T>
+ typename boost::disable_if<
+ boost::is_reference<T>,
+ void
+ >::type
+ impl(C& cont, T&& t )const
+ {
+ cont.at( (*this->ptr)() ) = std::move( t );
+ }
+
+#endif
+
+ template<typename C, typename T>
+ void impl(C& cont, T& t )const
+ {
+ cont.at( (*this->ptr)() ) = t;
+ }
+
+ // TODO verify
+ template<typename C, typename T>
+ void impl(C& cont, T* t)const
+ {
+ cont.replace( this->arg_() , t);
+ }
+
+ protected:
+ ptr_ ptr;
+
+ };
+
+}// put_aux
+}// v2
+}// assign
+}// boost
+
 #include <boost/assign/v2/put/modifier/modulo.hpp>
 BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_KEYWORD(iterate)
 

Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/iterate/impl.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/iterate/impl.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/iterate/impl.hpp 2011-03-13 10:01:40 EDT (Sun, 13 Mar 2011)
@@ -1,83 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to 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_ASSIGN_V2_PUT_MODIFIER_ITERATE_IMPL_ER_2010_HPP
-#define BOOST_ASSIGN_V2_PUT_MODIFIER_ITERATE_IMPL_ER_2010_HPP
-#include <boost/assign/v2/detail/keyword/ignore.hpp>
-#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
-#include <boost/assign/v2/put/adapter/modifier.hpp>
-#include <boost/assign/v2/put/modifier/iterate/tag.hpp>
-#include <boost/call_traits.hpp>
-#include <boost/shared_ptr.hpp>
-#if BOOST_ASSIGN_V2_ENABLE_CPP0X
-#include <utility>
-#include <boost/type_traits/is_reference.hpp>
-#include <boost/utility/enable_if.hpp>
-#endif
-
-namespace boost{
-namespace assign{
-namespace v2{
-namespace put_aux{
-
- template<typename Arg>
- class adapter_modifier< modifier_tag::iterate<Arg> >
- {
-
- typedef keyword_aux::ignore ignore_;
- typedef Arg arg_;
- // storing a copy of lambda::something has caused pbs, hence ptr
- typedef boost::shared_ptr<arg_> ptr_;
-
- public:
-
- adapter_modifier(): ptr( new arg_() ){}
- explicit adapter_modifier(
- ignore_,
- typename boost::call_traits<arg_>::param_type arg
- ) : ptr( new arg_( arg ) )
- {}
-
-#if BOOST_ASSIGN_V2_ENABLE_CPP0X
- template<typename C, typename T>
- typename boost::disable_if<
- boost::is_reference<T>,
- void
- >::type
- impl(C& cont, T&& t )const
- {
- cont.at( (*this->ptr)() ) = std::move( t );
- }
-
-#endif
-
- template<typename C, typename T>
- void impl(C& cont, T& t )const
- {
- cont.at( (*this->ptr)() ) = t;
- }
-
- // TODO verify
- template<typename C, typename T>
- void impl(C& cont, T* t)const
- {
- cont.replace( this->arg_() , t);
- }
-
- protected:
- ptr_ ptr;
-
- };
-
-}// put_aux
-}// v2
-}// assign
-}// boost
-
-#endif // BOOST_ASSIGN_V2_PUT_MODIFIER_ITERATE_IMPL_ER_2010_HPP
+// TODO remove file
\ No newline at end of file

Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/iterate/tag.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/iterate/tag.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/iterate/tag.hpp 2011-03-13 10:01:40 EDT (Sun, 13 Mar 2011)
@@ -1,46 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to 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_ASSIGN_V2_PUT_MODIFIER_ITERATE_TAG_ER_2010_HPP
-#define BOOST_ASSIGN_V2_PUT_MODIFIER_ITERATE_TAG_ER_2010_HPP
-#include <cstddef>
-//#include <boost/lambda/lambda.hpp>
-//#include <boost/typeof/typeof.hpp>
-
-namespace boost{
-namespace assign{
-namespace v2{
-namespace modifier_tag{
-
- // TODO think of lambda expression
- struct iterate_arg
- {
-
- typedef std::size_t result_type;
-
- iterate_arg():i( 0 ){}
- iterate_arg( result_type i_ ):i( i_ ){}
-
- result_type operator()()const{ return this->i++; }
-
- typedef iterate_arg type;
-
- private:
- mutable result_type i;
- };
-
-
- template<typename Arg = iterate_arg::type > struct iterate{};
-
-}// modifier_tag
-}// v2
-}// assign
-}// boost
-
-#endif // BOOST_ASSIGN_V2_PUT_MODIFIER_ITERATE_TAG_ER_2010_HPP
+// TODO remove file
\ No newline at end of file

Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/lookup.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/lookup.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/lookup.hpp 2011-03-13 10:01:40 EDT (Sun, 13 Mar 2011)
@@ -11,9 +11,9 @@
 #define BOOST_ASSIGN_V2_PUT_MODIFIER_LOOKUP_ER_2010_HPP
 #include <boost/assign/v2/put/modifier/lookup/impl.hpp>
 #include <boost/assign/v2/put/modifier/lookup/tag.hpp>
+
 #include <boost/assign/v2/put/modifier/modulo.hpp>
 BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_KEYWORD(lookup)
-
 #define BOOST_ASSIGN_V2_TAG modifier_tag::lookup<Arg>
 BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_META_MODIFIER_TAG(lookup, BOOST_ASSIGN_V2_TAG)
 #undef BOOST_ASSIGN_V2_TAG

Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/repeat.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/repeat.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/repeat.hpp 2011-03-13 10:01:40 EDT (Sun, 13 Mar 2011)
@@ -82,7 +82,6 @@
 }// v2
 }// assign
 }// boost
-#include <boost/assign/v2/put/modifier/repeat/tag.hpp>
 #include <boost/assign/v2/put/modifier/modulo.hpp>
 BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_KEYWORD(repeat)
 #define BOOST_ASSIGN_V2_TAG modifier_tag::repeat<typename D::modifier_tag>


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