From 9a8955fbe10560a8c4253f8bbad5db2bb4eb030f Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Fri, 16 Dec 2011 02:14:17 +0000 Subject: [PATCH] Merge from trunk [SVN r75980] --- .../algorithm/transformation/pop_back.hpp | 2 +- include/boost/fusion/container/list/cons.hpp | 4 +- .../fusion/container/map/detail/at_impl.hpp | 57 +++++++++++++++++++ .../map/detail/preprocessed/map10.hpp | 2 +- .../map/detail/preprocessed/map20.hpp | 2 +- .../map/detail/preprocessed/map30.hpp | 2 +- .../map/detail/preprocessed/map40.hpp | 2 +- .../map/detail/preprocessed/map50.hpp | 2 +- .../container/map/detail/value_at_impl.hpp | 34 +++++++++++ include/boost/fusion/container/map/map.hpp | 4 +- .../vector/detail/preprocessed/vector10.hpp | 22 +++---- .../vector/detail/preprocessed/vector20.hpp | 20 +++---- .../vector/detail/preprocessed/vector30.hpp | 20 +++---- .../vector/detail/preprocessed/vector40.hpp | 20 +++---- .../vector/detail/preprocessed/vector50.hpp | 20 +++---- .../vector/detail/preprocessed/vvector10.hpp | 3 +- .../vector/detail/preprocessed/vvector20.hpp | 3 +- .../vector/detail/preprocessed/vvector30.hpp | 3 +- .../vector/detail/preprocessed/vvector40.hpp | 3 +- .../vector/detail/preprocessed/vvector50.hpp | 3 +- .../container/vector/detail/vector_n.hpp | 4 +- .../boost/fusion/container/vector/vector.hpp | 54 +++++++++++------- include/boost/fusion/iterator/equal_to.hpp | 4 +- .../fusion/sequence/comparison/equal_to.hpp | 2 +- .../fusion/sequence/comparison/greater.hpp | 2 +- .../sequence/comparison/greater_equal.hpp | 2 +- .../boost/fusion/sequence/comparison/less.hpp | 2 +- .../fusion/sequence/comparison/less_equal.hpp | 2 +- .../sequence/comparison/not_equal_to.hpp | 2 +- include/boost/fusion/sequence/io/in.hpp | 2 +- include/boost/fusion/sequence/io/out.hpp | 2 +- .../boost/fusion/support/deduce_sequence.hpp | 8 +++ include/boost/fusion/support/tag_of.hpp | 31 +++++----- include/boost/fusion/support/tag_of_fwd.hpp | 3 - .../view/detail/strictest_traversal.hpp | 8 +++ .../fusion/view/nview/detail/nview_impl.hpp | 4 +- include/boost/fusion/view/nview/nview.hpp | 11 ++++ .../fusion/view/zip_view/detail/end_impl.hpp | 2 +- .../view/zip_view/detail/value_at_impl.hpp | 8 +++ .../view/zip_view/detail/value_of_impl.hpp | 8 +++ .../boost/fusion/view/zip_view/zip_view.hpp | 16 ++++++ 41 files changed, 287 insertions(+), 118 deletions(-) create mode 100644 include/boost/fusion/container/map/detail/at_impl.hpp create mode 100644 include/boost/fusion/container/map/detail/value_at_impl.hpp diff --git a/include/boost/fusion/algorithm/transformation/pop_back.hpp b/include/boost/fusion/algorithm/transformation/pop_back.hpp index ba68cd92..6059c555 100644 --- a/include/boost/fusion/algorithm/transformation/pop_back.hpp +++ b/include/boost/fusion/algorithm/transformation/pop_back.hpp @@ -96,7 +96,7 @@ namespace boost { namespace fusion { return type(fusion::prior(i.iterator_base)); } - }; + }; template struct prior_impl diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index e434d5c7..666b5367 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -88,7 +88,7 @@ namespace boost { namespace fusion template cons( Sequence const& seq - , typename disable_if< + , typename boost::disable_if< mpl::or_< is_convertible // use copy ctor instead , is_convertible // use copy to car instead @@ -119,7 +119,7 @@ namespace boost { namespace fusion } template - typename disable_if, cons&>::type + typename boost::disable_if, cons&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type Iterator; diff --git a/include/boost/fusion/container/map/detail/at_impl.hpp b/include/boost/fusion/container/map/detail/at_impl.hpp new file mode 100644 index 00000000..f871bee0 --- /dev/null +++ b/include/boost/fusion/container/map/detail/at_impl.hpp @@ -0,0 +1,57 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Brandon Kohn + + 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_MAP_DETAIL_AT_IMPL_HPP) +#define BOOST_FUSION_MAP_DETAIL_AT_IMPL_HPP + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct map_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef mpl::at element; + typedef typename detail::ref_result::type type; + + static type + call(Sequence& m) + { + return m.get_data().at_impl(N()); + } + }; + + template + struct apply + { + typedef mpl::at element; + typedef typename detail::cref_result::type type; + + static type + call(Sequence const& m) + { + return m.get_data().at_impl(N()); + } + }; + }; + } +}} + +#endif //BOOST_FUSION_MAP_DETAIL_AT_IMPL_HPP diff --git a/include/boost/fusion/container/map/detail/preprocessed/map10.hpp b/include/boost/fusion/container/map/detail/preprocessed/map10.hpp index cae643d8..fdf28eb2 100644 --- a/include/boost/fusion/container/map/detail/preprocessed/map10.hpp +++ b/include/boost/fusion/container/map/detail/preprocessed/map10.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion template struct map : sequence_base > { - struct category : forward_traversal_tag, associative_tag {}; + struct category : random_access_traversal_tag, associative_tag {}; typedef map_tag fusion_tag; typedef fusion_sequence_tag tag; typedef mpl::false_ is_view; diff --git a/include/boost/fusion/container/map/detail/preprocessed/map20.hpp b/include/boost/fusion/container/map/detail/preprocessed/map20.hpp index 01105265..33cd2e59 100644 --- a/include/boost/fusion/container/map/detail/preprocessed/map20.hpp +++ b/include/boost/fusion/container/map/detail/preprocessed/map20.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion template struct map : sequence_base > { - struct category : forward_traversal_tag, associative_tag {}; + struct category : random_access_traversal_tag, associative_tag {}; typedef map_tag fusion_tag; typedef fusion_sequence_tag tag; typedef mpl::false_ is_view; diff --git a/include/boost/fusion/container/map/detail/preprocessed/map30.hpp b/include/boost/fusion/container/map/detail/preprocessed/map30.hpp index ede29720..54f492d0 100644 --- a/include/boost/fusion/container/map/detail/preprocessed/map30.hpp +++ b/include/boost/fusion/container/map/detail/preprocessed/map30.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion template struct map : sequence_base > { - struct category : forward_traversal_tag, associative_tag {}; + struct category : random_access_traversal_tag, associative_tag {}; typedef map_tag fusion_tag; typedef fusion_sequence_tag tag; typedef mpl::false_ is_view; diff --git a/include/boost/fusion/container/map/detail/preprocessed/map40.hpp b/include/boost/fusion/container/map/detail/preprocessed/map40.hpp index 6a75d2c6..7060a670 100644 --- a/include/boost/fusion/container/map/detail/preprocessed/map40.hpp +++ b/include/boost/fusion/container/map/detail/preprocessed/map40.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion template struct map : sequence_base > { - struct category : forward_traversal_tag, associative_tag {}; + struct category : random_access_traversal_tag, associative_tag {}; typedef map_tag fusion_tag; typedef fusion_sequence_tag tag; typedef mpl::false_ is_view; diff --git a/include/boost/fusion/container/map/detail/preprocessed/map50.hpp b/include/boost/fusion/container/map/detail/preprocessed/map50.hpp index f9c36302..1da73641 100644 --- a/include/boost/fusion/container/map/detail/preprocessed/map50.hpp +++ b/include/boost/fusion/container/map/detail/preprocessed/map50.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion template struct map : sequence_base > { - struct category : forward_traversal_tag, associative_tag {}; + struct category : random_access_traversal_tag, associative_tag {}; typedef map_tag fusion_tag; typedef fusion_sequence_tag tag; typedef mpl::false_ is_view; diff --git a/include/boost/fusion/container/map/detail/value_at_impl.hpp b/include/boost/fusion/container/map/detail/value_at_impl.hpp new file mode 100644 index 00000000..31d9b383 --- /dev/null +++ b/include/boost/fusion/container/map/detail/value_at_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Brandon Kohn + + 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_MAP_DETAIL_VALUE_AT_IMPL_HPP) +#define BOOST_FUSION_MAP_DETAIL_VALUE_AT_IMPL_HPP + +#include + +namespace boost { namespace fusion +{ + struct map_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename mpl::at::type type; + }; + }; + } +}} + +#endif //BOOST_FUSION_MAP_DETAIL_VALUE_AT_IMPL_HPP diff --git a/include/boost/fusion/container/map/map.hpp b/include/boost/fusion/container/map/map.hpp index d61df914..5152e6e1 100644 --- a/include/boost/fusion/container/map/map.hpp +++ b/include/boost/fusion/container/map/map.hpp @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include @@ -50,7 +52,7 @@ namespace boost { namespace fusion template struct map : sequence_base > { - struct category : forward_traversal_tag, associative_tag {}; + struct category : random_access_traversal_tag, associative_tag {}; typedef map_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vector10.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vector10.hpp index 841eae19..d6258f60 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vector10.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vector10.hpp @@ -61,7 +61,7 @@ namespace boost { namespace fusion template vector1( Sequence const& seq - , typename disable_if >::type* = 0 + , typename boost::disable_if >::type* = 0 ) : base_type(base_type::init_from_sequence(seq)) {} template @@ -72,7 +72,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -157,7 +157,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -242,7 +242,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -327,7 +327,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -412,7 +412,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -497,7 +497,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -582,7 +582,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -667,7 +667,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -752,7 +752,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -837,7 +837,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vector20.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vector20.hpp index 94b82e20..a409b2e7 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vector20.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vector20.hpp @@ -73,7 +73,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -158,7 +158,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -243,7 +243,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -328,7 +328,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -413,7 +413,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -498,7 +498,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -583,7 +583,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -668,7 +668,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -753,7 +753,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -838,7 +838,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vector30.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vector30.hpp index 78ab3737..032ff9d2 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vector30.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vector30.hpp @@ -73,7 +73,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -158,7 +158,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -243,7 +243,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -328,7 +328,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -413,7 +413,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -498,7 +498,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -583,7 +583,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -668,7 +668,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -753,7 +753,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -838,7 +838,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vector40.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vector40.hpp index fb42550b..1b5fa58d 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vector40.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vector40.hpp @@ -73,7 +73,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -158,7 +158,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -243,7 +243,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -328,7 +328,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -413,7 +413,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -498,7 +498,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -583,7 +583,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -668,7 +668,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -753,7 +753,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -838,7 +838,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vector50.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vector50.hpp index 82f26096..ba6c1771 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vector50.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vector50.hpp @@ -73,7 +73,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -158,7 +158,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -243,7 +243,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -328,7 +328,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -413,7 +413,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -498,7 +498,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -583,7 +583,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -668,7 +668,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -753,7 +753,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; @@ -838,7 +838,7 @@ namespace boost { namespace fusion return *this; } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vvector10.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vvector10.hpp index a566278a..8e6f1f68 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vvector10.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vvector10.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion : vec(rhs.vec) {} template vector(Sequence const& rhs) - : vec(rhs) {} + : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} @@ -116,6 +116,7 @@ namespace boost { namespace fusion return vec.at_impl(mpl::int_()); } private: + BOOST_FUSION_VECTOR_CTOR_HELPER() vector_n vec; }; }} diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vvector20.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vvector20.hpp index 378ea978..bc04fefe 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vvector20.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vvector20.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion : vec(rhs.vec) {} template vector(Sequence const& rhs) - : vec(rhs) {} + : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} @@ -136,6 +136,7 @@ namespace boost { namespace fusion return vec.at_impl(mpl::int_()); } private: + BOOST_FUSION_VECTOR_CTOR_HELPER() vector_n vec; }; }} diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vvector30.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vvector30.hpp index f49d3ef2..0841920a 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vvector30.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vvector30.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion : vec(rhs.vec) {} template vector(Sequence const& rhs) - : vec(rhs) {} + : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} @@ -156,6 +156,7 @@ namespace boost { namespace fusion return vec.at_impl(mpl::int_()); } private: + BOOST_FUSION_VECTOR_CTOR_HELPER() vector_n vec; }; }} diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vvector40.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vvector40.hpp index c683cba6..11d9cc7d 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vvector40.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vvector40.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion : vec(rhs.vec) {} template vector(Sequence const& rhs) - : vec(rhs) {} + : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} @@ -176,6 +176,7 @@ namespace boost { namespace fusion return vec.at_impl(mpl::int_()); } private: + BOOST_FUSION_VECTOR_CTOR_HELPER() vector_n vec; }; }} diff --git a/include/boost/fusion/container/vector/detail/preprocessed/vvector50.hpp b/include/boost/fusion/container/vector/detail/preprocessed/vvector50.hpp index 316f9d27..1ac6c6f4 100644 --- a/include/boost/fusion/container/vector/detail/preprocessed/vvector50.hpp +++ b/include/boost/fusion/container/vector/detail/preprocessed/vvector50.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion : vec(rhs.vec) {} template vector(Sequence const& rhs) - : vec(rhs) {} + : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} @@ -196,6 +196,7 @@ namespace boost { namespace fusion return vec.at_impl(mpl::int_()); } private: + BOOST_FUSION_VECTOR_CTOR_HELPER() vector_n vec; }; }} diff --git a/include/boost/fusion/container/vector/detail/vector_n.hpp b/include/boost/fusion/container/vector/detail/vector_n.hpp index 274c33e8..431774b3 100644 --- a/include/boost/fusion/container/vector/detail/vector_n.hpp +++ b/include/boost/fusion/container/vector/detail/vector_n.hpp @@ -104,7 +104,7 @@ BOOST_PP_CAT(vector, N)( Sequence const& seq #if (N == 1) - , typename disable_if >::type* /*dummy*/ = 0 + , typename boost::disable_if >::type* /*dummy*/ = 0 #endif ) : base_type(base_type::init_from_sequence(seq)) {} @@ -118,7 +118,7 @@ } template - typename disable_if, this_type&>::type + typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type I0; diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 5bb0b6ab..6563bc93 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -17,6 +17,38 @@ #include #include +#if !defined(__WAVE__) + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1600) + +#define BOOST_FUSION_VECTOR_COPY_INIT() \ + ctor_helper(rhs, is_base_of()) \ + +#define BOOST_FUSION_VECTOR_CTOR_HELPER() \ + static vector_n const& \ + ctor_helper(vector const& rhs, mpl::true_) \ + { \ + return rhs.vec; \ + } \ + \ + template \ + static T const& \ + ctor_helper(T const& rhs, mpl::false_) \ + { \ + return rhs; \ + } + +#else + +#define BOOST_FUSION_VECTOR_COPY_INIT() \ + rhs \ + +#define BOOST_FUSION_VECTOR_CTOR_HELPER() + +#endif + +#endif // !defined(__WAVE__) + #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) #include #else @@ -76,11 +108,7 @@ namespace boost { namespace fusion template vector(Sequence const& rhs) -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1600) - : vec(ctor_helper(rhs, is_base_of())) {} -#else - : vec(rhs) {} -#endif + : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} // Expand a couple of forwarding constructors for arguments // of type (T0), (T0, T1), (T0, T1, T2) etc. Example: @@ -149,21 +177,7 @@ namespace boost { namespace fusion private: -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1600) - static vector_n const& - ctor_helper(vector const& rhs, mpl::true_) - { - return rhs.vec; - } - - template - static T const& - ctor_helper(T const& rhs, mpl::false_) - { - return rhs; - } -#endif - + BOOST_FUSION_VECTOR_CTOR_HELPER() vector_n vec; }; }} diff --git a/include/boost/fusion/iterator/equal_to.hpp b/include/boost/fusion/iterator/equal_to.hpp index c15d870a..33478377 100644 --- a/include/boost/fusion/iterator/equal_to.hpp +++ b/include/boost/fusion/iterator/equal_to.hpp @@ -74,7 +74,7 @@ namespace boost { namespace fusion { template inline typename - enable_if< + boost::enable_if< mpl::and_, is_fusion_iterator > , bool >::type @@ -85,7 +85,7 @@ namespace boost { namespace fusion template inline typename - enable_if< + boost::enable_if< mpl::and_, is_fusion_iterator > , bool >::type diff --git a/include/boost/fusion/sequence/comparison/equal_to.hpp b/include/boost/fusion/sequence/comparison/equal_to.hpp index ad3ba585..9c4e0435 100644 --- a/include/boost/fusion/sequence/comparison/equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/equal_to.hpp @@ -37,7 +37,7 @@ namespace boost { namespace fusion { template inline typename - enable_if< + boost::enable_if< traits::enable_equality , bool >::type diff --git a/include/boost/fusion/sequence/comparison/greater.hpp b/include/boost/fusion/sequence/comparison/greater.hpp index f672a48e..077138d8 100644 --- a/include/boost/fusion/sequence/comparison/greater.hpp +++ b/include/boost/fusion/sequence/comparison/greater.hpp @@ -37,7 +37,7 @@ namespace boost { namespace fusion { template inline typename - enable_if< + boost::enable_if< traits::enable_comparison , bool >::type diff --git a/include/boost/fusion/sequence/comparison/greater_equal.hpp b/include/boost/fusion/sequence/comparison/greater_equal.hpp index 753deb4d..90175bc7 100644 --- a/include/boost/fusion/sequence/comparison/greater_equal.hpp +++ b/include/boost/fusion/sequence/comparison/greater_equal.hpp @@ -37,7 +37,7 @@ namespace boost { namespace fusion { template inline typename - enable_if< + boost::enable_if< traits::enable_comparison , bool >::type diff --git a/include/boost/fusion/sequence/comparison/less.hpp b/include/boost/fusion/sequence/comparison/less.hpp index 82383f77..944cdcf6 100644 --- a/include/boost/fusion/sequence/comparison/less.hpp +++ b/include/boost/fusion/sequence/comparison/less.hpp @@ -28,7 +28,7 @@ namespace boost { namespace fusion { template inline typename - enable_if< + boost::enable_if< traits::enable_comparison , bool >::type diff --git a/include/boost/fusion/sequence/comparison/less_equal.hpp b/include/boost/fusion/sequence/comparison/less_equal.hpp index 890fb99c..0e5d23a5 100644 --- a/include/boost/fusion/sequence/comparison/less_equal.hpp +++ b/include/boost/fusion/sequence/comparison/less_equal.hpp @@ -65,7 +65,7 @@ namespace boost { namespace fusion template inline typename - enable_if< + boost::enable_if< traits::enable_comparison , bool >::type diff --git a/include/boost/fusion/sequence/comparison/not_equal_to.hpp b/include/boost/fusion/sequence/comparison/not_equal_to.hpp index efc9b537..14ef25df 100644 --- a/include/boost/fusion/sequence/comparison/not_equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/not_equal_to.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion { template inline typename - enable_if< + boost::enable_if< traits::enable_equality , bool >::type diff --git a/include/boost/fusion/sequence/io/in.hpp b/include/boost/fusion/sequence/io/in.hpp index da4e5a5c..73a1fffb 100644 --- a/include/boost/fusion/sequence/io/in.hpp +++ b/include/boost/fusion/sequence/io/in.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { template inline typename - enable_if< + boost::enable_if< fusion::traits::is_sequence , std::istream& >::type diff --git a/include/boost/fusion/sequence/io/out.hpp b/include/boost/fusion/sequence/io/out.hpp index fc7fa1af..988a3985 100644 --- a/include/boost/fusion/sequence/io/out.hpp +++ b/include/boost/fusion/sequence/io/out.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion { template inline typename - enable_if< + boost::enable_if< fusion::traits::is_sequence , std::ostream& >::type diff --git a/include/boost/fusion/support/deduce_sequence.hpp b/include/boost/fusion/support/deduce_sequence.hpp index 77631b79..ce02a3cd 100644 --- a/include/boost/fusion/support/deduce_sequence.hpp +++ b/include/boost/fusion/support/deduce_sequence.hpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace boost { namespace fusion { namespace traits @@ -29,6 +30,13 @@ namespace boost { namespace fusion { namespace traits struct result< Self(T) > : fusion::traits::deduce { }; + + // never called, but needed for decltype-based result_of (C++0x) +#ifndef BOOST_NO_RVALUE_REFERENCES + template + typename result< deducer(T) >::type + operator()(T&&) const; +#endif }; } diff --git a/include/boost/fusion/support/tag_of.hpp b/include/boost/fusion/support/tag_of.hpp index 1c5a26e5..a3fef3ba 100644 --- a/include/boost/fusion/support/tag_of.hpp +++ b/include/boost/fusion/support/tag_of.hpp @@ -46,28 +46,29 @@ namespace boost { namespace fusion namespace detail { BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag) + + template + struct tag_of_impl + : mpl::if_, + mpl::identity, + mpl::identity >::type + {}; + + template + struct tag_of_impl< + Sequence + , typename boost::enable_if >::type> + { + typedef typename Sequence::fusion_tag type; + }; } namespace traits { - template - struct tag_of_fallback - { - typedef non_fusion_tag type; - }; - template struct tag_of - : mpl::if_< fusion::detail::is_mpl_sequence, - mpl::identity, - tag_of_fallback >::type + : boost::fusion::detail::tag_of_impl {}; - - template - struct tag_of >::type> - { - typedef typename Sequence::fusion_tag type; - }; } namespace detail diff --git a/include/boost/fusion/support/tag_of_fwd.hpp b/include/boost/fusion/support/tag_of_fwd.hpp index dfc0e01c..ba434d93 100644 --- a/include/boost/fusion/support/tag_of_fwd.hpp +++ b/include/boost/fusion/support/tag_of_fwd.hpp @@ -12,9 +12,6 @@ namespace boost { namespace fusion { namespace traits { - template - struct tag_of_fallback; - template struct tag_of; } diff --git a/include/boost/fusion/view/detail/strictest_traversal.hpp b/include/boost/fusion/view/detail/strictest_traversal.hpp index 39a389c3..7b7c9760 100644 --- a/include/boost/fusion/view/detail/strictest_traversal.hpp +++ b/include/boost/fusion/view/detail/strictest_traversal.hpp @@ -8,6 +8,7 @@ #if !defined(FUSION_STRICTEST_TRAVERSAL_20060123_2101) #define FUSION_STRICTEST_TRAVERSAL_20060123_2101 +#include #include #include #include @@ -53,6 +54,13 @@ namespace boost { namespace fusion typedef typename stricter_traversal::type type; }; + + // never called, but needed for decltype-based result_of (C++0x) +#ifndef BOOST_NO_RVALUE_REFERENCES + template + typename result::type + operator()(StrictestSoFar&&, Next&&) const; +#endif }; template diff --git a/include/boost/fusion/view/nview/detail/nview_impl.hpp b/include/boost/fusion/view/nview/detail/nview_impl.hpp index 03aa49f4..555c34ea 100644 --- a/include/boost/fusion/view/nview/detail/nview_impl.hpp +++ b/include/boost/fusion/view/nview/detail/nview_impl.hpp @@ -1,7 +1,7 @@ /*============================================================================= Copyright (c) 2009 Hartmut Kaiser - 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) ==============================================================================*/ @@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace result_of { template + , BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, INT_MAX)> struct as_nview { typedef mpl::vector_c< diff --git a/include/boost/fusion/view/nview/nview.hpp b/include/boost/fusion/view/nview/nview.hpp index 02422e0b..2355b688 100644 --- a/include/boost/fusion/view/nview/nview.hpp +++ b/include/boost/fusion/view/nview/nview.hpp @@ -23,6 +23,8 @@ #include #include +#include + namespace boost { namespace fusion { namespace detail @@ -35,12 +37,21 @@ namespace boost { namespace fusion template struct result : add_reference {}; +#ifdef BOOST_NO_RVALUE_REFERENCES template typename add_reference::type operator()(T& x) const { return x; } +#else + template + typename result::type + operator()(T&& x) const + { + return x; + } +#endif }; struct addconstref diff --git a/include/boost/fusion/view/zip_view/detail/end_impl.hpp b/include/boost/fusion/view/zip_view/detail/end_impl.hpp index b58854e3..6423a88f 100644 --- a/include/boost/fusion/view/zip_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/end_impl.hpp @@ -62,7 +62,7 @@ namespace boost { namespace fusion { template typename result::type - operator()(Seq const& seq) + operator()(Seq const& seq) const { return fusion::advance(fusion::begin(seq)); } diff --git a/include/boost/fusion/view/zip_view/detail/value_at_impl.hpp b/include/boost/fusion/view/zip_view/detail/value_at_impl.hpp index 93f0979b..13e0274f 100644 --- a/include/boost/fusion/view/zip_view/detail/value_at_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/value_at_impl.hpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace boost { namespace fusion { @@ -35,6 +36,13 @@ namespace boost { namespace fusion { mpl::identity, result_of::value_at::type, N> > {}; + + // never called, but needed for decltype-based result_of (C++0x) +#ifndef BOOST_NO_RVALUE_REFERENCES + template + typename result::type + operator()(Seq&&) const; +#endif }; } diff --git a/include/boost/fusion/view/zip_view/detail/value_of_impl.hpp b/include/boost/fusion/view/zip_view/detail/value_of_impl.hpp index 45b7b962..5571155e 100644 --- a/include/boost/fusion/view/zip_view/detail/value_of_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/value_of_impl.hpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace boost { namespace fusion { @@ -34,6 +35,13 @@ namespace boost { namespace fusion mpl::identity, result_of::value_of > {}; + + // never called, but needed for decltype-based result_of (C++0x) +#ifndef BOOST_NO_RVALUE_REFERENCES + template + typename result::type + operator()(It&&) const; +#endif }; } diff --git a/include/boost/fusion/view/zip_view/zip_view.hpp b/include/boost/fusion/view/zip_view/zip_view.hpp index 6258711c..e9a0222d 100644 --- a/include/boost/fusion/view/zip_view/zip_view.hpp +++ b/include/boost/fusion/view/zip_view/zip_view.hpp @@ -37,6 +37,8 @@ #include #include +#include + namespace boost { namespace fusion { namespace detail @@ -64,6 +66,13 @@ namespace boost { namespace fusion { result_of::size, mpl::int_ >::type type; }; + + // never called, but needed for decltype-based result_of (C++0x) +#ifndef BOOST_NO_RVALUE_REFERENCES + template + typename result::type + operator()(Seq&&) const; +#endif }; struct poly_min @@ -78,6 +87,13 @@ namespace boost { namespace fusion { typedef typename remove_reference::type rhs; typedef typename mpl::min::type type; }; + + // never called, but needed for decltype-based result_of (C++0x) +#ifndef BOOST_NO_RVALUE_REFERENCES + template + typename result::type + operator()(Lhs&&, Rhs&&) const; +#endif }; template