diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index e826394f..56ae290e 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -11,24 +11,23 @@ #include /////////////////////////////////////////////////////////////////////////////// -// With no decltype and variadics, we will use the C++03 version +// With variadics, we will use the PP version version /////////////////////////////////////////////////////////////////////////////// -#if (defined(BOOST_NO_DECLTYPE) \ - || defined(BOOST_NO_VARIADIC_TEMPLATES) \ - || defined(BOOST_NO_RVALUE_REFERENCES)) -# include +#if defined(BOOST_NO_VARIADIC_TEMPLATES) +# include #else -# if !defined(BOOST_FUSION_HAS_CPP11_DEQUE) -# define BOOST_FUSION_HAS_CPP11_DEQUE +# if !defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) +# define BOOST_FUSION_HAS_VARIADIC_DEQUE # endif /////////////////////////////////////////////////////////////////////////////// -// C++11 interface +// C++11 variadic interface /////////////////////////////////////////////////////////////////////////////// #include #include +#include #include -#include +#include #include #include #include @@ -36,8 +35,10 @@ #include #include #include +#include #include +#include #include #include @@ -48,6 +49,22 @@ namespace boost { namespace fusion template struct deque : detail::nil_keyed_element { + typedef deque_tag fusion_tag; + typedef bidirectional_traversal_tag category; + typedef mpl::int_<0> size; + typedef mpl::int_<0> next_up; + typedef mpl::int_<0> next_down; + typedef mpl::false_ is_view; + + template + deque(Sequence const&, + typename enable_if< + mpl::and_< + traits::is_sequence + , result_of::empty>>::type* /*dummy*/ = 0) + {} + + deque() {} }; template @@ -60,7 +77,7 @@ namespace boost { namespace fusion typedef typename detail::deque_keyed_values::type base; typedef mpl::int_<(sizeof ...(Tail) + 1)> size; typedef mpl::int_ next_up; - typedef mpl::int_::type::value> next_down; + typedef mpl::int_<((size::value == 0) ? 0 : -1)> next_down; typedef mpl::false_ is_view; deque() diff --git a/include/boost/fusion/container/deque/deque_fwd.hpp b/include/boost/fusion/container/deque/deque_fwd.hpp index 19ca8f8f..fc1f9cbd 100644 --- a/include/boost/fusion/container/deque/deque_fwd.hpp +++ b/include/boost/fusion/container/deque/deque_fwd.hpp @@ -16,10 +16,10 @@ #if (defined(BOOST_NO_DECLTYPE) \ || defined(BOOST_NO_VARIADIC_TEMPLATES) \ || defined(BOOST_NO_RVALUE_REFERENCES)) -# include +# include #else -# if !defined(BOOST_FUSION_HAS_CPP11_DEQUE) -# define BOOST_FUSION_HAS_CPP11_DEQUE +# if !defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) +# define BOOST_FUSION_HAS_VARIADIC_DEQUE # endif /////////////////////////////////////////////////////////////////////////////// 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 09d10223..44d279f6 100644 --- a/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp +++ b/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp @@ -9,7 +9,7 @@ #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) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif 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 edb3c176..21075ef4 100644 --- a/include/boost/fusion/container/deque/detail/deque_initial_size.hpp +++ b/include/boost/fusion/container/deque/detail/deque_initial_size.hpp @@ -8,7 +8,7 @@ #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) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif 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 eea7e8c3..d457516f 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,7 +9,7 @@ #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) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque.hpp b/include/boost/fusion/container/deque/detail/pp_deque.hpp similarity index 96% rename from include/boost/fusion/container/deque/detail/cpp03_deque.hpp rename to include/boost/fusion/container/deque/detail/pp_deque.hpp index dcc1e3c3..7913b67b 100644 --- a/include/boost/fusion/container/deque/detail/cpp03_deque.hpp +++ b/include/boost/fusion/container/deque/detail/pp_deque.hpp @@ -5,17 +5,17 @@ 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_CPP03_FUSION_DEQUE_26112006_1649) -#define BOOST_CPP03_FUSION_DEQUE_26112006_1649 +#if !defined(BOOST_PP_FUSION_DEQUE_26112006_1649) +#define BOOST_PP_FUSION_DEQUE_26112006_1649 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif #include #include #include -#include +#include #include #include #include diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp b/include/boost/fusion/container/deque/detail/pp_deque_fwd.hpp similarity index 92% rename from include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp rename to include/boost/fusion/container/deque/detail/pp_deque_fwd.hpp index 3a74447b..354cfccd 100644 --- a/include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp +++ b/include/boost/fusion/container/deque/detail/pp_deque_fwd.hpp @@ -5,10 +5,10 @@ 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(FUSION_CPP03_DEQUE_FORWARD_02092007_0749) -#define FUSION_CPP03_DEQUE_FORWARD_02092007_0749 +#if !defined(FUSION_PP_DEQUE_FORWARD_02092007_0749) +#define FUSION_PP_DEQUE_FORWARD_02092007_0749 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/pp_deque_keyed_values.hpp similarity index 98% rename from include/boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp rename to include/boost/fusion/container/deque/detail/pp_deque_keyed_values.hpp index d32c13a5..a7c4939a 100644 --- a/include/boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/pp_deque_keyed_values.hpp @@ -8,7 +8,7 @@ #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) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif diff --git a/include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/variadic_deque_keyed_values.hpp similarity index 100% rename from include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp rename to include/boost/fusion/container/deque/detail/variadic_deque_keyed_values.hpp diff --git a/include/boost/fusion/container/deque/limits.hpp b/include/boost/fusion/container/deque/limits.hpp index 2a7d219d..7892ba1a 100644 --- a/include/boost/fusion/container/deque/limits.hpp +++ b/include/boost/fusion/container/deque/limits.hpp @@ -8,7 +8,7 @@ #if !defined(BOOST_FUSION_DEQUE_LIMITS_26112006_1737) #define BOOST_FUSION_DEQUE_LIMITS_26112006_1737 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif