From 93477e270e77bc4290220ddb8179d4d5968f8f3e Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Thu, 26 Apr 2012 00:18:51 +0000 Subject: [PATCH] Merging 77932-78199 from trunk [SVN r78200] --- .../adapted/std_tuple/detail/at_impl.hpp | 10 +- .../adapted/std_tuple/std_tuple_iterator.hpp | 10 +- .../boost/fusion/adapted/std_tuple/tag_of.hpp | 6 - .../boost/fusion/container/deque/deque.hpp | 111 ++++++++-------- .../fusion/container/deque/deque_fwd.hpp | 36 ++--- .../container/deque/detail/cpp03_deque.hpp | 125 ++++++++++++++++++ .../deque/detail/cpp03_deque_fwd.hpp | 54 ++++++++ .../container/deque/detail/keyed_element.hpp | 10 +- .../fusion/container/list/detail/at_impl.hpp | 12 +- .../fusion/container/map/detail/at_impl.hpp | 8 +- .../container/map/detail/deref_data_impl.hpp | 9 +- .../container/vector/detail/at_impl.hpp | 4 +- .../container/vector/detail/deref_impl.hpp | 9 +- .../boost/fusion/support/detail/access.hpp | 4 +- 14 files changed, 281 insertions(+), 127 deletions(-) create mode 100644 include/boost/fusion/container/deque/detail/cpp03_deque.hpp create mode 100644 include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp diff --git a/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp index 2f09719c..400f366e 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -29,13 +29,13 @@ namespace boost { namespace fusion struct apply { typedef typename remove_const::type seq_type; - typedef std::tuple_element element; + typedef typename std::tuple_element::type element; typedef typename - mpl::eval_if< + mpl::if_< is_const - , fusion::detail::cref_result - , fusion::detail::ref_result + , typename fusion::detail::cref_result::type + , typename fusion::detail::ref_result::type >::type type; diff --git a/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp b/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp index 4998e21d..082018a4 100644 --- a/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp +++ b/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -48,12 +48,12 @@ namespace boost { namespace fusion template struct deref { - typedef value_of element; + typedef typename value_of::type element; typedef typename - mpl::eval_if< + mpl::if_< is_const - , fusion::detail::cref_result - , fusion::detail::ref_result + , typename fusion::detail::cref_result::type + , typename fusion::detail::ref_result::type >::type type; diff --git a/include/boost/fusion/adapted/std_tuple/tag_of.hpp b/include/boost/fusion/adapted/std_tuple/tag_of.hpp index 10e2e181..6d7b4d6f 100644 --- a/include/boost/fusion/adapted/std_tuple/tag_of.hpp +++ b/include/boost/fusion/adapted/std_tuple/tag_of.hpp @@ -10,12 +10,6 @@ #include #include -namespace std -{ - template - class tuple; -} - namespace boost { namespace fusion { struct std_tuple_tag; diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index 97238f4a..85b64b4a 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -22,6 +22,25 @@ #include #include +/////////////////////////////////////////////////////////////////////////////// +// 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 +#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 +#include +#include +#include #include #include #include @@ -29,93 +48,67 @@ #include #include #include -#include -#include -#include +#include #include +#include -#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) -#include -#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 - struct deque - : - detail::deque_keyed_values::type, - sequence_base > + template + struct deque : detail::nil_keyed_element + { + }; + + template + struct deque + : detail::deque_keyed_values::type + , sequence_base> { typedef deque_tag fusion_tag; typedef bidirectional_traversal_tag category; - typedef typename detail::deque_keyed_values::type base; - typedef typename detail::deque_initial_size::type size; + typedef typename detail::deque_keyed_values::type base; + typedef mpl::int_<(sizeof ...(Tail) + 1)> size; typedef mpl::int_ next_up; - typedef mpl::int_< - mpl::if_ >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down; + typedef mpl::int_::type::value> next_down; typedef mpl::false_ is_view; -#include - deque() - {} + {} - explicit deque(typename add_reference::type>::type t0) - : base(t0, detail::nil_keyed_element()) - {} + template + deque(deque const& seq) + : base(seq) + {} - template - deque(deque const& seq) - : base(seq) - {} + explicit deque(typename detail::call_param::type head + , typename detail::call_param::type... tail) + : base(detail::deque_keyed_values::call(head, tail...)) + {} - template - deque(Sequence const& seq, typename disable_if >::type* /*dummy*/ = 0) - : base(base::from_iterator(fusion::begin(seq))) - {} + template + explicit deque(Sequence const& seq + , typename disable_if >::type* /*dummy*/ = 0) + : base(base::from_iterator(fusion::begin(seq))) + {} - template - deque& - operator=(deque const& rhs) + template + deque& operator=(deque const& rhs) { base::operator=(rhs); return *this; } template - 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 diff --git a/include/boost/fusion/container/deque/deque_fwd.hpp b/include/boost/fusion/container/deque/deque_fwd.hpp index 7f9a1f9b..858b55bd 100644 --- a/include/boost/fusion/container/deque/deque_fwd.hpp +++ b/include/boost/fusion/container/deque/deque_fwd.hpp @@ -11,40 +11,26 @@ #include #include -#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) -#include +/////////////////////////////////////////////////////////////////////////////// +// 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 #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 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 diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque.hpp b/include/boost/fusion/container/deque/detail/cpp03_deque.hpp new file mode 100644 index 00000000..5804d890 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/cpp03_deque.hpp @@ -0,0 +1,125 @@ +/*============================================================================= + Copyright (c) 2005-2012 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + 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_FUSION_HAS_CPP11_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#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 { + + struct deque_tag; + + template + struct deque + : + detail::deque_keyed_values::type, + sequence_base > + { + typedef deque_tag fusion_tag; + typedef bidirectional_traversal_tag category; + typedef typename detail::deque_keyed_values::type base; + typedef typename detail::deque_initial_size::type size; + typedef mpl::int_ next_up; + typedef mpl::int_< + mpl::if_ >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down; + typedef mpl::false_ is_view; + +#include + + deque() + {} + + explicit deque(typename add_reference::type>::type t0) + : base(t0, detail::nil_keyed_element()) + {} + + template + deque(deque const& seq) + : base(seq) + {} + + template + deque(Sequence const& seq, typename disable_if >::type* /*dummy*/ = 0) + : base(base::from_iterator(fusion::begin(seq))) + {} + + template + deque& + operator=(deque const& rhs) + { + base::operator=(rhs); + return *this; + } + + template + 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 diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp b/include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp new file mode 100644 index 00000000..3a74447b --- /dev/null +++ b/include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2005-2012 Joel de Guzman + Copyright (c) 2005-2007 Dan Marsden + + 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(BOOST_FUSION_HAS_CPP11_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + +#include +#include + +#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#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 + +namespace boost { namespace fusion +{ + struct void_; + + template< + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_DEQUE_SIZE, typename T, void_)> + 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 diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp index 1b5e3468..ff6f19a7 100644 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -8,9 +8,7 @@ #if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330) #define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330 -#include -#include - +#include #include #include @@ -59,17 +57,17 @@ namespace detail { return *this; } - typename add_reference::type>::type get(Key) const + typename cref_result::type get(Key) const { return value_; } - typename add_reference::type get(Key) + typename ref_result::type get(Key) { return value_; } - keyed_element(typename add_reference::type>::type value, Rest const& rest) + keyed_element(typename call_param::type value, Rest const& rest) : Rest(rest), value_(value) {} diff --git a/include/boost/fusion/container/list/detail/at_impl.hpp b/include/boost/fusion/container/list/detail/at_impl.hpp index 145f8aa5..75746392 100644 --- a/include/boost/fusion/container/list/detail/at_impl.hpp +++ b/include/boost/fusion/container/list/detail/at_impl.hpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include namespace boost { namespace fusion @@ -93,15 +93,15 @@ namespace boost { namespace fusion template struct apply { - typedef detail::cons_deref< - typename detail::cons_advance::type> + typedef typename detail::cons_deref< + typename detail::cons_advance::type>::type element; typedef typename - mpl::eval_if< + mpl::if_< is_const - , detail::cref_result - , detail::ref_result + , typename detail::cref_result::type + , typename detail::ref_result::type >::type type; diff --git a/include/boost/fusion/container/map/detail/at_impl.hpp b/include/boost/fusion/container/map/detail/at_impl.hpp index f871bee0..bc51e815 100644 --- a/include/boost/fusion/container/map/detail/at_impl.hpp +++ b/include/boost/fusion/container/map/detail/at_impl.hpp @@ -28,7 +28,9 @@ namespace boost { namespace fusion template struct apply { - typedef mpl::at element; + typedef typename + mpl::at::type + element; typedef typename detail::ref_result::type type; static type @@ -41,7 +43,9 @@ namespace boost { namespace fusion template struct apply { - typedef mpl::at element; + typedef typename + mpl::at::type + element; typedef typename detail::cref_result::type type; static type diff --git a/include/boost/fusion/container/map/detail/deref_data_impl.hpp b/include/boost/fusion/container/map/detail/deref_data_impl.hpp index 07087a39..8304c898 100644 --- a/include/boost/fusion/container/map/detail/deref_data_impl.hpp +++ b/include/boost/fusion/container/map/detail/deref_data_impl.hpp @@ -12,8 +12,7 @@ #include #include #include -#include -#include +#include namespace boost { namespace fusion { namespace extension { @@ -29,10 +28,10 @@ namespace boost { namespace fusion { namespace extension typedef typename result_of::value_of::type::second_type data; typedef typename - mpl::eval_if< + mpl::if_< is_const - , detail::cref_result > - , detail::ref_result > + , typename detail::cref_result::type + , typename detail::ref_result::type >::type type; diff --git a/include/boost/fusion/container/vector/detail/at_impl.hpp b/include/boost/fusion/container/vector/detail/at_impl.hpp index 0a006dc3..0017d9c8 100644 --- a/include/boost/fusion/container/vector/detail/at_impl.hpp +++ b/include/boost/fusion/container/vector/detail/at_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion template struct apply { - typedef mpl::at element; + typedef typename mpl::at::type element; typedef typename detail::ref_result::type type; static type @@ -40,7 +40,7 @@ namespace boost { namespace fusion template struct apply { - typedef mpl::at element; + typedef typename mpl::at::type element; typedef typename detail::cref_result::type type; static type diff --git a/include/boost/fusion/container/vector/detail/deref_impl.hpp b/include/boost/fusion/container/vector/detail/deref_impl.hpp index 1d9ac4a8..8c5fb942 100644 --- a/include/boost/fusion/container/vector/detail/deref_impl.hpp +++ b/include/boost/fusion/container/vector/detail/deref_impl.hpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace boost { namespace fusion { @@ -29,14 +30,14 @@ namespace boost { namespace fusion 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 - , fusion::detail::cref_result - , fusion::detail::ref_result + , typename fusion::detail::cref_result::type + , typename fusion::detail::ref_result::type >::type type; diff --git a/include/boost/fusion/support/detail/access.hpp b/include/boost/fusion/support/detail/access.hpp index 03c9c319..ced7cea1 100644 --- a/include/boost/fusion/support/detail/access.hpp +++ b/include/boost/fusion/support/detail/access.hpp @@ -15,7 +15,7 @@ namespace boost { namespace fusion { namespace detail template struct ref_result { - typedef typename add_reference::type type; + typedef typename add_reference::type type; }; template @@ -23,7 +23,7 @@ namespace boost { namespace fusion { namespace detail { typedef typename add_reference< - typename add_const::type + typename add_const::type >::type type; };