Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69416 - sandbox/assign_v2/boost/assign/v2/put/deduce
From: erwann.rogard_at_[hidden]
Date: 2011-02-28 19:31:26


Author: e_r
Date: 2011-02-28 19:31:24 EST (Mon, 28 Feb 2011)
New Revision: 69416
URL: http://svn.boost.org/trac/boost/changeset/69416

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

Deleted: sandbox/assign_v2/boost/assign/v2/put/deduce/modifier.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/deduce/modifier.hpp 2011-02-28 19:31:24 EST (Mon, 28 Feb 2011)
+++ (empty file)
@@ -1 +0,0 @@
-// TODO remove file
\ No newline at end of file

Added: sandbox/assign_v2/boost/assign/v2/put/deduce/modifier_tag.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/deduce/modifier_tag.hpp 2011-02-28 19:31:24 EST (Mon, 28 Feb 2011)
@@ -0,0 +1,76 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DEDUCE_MODIFIER_TAG_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEDUCE_MODIFIER_TAG_ER_2010_HPP
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/assign/v2/detail/traits/switch.hpp>
+#include <boost/assign/v2/detail/traits/container/is_array.hpp>
+#include <boost/assign/v2/detail/traits/container/has_push.hpp>
+#include <boost/assign/v2/detail/traits/container/is_associative.hpp>
+
+#include <boost/assign/v2/put/deduce/fwd.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace switch_tag{
+ struct deduce_put{};
+}// switch_tag
+namespace switch_aux{
+
+ template<>
+ struct case_<switch_tag::deduce_put, 0> :
+ switch_aux::helper<
+ v2::modifier_tag::insert,
+ v2::container_traits::is_associative
+ >{};
+
+ template<>
+ struct case_<switch_tag::deduce_put, 1> :
+ switch_aux::helper<
+ v2::modifier_tag::iterate,
+ v2::container_traits::is_array
+ >{};
+
+ template<>
+ struct case_<switch_tag::deduce_put, 2> :
+ switch_aux::helper<
+ v2::modifier_tag::push,
+ container_traits::has_push_deduced_value
+ >{};
+
+ template<>
+ struct case_<switch_tag::deduce_put, 3> :
+ switch_aux::helper<v2::modifier_tag::push_back>{};
+
+}// switch_aux
+namespace put_aux{
+
+ template<typename T>
+ struct deduce_modifier_tag
+ : switch_aux::result< switch_tag::deduce_put, T>
+ {};
+
+ // For testing purposes
+ template<typename C, typename X>
+ void check_deduce()
+ {
+ typedef typename put_aux::deduce_modifier_tag<C>::type found_;
+ BOOST_MPL_ASSERT(( boost::is_same<found_, X> ));
+ }
+
+}// put_aux
+}// v2
+}// assign
+}// boost
+
+#endif


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