diff --git a/include/boost/fusion/container/deque.hpp b/include/boost/fusion/container/deque.hpp index 0ee058a3..457b5166 100644 --- a/include/boost/fusion/container/deque.hpp +++ b/include/boost/fusion/container/deque.hpp @@ -9,7 +9,7 @@ #define BOOST_FUSION_SEQUENCE_CONTAINER_DEQUE_24112006_2036 #include -#include +//#include #endif diff --git a/include/boost/fusion/container/deque/back_extended_deque.hpp b/include/boost/fusion/container/deque/back_extended_deque.hpp index f11aef83..85edaed0 100644 --- a/include/boost/fusion/container/deque/back_extended_deque.hpp +++ b/include/boost/fusion/container/deque/back_extended_deque.hpp @@ -14,11 +14,12 @@ #include #include -namespace boost { namespace fusion { +namespace boost { namespace fusion +{ template struct back_extended_deque - : detail::keyed_element, - sequence_base > + : detail::keyed_element + , sequence_base > { typedef detail::keyed_element base; typedef typename Deque::next_down next_down; diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index 4aef8144..b5677f86 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -13,7 +13,7 @@ || defined(BOOST_NO_RVALUE_REFERENCES)) # include #else -# include +# include #endif #endif diff --git a/include/boost/fusion/container/deque/deque_fwd.hpp b/include/boost/fusion/container/deque/deque_fwd.hpp index 4d32b9fd..1da01353 100644 --- a/include/boost/fusion/container/deque/deque_fwd.hpp +++ b/include/boost/fusion/container/deque/deque_fwd.hpp @@ -15,7 +15,7 @@ || defined(BOOST_NO_RVALUE_REFERENCES)) # include #else -# include +# include #endif #endif diff --git a/include/boost/fusion/container/deque/deque_iterator.hpp b/include/boost/fusion/container/deque/deque_iterator.hpp index 76d8e367..d3e5f31e 100644 --- a/include/boost/fusion/container/deque/deque_iterator.hpp +++ b/include/boost/fusion/container/deque/deque_iterator.hpp @@ -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 #include #include -#include +#include namespace boost { namespace fusion { struct bidirectional_traversal_tag; - template + template struct deque_iterator : iterator_facade, bidirectional_traversal_tag> { @@ -84,7 +84,7 @@ namespace boost { namespace fusion { typedef typename mpl::minus< typename I2::index, typename I1::index - >::type + >::type type; static type diff --git a/include/boost/fusion/container/deque/detail/at_impl.hpp b/include/boost/fusion/container/deque/detail/at_impl.hpp index daaf6b26..bf5f91a1 100644 --- a/include/boost/fusion/container/deque/detail/at_impl.hpp +++ b/include/boost/fusion/container/deque/detail/at_impl.hpp @@ -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 #include -namespace boost { namespace fusion { +namespace boost { namespace fusion { struct deque_tag; - namespace extension + namespace extension { template struct at_impl; - + template<> struct at_impl { @@ -37,10 +37,13 @@ namespace boost { namespace fusion { 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 > offset; - typedef mpl::int_::value> adjusted_index; - typedef typename detail::keyed_element_value_at::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::type + element_type; + typedef typename add_reference< typename mpl::eval_if< is_const, diff --git a/include/boost/fusion/container/deque/detail/begin_impl.hpp b/include/boost/fusion/container/deque/detail/begin_impl.hpp index b1ecdd89..b904b6c5 100644 --- a/include/boost/fusion/container/deque/detail/begin_impl.hpp +++ b/include/boost/fusion/container/deque/detail/begin_impl.hpp @@ -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 #include -namespace boost { namespace fusion { +namespace boost { namespace fusion { struct deque_tag; - namespace extension + namespace extension { template struct begin_impl; - + template<> struct begin_impl { template struct apply { - typedef typename mpl::if_< - mpl::equal_to, - deque_iterator, - deque_iterator< - Sequence, mpl::plus >::value> >::type type; - + typedef typename + mpl::if_c< + (Sequence::next_down::value == Sequence::next_up::value) + , deque_iterator + , deque_iterator + >::type + type; + static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp index 720daaa3..c080fe99 100644 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -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 @@ namespace detail { void get(); template - static nil_keyed_element + static nil_keyed_element from_iterator(It const&) { return nil_keyed_element(); @@ -49,7 +49,7 @@ namespace detail { *it, base::from_iterator(fusion::next(it))); } - template + template keyed_element(keyed_element const& rhs) : Rest(rhs.get_base()), value_(rhs.value_) {} diff --git a/include/boost/fusion/container/deque/detail/value_at_impl.hpp b/include/boost/fusion/container/deque/detail/value_at_impl.hpp index 5ad74c8c..cfc88ba7 100644 --- a/include/boost/fusion/container/deque/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/deque/detail/value_at_impl.hpp @@ -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 #include -namespace boost { namespace fusion { +namespace boost { namespace fusion { struct deque_tag; - namespace extension + namespace extension { template struct value_at_impl; - + template<> struct value_at_impl { @@ -31,10 +31,12 @@ namespace boost { namespace fusion { 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 > offset; - typedef mpl::int_::value> adjusted_index; - typedef typename detail::keyed_element_value_at::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::type + type; }; }; } diff --git a/include/boost/fusion/container/deque/front_extended_deque.hpp b/include/boost/fusion/container/deque/front_extended_deque.hpp index 0d672dad..13da910a 100644 --- a/include/boost/fusion/container/deque/front_extended_deque.hpp +++ b/include/boost/fusion/container/deque/front_extended_deque.hpp @@ -17,8 +17,8 @@ namespace boost { namespace fusion { template struct front_extended_deque - : detail::keyed_element, - sequence_base > + : detail::keyed_element + , sequence_base > { typedef detail::keyed_element base; typedef mpl::int_<(Deque::next_down::value - 1)> next_down;