Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69922 - sandbox/assign_v2/boost/assign/v2/put
From: erwann.rogard_at_[hidden]
Date: 2011-03-13 09:31:47


Author: e_r
Date: 2011-03-13 09:31:46 EDT (Sun, 13 Mar 2011)
New Revision: 69922
URL: http://svn.boost.org/trac/boost/changeset/69922

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/put.hpp (contents, props changed)

Added: sandbox/assign_v2/boost/assign/v2/put/put.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/put.hpp 2011-03-13 09:31:46 EDT (Sun, 13 Mar 2011)
@@ -0,0 +1,98 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_PUT_ER_2010_HPP
+#include <boost/assign/v2/put/adapter/crtp.hpp>
+#include <boost/assign/v2/put/adapter/modifier.hpp>
+#include <boost/assign/v2/put/adapter/replace_parameter.hpp>
+#include <boost/assign/v2/put/fun/deduce.hpp>
+#include <boost/assign/v2/put/modifier/deduce.hpp>
+#include <boost/assign/v2/ref/wrapper/copy.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+ template<typename C, typename F, typename Tag>
+ class container_adapter
+ : protected ref::wrapper< ref::assign_tag::copy, C >
+ , public put_aux::crtp< C, F, Tag, container_adapter<C, F, Tag> >
+ {
+ typedef put_aux::crtp< C, F, Tag, container_adapter > super2_t;
+
+ public:
+
+ typedef typename super2_t::result_type result_type;
+
+ protected:
+
+ typedef put_aux::adapter_modifier<Tag> modifier_;
+ typedef ref::assign_tag::copy assign_tag_;
+ typedef ref::wrapper<assign_tag_,C> super1_t;
+
+ public:
+
+ container_adapter(){}
+ explicit container_adapter( C& cont ) : super1_t( cont ) {}
+ explicit container_adapter( C& cont, F const& f, modifier_ const& m )
+ : super1_t( cont ), super2_t( f, m )
+ {
+ // This constructor is required in conjunction with modulo
+ }
+
+ C& container()const{
+ return static_cast<super1_t const&>(*this).get();
+ }
+
+ };
+
+ template<typename C, typename F, typename Tag>
+ struct replace_fun< put_aux::container_adapter<C, F, Tag> >
+ {
+ template<typename F1>
+ struct apply{ typedef put_aux::container_adapter<C, F1, Tag> type; };
+ };
+
+ template<typename C, typename F, typename Tag>
+ struct replace_modifier_tag< put_aux::container_adapter<C, F, Tag> >
+ {
+ template<typename Tag1>
+ struct apply{ typedef put_aux::container_adapter<C, F, Tag1> type; };
+ };
+
+}// put_aux
+//synopsis_put_container
+namespace result_of{
+
+ template<typename C>
+ struct put
+ {
+ typedef typename put_aux::deduce_fun<C>::type f_;
+ typedef typename put_aux::deduce_modifier_tag<C>::type modifier_tag_;
+ typedef put_aux::container_adapter<C, f_, modifier_tag_> type;
+ };
+
+}// result_of
+
+ template<typename C>
+ typename result_of::put<C>::type
+ put( C& cont )
+ {
+ typedef typename result_of::put<C>::type result_;
+ return result_( cont );
+ }
+
+//]
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_PUT_ER_2010_HPP


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