Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70678 - sandbox/assign_v2/boost/assign/v2/detail/functor
From: erwann.rogard_at_[hidden]
Date: 2011-03-28 19:27:54


Author: e_r
Date: 2011-03-28 19:27:53 EDT (Mon, 28 Mar 2011)
New Revision: 70678
URL: http://svn.boost.org/trac/boost/changeset/70678

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/detail/functor/pair.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/detail/functor/value.hpp (contents, props changed)

Added: sandbox/assign_v2/boost/assign/v2/detail/functor/pair.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/detail/functor/pair.hpp 2011-03-28 19:27:53 EDT (Mon, 28 Mar 2011)
@@ -0,0 +1,95 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DETAIL_FUNCTOR_PAIR_ER_2010_HPP
+#define BOOST_ASSIGN_V2_DETAIL_FUNCTOR_PAIR_ER_2010_HPP
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#include <boost/assign/v2/detail/pp/ignore.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <boost/assign/v2/detail/config/limit_arity.hpp>
+#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/preprocessor/arithmetic.hpp>
+#include <boost/preprocessor/repetition.hpp>
+#endif
+
+namespace boost{
+namespace assign{
+namespace v2{
+//syntax_detail_functor_pair
+namespace functor_aux{
+
+ template<typename T, typename K, typename M>
+ class pair/*<-*/
+#if !BOOST_ASSIGN_V2_ENABLE_CPP0X
+ : public functor_aux::crtp_unary_and_up<
+ functor_aux::pair<T, K, M>,
+ ::boost::mpl::always<T>
+ >
+#endif
+ /*->*/
+ {
+
+ public:
+
+ pair()/*<-*/{}BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+//<-
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+//->
+ template<typename... Args>
+ T operator()(K const& k, Args&&...args)const/*<-*/
+ {
+ return T( k, M( std::forward<Args>(args)... ) );
+ }/*->*/BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+//<-
+
+#else
+
+ protected:
+ typedef ::boost::mpl::always<T> meta_result_;
+ typedef functor_aux::crtp_unary_and_up<pair, meta_result_> super_;
+
+ public:
+
+ using super_::operator();
+
+ T impl( K const& k )const{
+ return T( k, M() );
+ }
+
+#define BOOST_ASSIGN_V2_MACRO(z, N, data) \
+ template<BOOST_PP_ENUM_PARAMS(N, typename T)> \
+ T impl( K const& k BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(N, T, &_) )const{ \
+ return T( k, M( BOOST_PP_ENUM_PARAMS(N, _) ) ); \
+ } \
+/**/
+BOOST_PP_REPEAT_FROM_TO(
+ 1,
+ BOOST_ASSIGN_V2_LIMIT_ARITY,
+ BOOST_ASSIGN_V2_MACRO,
+ ~
+)
+#undef BOOST_ASSIGN_V2_MACRO
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+//->
+ };
+
+}// functor_aux
+//]
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_DETAIL_FUNCTOR_PAIR_ER_2010_HPP

Added: sandbox/assign_v2/boost/assign/v2/detail/functor/value.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/detail/functor/value.hpp 2011-03-28 19:27:53 EDT (Mon, 28 Mar 2011)
@@ -0,0 +1,95 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DETAIL_FUNCTOR_VALUE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_DETAIL_FUNCTOR_VALUE_ER_2010_HPP
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#include <boost/assign/v2/detail/keyword/nil.hpp>
+#include <boost/assign/v2/detail/pp/ignore.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <boost/assign/v2/detail/config/limit_arity.hpp>
+#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/preprocessor/arithmetic.hpp>
+#include <boost/preprocessor/repetition.hpp>
+#endif
+
+namespace boost{
+namespace assign{
+namespace v2{
+//syntax_detail_functor_value
+namespace functor_aux{
+
+ template<typename T = keyword_aux::nil>
+ class value/*<-*/
+#if !BOOST_ASSIGN_V2_ENABLE_CPP0X
+ : public functor_aux::crtp_unary_and_up<
+ functor_aux::value<T>,
+ ::boost::mpl::always<T>
+ >
+#endif
+ /*->*/
+ {
+//<-
+ typedef functor_aux::value<T> this_;
+//->
+ public:
+
+ value()/*<-*/{}BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+//<-
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+//->
+ template<typename... Args>
+ T operator()(Args&&...args)const/*<-*/
+ {
+ return T( std::forward<Args>(args)... );
+ }/*->*/BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+//<-
+
+#else
+
+ protected:
+ typedef ::boost::mpl::always<T> meta_result_;
+ typedef functor_aux::crtp_unary_and_up<this_, meta_result_> super_;
+
+ public:
+
+ using super_::operator();
+ T operator()()const{ return T(); }
+
+#define BOOST_ASSIGN_V2_MACRO(z, N,data) \
+ template<BOOST_PP_ENUM_PARAMS(N, typename T)> \
+ T impl( BOOST_PP_ENUM_BINARY_PARAMS(N, T, &_) )const{ \
+ return T( BOOST_PP_ENUM_PARAMS(N, _) ); \
+ } \
+/**/
+BOOST_PP_REPEAT_FROM_TO(
+ 1,
+ BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_ARITY),
+ BOOST_ASSIGN_V2_MACRO,
+ ~
+)
+#undef BOOST_ASSIGN_V2_MACRO
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+//->
+ };
+
+}// functor_aux
+//]
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_DETAIL_FUNCTOR_VALUE_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