Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78200 - in branches/release/boost/fusion: . adapted/std_tuple adapted/std_tuple/detail container/deque container/deque/detail container/list/detail container/map/detail container/vector/detail support/detail
From: joel_at_[hidden]
Date: 2012-04-25 20:18:52


Author: djowel
Date: 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
New Revision: 78200
URL: http://svn.boost.org/trac/boost/changeset/78200

Log:
Merging 77932-78199 from trunk
Added:
   branches/release/boost/fusion/container/deque/detail/cpp03_deque.hpp
      - copied unchanged from r78199, /trunk/boost/fusion/container/deque/detail/cpp03_deque.hpp
   branches/release/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp
      - copied unchanged from r78199, /trunk/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp
Properties modified:
   branches/release/boost/fusion/ (props changed)
Text files modified:
   branches/release/boost/fusion/adapted/std_tuple/detail/at_impl.hpp | 10 +-
   branches/release/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp | 10 +-
   branches/release/boost/fusion/adapted/std_tuple/tag_of.hpp | 6 --
   branches/release/boost/fusion/container/deque/deque.hpp | 117 ++++++++++++++++++---------------------
   branches/release/boost/fusion/container/deque/deque_fwd.hpp | 36 +++--------
   branches/release/boost/fusion/container/deque/detail/keyed_element.hpp | 10 +--
   branches/release/boost/fusion/container/list/detail/at_impl.hpp | 12 ++--
   branches/release/boost/fusion/container/map/detail/at_impl.hpp | 8 ++
   branches/release/boost/fusion/container/map/detail/deref_data_impl.hpp | 9 +-
   branches/release/boost/fusion/container/vector/detail/at_impl.hpp | 4
   branches/release/boost/fusion/container/vector/detail/deref_impl.hpp | 9 +-
   branches/release/boost/fusion/support/detail/access.hpp | 4
   12 files changed, 105 insertions(+), 130 deletions(-)

Modified: branches/release/boost/fusion/adapted/std_tuple/detail/at_impl.hpp
==============================================================================
--- branches/release/boost/fusion/adapted/std_tuple/detail/at_impl.hpp (original)
+++ branches/release/boost/fusion/adapted/std_tuple/detail/at_impl.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -9,7 +9,7 @@
 
 #include <tuple>
 #include <utility>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
 #include <boost/fusion/support/detail/access.hpp>
 #include <boost/type_traits/remove_const.hpp>
 
