Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77808 - in trunk/boost/fusion/container: . deque deque/detail
From: joel_at_[hidden]
Date: 2012-04-07 05:56:09


Author: djowel
Date: 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
New Revision: 77808
URL: http://svn.boost.org/trac/boost/changeset/77808

Log:
c++ port of deque underway
Text files modified:
   trunk/boost/fusion/container/deque.hpp | 2 +-
   trunk/boost/fusion/container/deque/back_extended_deque.hpp | 7 ++++---
   trunk/boost/fusion/container/deque/deque.hpp | 2 +-
   trunk/boost/fusion/container/deque/deque_fwd.hpp | 2 +-
   trunk/boost/fusion/container/deque/deque_iterator.hpp | 8 ++++----
   trunk/boost/fusion/container/deque/detail/at_impl.hpp | 19 +++++++++++--------
   trunk/boost/fusion/container/deque/detail/begin_impl.hpp | 22 ++++++++++++----------
   trunk/boost/fusion/container/deque/detail/keyed_element.hpp | 6 +++---
   trunk/boost/fusion/container/deque/detail/value_at_impl.hpp | 18 ++++++++++--------
   trunk/boost/fusion/container/deque/front_extended_deque.hpp | 4 ++--
   10 files changed, 49 insertions(+), 41 deletions(-)

Modified: trunk/boost/fusion/container/deque.hpp
==============================================================================
--- trunk/boost/fusion/container/deque.hpp (original)
+++ trunk/boost/fusion/container/deque.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_SEQUENCE_CONTAINER_DEQUE_24112006_2036
 
 #include <boost/fusion/container/deque/deque.hpp>
-#include <boost/fusion/container/deque/convert.hpp>
+//#include <boost/fusion/container/deque/convert.hpp>
 
 #endif
 

Modified: trunk/boost/fusion/container/deque/back_extended_deque.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/back_extended_deque.hpp (original)
+++ trunk/boost/fusion/container/deque/back_extended_deque.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -14,11 +14,12 @@
 #include <boost/fusion/support/sequence_base.hpp>
 #include <boost/fusion/container/deque/detail/keyed_element.hpp>
 
