diff --git a/include/boost/fusion/algorithm/query/find.hpp b/include/boost/fusion/algorithm/query/find.hpp index 7bb74413..fcc74341 100644 --- a/include/boost/fusion/algorithm/query/find.hpp +++ b/include/boost/fusion/algorithm/query/find.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/boost/fusion/iterator.hpp b/include/boost/fusion/iterator.hpp index 48083ddf..074d9542 100644 --- a/include/boost/fusion/iterator.hpp +++ b/include/boost/fusion/iterator.hpp @@ -8,6 +8,7 @@ #if !defined(FUSION_ITERATOR_10022005_0559) #define FUSION_ITERATOR_10022005_0559 +#include #include #include #include diff --git a/include/boost/fusion/iterator/advance.hpp b/include/boost/fusion/iterator/advance.hpp index f62b84b1..918a37fa 100644 --- a/include/boost/fusion/iterator/advance.hpp +++ b/include/boost/fusion/iterator/advance.hpp @@ -19,6 +19,9 @@ namespace boost { namespace fusion { struct random_access_traversal_tag; + + // Special tags: + struct iterator_facade_tag; // iterator facade tag struct array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -37,11 +40,17 @@ namespace boost { namespace fusion , advance_detail::backward >::type { - typedef typename traits::category_of::type category; - BOOST_MPL_ASSERT_NOT((is_same)); + BOOST_MPL_ASSERT_NOT((traits::is_random_access)); }; }; + template <> + struct advance_impl + { + template + struct apply : Iterator::template advance {}; + }; + template <> struct advance_impl; diff --git a/include/boost/fusion/iterator/deref.hpp b/include/boost/fusion/iterator/deref.hpp index c2a40564..dae0a04e 100644 --- a/include/boost/fusion/iterator/deref.hpp +++ b/include/boost/fusion/iterator/deref.hpp @@ -13,6 +13,8 @@ namespace boost { namespace fusion { + // Special tags: + struct iterator_facade_tag; // iterator facade tag struct array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -26,6 +28,13 @@ namespace boost { namespace fusion struct apply {}; }; + template <> + struct deref_impl + { + template + struct apply : Iterator::template deref {}; + }; + template <> struct deref_impl; diff --git a/include/boost/fusion/iterator/distance.hpp b/include/boost/fusion/iterator/distance.hpp index 422a1231..bdafa9f1 100644 --- a/include/boost/fusion/iterator/distance.hpp +++ b/include/boost/fusion/iterator/distance.hpp @@ -20,6 +20,9 @@ namespace boost { namespace fusion { struct random_access_traversal_tag; + + // Special tags: + struct iterator_facade_tag; // iterator facade tag struct array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -33,13 +36,18 @@ namespace boost { namespace fusion template struct apply : distance_detail::linear_distance { - typedef typename traits::category_of::type first_category; - typedef typename traits::category_of::type last_category; - BOOST_MPL_ASSERT((is_same)); - BOOST_MPL_ASSERT_NOT((is_same)); + BOOST_MPL_ASSERT_NOT((traits::is_random_access)); + BOOST_MPL_ASSERT_NOT((traits::is_random_access)); }; }; + template <> + struct distance_impl + { + template + struct apply : First::template distance {}; + }; + template <> struct distance_impl; diff --git a/include/boost/fusion/iterator/equal_to.hpp b/include/boost/fusion/iterator/equal_to.hpp index f6cd826c..be1e7ed7 100644 --- a/include/boost/fusion/iterator/equal_to.hpp +++ b/include/boost/fusion/iterator/equal_to.hpp @@ -17,6 +17,8 @@ namespace boost { namespace fusion { + // Special tags: + struct iterator_facade_tag; // iterator facade tag struct array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -33,6 +35,13 @@ namespace boost { namespace fusion {}; }; + template <> + struct equal_to_impl + { + template + struct apply : I1::template equal_to {}; + }; + template <> struct equal_to_impl; diff --git a/include/boost/fusion/iterator/iterator_facade.hpp b/include/boost/fusion/iterator/iterator_facade.hpp new file mode 100644 index 00000000..a7250427 --- /dev/null +++ b/include/boost/fusion/iterator/iterator_facade.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Use, modification and distribution is subject to 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_ITERATOR_FACADE_09252006_1011) +#define FUSION_ITERATOR_FACADE_09252006_1011 + +#include +#include + +namespace boost { namespace fusion +{ + struct iterator_facade_tag; + + template + struct iterator_facade : iterator_base + { + typedef iterator_facade_tag fusion_tag; + typedef Derived derived_type; + typedef Category category; + + template + struct equal_to // default implementation + : is_same< + typename I1::derived_type + , typename I2::derived_type + > + {}; + }; +}} + +#endif diff --git a/include/boost/fusion/iterator/next.hpp b/include/boost/fusion/iterator/next.hpp index aa7f2de8..fa69ae66 100644 --- a/include/boost/fusion/iterator/next.hpp +++ b/include/boost/fusion/iterator/next.hpp @@ -12,6 +12,8 @@ namespace boost { namespace fusion { + // Special tags: + struct iterator_facade_tag; // iterator facade tag struct array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -25,6 +27,13 @@ namespace boost { namespace fusion struct apply {}; }; + template <> + struct next_impl + { + template + struct apply : Iterator::template next {}; + }; + template <> struct next_impl; diff --git a/include/boost/fusion/iterator/prior.hpp b/include/boost/fusion/iterator/prior.hpp index 0e859d9b..b9528150 100644 --- a/include/boost/fusion/iterator/prior.hpp +++ b/include/boost/fusion/iterator/prior.hpp @@ -12,6 +12,8 @@ namespace boost { namespace fusion { + // Special tags: + struct iterator_facade_tag; // iterator facade tag struct array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -25,6 +27,13 @@ namespace boost { namespace fusion struct apply {}; }; + template <> + struct prior_impl + { + template + struct apply : Iterator::template prior {}; + }; + template <> struct prior_impl; diff --git a/include/boost/fusion/iterator/value_of.hpp b/include/boost/fusion/iterator/value_of.hpp index 5a4f6585..17ab07c8 100644 --- a/include/boost/fusion/iterator/value_of.hpp +++ b/include/boost/fusion/iterator/value_of.hpp @@ -13,6 +13,8 @@ namespace boost { namespace fusion { + // Special tags: + struct iterator_facade_tag; // iterator facade tag struct array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -26,6 +28,13 @@ namespace boost { namespace fusion struct apply {}; }; + template <> + struct value_of_impl + { + template + struct apply : Iterator::template value_of {}; + }; + template <> struct value_of_impl; diff --git a/include/boost/fusion/sequence.hpp b/include/boost/fusion/sequence.hpp index 5b6763c6..86d7bdd3 100644 --- a/include/boost/fusion/sequence.hpp +++ b/include/boost/fusion/sequence.hpp @@ -8,6 +8,7 @@ #if !defined(FUSION_SEQUENCE_10022005_0559) #define FUSION_ITERATOR_10022005_0559 +#include #include #include #include diff --git a/include/boost/fusion/sequence/adapted/array/array_iterator.hpp b/include/boost/fusion/sequence/adapted/array/array_iterator.hpp index 93a0fa0f..71a9921c 100644 --- a/include/boost/fusion/sequence/adapted/array/array_iterator.hpp +++ b/include/boost/fusion/sequence/adapted/array/array_iterator.hpp @@ -10,45 +10,119 @@ #define BOOST_FUSION_ARRAY_ITERATOR_26122005_2250 #include - #include #include #include -#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { - - struct array_iterator_tag; +namespace boost { namespace fusion +{ struct random_access_traversal_tag; template struct array_iterator - : iterator_base > + : iterator_facade, random_access_traversal_tag> { BOOST_MPL_ASSERT_RELATION(Pos,>=,0); BOOST_MPL_ASSERT_RELATION(Pos,<=,std::size_t(Array::static_size)); typedef mpl::size_t index; - typedef array_iterator_tag fusion_tag; - typedef random_access_traversal_tag category; typedef Array array_type; - typedef array_iterator< - typename add_const::type, Pos> identity; array_iterator(Array& a) : array(a) {} Array& array; + + template + struct value_of + { + typedef typename Iterator::array_type array_type; + typedef typename array_type::value_type type; + }; + + template + struct deref + { + typedef typename Iterator::array_type array_type; + typedef typename + mpl::if_< + is_const + , typename array_type::const_reference + , typename array_type::reference + >::type + type; + + static type + call(Iterator const & it) + { + return it.array[Iterator::index::value]; + } + }; + + template + struct next + { + typedef typename Iterator::array_type array_type; + typedef typename Iterator::index index; + static int const index_val = index::value; + typedef array_iterator type; + + static type + call(Iterator const& i) + { + return type(i.array); + } + }; + + template + struct prior + { + typedef typename Iterator::array_type array_type; + typedef typename Iterator::index index; + static int const index_val = index::value; + typedef array_iterator type; + + static type + call(Iterator const& i) + { + return type(i.array); + } + }; + + template + struct advance + { + typedef typename Iterator::index index; + typedef typename Iterator::array_type array_type; + typedef array_iterator type; + + static type + call(Iterator const& i) + { + return type(i.array); + } + }; + + template + struct distance : mpl::minus + { + typedef typename mpl::minus< + typename Last::index, typename First::index>::type + type; + + static type + call(First const&, Last const&) + { + return type(); + } + }; + private: + array_iterator operator=(const array_iterator&); }; }} diff --git a/include/boost/fusion/sequence/adapted/array/detail/advance_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/advance_impl.hpp deleted file mode 100644 index c93133da..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/advance_impl.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2005-2006 Dan Marsden - - Use, modification and distribution is subject to 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_ADVANCE_IMPL_27122005_0938) -#define BOOST_FUSION_ADVANCE_IMPL_27122005_0938 - -namespace boost { namespace fusion { - - struct array_iterator_tag; - - template - struct array_iterator; - - namespace extension - { - template - struct advance_impl; - - template<> - struct advance_impl - { - template - struct apply - { - typedef typename Iterator::index index; - typedef typename Iterator::array_type array_type; - typedef array_iterator type; - - static type - call(Iterator const& i) - { - return type(i.array); - } - }; - }; - } -}} - -#endif diff --git a/include/boost/fusion/sequence/adapted/array/detail/deref_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/deref_impl.hpp deleted file mode 100644 index 012d1aaf..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/deref_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2005-2006 Dan Marsden - - Use, modification and distribution is subject to 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_DEREF_IMPL_27122005_0951) -#define BOOST_FUSION_DEREF_IMPL_27122005_0951 - -#include -#include - -namespace boost { namespace fusion { - - struct array_iterator_tag; - - template - struct array_iterator; - - namespace extension - { - template - struct deref_impl; - - template<> - struct deref_impl - { - template - struct apply - { - typedef typename Iterator::array_type array_type; - typedef typename mpl::if_< - is_const, - typename array_type::const_reference, - typename array_type::reference>::type type; - - static type - call(Iterator const & it) - { - return it.array[Iterator::index::value]; - } - }; - }; - } -}} - -#endif diff --git a/include/boost/fusion/sequence/adapted/array/detail/distance_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/distance_impl.hpp deleted file mode 100644 index 062dc7d9..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/distance_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2005-2006 Dan Marsden - - Use, modification and distribution is subject to 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_DISTANCE_IMPL_27122005_1016) -#define BOOST_FUSION_DISTANCE_IMPL_27122005_1016 - -#include - -namespace boost { namespace fusion -{ - struct array_iterator_tag; - - namespace extension - { - template - struct distance_impl; - - template <> - struct distance_impl - { - template - struct apply : mpl::minus - { - static typename mpl::minus< - typename Last::index, typename First::index>::type - call(First const&, Last const&) - { - typedef typename mpl::minus< - typename Last::index, typename First::index>::type - result; - return result(); - } - }; - }; - } -}} - -#endif diff --git a/include/boost/fusion/sequence/adapted/array/detail/equal_to_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/equal_to_impl.hpp deleted file mode 100644 index f395ba5d..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/equal_to_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2005-2006 Dan Marsden - - Use, modification and distribution is subject to 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_EQUAL_TO_IMPL_27122005_1020) -#define BOOST_FUSION_EQUAL_TO_IMPL_27122005_1020 - -#include -#include -#include - -namespace boost { namespace fusion -{ - struct array_iterator_tag; - - namespace extension - { - template - struct equal_to_impl; - - template <> - struct equal_to_impl - { - template - struct apply - : is_same< - typename I1::identity - , typename I2::identity - > - {}; - }; - } -}} - -#endif - diff --git a/include/boost/fusion/sequence/adapted/array/detail/next_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/next_impl.hpp deleted file mode 100644 index 3f6d1df2..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/next_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2005-2006 Dan Marsden - - Use, modification and distribution is subject to 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_NEXT_IMPL_27122005_0927) -#define FUSION_NEXT_IMPL_27122005_0927 - -#include - -namespace boost { namespace fusion { - - struct array_iterator_tag; - - template - struct array_iterator; - - namespace extension - { - template - struct next_impl; - - template<> - struct next_impl - { - template - struct apply - { - typedef typename Iterator::array_type array_type; - typedef typename Iterator::index index; - static int const index_val = index::value; - typedef array_iterator type; - - static type - call(Iterator const& i) - { - return type(i.array); - } - }; - }; - } -}} - -#endif diff --git a/include/boost/fusion/sequence/adapted/array/detail/prior_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/prior_impl.hpp deleted file mode 100644 index 27f4d2e5..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/prior_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2005-2006 Dan Marsden - - Use, modification and distribution is subject to 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_PRIOR_IMPL_27122005_0935) -#define FUSION_PRIOR_IMPL_27122005_0935 - -namespace boost { namespace fusion { - - struct array_iterator_tag; - - template - struct array_iterator; - - namespace extension - { - template - struct prior_impl; - - template<> - struct prior_impl - { - template - struct apply - { - typedef typename Iterator::array_type array_type; - typedef typename Iterator::index index; - static int const index_val = index::value; - typedef array_iterator type; - - static type - call(Iterator const& i) - { - return type(i.array); - } - }; - }; - } -}} - -#endif diff --git a/include/boost/fusion/sequence/adapted/array/detail/value_of_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/value_of_impl.hpp deleted file mode 100644 index 5056ac8b..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/value_of_impl.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2005-2006 Dan Marsden - - Use, modification and distribution is subject to 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_VALUE_OF_IMPL_27122005_1011) -#define BOOST_FUSION_VALUE_OF_IMPL_27122005_1011 - -namespace boost { namespace fusion -{ - struct array_iterator_tag; - - namespace extension - { - template - struct value_of_impl; - - template <> - struct value_of_impl - { - template - struct apply - { - typedef typename Iterator::array_type array_type; - typedef typename array_type::value_type type; - }; - }; - } -}} - -#endif diff --git a/include/boost/fusion/support.hpp b/include/boost/fusion/support.hpp index adede25c..764fe795 100644 --- a/include/boost/fusion/support.hpp +++ b/include/boost/fusion/support.hpp @@ -16,6 +16,5 @@ #include #include #include -#include #endif diff --git a/include/boost/fusion/support/category_of.hpp b/include/boost/fusion/support/category_of.hpp index 7aebc9ac..fa8f795f 100644 --- a/include/boost/fusion/support/category_of.hpp +++ b/include/boost/fusion/support/category_of.hpp @@ -10,23 +10,38 @@ #include #include -#include +#include namespace boost { namespace fusion { + // Special tags: struct array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag + struct incrementable_traversal_tag {}; + + struct single_pass_traversal_tag + : incrementable_traversal_tag {}; + + struct forward_traversal_tag + : single_pass_traversal_tag {}; + + struct bidirectional_traversal_tag + : forward_traversal_tag {}; + + struct random_access_traversal_tag + : bidirectional_traversal_tag {}; + + struct associative_sequence_tag {}; + namespace extension { template struct category_of_impl { template - struct apply - : detail::fusion_category_of - {}; + struct apply : detail::fusion_category_of {}; }; template <> @@ -46,6 +61,49 @@ namespace boost { namespace fusion : extension::category_of_impl::type>:: template apply {}; -}}} + + template + struct is_associative + : is_base_of< + associative_sequence_tag + , typename category_of::type> + {}; + + template + struct is_incrementable + : is_base_of< + incrementable_traversal_tag + , typename category_of::type> + {}; + + template + struct is_single_pass + : is_base_of< + single_pass_traversal_tag + , typename category_of::type> + {}; + + template + struct is_forward + : is_base_of< + forward_traversal_tag + , typename category_of::type> + {}; + + template + struct is_bidirectional + : is_base_of< + bidirectional_traversal_tag + , typename category_of::type> + {}; + + template + struct is_random_access + : is_base_of< + random_access_traversal_tag + , typename category_of::type> + {}; + } +}} #endif diff --git a/include/boost/fusion/support/detail/iterator_to_sequence_category.hpp b/include/boost/fusion/support/detail/iterator_to_sequence_category.hpp deleted file mode 100644 index 9ffbb5a5..00000000 --- a/include/boost/fusion/support/detail/iterator_to_sequence_category.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - - Use, modification and distribution is subject to 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_ITERATOR_TO_SEQUENCE_CATEGORY_07212005_0726) -#define FUSION_ITERATOR_TO_SEQUENCE_CATEGORY_07212005_0726 - -namespace boost { namespace fusion -{ - struct incrementable_traversal_tag; - struct single_pass_traversal_tag; - struct forward_traversal_tag; - struct bidirectional_traversal_tag; - struct random_access_traversal_tag; - - struct incrementable_sequence_tag; - struct single_pass_sequence_tag; - struct forward_sequence_tag; - struct bidirectional_sequence_tag; - struct random_access_sequence_tag; -}} - -namespace boost { namespace fusion { namespace detail -{ - template - struct iterator_to_sequence_category; - - template <> - struct iterator_to_sequence_category - { - typedef incrementable_sequence_tag type; - }; - - template <> - struct iterator_to_sequence_category - { - typedef single_pass_sequence_tag type; - }; - - template <> - struct iterator_to_sequence_category - { - typedef forward_sequence_tag type; - }; - - template <> - struct iterator_to_sequence_category - { - typedef bidirectional_sequence_tag type; - }; - - template <> - struct iterator_to_sequence_category - { - typedef random_access_sequence_tag type; - }; -}}} - -#endif diff --git a/include/boost/fusion/support/is_associative.hpp b/include/boost/fusion/support/is_associative.hpp deleted file mode 100644 index ae339f25..00000000 --- a/include/boost/fusion/support/is_associative.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2006 Dan Marsden - - Use, modification and distribution is subject to 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_IS_ASSOCIATIVE_09242005_1018) -#define FUSION_IS_ASSOCIATIVE_09242005_1018 - -#include -#include - -namespace boost { namespace fusion -{ - namespace extension - { - template - struct is_associative_impl - { - template - struct apply : mpl::false_ {}; - }; - } - - namespace traits - { - template - struct is_associative - : extension::is_associative_impl::type>:: - template apply - {}; - } -}} - -#endif diff --git a/include/boost/fusion/support/is_iterator.hpp b/include/boost/fusion/support/is_iterator.hpp index 3e9415cb..63020a4b 100644 --- a/include/boost/fusion/support/is_iterator.hpp +++ b/include/boost/fusion/support/is_iterator.hpp @@ -8,14 +8,14 @@ #if !defined(FUSION_IS_ITERATOR_05062005_1219) #define FUSION_IS_ITERATOR_05062005_1219 -#include +#include namespace boost { namespace fusion { struct iterator_root; template - struct is_fusion_iterator : is_base_and_derived {}; + struct is_fusion_iterator : is_base_of {}; }} #endif diff --git a/include/boost/fusion/support/is_sequence.hpp b/include/boost/fusion/support/is_sequence.hpp index 86ed6f77..5de2e94c 100644 --- a/include/boost/fusion/support/is_sequence.hpp +++ b/include/boost/fusion/support/is_sequence.hpp @@ -8,7 +8,7 @@ #if !defined(FUSION_IS_SEQUENCE_05052005_1002) #define FUSION_IS_SEQUENCE_05052005_1002 -#include +#include #include #include #include @@ -17,6 +17,7 @@ namespace boost { namespace fusion { + // Special tags: struct non_fusion_tag; struct array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag @@ -26,18 +27,15 @@ namespace boost { namespace fusion { template struct is_sequence_impl - : is_base_and_derived { - template - struct apply - : is_base_and_derived - {}; + template + struct apply : is_base_of {}; }; template <> struct is_sequence_impl { - template + template struct apply : mpl::false_ {}; }; diff --git a/include/boost/fusion/support/is_view.hpp b/include/boost/fusion/support/is_view.hpp index e1a03add..4db7883e 100644 --- a/include/boost/fusion/support/is_view.hpp +++ b/include/boost/fusion/support/is_view.hpp @@ -13,6 +13,8 @@ namespace boost { namespace fusion { + // Special tags: + struct sequence_facade_tag; struct array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -22,12 +24,19 @@ namespace boost { namespace fusion template struct is_view_impl { - template + template struct apply : detail::fusion_is_view {}; }; + template <> + struct is_view_impl + { + template + struct apply : Sequence::is_view {}; + }; + template <> struct is_view_impl; diff --git a/include/boost/fusion/support/tag_of.hpp b/include/boost/fusion/support/tag_of.hpp index 0fbb47a6..cf5b9a32 100644 --- a/include/boost/fusion/support/tag_of.hpp +++ b/include/boost/fusion/support/tag_of.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace boost @@ -24,7 +25,7 @@ namespace boost namespace boost { namespace fusion { struct non_fusion_tag; - + namespace detail { BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag) diff --git a/include/boost/fusion/support/tags.hpp b/include/boost/fusion/support/tags.hpp deleted file mode 100644 index 5571d779..00000000 --- a/include/boost/fusion/support/tags.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - - Use, modification and distribution is subject to 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_TAGS_07212005_1031) -#define FUSION_TAGS_07212005_1031 - -namespace boost { namespace fusion -{ -// Iterator Classification - struct incrementable_traversal_tag {}; - - struct single_pass_traversal_tag - : incrementable_traversal_tag {}; - - struct forward_traversal_tag - : single_pass_traversal_tag {}; - - struct bidirectional_traversal_tag - : forward_traversal_tag {}; - - struct random_access_traversal_tag - : bidirectional_traversal_tag {}; - -// Sequence Classification - struct incrementable_sequence_tag {}; - - struct single_pass_sequence_tag - : incrementable_sequence_tag {}; - - struct forward_sequence_tag - : single_pass_sequence_tag {}; - - struct bidirectional_sequence_tag - : forward_sequence_tag {}; - - struct random_access_sequence_tag - : bidirectional_sequence_tag {}; - - struct associative_sequence_tag // $$$ this is no longer true $$$ - : forward_sequence_tag {}; -}} - -#endif