@@ -29,13 +29,13 @@
             struct apply
             {
                 typedef typename remove_const<Sequence>::type seq_type;
- typedef std::tuple_element<N::value, seq_type> element;
+ typedef typename std::tuple_element<N::value, seq_type>::type element;
 
                 typedef typename
- mpl::eval_if<
+ mpl::if_<
                         is_const<Sequence>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
                 type;
 

Modified: branches/release/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp
==============================================================================
--- branches/release/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp (original)
+++ branches/release/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -12,7 +12,7 @@
 #include <boost/type_traits/remove_const.hpp>
 #include <boost/fusion/support/detail/access.hpp>
 #include <boost/mpl/int.hpp>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
 #include <tuple>
 #include <utility>
 
@@ -48,12 +48,12 @@
         template <typename Iterator>
         struct deref
         {
- typedef value_of<Iterator> element;
+ typedef typename value_of<Iterator>::type element;
             typedef typename
- mpl::eval_if<
+ mpl::if_<
                     is_const<typename Iterator::tuple_type>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
             type;
 

Modified: branches/release/boost/fusion/adapted/std_tuple/tag_of.hpp
==============================================================================
--- branches/release/boost/fusion/adapted/std_tuple/tag_of.hpp (original)
+++ branches/release/boost/fusion/adapted/std_tuple/tag_of.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -10,12 +10,6 @@
 #include <tuple>
 #include <boost/fusion/support/tag_of_fwd.hpp>
 
-namespace std
-{
- template <typename... Elements>
- class tuple;
-}
-
 namespace boost { namespace fusion
 {
     struct std_tuple_tag;

Modified: branches/release/boost/fusion/container/deque/deque.hpp
==============================================================================
--- branches/release/boost/fusion/container/deque/deque.hpp (original)
+++ branches/release/boost/fusion/container/deque/deque.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -22,6 +22,25 @@
 #include <boost/type_traits/add_const.hpp>
 #include <boost/type_traits/is_convertible.hpp>
 
+///////////////////////////////////////////////////////////////////////////////
+// With no decltype and variadics, we will use the C++03 version
+///////////////////////////////////////////////////////////////////////////////
+#if (defined(BOOST_NO_DECLTYPE) \
+ || defined(BOOST_NO_VARIADIC_TEMPLATES) \
+ || defined(BOOST_NO_RVALUE_REFERENCES))
+# include <boost/fusion/container/deque/detail/cpp03_deque.hpp>
+#else
+#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
+#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// C++11 interface
+///////////////////////////////////////////////////////////////////////////////
+#include <boost/fusion/support/sequence_base.hpp>
+#include <boost/fusion/support/detail/access.hpp>
+#include <boost/fusion/container/deque/detail/keyed_element.hpp>
+#include <boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp>
 #include <boost/fusion/container/deque/deque_fwd.hpp>
 #include <boost/fusion/container/deque/detail/value_at_impl.hpp>
 #include <boost/fusion/container/deque/detail/at_impl.hpp>
@@ -29,93 +48,67 @@
 #include <boost/fusion/container/deque/detail/end_impl.hpp>
 #include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
 #include <boost/fusion/sequence/intrinsic/begin.hpp>
-#include <boost/mpl/bool.hpp>
 
-#include <boost/fusion/support/sequence_base.hpp>
-#include <boost/fusion/support/void.hpp>
+#include <boost/mpl/int.hpp>
 #include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_convertible.hpp>
 
-#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
-#include <boost/fusion/container/deque/detail/preprocessed/deque.hpp>
-#else
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
-#endif
-
-/*=============================================================================
- Copyright (c) 2001-2011 Joel de Guzman
-
- Distributed under 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)
-
- This is an auto-generated file. Do not edit!
-==============================================================================*/
-
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(preserve: 1)
-#endif
-
-namespace boost { namespace fusion {
-
+namespace boost { namespace fusion
+{
     struct deque_tag;
 
- template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
- struct deque
- :
- detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type,
- sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
+ template <typename ...Elements>
+ struct deque : detail::nil_keyed_element
+ {
+ };
+
+ template <typename Head, typename ...Tail>
+ struct deque<Head, Tail...>
+ : detail::deque_keyed_values<Head, Tail...>::type
+ , sequence_base<deque<Head, Tail...>>
     {
         typedef deque_tag fusion_tag;
         typedef bidirectional_traversal_tag category;
- typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base;
- typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size;
+ typedef typename detail::deque_keyed_values<Head, Tail...>::type base;
+ typedef mpl::int_<(sizeof ...(Tail) + 1)> size;
         typedef mpl::int_<size::value> next_up;
- typedef mpl::int_<
- mpl::if_<mpl::equal_to<size, mpl::int_<0> >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down;
+ typedef mpl::int_<mpl::int_<((size::value == 0) ? 0 : -1)>::type::value> next_down;
         typedef mpl::false_ is_view;
 
-#include <boost/fusion/container/deque/detail/deque_forward_ctor.hpp>
-
         deque()
- {}
+ {}
 
- explicit deque(typename add_reference<typename add_const<T0>::type>::type t0)
- : base(t0, detail::nil_keyed_element())
- {}
-
- template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
- deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
- : base(seq)
- {}
-
- template<typename Sequence>
- deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
- : base(base::from_iterator(fusion::begin(seq)))
- {}
-
- template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
- deque&
- operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
+ template <typename ...Elements>
+ deque(deque<Elements...> const& seq)
+ : base(seq)
+ {}
+
+ explicit deque(typename detail::call_param<Head>::type head
+ , typename detail::call_param<Tail>::type... tail)
+ : base(detail::deque_keyed_values<Head, Tail...>::call(head, tail...))
+ {}
+
+ template <typename Sequence>
+ explicit deque(Sequence const& seq
+ , typename disable_if<is_convertible<Sequence, Head> >::type* /*dummy*/ = 0)
+ : base(base::from_iterator(fusion::begin(seq)))
+ {}
+
+ template <typename ...Elements>
+ deque& operator=(deque<Elements...> const& rhs)
         {
             base::operator=(rhs);
             return *this;
         }
 
         template <typename T>
- deque&
- operator=(T const& rhs)
+ deque& operator=(T const& rhs)
         {
             base::operator=(rhs);
             return *this;
         }
-
     };
 }}
 
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(output: null)
 #endif
-
-#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
-
 #endif

Modified: branches/release/boost/fusion/container/deque/deque_fwd.hpp
==============================================================================
--- branches/release/boost/fusion/container/deque/deque_fwd.hpp (original)
+++ branches/release/boost/fusion/container/deque/deque_fwd.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -11,40 +11,26 @@
 #include <boost/fusion/container/deque/limits.hpp>
 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
 
-#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
-#include <boost/fusion/container/deque/detail/preprocessed/deque_fwd.hpp>
+///////////////////////////////////////////////////////////////////////////////
+// With no decltype and variadics, we will use the C++03 version
+///////////////////////////////////////////////////////////////////////////////
+#if (defined(BOOST_NO_DECLTYPE) \
+ || defined(BOOST_NO_VARIADIC_TEMPLATES) \
+ || defined(BOOST_NO_RVALUE_REFERENCES))
+# include <boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp>
 #else
 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
 #pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp")
 #endif
 
-/*=============================================================================
- Copyright (c) 2001-2011 Joel de Guzman
-
- Distributed under 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)
-
- This is an auto-generated file. Do not edit!
-==============================================================================*/
-
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(preserve: 1)
-#endif
-
+///////////////////////////////////////////////////////////////////////////////
+// C++11 interface
+///////////////////////////////////////////////////////////////////////////////
 namespace boost { namespace fusion
 {
- struct void_;
-
- template<
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
- FUSION_MAX_DEQUE_SIZE, typename T, void_)>
+ template <typename ...T>
     struct deque;
 }}
 
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(output: null)
 #endif
-
-#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
-
 #endif

Modified: branches/release/boost/fusion/container/deque/detail/keyed_element.hpp
==============================================================================
--- branches/release/boost/fusion/container/deque/detail/keyed_element.hpp (original)
+++ branches/release/boost/fusion/container/deque/detail/keyed_element.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -8,9 +8,7 @@
 #if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330)
 #define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330
 
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/type_traits/add_const.hpp>
-
+#include <boost/fusion/support/detail/access.hpp>
 #include <boost/fusion/iterator/deref.hpp>
 #include <boost/fusion/iterator/next.hpp>
 
@@ -59,17 +57,17 @@
             return *this;
         }
 
- typename add_reference<typename add_const<Value>::type>::type get(Key) const
+ typename cref_result<Value>::type get(Key) const
         {
             return value_;
         }
 
- typename add_reference<Value>::type get(Key)
+ typename ref_result<Value>::type get(Key)
         {
             return value_;
         }
 
- keyed_element(typename add_reference<typename add_const<Value>::type>::type value, Rest const& rest)
+ keyed_element(typename call_param<Value>::type value, Rest const& rest)
             : Rest(rest), value_(value)
         {}
 

Modified: branches/release/boost/fusion/container/list/detail/at_impl.hpp
==============================================================================
--- branches/release/boost/fusion/container/list/detail/at_impl.hpp (original)
+++ branches/release/boost/fusion/container/list/detail/at_impl.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -10,7 +10,7 @@
 #include <boost/fusion/support/detail/access.hpp>
 #include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/add_const.hpp>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
 #include <boost/mpl/bool.hpp>
 
 namespace boost { namespace fusion
@@ -93,15 +93,15 @@
             template <typename Sequence, typename N>
             struct apply
             {
- typedef detail::cons_deref<
- typename detail::cons_advance<Sequence, N::value>::type>
+ typedef typename detail::cons_deref<
+ typename detail::cons_advance<Sequence, N::value>::type>::type
                 element;
 
                 typedef typename
- mpl::eval_if<
+ mpl::if_<
                         is_const<Sequence>
- , detail::cref_result<element>
- , detail::ref_result<element>
+ , typename detail::cref_result<element>::type
+ , typename detail::ref_result<element>::type
>::type
                 type;
 

Modified: branches/release/boost/fusion/container/map/detail/at_impl.hpp
==============================================================================
--- branches/release/boost/fusion/container/map/detail/at_impl.hpp (original)
+++ branches/release/boost/fusion/container/map/detail/at_impl.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -28,7 +28,9 @@
             template <typename Sequence, typename N>
             struct apply
             {
- typedef mpl::at<typename Sequence::storage_type::types, N> element;
+ typedef typename
+ mpl::at<typename Sequence::storage_type::types, N>::type
+ element;
                 typedef typename detail::ref_result<element>::type type;
     
                 static type
@@ -41,7 +43,9 @@
             template <typename Sequence, typename N>
             struct apply <Sequence const, N>
             {
- typedef mpl::at<typename Sequence::storage_type::types, N> element;
+ typedef typename
+ mpl::at<typename Sequence::storage_type::types, N>::type
+ element;
                 typedef typename detail::cref_result<element>::type type;
     
                 static type

Modified: branches/release/boost/fusion/container/map/detail/deref_data_impl.hpp
==============================================================================
--- branches/release/boost/fusion/container/map/detail/deref_data_impl.hpp (original)
+++ branches/release/boost/fusion/container/map/detail/deref_data_impl.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -12,8 +12,7 @@
 #include <boost/fusion/iterator/deref.hpp>
 #include <boost/fusion/support/detail/access.hpp>
 #include <boost/type_traits/is_const.hpp>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
+#include <boost/mpl/if.hpp>
 
 namespace boost { namespace fusion { namespace extension
 {
@@ -29,10 +28,10 @@
             typedef typename result_of::value_of<It>::type::second_type data;
 
             typedef typename
- mpl::eval_if<
+ mpl::if_<
                     is_const<typename It::seq_type>
- , detail::cref_result<mpl::identity<data> >
- , detail::ref_result<mpl::identity<data> >
+ , typename detail::cref_result<data>::type
+ , typename detail::ref_result<data>::type
>::type
             type;
 

Modified: branches/release/boost/fusion/container/vector/detail/at_impl.hpp
==============================================================================
--- branches/release/boost/fusion/container/vector/detail/at_impl.hpp (original)
+++ branches/release/boost/fusion/container/vector/detail/at_impl.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -27,7 +27,7 @@
             template <typename Sequence, typename N>
             struct apply
             {
- typedef mpl::at<typename Sequence::types, N> element;
+ typedef typename mpl::at<typename Sequence::types, N>::type element;
                 typedef typename detail::ref_result<element>::type type;
     
                 static type
@@ -40,7 +40,7 @@
             template <typename Sequence, typename N>
             struct apply <Sequence const, N>
             {
- typedef mpl::at<typename Sequence::types, N> element;
+ typedef typename mpl::at<typename Sequence::types, N>::type element;
                 typedef typename detail::cref_result<element>::type type;
     
                 static type

Modified: branches/release/boost/fusion/container/vector/detail/deref_impl.hpp
==============================================================================
--- branches/release/boost/fusion/container/vector/detail/deref_impl.hpp (original)
+++ branches/release/boost/fusion/container/vector/detail/deref_impl.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -10,6 +10,7 @@
 #include <boost/mpl/at.hpp>
 #include <boost/fusion/support/detail/access.hpp>
 #include <boost/type_traits/is_const.hpp>
+#include <boost/mpl/if.hpp>
 
 namespace boost { namespace fusion
 {
@@ -29,14 +30,14 @@
                 typedef typename Iterator::vector vector;
                 typedef typename Iterator::index index;
                 typedef typename mpl::at<
- typename vector::types, index>
+ typename vector::types, index>::type
                 element;
                 
                 typedef typename
- mpl::eval_if<
+ mpl::if_<
                         is_const<vector>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
                 type;
 

Modified: branches/release/boost/fusion/support/detail/access.hpp
==============================================================================
--- branches/release/boost/fusion/support/detail/access.hpp (original)
+++ branches/release/boost/fusion/support/detail/access.hpp 2012-04-25 20:18:51 EDT (Wed, 25 Apr 2012)
@@ -15,7 +15,7 @@
     template <typename T>
     struct ref_result
     {
- typedef typename add_reference<typename T::type>::type type;
+ typedef typename add_reference<T>::type type;
     };
 
     template <typename T>
@@ -23,7 +23,7 @@
     {
         typedef typename
             add_reference<
- typename add_const<typename T::type>::type
+ typename add_const<T>::type
>::type
         type;
     };


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