-namespace boost { namespace fusion {
+namespace boost { namespace fusion
+{
     template<typename Deque, typename T>
     struct back_extended_deque
- : detail::keyed_element<typename Deque::next_up, T, Deque>,
- sequence_base<back_extended_deque<Deque, T> >
+ : detail::keyed_element<typename Deque::next_up, T, Deque>
+ , sequence_base<back_extended_deque<Deque, T> >
     {
         typedef detail::keyed_element<typename Deque::next_up, T, Deque> base;
         typedef typename Deque::next_down next_down;

Modified: trunk/boost/fusion/container/deque/deque.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/deque.hpp (original)
+++ trunk/boost/fusion/container/deque/deque.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -13,7 +13,7 @@
   || defined(BOOST_NO_RVALUE_REFERENCES))
 # include <boost/fusion/container/deque/cpp03_deque.hpp>
 #else
-# include <boost/fusion/container/deque/cpp03_deque.hpp>
+# include <boost/fusion/container/deque/cpp11_deque.hpp>
 #endif
 
 #endif

Modified: trunk/boost/fusion/container/deque/deque_fwd.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/deque_fwd.hpp (original)
+++ trunk/boost/fusion/container/deque/deque_fwd.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -15,7 +15,7 @@
   || defined(BOOST_NO_RVALUE_REFERENCES))
 # include <boost/fusion/container/deque/cpp03_deque_fwd.hpp>
 #else
-# include <boost/fusion/container/deque/cpp03_deque_fwd.hpp>
+# include <boost/fusion/container/deque/cpp11_deque_fwd.hpp>
 #endif
 
 #endif

Modified: trunk/boost/fusion/container/deque/deque_iterator.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/deque_iterator.hpp (original)
+++ trunk/boost/fusion/container/deque/deque_iterator.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -2,7 +2,7 @@
     Copyright (c) 2005-2012 Joel de Guzman
     Copyright (c) 2005-2006 Dan Marsden
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(BOOST_FUSION_DEQUE_ITERATOR_26112006_2154)
@@ -12,13 +12,13 @@
 #include <boost/fusion/container/deque/detail/keyed_element.hpp>
 #include <boost/mpl/minus.hpp>
 #include <boost/mpl/equal_to.hpp>
-#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_const.hpp>
 
 namespace boost { namespace fusion {
 
     struct bidirectional_traversal_tag;
 
- template<typename Seq, int Pos>
+ template <typename Seq, int Pos>
     struct deque_iterator
         : iterator_facade<deque_iterator<Seq, Pos>, bidirectional_traversal_tag>
     {
@@ -84,7 +84,7 @@
             typedef typename
                 mpl::minus<
                     typename I2::index, typename I1::index
- >::type
+ >::type
             type;
 
             static type

Modified: trunk/boost/fusion/container/deque/detail/at_impl.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/detail/at_impl.hpp (original)
+++ trunk/boost/fusion/container/deque/detail/at_impl.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -2,7 +2,7 @@
     Copyright (c) 2005-2012 Joel de Guzman
     Copyright (c) 2005-2006 Dan Marsden
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(BOOST_FUSION_DEQUE_AT_IMPL_09122006_2017)
@@ -19,15 +19,15 @@
 #include <boost/type_traits/add_const.hpp>
 #include <boost/type_traits/add_reference.hpp>
 
-namespace boost { namespace fusion {
+namespace boost { namespace fusion {
 
     struct deque_tag;
 
- namespace extension
+ namespace extension
     {
         template<typename T>
         struct at_impl;
-
+
         template<>
         struct at_impl<deque_tag>
         {
@@ -37,10 +37,13 @@
                 typedef typename Sequence::next_up next_up;
                 typedef typename Sequence::next_down next_down;
                 BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value);
-
- typedef mpl::plus<next_down, mpl::int_<1> > offset;
- typedef mpl::int_<mpl::plus<N, offset>::value> adjusted_index;
- typedef typename detail::keyed_element_value_at<Sequence, adjusted_index>::type element_type;
+
+ static int const offset = next_down::value + 1;
+ typedef mpl::int_<(N::value + offset)> adjusted_index;
+ typedef typename
+ detail::keyed_element_value_at<Sequence, adjusted_index>::type
+ element_type;
+
                 typedef typename add_reference<
                     typename mpl::eval_if<
                     is_const<Sequence>,

Modified: trunk/boost/fusion/container/deque/detail/begin_impl.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/detail/begin_impl.hpp (original)
+++ trunk/boost/fusion/container/deque/detail/begin_impl.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -2,7 +2,7 @@
     Copyright (c) 2005-2012 Joel de Guzman
     Copyright (c) 2005-2006 Dan Marsden
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(BOOST_FUSION_DEQUE_BEGIN_IMPL_09122006_2034)
@@ -13,27 +13,29 @@
 #include <boost/mpl/equal_to.hpp>
 #include <boost/mpl/if.hpp>
 
-namespace boost { namespace fusion {
+namespace boost { namespace fusion {
 
     struct deque_tag;
 
- namespace extension
+ namespace extension
     {
         template<typename T>
         struct begin_impl;
-
+
         template<>
         struct begin_impl<deque_tag>
         {
             template<typename Sequence>
             struct apply
             {
- typedef typename mpl::if_<
- mpl::equal_to<typename Sequence::next_down, typename Sequence::next_up>,
- deque_iterator<Sequence, 0>,
- deque_iterator<
- Sequence, mpl::plus<typename Sequence::next_down, mpl::int_<1> >::value> >::type type;
-
+ typedef typename
+ mpl::if_c<
+ (Sequence::next_down::value == Sequence::next_up::value)
+ , deque_iterator<Sequence, 0>
+ , deque_iterator<Sequence, (Sequence::next_down::value + 1)>
+ >::type
+ type;
+
                 static type call(Sequence& seq)
                 {
                     return type(seq);

Modified: trunk/boost/fusion/container/deque/detail/keyed_element.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/detail/keyed_element.hpp (original)
+++ trunk/boost/fusion/container/deque/detail/keyed_element.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -2,7 +2,7 @@
     Copyright (c) 2005-2012 Joel de Guzman
     Copyright (c) 2005-2006 Dan Marsden
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330)
@@ -26,7 +26,7 @@
         void get();
 
         template<typename It>
- static nil_keyed_element
+ static nil_keyed_element
         from_iterator(It const&)
         {
             return nil_keyed_element();
@@ -49,7 +49,7 @@
                 *it, base::from_iterator(fusion::next(it)));
         }
 
- template<typename U, typename Rst>
+ template <typename U, typename Rst>
         keyed_element(keyed_element<Key, U, Rst> const& rhs)
             : Rest(rhs.get_base()), value_(rhs.value_)
         {}

Modified: trunk/boost/fusion/container/deque/detail/value_at_impl.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/detail/value_at_impl.hpp (original)
+++ trunk/boost/fusion/container/deque/detail/value_at_impl.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -2,7 +2,7 @@
     Copyright (c) 2005-2012 Joel de Guzman
     Copyright (c) 2005-2006 Dan Marsden
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(BOOST_FUSION_DEQUE_VALUE_AT_IMPL_08122006_0756)
@@ -13,15 +13,15 @@
 #include <boost/mpl/equal_to.hpp>
 #include <boost/mpl/assert.hpp>
 
-namespace boost { namespace fusion {
+namespace boost { namespace fusion {
 
     struct deque_tag;
 
- namespace extension
+ namespace extension
     {
         template<typename T>
         struct value_at_impl;
-
+
         template<>
         struct value_at_impl<deque_tag>
         {
@@ -31,10 +31,12 @@
                 typedef typename Sequence::next_up next_up;
                 typedef typename Sequence::next_down next_down;
                 BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value);
-
- typedef mpl::plus<next_down, mpl::int_<1> > offset;
- typedef mpl::int_<mpl::plus<N, offset>::value> adjusted_index;
- typedef typename detail::keyed_element_value_at<Sequence, adjusted_index>::type type;
+
+ static int const offset = next_down::value + 1;
+ typedef mpl::int_<(N::value + offset)> adjusted_index;
+ typedef typename
+ detail::keyed_element_value_at<Sequence, adjusted_index>::type
+ type;
             };
         };
     }

Modified: trunk/boost/fusion/container/deque/front_extended_deque.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/front_extended_deque.hpp (original)
+++ trunk/boost/fusion/container/deque/front_extended_deque.hpp 2012-04-07 05:56:07 EDT (Sat, 07 Apr 2012)
@@ -17,8 +17,8 @@
 {
     template<typename Deque, typename T>
     struct front_extended_deque
- : detail::keyed_element<typename Deque::next_down, T, Deque>,
- sequence_base<front_extended_deque<Deque, T> >
+ : detail::keyed_element<typename Deque::next_down, T, Deque>
+ , sequence_base<front_extended_deque<Deque, T> >
     {
         typedef detail::keyed_element<typename Deque::next_down, T, Deque> base;
         typedef mpl::int_<(Deque::next_down::value - 1)> next_down;


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