diff --git a/include/boost/fusion/container/deque/convert.hpp b/include/boost/fusion/container/deque/convert.hpp index f8b6097a..1910cb84 100644 --- a/include/boost/fusion/container/deque/convert.hpp +++ b/include/boost/fusion/container/deque/convert.hpp @@ -21,7 +21,9 @@ namespace boost { namespace fusion template struct as_deque { - typedef typename detail::as_deque::value> gen; + typedef typename + detail::as_deque::value> + gen; typedef typename gen:: template apply::type>::type type; diff --git a/include/boost/fusion/container/deque/cpp03_deque.hpp b/include/boost/fusion/container/deque/cpp03_deque.hpp index c7805764..d3eaa7cd 100644 --- a/include/boost/fusion/container/deque/cpp03_deque.hpp +++ b/include/boost/fusion/container/deque/cpp03_deque.hpp @@ -8,6 +8,10 @@ #if !defined(BOOST_CPP03_FUSION_DEQUE_26112006_1649) #define BOOST_CPP03_FUSION_DEQUE_26112006_1649 +#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + #include #include #include diff --git a/include/boost/fusion/container/deque/cpp03_deque_fwd.hpp b/include/boost/fusion/container/deque/cpp03_deque_fwd.hpp index 90897718..3a74447b 100644 --- a/include/boost/fusion/container/deque/cpp03_deque_fwd.hpp +++ b/include/boost/fusion/container/deque/cpp03_deque_fwd.hpp @@ -8,6 +8,10 @@ #if !defined(FUSION_CPP03_DEQUE_FORWARD_02092007_0749) #define FUSION_CPP03_DEQUE_FORWARD_02092007_0749 +#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + #include #include diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index 131cb026..0a3353b7 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -15,6 +15,9 @@ || defined(BOOST_NO_RVALUE_REFERENCES)) # include #else +# if !defined(BOOST_FUSION_HAS_CPP11_DEQUE) +# define BOOST_FUSION_HAS_CPP11_DEQUE +# endif # include #endif diff --git a/include/boost/fusion/container/deque/deque_fwd.hpp b/include/boost/fusion/container/deque/deque_fwd.hpp index 1da01353..d1696936 100644 --- a/include/boost/fusion/container/deque/deque_fwd.hpp +++ b/include/boost/fusion/container/deque/deque_fwd.hpp @@ -15,6 +15,9 @@ || defined(BOOST_NO_RVALUE_REFERENCES)) # include #else +# if !defined(BOOST_FUSION_HAS_CPP11_DEQUE) +# define BOOST_FUSION_HAS_CPP11_DEQUE +# endif # include #endif diff --git a/include/boost/fusion/container/deque/detail/at_impl.hpp b/include/boost/fusion/container/deque/detail/at_impl.hpp index bf5f91a1..0684dcf1 100644 --- a/include/boost/fusion/container/deque/detail/at_impl.hpp +++ b/include/boost/fusion/container/deque/detail/at_impl.hpp @@ -19,8 +19,8 @@ #include #include -namespace boost { namespace fusion { - +namespace boost { namespace fusion +{ struct deque_tag; namespace extension @@ -44,11 +44,14 @@ namespace boost { namespace fusion { detail::keyed_element_value_at::type element_type; - typedef typename add_reference< - typename mpl::eval_if< - is_const, - add_const, - mpl::identity >::type>::type type; + typedef typename + add_reference< + typename mpl::eval_if< + is_const, + add_const, + mpl::identity >::type + >::type + type; static type call(Sequence& seq) { diff --git a/include/boost/fusion/container/deque/detail/begin_impl.hpp b/include/boost/fusion/container/deque/detail/begin_impl.hpp index b904b6c5..1447868a 100644 --- a/include/boost/fusion/container/deque/detail/begin_impl.hpp +++ b/include/boost/fusion/container/deque/detail/begin_impl.hpp @@ -13,8 +13,8 @@ #include #include -namespace boost { namespace fusion { - +namespace boost { namespace fusion +{ struct deque_tag; namespace extension diff --git a/include/boost/fusion/container/deque/detail/convert_impl.hpp b/include/boost/fusion/container/deque/detail/convert_impl.hpp index c417b81c..1401ef1a 100644 --- a/include/boost/fusion/container/deque/detail/convert_impl.hpp +++ b/include/boost/fusion/container/deque/detail/convert_impl.hpp @@ -28,7 +28,7 @@ namespace boost { namespace fusion template struct apply { - typedef typename detail::as_deque::value> gen; + typedef detail::as_deque::value> gen; typedef typename gen:: template apply::type>::type type; diff --git a/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp b/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp index 03b81d7a..b76916eb 100644 --- a/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp +++ b/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp @@ -2,13 +2,17 @@ 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_PP_IS_ITERATING) #if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_FORWARD_CTOR_04122006_2212) #define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_FORWARD_CTOR_04122006_2212 +#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + #include #include #include diff --git a/include/boost/fusion/container/deque/detail/deque_initial_size.hpp b/include/boost/fusion/container/deque/detail/deque_initial_size.hpp index 6a49b9bb..edb3c176 100644 --- a/include/boost/fusion/container/deque/detail/deque_initial_size.hpp +++ b/include/boost/fusion/container/deque/detail/deque_initial_size.hpp @@ -8,6 +8,10 @@ #if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_INITIAL_SIZE_26112006_2139) #define BOOST_FUSION_DEQUE_DETAIL_DEQUE_INITIAL_SIZE_26112006_2139 +#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + #include #include #include diff --git a/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp index 079f4b4d..2fee4700 100644 --- a/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp @@ -8,6 +8,10 @@ #if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330) #define BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330 +#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + #include #include diff --git a/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp b/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp index f9049509..f95960bc 100644 --- a/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp +++ b/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp @@ -9,6 +9,10 @@ #if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211) #define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211 +#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + #include #include #include diff --git a/include/boost/fusion/container/deque/detail/end_impl.hpp b/include/boost/fusion/container/deque/detail/end_impl.hpp index 104cda64..8037689a 100644 --- a/include/boost/fusion/container/deque/detail/end_impl.hpp +++ b/include/boost/fusion/container/deque/detail/end_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_END_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 end_impl; - + template<> struct end_impl { template struct apply { - typedef typename mpl::if_< - mpl::equal_to, - deque_iterator, - deque_iterator< - Sequence, Sequence::next_up::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/is_sequence_impl.hpp b/include/boost/fusion/container/deque/detail/is_sequence_impl.hpp index ff88ed6f..b4718be4 100644 --- a/include/boost/fusion/container/deque/detail/is_sequence_impl.hpp +++ b/include/boost/fusion/container/deque/detail/is_sequence_impl.hpp @@ -1,7 +1,7 @@ /*============================================================================= Copyright (c) 2010 Christopher Schmidt - 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) ==============================================================================*/ @@ -14,18 +14,16 @@ namespace boost { namespace fusion { struct deque_tag; - namespace extension + namespace extension { template struct is_sequence_impl; - + template<> struct is_sequence_impl { template - struct apply - : mpl::true_ - {}; + struct apply : mpl::true_ {}; }; } }} diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp index c080fe99..e158096b 100644 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -14,12 +14,13 @@ #include #include -namespace boost { namespace fusion { - +namespace boost { namespace fusion +{ struct fusion_sequence_tag; +}} -namespace detail { - +namespace boost { namespace fusion { namespace detail +{ struct nil_keyed_element { typedef fusion_sequence_tag tag; @@ -33,15 +34,18 @@ namespace detail { } }; - template - struct keyed_element - : Rest + template + struct keyed_element : Rest { typedef Rest base; typedef fusion_sequence_tag tag; + typedef typename + add_reference::type>::type + const_value_type; + typedef typename add_reference::type value_type; using Rest::get; - template + template static keyed_element from_iterator(It const& it) { @@ -51,7 +55,7 @@ namespace detail { template keyed_element(keyed_element const& rhs) - : Rest(rhs.get_base()), value_(rhs.value_) + : Rest(rhs.get_base()), value_(rhs.value_) {} Rest const get_base() const @@ -59,17 +63,17 @@ namespace detail { return *this; } - typename add_reference::type>::type get(Key) const + const_value_type get(Key) const { return value_; } - typename add_reference::type get(Key) + value_type get(Key) { return value_; } - keyed_element(typename add_reference::type>::type value, Rest const& rest) + keyed_element(const_value_type value, Rest const& rest) : Rest(rest), value_(value) {} @@ -97,7 +101,7 @@ namespace detail { template struct keyed_element_value_at - : keyed_element_value_at + : keyed_element_value_at {}; template @@ -105,7 +109,6 @@ namespace detail { { typedef Value type; }; - }}} #endif 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 cfc88ba7..cba31a3e 100644 --- a/include/boost/fusion/container/deque/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/deque/detail/value_at_impl.hpp @@ -13,8 +13,8 @@ #include #include -namespace boost { namespace fusion { - +namespace boost { namespace fusion +{ struct deque_tag; namespace extension