diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index e2745616..4ffd0a7b 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -8,6 +8,7 @@ #if !defined(FUSION_CONS_07172005_0843) #define FUSION_CONS_07172005_0843 +#include #include #include #include @@ -55,7 +56,7 @@ namespace boost { namespace fusion } }; - template + template struct cons : sequence_base > { typedef mpl::int_ size; diff --git a/include/boost/fusion/container/list/cons_fwd.hpp b/include/boost/fusion/container/list/cons_fwd.hpp new file mode 100644 index 00000000..cbbe4be6 --- /dev/null +++ b/include/boost/fusion/container/list/cons_fwd.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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_CONS_FWD_HPP_INCLUDED) +#define BOOST_FUSION_CONS_FWD_HPP_INCLUDED + +namespace boost { namespace fusion +{ + struct nil; + + template + struct cons; +}} + +#endif + diff --git a/include/boost/fusion/container/list/detail/reverse_cons.hpp b/include/boost/fusion/container/list/detail/reverse_cons.hpp index 9f17b07e..59178e84 100644 --- a/include/boost/fusion/container/list/detail/reverse_cons.hpp +++ b/include/boost/fusion/container/list/detail/reverse_cons.hpp @@ -7,8 +7,7 @@ #if !defined(BOOST_FUSION_REVERSE_CONS_HPP_INCLUDED) #define BOOST_FUSION_REVERSE_CONS_HPP_INCLUDED -#include -#include +#include namespace boost { namespace fusion { namespace detail { @@ -24,7 +23,8 @@ namespace boost { namespace fusion { namespace detail static type call(cons const &cons, State const &state = State()) { - return impl::call(cons.cdr, fusion::make_cons(cons.car, state)); + typedef fusion::cons cdr_type; + return impl::call(cons.cdr, cdr_type(cons.car, state)); } }; diff --git a/include/boost/fusion/include/is_segmented.hpp b/include/boost/fusion/include/is_segmented.hpp new file mode 100644 index 00000000..28fa4346 --- /dev/null +++ b/include/boost/fusion/include/is_segmented.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_INCLUDE_IS_SEGMENTED) +#define BOOST_FUSION_INCLUDE_IS_SEGMENTED + +#include + +#endif diff --git a/include/boost/fusion/include/segmented_fold_until.hpp b/include/boost/fusion/include/segmented_fold_until.hpp new file mode 100644 index 00000000..d7fe06af --- /dev/null +++ b/include/boost/fusion/include/segmented_fold_until.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_INCLUDE_SEGMENTED_FOLD_UNTIL) +#define BOOST_FUSION_INCLUDE_SEGMENTED_FOLD_UNTIL + +#include + +#endif diff --git a/include/boost/fusion/include/segmented_iterator.hpp b/include/boost/fusion/include/segmented_iterator.hpp new file mode 100644 index 00000000..6e8a4964 --- /dev/null +++ b/include/boost/fusion/include/segmented_iterator.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_INCLUDE_SEGMENTED_ITERATOR) +#define BOOST_FUSION_INCLUDE_SEGMENTED_ITERATOR + +#include + +#endif diff --git a/include/boost/fusion/include/segments.hpp b/include/boost/fusion/include/segments.hpp new file mode 100644 index 00000000..7bc7b2bf --- /dev/null +++ b/include/boost/fusion/include/segments.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_INCLUDE_SEGMENTS) +#define BOOST_FUSION_INCLUDE_SEGMENTS + +#include + +#endif diff --git a/include/boost/fusion/iterator/detail/segment_sequence.hpp b/include/boost/fusion/iterator/detail/segment_sequence.hpp new file mode 100644 index 00000000..c372a836 --- /dev/null +++ b/include/boost/fusion/iterator/detail/segment_sequence.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_SEGMENTED_SEQUENCE_HPP_INCLUDED) +#define BOOST_FUSION_SEGMENTED_SEQUENCE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + struct segment_sequence_tag {}; + + // Here, Sequence is a sequence of ranges (which may or may not be + // segmented). + template + struct segment_sequence + : sequence_base > + { + typedef fusion_sequence_tag tag; + typedef segment_sequence_tag fusion_tag; + typedef typename Sequence::is_view is_view; + typedef typename Sequence::category category; + typedef Sequence sequence_type; + sequence_type sequence; + + explicit segment_sequence(Sequence const & seq) + : sequence(seq) + {} + }; +} + +namespace extension +{ + template + struct is_segmented_impl; + + template<> + struct is_segmented_impl + { + template + struct apply + : mpl::true_ + {}; + }; + + template + struct segments_impl; + + template<> + struct segments_impl + { + template + struct apply + { + typedef typename Sequence::sequence_type type; + + static type call(Sequence & seq) + { + return seq.sequence; + } + }; + }; +}}} + +#endif diff --git a/include/boost/fusion/iterator/detail/segmented_equal_to.hpp b/include/boost/fusion/iterator/detail/segmented_equal_to.hpp new file mode 100644 index 00000000..d10b094d --- /dev/null +++ b/include/boost/fusion/iterator/detail/segmented_equal_to.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_SEGMENTED_ITERATOR_EQUAL_TO_HPP_INCLUDED) +#define BOOST_FUSION_SEGMENTED_ITERATOR_EQUAL_TO_HPP_INCLUDED + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct nil; + + namespace detail + { + template + struct segmented_equal_to + : mpl::and_< + result_of::equal_to< + typename Stack1::car_type::begin_type, + typename Stack2::car_type::begin_type + >, + segmented_equal_to< + typename Stack1::cdr_type, + typename Stack2::cdr_type + > + > + {}; + + template + struct segmented_equal_to + : mpl::false_ + {}; + + template + struct segmented_equal_to + : mpl::false_ + {}; + + template <> + struct segmented_equal_to + : mpl::true_ + {}; + } +}} + +#endif diff --git a/include/boost/fusion/iterator/segmented_iterator/segmented_iterator.hpp b/include/boost/fusion/iterator/detail/segmented_iterator.hpp similarity index 65% rename from include/boost/fusion/iterator/segmented_iterator/segmented_iterator.hpp rename to include/boost/fusion/iterator/detail/segmented_iterator.hpp index cd889647..f150f4ae 100644 --- a/include/boost/fusion/iterator/segmented_iterator/segmented_iterator.hpp +++ b/include/boost/fusion/iterator/detail/segmented_iterator.hpp @@ -7,24 +7,22 @@ #if !defined(BOOST_FUSION_SEGMENTED_ITERATOR_SEGMENTED_ITERATOR_HPP_INCLUDED) #define BOOST_FUSION_SEGMENTED_ITERATOR_SEGMENTED_ITERATOR_HPP_INCLUDED -#include -#include -#include -#include -#include -#include -#include +#include #include #include -#include -#include -#include -#include -#include -#include +#include +#include namespace boost { namespace fusion { + struct nil; + + namespace detail + { + template + struct segmented_next_impl; + } + // A segmented iterator wraps a "context", which is a cons list // of ranges, the frontmost is range over values and the rest // are ranges over internal segments. @@ -59,16 +57,9 @@ namespace boost { namespace fusion // the bottom-most. template struct equal_to - : mpl::equal< - typename mpl::reverse_transform< - typename result_of::as_vector::type, - result_of::begin - >::type, - typename mpl::reverse_transform< - typename result_of::as_vector::type, - result_of::begin - >::type, - result_of::equal_to + : detail::segmented_equal_to< + typename detail::reverse_cons::type, + typename detail::reverse_cons::type > {}; diff --git a/include/boost/fusion/iterator/segmented_iterator/detail/next_impl.hpp b/include/boost/fusion/iterator/detail/segmented_next_impl.hpp similarity index 88% rename from include/boost/fusion/iterator/segmented_iterator/detail/next_impl.hpp rename to include/boost/fusion/iterator/detail/segmented_next_impl.hpp index b83a858b..60ead2e5 100644 --- a/include/boost/fusion/iterator/segmented_iterator/detail/next_impl.hpp +++ b/include/boost/fusion/iterator/detail/segmented_next_impl.hpp @@ -10,27 +10,29 @@ #include #include #include -#include +#include #include #include -#include namespace boost { namespace fusion { - template + template struct iterator_range; - template + template struct segmented_iterator; namespace detail { + template + struct segmented_begin_impl; + //bool is_invalid(stack) //{ // return empty(car(stack)); //} - template + template struct is_invalid : result_of::equal_to< typename Stack::car_type::begin_type, @@ -46,7 +48,7 @@ namespace boost { namespace fusion // return cons(iterator_range(next(begin(car(stack))), end(car(stack))), cdr(stack)); //} - template + template struct pop_front_car { typedef @@ -70,7 +72,7 @@ namespace boost { namespace fusion } }; - template< + template < typename Stack, typename Next = typename pop_front_car::type, bool IsInvalid = is_invalid::value, @@ -86,7 +88,7 @@ namespace boost { namespace fusion // return segmented_next_impl_recurse(stack.cdr); //} - template< + template < typename Stack, int StackSize = Stack::size::value> struct segmented_next_impl_recurse3 @@ -100,7 +102,7 @@ namespace boost { namespace fusion } }; - template + template struct segmented_next_impl_recurse3 { typedef typename Stack::car_type::end_type end_type; @@ -122,7 +124,7 @@ namespace boost { namespace fusion // return res; //} - template< + template < typename Stack, typename Range = typename remove_reference< @@ -147,7 +149,7 @@ namespace boost { namespace fusion } }; - template + template struct segmented_next_impl_recurse2 { typedef Result type; @@ -170,7 +172,7 @@ namespace boost { namespace fusion // return segmented_next_impl_recurse2(next) //} - template + template struct segmented_next_impl_recurse { typedef @@ -183,7 +185,7 @@ namespace boost { namespace fusion } }; - template + template struct segmented_next_impl_recurse { typedef Next type; @@ -194,7 +196,7 @@ namespace boost { namespace fusion } }; - template + template struct segmented_next_impl_recurse { typedef segmented_next_impl_recurse2 impl; @@ -216,11 +218,11 @@ namespace boost { namespace fusion // return next; //} - template< + template < typename Stack, typename Next = typename pop_front_car::type, bool IsInvalid = is_invalid::value> - struct segmented_next_impl + struct segmented_next_impl_aux { typedef segmented_next_impl_recurse impl; typedef typename impl::type type; @@ -231,8 +233,8 @@ namespace boost { namespace fusion } }; - template - struct segmented_next_impl + template + struct segmented_next_impl_aux { typedef Next type; @@ -241,6 +243,11 @@ namespace boost { namespace fusion return pop_front_car::call(stack); } }; + + template + struct segmented_next_impl + : segmented_next_impl_aux + {}; } }} diff --git a/include/boost/fusion/iterator/segmented_iterator.hpp b/include/boost/fusion/iterator/segmented_iterator.hpp index 5e446f5c..21095e78 100644 --- a/include/boost/fusion/iterator/segmented_iterator.hpp +++ b/include/boost/fusion/iterator/segmented_iterator.hpp @@ -7,6 +7,9 @@ #if !defined(BOOST_FUSION_SEGMENTED_ITERATOR_HPP_INCLUDED) #define BOOST_FUSION_SEGMENTED_ITERATOR_HPP_INCLUDED -#include +#include +#include +#include +#include #endif diff --git a/include/boost/fusion/iterator/segmented_iterator/detail/segment_sequence.hpp b/include/boost/fusion/iterator/segmented_iterator/detail/segment_sequence.hpp deleted file mode 100644 index 2a31ab01..00000000 --- a/include/boost/fusion/iterator/segmented_iterator/detail/segment_sequence.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/*============================================================================= - Copyright (c) 2011 Eric Niebler - - 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_SEGMENTED_SEQUENCE_HPP_INCLUDED) -#define BOOST_FUSION_SEGMENTED_SEQUENCE_HPP_INCLUDED - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace detail - { - struct segment_sequence_tag {}; - - // Here, Sequence is a sequence of ranges (which may or may not be - // segmented). - template - struct segment_sequence - : sequence_base > - { - typedef fusion_sequence_tag tag; - typedef segment_sequence_tag fusion_tag; - typedef typename Sequence::is_view is_view; - typedef typename Sequence::category category; - typedef Sequence sequence_type; - sequence_type sequence; - - explicit segment_sequence(Sequence const & seq) - : sequence(seq) - {} - }; - } - - namespace extension - { - template - struct is_segmented_impl; - - template<> - struct is_segmented_impl - { - template - struct apply - : mpl::true_ - {}; - }; - - template - struct segments_impl; - - template<> - struct segments_impl - { - template - struct apply - { - typedef typename Sequence::sequence_type type; - - static type call(Sequence & seq) - { - return seq.sequence; - } - }; - }; - - template - struct begin_impl; - - template<> - struct begin_impl - { - template - struct apply - : segmented_begin - {}; - }; - - template - struct end_impl; - - template<> - struct end_impl - { - template - struct apply - : segmented_end - {}; - }; - - template - struct size_impl; - - template<> - struct size_impl - { - template - struct apply - : segmented_size::type - {}; - }; - - } -}} - -#endif diff --git a/include/boost/fusion/sequence/intrinsic/at.hpp b/include/boost/fusion/sequence/intrinsic/at.hpp index 9ccbfc64..5820394b 100644 --- a/include/boost/fusion/sequence/intrinsic/at.hpp +++ b/include/boost/fusion/sequence/intrinsic/at.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include diff --git a/include/boost/fusion/sequence/intrinsic/at_key.hpp b/include/boost/fusion/sequence/intrinsic/at_key.hpp index 30fefe01..b75dc517 100644 --- a/include/boost/fusion/sequence/intrinsic/at_key.hpp +++ b/include/boost/fusion/sequence/intrinsic/at_key.hpp @@ -9,6 +9,7 @@ #define BOOST_FUSION_AT_KEY_20060304_1755 #include +#include #include #include #include diff --git a/include/boost/fusion/sequence/intrinsic/back.hpp b/include/boost/fusion/sequence/intrinsic/back.hpp index 1f3567f9..adfacc75 100644 --- a/include/boost/fusion/sequence/intrinsic/back.hpp +++ b/include/boost/fusion/sequence/intrinsic/back.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_BACK_09162005_0350) #define FUSION_BACK_09162005_0350 +#include #include #include #include diff --git a/include/boost/fusion/sequence/intrinsic/begin.hpp b/include/boost/fusion/sequence/intrinsic/begin.hpp index c9ece3ab..cc8506b9 100644 --- a/include/boost/fusion/sequence/intrinsic/begin.hpp +++ b/include/boost/fusion/sequence/intrinsic/begin.hpp @@ -7,9 +7,14 @@ #if !defined(FUSION_BEGIN_04052005_1132) #define FUSION_BEGIN_04052005_1132 +#include +#include +#include +#include #include #include -#include +#include +#include namespace boost { namespace fusion { @@ -26,7 +31,13 @@ namespace boost { namespace fusion struct begin_impl { template - struct apply; + struct apply + : mpl::if_< + traits::is_segmented + , detail::segmented_begin + , blank + >::type + {}; }; template <> diff --git a/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp index 3184474d..b1c5b907 100644 --- a/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp @@ -7,13 +7,11 @@ #if !defined(BOOST_FUSION_SEGMENTED_BEGIN_HPP_INCLUDED) #define BOOST_FUSION_SEGMENTED_BEGIN_HPP_INCLUDED -#include +#include +#include -namespace boost { namespace fusion +namespace boost { namespace fusion { namespace detail { - template - struct segmented_iterator; - //auto segmented_begin( rng ) //{ // return make_segmented_iterator( segmented_begin_impl( rng, nil ) ); @@ -24,17 +22,17 @@ namespace boost { namespace fusion { typedef segmented_iterator< - typename detail::segmented_begin_impl::type + typename segmented_begin_impl::type > type; static type call(Range & rng) { return type( - detail::segmented_begin_impl::call(rng, fusion::nil())); + segmented_begin_impl::call(rng, fusion::nil())); } }; -}} +}}} #endif diff --git a/include/boost/fusion/iterator/segmented_iterator/detail/begin_impl.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp similarity index 72% rename from include/boost/fusion/iterator/segmented_iterator/detail/begin_impl.hpp rename to include/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp index b66f9939..d75a1e77 100644 --- a/include/boost/fusion/iterator/segmented_iterator/detail/begin_impl.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp @@ -8,23 +8,26 @@ #define BOOST_FUSION_SEGMENTED_BEGIN_IMPL_HPP_INCLUDED #include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include +#include +#include + +namespace boost { namespace fusion +{ + template + struct iterator_range; +}} namespace boost { namespace fusion { namespace detail { struct segmented_begin_fun { - template + template struct result; - template + template struct result { typedef @@ -42,7 +45,7 @@ namespace boost { namespace fusion { namespace detail type; }; - template + template typename result::type operator()(Range& rng, State const&, Context const& context) const { @@ -53,12 +56,12 @@ namespace boost { namespace fusion { namespace detail > range_type; - return fusion::make_cons(range_type(fusion::begin(rng), fusion::end(rng)), context); + return cons(range_type(fusion::begin(rng), fusion::end(rng)), context); } }; - template::type::value> - struct segmented_begin_impl + template ::type::value> + struct segmented_begin_impl_aux { typedef segmented_end_impl @@ -81,8 +84,8 @@ namespace boost { namespace fusion { namespace detail } }; - template - struct segmented_begin_impl + template + struct segmented_begin_impl_aux { typedef typename result_of::begin::type begin_type; typedef typename result_of::end::type end_type; @@ -95,6 +98,11 @@ namespace boost { namespace fusion { namespace detail } }; + template + struct segmented_begin_impl + : segmented_begin_impl_aux + {}; + }}} #endif diff --git a/include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp index 584b60fe..5287a725 100644 --- a/include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp @@ -7,14 +7,12 @@ #if !defined(BOOST_FUSION_SEGMENTED_END_HPP_INCLUDED) #define BOOST_FUSION_SEGMENTED_END_HPP_INCLUDED -#include -#include +#include +#include +#include -namespace boost { namespace fusion +namespace boost { namespace fusion { namespace detail { - template - struct segmented_iterator; - //auto segmented_end( rng ) //{ // return make_segmented_iterator( segmented_end_impl( rng ) ); @@ -25,17 +23,17 @@ namespace boost { namespace fusion { typedef segmented_iterator< - typename detail::segmented_end_impl::type + typename segmented_end_impl::type > type; static type call(Range & rng) { return type( - detail::segmented_end_impl::call(rng, fusion::nil())); + segmented_end_impl::call(rng, fusion::nil())); } }; -}} +}}} #endif diff --git a/include/boost/fusion/iterator/segmented_iterator/detail/end_impl.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp similarity index 88% rename from include/boost/fusion/iterator/segmented_iterator/detail/end_impl.hpp rename to include/boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp index 44a7ef5e..1df8b4bd 100644 --- a/include/boost/fusion/iterator/segmented_iterator/detail/end_impl.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp @@ -10,12 +10,16 @@ #include #include #include -#include -#include -#include -#include +#include +#include #include +namespace boost { namespace fusion +{ + template + struct iterator_range; +}} + namespace boost { namespace fusion { namespace detail { //auto segmented_end_impl( rng, stack ) diff --git a/include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp index 1ee72720..3354b651 100644 --- a/include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp @@ -13,48 +13,42 @@ #include #include #include +#include #include #include -#include -#include -#include -#include #include -namespace boost { namespace fusion +namespace boost { namespace fusion { namespace detail { /////////////////////////////////////////////////////////////////////////// // calculates the size of any segmented data structure. template struct segmented_size; - namespace detail - { - /////////////////////////////////////////////////////////////////////////// - template::value> - struct segmented_size_impl - : mpl::fold< - typename remove_reference< - typename add_const< - typename result_of::segments::type - >::type - >::type, - mpl::size_t<0>, - mpl::plus > - >::type - {}; + /////////////////////////////////////////////////////////////////////////// + template::value> + struct segmented_size_impl + : mpl::fold< + typename remove_reference< + typename add_const< + typename result_of::segments::type + >::type + >::type, + mpl::size_t<0>, + mpl::plus > + >::type + {}; - template - struct segmented_size_impl - : result_of::size::type - {}; - } + template + struct segmented_size_impl + : result_of::size::type + {}; template struct segmented_size - : detail::segmented_size_impl + : segmented_size_impl {}; -}} +}}} #endif diff --git a/include/boost/fusion/sequence/intrinsic/empty.hpp b/include/boost/fusion/sequence/intrinsic/empty.hpp index 2390a49b..81656282 100644 --- a/include/boost/fusion/sequence/intrinsic/empty.hpp +++ b/include/boost/fusion/sequence/intrinsic/empty.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_EMPTY_09162005_0335) #define FUSION_EMPTY_09162005_0335 +#include #include #include #include diff --git a/include/boost/fusion/sequence/intrinsic/end.hpp b/include/boost/fusion/sequence/intrinsic/end.hpp index 02476710..e3319719 100644 --- a/include/boost/fusion/sequence/intrinsic/end.hpp +++ b/include/boost/fusion/sequence/intrinsic/end.hpp @@ -7,9 +7,14 @@ #if !defined(FUSION_END_04052005_1141) #define FUSION_END_04052005_1141 +#include +#include +#include +#include #include #include -#include +#include +#include namespace boost { namespace fusion { @@ -26,7 +31,13 @@ namespace boost { namespace fusion struct end_impl { template - struct apply; + struct apply + : mpl::if_< + traits::is_segmented + , detail::segmented_end + , blank + >::type + {}; }; template <> diff --git a/include/boost/fusion/sequence/intrinsic/front.hpp b/include/boost/fusion/sequence/intrinsic/front.hpp index bb79cfa9..3b50530f 100644 --- a/include/boost/fusion/sequence/intrinsic/front.hpp +++ b/include/boost/fusion/sequence/intrinsic/front.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_FRONT_09162005_0343) #define FUSION_FRONT_09162005_0343 +#include #include #include #include diff --git a/include/boost/fusion/sequence/intrinsic/has_key.hpp b/include/boost/fusion/sequence/intrinsic/has_key.hpp index f254eb1e..946ebba0 100644 --- a/include/boost/fusion/sequence/intrinsic/has_key.hpp +++ b/include/boost/fusion/sequence/intrinsic/has_key.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_HAS_KEY_09232005_1454) #define FUSION_HAS_KEY_09232005_1454 +#include #include #include #include diff --git a/include/boost/fusion/sequence/intrinsic/segments.hpp b/include/boost/fusion/sequence/intrinsic/segments.hpp index 77ed0773..afd5d400 100644 --- a/include/boost/fusion/sequence/intrinsic/segments.hpp +++ b/include/boost/fusion/sequence/intrinsic/segments.hpp @@ -7,6 +7,9 @@ #if !defined(BOOST_FUSION_SEGMENTS_04052005_1141) #define BOOST_FUSION_SEGMENTS_04052005_1141 +#include +#include +#include #include namespace boost { namespace fusion @@ -50,15 +53,19 @@ namespace boost { namespace fusion } template - typename result_of::segments::type - segments(Sequence & seq) + inline typename + lazy_disable_if< + is_const + , result_of::segments + >::type + segments(Sequence& seq) { typedef typename traits::tag_of::type tag_type; return extension::segments_impl::template apply::call(seq); } template - typename result_of::segments::type + inline typename result_of::segments::type segments(Sequence const& seq) { typedef typename traits::tag_of::type tag_type; diff --git a/include/boost/fusion/sequence/intrinsic/size.hpp b/include/boost/fusion/sequence/intrinsic/size.hpp index 2a3cb7f8..f29ea1ba 100644 --- a/include/boost/fusion/sequence/intrinsic/size.hpp +++ b/include/boost/fusion/sequence/intrinsic/size.hpp @@ -7,8 +7,13 @@ #if !defined(FUSION_SIZE_05052005_0214) #define FUSION_SIZE_05052005_0214 +#include +#include #include +#include #include +#include +#include namespace boost { namespace fusion { @@ -24,8 +29,17 @@ namespace boost { namespace fusion template struct size_impl { + template + struct unsegmented_size : Sequence::size {}; + template - struct apply : Sequence::size {}; + struct apply + : mpl::if_< + traits::is_segmented + , detail::segmented_size + , unsegmented_size + >::type + {}; }; template <> diff --git a/include/boost/fusion/sequence/intrinsic/value_at.hpp b/include/boost/fusion/sequence/intrinsic/value_at.hpp index 01cdc9d5..f64c9735 100644 --- a/include/boost/fusion/sequence/intrinsic/value_at.hpp +++ b/include/boost/fusion/sequence/intrinsic/value_at.hpp @@ -8,6 +8,7 @@ #define FUSION_VALUE_AT_05052005_0229 #include +#include #include namespace boost { namespace fusion diff --git a/include/boost/fusion/sequence/intrinsic/value_at_key.hpp b/include/boost/fusion/sequence/intrinsic/value_at_key.hpp index d7f84cd9..4c15521d 100644 --- a/include/boost/fusion/sequence/intrinsic/value_at_key.hpp +++ b/include/boost/fusion/sequence/intrinsic/value_at_key.hpp @@ -9,6 +9,7 @@ #define FUSION_VALUE_AT_KEY_05052005_0229 #include +#include #include #include #include diff --git a/include/boost/fusion/sequence/intrinsic_fwd.hpp b/include/boost/fusion/sequence/intrinsic_fwd.hpp new file mode 100644 index 00000000..75077dfa --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic_fwd.hpp @@ -0,0 +1,203 @@ +/*============================================================================= + Copyright (c) 2001-2006 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) +==============================================================================*/ +#if !defined(BOOST_FUSION_SEQUENCE_INTRINSIC_FWD_HPP_INCLUDED) +#define BOOST_FUSION_SEQUENCE_INTRINSIC_FWD_HPP_INCLUDED + +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace extension + { + template + struct at_impl; + + template + struct begin_impl; + + template + struct empty_impl; + + template + struct end_impl; + + template + struct has_key_impl; + + template + struct segments_impl; + + template + struct size_impl; + + template + struct value_at_impl; + + template + struct at_key_impl; + + template + struct value_at_key_impl; + } + + namespace result_of + { + template + struct at; + + template + struct at_c; + + template + struct back; + + template + struct begin; + + template + struct empty; + + template + struct end; + + template + struct front; + + template + struct has_key; + + template + struct segments; + + template + struct size; + + template + struct value_at; + + template + struct value_at_c; + + template + struct at_key; + + template + struct value_at_key; + } + + template + typename + lazy_disable_if< + is_const + , result_of::at + >::type + at(Sequence& seq); + + template + typename result_of::at::type + at(Sequence const& seq); + + template + typename + lazy_disable_if< + is_const + , result_of::at_c + >::type + at_c(Sequence& seq); + + template + typename result_of::at_c::type + at_c(Sequence const& seq); + + template + typename result_of::back::type + back(Sequence& seq); + + template + typename result_of::back::type + back(Sequence const& seq); + + template + typename + lazy_enable_if< + traits::is_sequence + , result_of::begin + >::type const + begin(Sequence& seq); + + template + typename + lazy_enable_if< + traits::is_sequence + , result_of::begin + >::type const + begin(Sequence const& seq); + + template + typename result_of::empty::type + empty(Sequence const&); + + template + typename + lazy_enable_if< + traits::is_sequence + , result_of::end + >::type const + end(Sequence& seq); + + template + typename + lazy_enable_if< + traits::is_sequence + , result_of::end + >::type const + end(Sequence const& seq); + + template + typename result_of::front::type + front(Sequence& seq); + + template + typename result_of::front::type + front(Sequence const& seq); + + template + typename result_of::has_key::type + has_key(Sequence const& seq); + + template + typename + lazy_disable_if< + is_const + , result_of::segments + >::type + segments(Sequence& seq); + + template + typename result_of::segments::type + segments(Sequence const& seq); + + template + typename result_of::size::type + size(Sequence const&); + + template + typename + lazy_disable_if< + is_const + , result_of::at_key + >::type + at_key(Sequence& seq); + + template + typename result_of::at_key::type + at_key(Sequence const& seq); +}} + +#endif diff --git a/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp b/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp new file mode 100644 index 00000000..cdc5eb1e --- /dev/null +++ b/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp @@ -0,0 +1,401 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_SEGMENTED_FOLD_UNTIL_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_SEGMENTED_FOLD_UNTIL_IMPL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// fun(rng, state, context) +// rng: a non-segmented range +// state: the state of the fold so far +// context: the path to the current range +// +// returns: (state', fcontinue) + +namespace boost { namespace fusion +{ + template + struct iterator_range; + + template + struct segmented_iterator; + + namespace result_of + { + template + struct make_segmented_iterator + { + typedef + iterator_range< + Cur, + typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Context::car_type::begin_type + >::type + >::type + >::type + >::type + > + range_type; + + typedef + segmented_iterator > + type; + }; + } + + template + typename result_of::make_segmented_iterator::type + make_segmented_iterator(Cur const& cur, Context const& context) + { + typedef result_of::make_segmented_iterator impl_type; + typedef typename impl_type::type type; + typedef typename impl_type::range_type range_type; + return type(cons(range_type(cur, fusion::end(*context.car.first)), context)); + } + + typedef mpl::true_ continue_; + typedef mpl::false_ break_; + + template + struct result + { + typedef Value value_type; + typedef Continue continue_type; + + result(Value const& val) + : value(val) + {} + + value_type value; + }; + + template + struct result + { + typedef void_ value_type; + typedef Continue continue_type; + + result(void_ const&) + {} + + value_type value; + }; + + template + result make_result_continue(Value const& val) + { + return result(val); + } + + template + result make_result_break(Value const& val) + { + return result(val); + } + + namespace detail + { + template < + typename Begin, + typename End, + typename State, + typename Context, + typename Fun, + bool IsEmpty = result_of::empty< + typename result_of::value_of::type + >::type::value> + struct segmented_fold_until_iterate_skip_empty; + + template < + typename Begin, + typename End, + typename State, + typename Context, + typename Fun, + bool IsDone = result_of::equal_to::type::value> + struct segmented_fold_until_iterate; + + template < + typename Range, + typename State, + typename Context, + typename Fun, + bool IsSegmented = traits::is_segmented::type::value> + struct segmented_fold_until_impl; + + template + struct segmented_fold_until_on_segments; + + //auto push_context(cur, end, context) + //{ + // return push_back(context, segment_sequence(iterator_range(cur, end))); + //} + + template + struct push_context + { + typedef iterator_range range_type; + typedef cons type; + + static type call(Cur const& cur, End const& end, Context const& context) + { + return cons(range_type(cur, end), context); + } + }; + + //auto make_segmented_iterator(cur, end, context) + //{ + // return segmented_iterator(push_context(cur, end, context)); + //} + // + //auto segmented_fold_until_impl(rng, state, context, fun) + //{ + // if (is_segmented(rng)) + // { + // segmented_fold_until_on_segments(segments(rng), state, context, fun); + // } + // else + // { + // return fun(rng, state, context); + // } + //} + + template < + typename Range, + typename State, + typename Context, + typename Fun, + bool IsSegmented> + struct segmented_fold_until_impl + { + typedef + segmented_fold_until_on_segments< + typename remove_reference< + typename add_const< + typename result_of::segments::type + >::type + >::type, + State, + Context, + Fun + > + impl; + + typedef typename impl::type type; + + static type call(Range& rng, State const& state, Context const& context, Fun const& fun) + { + return impl::call(fusion::segments(rng), state, context, fun); + } + }; + + template < + typename Range, + typename State, + typename Context, + typename Fun> + struct segmented_fold_until_impl + { + typedef + typename boost::result_of::type>::type, + Context const& + )>::type + type; + + static type call(Range& rng, State const& state, Context const& context, Fun const& fun) + { + return fun(rng, state.value, context); + } + }; + + //auto segmented_fold_until_on_segments(segs, state, context, fun) + //{ + // auto cur = begin(segs), end = end(segs); + // for (; cur != end; ++cur) + // { + // if (empty(*cur)) + // continue; + // auto context` = push_context(cur, end, context); + // state = segmented_fold_until_impl(*cur, state, context`, fun); + // if (!second(state)) + // return state; + // } + //} + + template + struct segmented_fold_until_iterate_skip_empty + { + // begin != end and !empty(*begin) + typedef + push_context + push_context_impl; + + typedef + typename push_context_impl::type + next_context_type; + + typedef + segmented_fold_until_impl< + typename remove_reference< + typename add_const< + typename result_of::deref::type + >::type + >::type, + State, + next_context_type, + Fun + > + fold_recurse_impl; + + typedef + typename fold_recurse_impl::type + next_state_type; + + typedef + segmented_fold_until_iterate< + typename result_of::next::type, + End, + next_state_type, + Context, + Fun + > + next_iteration_impl; + + typedef + typename mpl::eval_if< + typename next_state_type::continue_type, + next_iteration_impl, + mpl::identity + >::type + type; + + static type call(Begin const& beg, End const& end, State const& state, + Context const& context, Fun const& fun) + { + return call(beg, end, state, context, fun, typename next_state_type::continue_type()); + } + + static type call(Begin const& beg, End const& end, State const& state, + Context const& context, Fun const& fun, mpl::true_) // continue + { + return next_iteration_impl::call( + fusion::next(beg), + end, + fold_recurse_impl::call( + *beg, + state, + push_context_impl::call(beg, end, context), + fun), + context, + fun); + } + + static type call(Begin const& beg, End const& end, State const& state, + Context const& context, Fun const& fun, mpl::false_) // break + { + return fold_recurse_impl::call( + *beg, + state, + push_context_impl::call(beg, end, context), + fun); + } + }; + + template + struct segmented_fold_until_iterate_skip_empty + { + typedef + segmented_fold_until_iterate< + typename result_of::next::type, + End, + State, + Context, + Fun + > + impl; + + typedef typename impl::type type; + + static type call(Begin const& beg, End const& end, State const& state, + Context const& context, Fun const& fun) + { + return impl::call(fusion::next(beg), end, state, context, fun); + } + }; + + template + struct segmented_fold_until_iterate + { + typedef + segmented_fold_until_iterate_skip_empty + impl; + + typedef typename impl::type type; + + static type call(Begin const& beg, End const& end, State const& state, + Context const& context, Fun const& fun) + { + return impl::call(beg, end, state, context, fun); + } + }; + + template + struct segmented_fold_until_iterate + { + typedef State type; + + static type call(Begin const&, End const&, State const& state, + Context const&, Fun const&) + { + return state; + } + }; + + template + struct segmented_fold_until_on_segments + { + typedef + segmented_fold_until_iterate< + typename result_of::begin::type, + typename result_of::end::type, + State, + Context, + Fun + > + impl; + + typedef typename impl::type type; + + static type call(Segments& segs, State const& state, Context const& context, Fun const& fun) + { + return impl::call(fusion::begin(segs), fusion::end(segs), state, context, fun); + } + }; + } +}} + +#endif diff --git a/include/boost/fusion/support/segmented_fold_until.hpp b/include/boost/fusion/support/segmented_fold_until.hpp index b5e0299f..670266ce 100644 --- a/include/boost/fusion/support/segmented_fold_until.hpp +++ b/include/boost/fusion/support/segmented_fold_until.hpp @@ -7,397 +7,15 @@ #if !defined(BOOST_FUSION_SEGMENTED_FOLD_UNTIL_HPP_INCLUDED) #define BOOST_FUSION_SEGMENTED_FOLD_UNTIL_HPP_INCLUDED -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include #include #include -#include #include -#include -#include -#include -#include -#include - -// fun(rng, state, context) -// rng: a non-segmented range -// state: the state of the fold so far -// context: the path to the current range -// -// returns: (state', fcontinue) +#include +#include namespace boost { namespace fusion { - template - struct segmented_iterator; - - namespace result_of - { - template - struct make_segmented_iterator - { - typedef - iterator_range< - Cur, - typename result_of::end< - typename remove_reference< - typename add_const< - typename result_of::deref< - typename Context::car_type::begin_type - >::type - >::type - >::type - >::type - > - range_type; - - typedef - segmented_iterator > - type; - }; - } - - template - typename result_of::make_segmented_iterator::type - make_segmented_iterator(Cur const& cur, Context const& context) - { - typedef result_of::make_segmented_iterator impl_type; - typedef typename impl_type::type type; - typedef typename impl_type::range_type range_type; - return type(fusion::make_cons(range_type(cur, fusion::end(*context.car.first)), context)); - } - - typedef mpl::true_ continue_; - typedef mpl::false_ break_; - - template - struct result - { - typedef Value value_type; - typedef Continue continue_type; - - result(Value const& val) - : value(val) - {} - - value_type value; - }; - - template - struct result - { - typedef void_ value_type; - typedef Continue continue_type; - - result(void_ const&) - {} - - value_type value; - }; - - template - result make_result_continue(Value const& val) - { - return result(val); - } - - template - result make_result_break(Value const& val) - { - return result(val); - } - - namespace detail - { - template< - typename Begin, - typename End, - typename State, - typename Context, - typename Fun, - bool IsEmpty = result_of::empty< - typename result_of::value_of::type - >::type::value> - struct segmented_fold_until_iterate_skip_empty; - - template< - typename Begin, - typename End, - typename State, - typename Context, - typename Fun, - bool IsDone = result_of::equal_to::type::value> - struct segmented_fold_until_iterate; - - template< - typename Range, - typename State, - typename Context, - typename Fun, - bool IsSegmented = traits::is_segmented::type::value> - struct segmented_fold_until_impl; - - template - struct segmented_fold_until_on_segments; - - //auto push_context(cur, end, context) - //{ - // return push_back(context, segment_sequence(iterator_range(cur, end))); - //} - - template - struct push_context - { - typedef iterator_range range_type; - typedef cons type; - - static type call(Cur const& cur, End const& end, Context const& context) - { - return fusion::make_cons(range_type(cur, end), context); - } - }; - - //auto make_segmented_iterator(cur, end, context) - //{ - // return segmented_iterator(push_context(cur, end, context)); - //} - // - //auto segmented_fold_until_impl(rng, state, context, fun) - //{ - // if (is_segmented(rng)) - // { - // segmented_fold_until_on_segments(segments(rng), state, context, fun); - // } - // else - // { - // return fun(rng, state, context); - // } - //} - - template< - typename Range, - typename State, - typename Context, - typename Fun, - bool IsSegmented> - struct segmented_fold_until_impl - { - typedef - segmented_fold_until_on_segments< - typename remove_reference< - typename add_const< - typename result_of::segments::type - >::type - >::type, - State, - Context, - Fun - > - impl; - - typedef typename impl::type type; - - static type call(Range& rng, State const& state, Context const& context, Fun const& fun) - { - return impl::call(fusion::segments(rng), state, context, fun); - } - }; - - template< - typename Range, - typename State, - typename Context, - typename Fun> - struct segmented_fold_until_impl - { - typedef - typename boost::result_of::type>::type, - Context const& - )>::type - type; - - static type call(Range& rng, State const& state, Context const& context, Fun const& fun) - { - return fun(rng, state.value, context); - } - }; - - //auto segmented_fold_until_on_segments(segs, state, context, fun) - //{ - // auto cur = begin(segs), end = end(segs); - // for (; cur != end; ++cur) - // { - // if (empty(*cur)) - // continue; - // auto context` = push_context(cur, end, context); - // state = segmented_fold_until_impl(*cur, state, context`, fun); - // if (!second(state)) - // return state; - // } - //} - - template - struct segmented_fold_until_iterate_skip_empty - { - // begin != end and !empty(*begin) - typedef - push_context - push_context_impl; - - typedef - typename push_context_impl::type - next_context_type; - - typedef - segmented_fold_until_impl< - typename remove_reference< - typename add_const< - typename result_of::deref::type - >::type - >::type, - State, - next_context_type, - Fun - > - fold_recurse_impl; - - typedef - typename fold_recurse_impl::type - next_state_type; - - typedef - segmented_fold_until_iterate< - typename result_of::next::type, - End, - next_state_type, - Context, - Fun - > - next_iteration_impl; - - typedef - typename mpl::eval_if< - typename next_state_type::continue_type, - next_iteration_impl, - mpl::identity - >::type - type; - - static type call(Begin const& beg, End const& end, State const& state, - Context const& context, Fun const& fun) - { - return call(beg, end, state, context, fun, typename next_state_type::continue_type()); - } - - static type call(Begin const& beg, End const& end, State const& state, - Context const& context, Fun const& fun, mpl::true_) // continue - { - return next_iteration_impl::call( - fusion::next(beg), - end, - fold_recurse_impl::call( - *beg, - state, - push_context_impl::call(beg, end, context), - fun), - context, - fun); - } - - static type call(Begin const& beg, End const& end, State const& state, - Context const& context, Fun const& fun, mpl::false_) // break - { - return fold_recurse_impl::call( - *beg, - state, - push_context_impl::call(beg, end, context), - fun); - } - }; - - template - struct segmented_fold_until_iterate_skip_empty - { - typedef - segmented_fold_until_iterate< - typename result_of::next::type, - End, - State, - Context, - Fun - > - impl; - - typedef typename impl::type type; - - static type call(Begin const& beg, End const& end, State const& state, - Context const& context, Fun const& fun) - { - return impl::call(fusion::next(beg), end, state, context, fun); - } - }; - - template - struct segmented_fold_until_iterate - { - typedef - segmented_fold_until_iterate_skip_empty - impl; - - typedef typename impl::type type; - - static type call(Begin const& beg, End const& end, State const& state, - Context const& context, Fun const& fun) - { - return impl::call(beg, end, state, context, fun); - } - }; - - template - struct segmented_fold_until_iterate - { - typedef State type; - - static type call(Begin const&, End const&, State const& state, - Context const&, Fun const&) - { - return state; - } - }; - - template - struct segmented_fold_until_on_segments - { - typedef - segmented_fold_until_iterate< - typename result_of::begin::type, - typename result_of::end::type, - State, - Context, - Fun - > - impl; - - typedef typename impl::type type; - - static type call(Segments& segs, State const& state, Context const& context, Fun const& fun) - { - return impl::call(fusion::begin(segs), fusion::end(segs), state, context, fun); - } - }; - - } - //auto segmented_fold_until(rng, state, fun) //{ // return first(segmented_fold_until_impl(rng, state, nil, fun)); @@ -405,7 +23,7 @@ namespace boost { namespace fusion namespace result_of { - template + template struct segmented_fold_until { typedef @@ -423,7 +41,7 @@ namespace boost { namespace fusion }; } - template + template typename result_of::segmented_fold_until::type segmented_fold_until(Range& rng, State const& state, Fun const& fun) { @@ -431,7 +49,7 @@ namespace boost { namespace fusion return impl::call(rng, state, fusion::nil(), fun).value; } - template + template typename result_of::segmented_fold_until::type segmented_fold_until(Range const& rng, State const& state, Fun const& fun) { @@ -439,5 +57,4 @@ namespace boost { namespace fusion return impl::call(rng, state, fusion::nil(), fun).value; } }} - #endif diff --git a/include/boost/fusion/view/iterator_range/detail/is_segmented_impl.hpp b/include/boost/fusion/view/iterator_range/detail/is_segmented_impl.hpp new file mode 100644 index 00000000..5ca20378 --- /dev/null +++ b/include/boost/fusion/view/iterator_range/detail/is_segmented_impl.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_ITERATOR_RANGE_IS_SEGMENTED_HPP_INCLUDED) +#define BOOST_FUSION_ITERATOR_RANGE_IS_SEGMENTED_HPP_INCLUDED + +#include +#include + +namespace boost { namespace fusion +{ + struct iterator_range_tag; + + template + struct segmented_iterator; + + namespace extension + { + template + struct is_segmented_impl; + + // An iterator_range of segmented_iterators is segmented + template <> + struct is_segmented_impl + { + private: + template + struct is_segmented_iterator + : mpl::false_ + {}; + + template + struct is_segmented_iterator + : is_segmented_iterator + {}; + + template + struct is_segmented_iterator + : is_segmented_iterator + {}; + + template + struct is_segmented_iterator > + : mpl::true_ + {}; + + public: + template + struct apply + : is_segmented_iterator + { + BOOST_MPL_ASSERT_RELATION( + is_segmented_iterator::value, + ==, + is_segmented_iterator::value); + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp index 80c000c7..df5f7a93 100644 --- a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp +++ b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp @@ -16,14 +16,11 @@ #include #include #include -#include #include #include -#include #include -#include #include -#include +#include // Invariants: // - Each segmented iterator has a stack @@ -35,8 +32,8 @@ namespace boost { namespace fusion { - template - struct segmented_iterator; + template + struct iterator_range; }} namespace boost { namespace fusion { namespace detail @@ -65,7 +62,7 @@ namespace boost { namespace fusion { namespace detail // } //} - template + template struct make_segment_sequence_front { // assert(end(segments(front(car(stack_begin)))) == end(car(cdr(stack_begin)))); @@ -138,7 +135,7 @@ namespace boost { namespace fusion { namespace detail } }; - template + template struct make_segment_sequence_front { // assert(end(front(car(stack_begin))) == end(car(cdr(stack_begin)))); @@ -178,7 +175,7 @@ namespace boost { namespace fusion { namespace detail } }; - template + template struct make_segment_sequence_front { typedef nil type; @@ -209,7 +206,7 @@ namespace boost { namespace fusion { namespace detail // } //} - template + template struct make_segment_sequence_back { // assert(end(segments(front(car(stack_begin)))) == end(car(cdr(stack_begin)))); @@ -280,7 +277,7 @@ namespace boost { namespace fusion { namespace detail } }; - template + template struct make_segment_sequence_back { // assert(end(front(car(stack_end))) == end(car(cdr(stack_end)))); @@ -320,7 +317,7 @@ namespace boost { namespace fusion { namespace detail } }; - template + template struct make_segment_sequence_back { typedef nil type; @@ -364,14 +361,14 @@ namespace boost { namespace fusion { namespace detail // } //} - template< + template < typename StackBegin, typename StackEnd, int StackBeginSize = StackBegin::size::value, int StackEndSize = StackEnd::size::value> struct make_segmented_range_reduce; - template< + template < typename StackBegin, typename StackEnd, bool SameSegment = @@ -421,7 +418,7 @@ namespace boost { namespace fusion { namespace detail } }; - template + template struct make_segmented_range_reduce2 { typedef @@ -441,12 +438,12 @@ namespace boost { namespace fusion { namespace detail } }; - template + template struct make_segmented_range_reduce : make_segmented_range_reduce2 {}; - template + template struct make_segmented_range_reduce { typedef @@ -478,7 +475,7 @@ namespace boost { namespace fusion { namespace detail // return make_segmented_range_reduce(reverse(begin.context), reverse(end.context)); //} - template + template struct make_segmented_range { typedef reverse_cons reverse_begin_cons; @@ -503,81 +500,4 @@ namespace boost { namespace fusion { namespace detail }}} -namespace boost { namespace fusion { namespace extension -{ - template - struct is_segmented_impl; - - // An iterator_range of segmented_iterators is segmented - template<> - struct is_segmented_impl - { - private: - template - struct is_segmented_iterator - : mpl::false_ - {}; - - template - struct is_segmented_iterator - : is_segmented_iterator - {}; - - template - struct is_segmented_iterator - : is_segmented_iterator - {}; - - template - struct is_segmented_iterator > - : mpl::true_ - {}; - - public: - template - struct apply - : is_segmented_iterator - { - BOOST_MPL_ASSERT_RELATION( - is_segmented_iterator::value, - ==, - is_segmented_iterator::value); - }; - }; - - template - struct segments_impl; - - template<> - struct segments_impl - { - template - struct apply - { - typedef - detail::make_segmented_range< - typename Sequence::begin_type, - typename Sequence::end_type - > - impl; - - BOOST_MPL_ASSERT((traits::is_segmented)); - - typedef - typename result_of::segments::type - type; - - static type call(Sequence & seq) - { - return fusion::segments(impl::call(seq.first, seq.last)); - } - }; - }; - - // TODO: default implementation of begin, end, and size - // should check if the sequence is segmented and to - // the right thing. - -}}} - #endif diff --git a/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp b/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp new file mode 100644 index 00000000..5d114615 --- /dev/null +++ b/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED) +#define BOOST_FUSION_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct segments_impl; + + template <> + struct segments_impl + { + template + struct apply + { + typedef + detail::make_segmented_range< + typename Sequence::begin_type, + typename Sequence::end_type + > + impl; + + BOOST_MPL_ASSERT((traits::is_segmented)); + + typedef + typename result_of::segments::type + type; + + static type call(Sequence & seq) + { + return fusion::segments(impl::call(seq.first, seq.last)); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/iterator_range/iterator_range.hpp b/include/boost/fusion/view/iterator_range/iterator_range.hpp index 5e000b72..1b9d73f9 100644 --- a/include/boost/fusion/view/iterator_range/iterator_range.hpp +++ b/include/boost/fusion/view/iterator_range/iterator_range.hpp @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include diff --git a/test/algorithm/erase_key.cpp b/test/algorithm/erase_key.cpp index 418b5d77..81d0f933 100644 --- a/test/algorithm/erase_key.cpp +++ b/test/algorithm/erase_key.cpp @@ -30,7 +30,7 @@ void test_set(Set const& set) using namespace boost::fusion; std::cout << set << std::endl; - BOOST_STATIC_ASSERT(result_of::size::value == 3); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_TEST((*find(set) == 1)); BOOST_TEST((*find(set) == 1.5)); BOOST_TEST((*find(set) == "hello")); @@ -47,7 +47,7 @@ void test_map(Map const& map) using namespace boost::fusion; std::cout << map << std::endl; - BOOST_STATIC_ASSERT(result_of::size::value == 3); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_TEST(((*find<_1>(map)).second == 1)); BOOST_TEST(((*find<_3>(map)).second == 1.5)); BOOST_TEST(((*find<_4>(map)).second == std::string("hello"))); diff --git a/test/algorithm/fold.hpp b/test/algorithm/fold.hpp index df42d7d7..87a81a7c 100644 --- a/test/algorithm/fold.hpp +++ b/test/algorithm/fold.hpp @@ -59,7 +59,7 @@ struct sum template struct result - : fusion::result_of::make_pair< + : boost::fusion::result_of::make_pair< mpl::int_< boost::remove_reference< State @@ -108,7 +108,7 @@ struct meta_sum #ifdef BOOST_FUSION_TEST_ITER_FOLD typedef typename - fusion::result_of::value_of< + boost::fusion::result_of::value_of< typename boost::remove_reference::type >::type t; @@ -144,7 +144,7 @@ struct fold_test_n { mpl::range_c init_range; - typename fusion::result_of::as_vector< + typename boost::fusion::result_of::as_vector< typename mpl::transform< range , mpl::always @@ -169,20 +169,20 @@ struct fold_test_n { typedef typename #ifdef BOOST_FUSION_TEST_REVERSE_FOLD - fusion::result_of::as_vector< + boost::fusion::result_of::as_vector< typename mpl::copy< mpl::range_c , mpl::front_inserter > >::type >::type #else - fusion::result_of::as_vector >::type + boost::fusion::result_of::as_vector >::type #endif vec; typedef boost::is_same< - typename fusion::result_of::BOOST_FUSION_TEST_FOLD_NAME< + typename boost::fusion::result_of::BOOST_FUSION_TEST_FOLD_NAME< vec , mpl::vector, mpl::int_<0> > , meta_sum diff --git a/test/algorithm/segmented_find.cpp b/test/algorithm/segmented_find.cpp index a334c222..4c4c31a5 100644 --- a/test/algorithm/segmented_find.cpp +++ b/test/algorithm/segmented_find.cpp @@ -19,9 +19,9 @@ process_tree(Tree const &tree) { using namespace boost; - typedef typename fusion::result_of::find_s::type short_iter; - typedef typename fusion::result_of::find_s::type float_iter; - typedef typename fusion::result_of::find_s::type not_there_iter; + typedef typename boost::fusion::result_of::find_s::type short_iter; + typedef typename boost::fusion::result_of::find_s::type float_iter; + typedef typename boost::fusion::result_of::find_s::type not_there_iter; // find_if_s of a segmented data structure returns generic // segmented iterators diff --git a/test/algorithm/segmented_find_if.cpp b/test/algorithm/segmented_find_if.cpp index ff7ed888..14a2af7e 100644 --- a/test/algorithm/segmented_find_if.cpp +++ b/test/algorithm/segmented_find_if.cpp @@ -22,9 +22,9 @@ process_tree(Tree const &tree) using namespace boost; using mpl::_; - typedef typename fusion::result_of::find_if_s >::type short_iter; - typedef typename fusion::result_of::find_if_s >::type float_iter; - typedef typename fusion::result_of::find_if_s >::type not_there_iter; + typedef typename boost::fusion::result_of::find_if_s >::type short_iter; + typedef typename boost::fusion::result_of::find_if_s >::type float_iter; + typedef typename boost::fusion::result_of::find_if_s >::type not_there_iter; // find_if_s of a segmented data structure returns generic // segmented iterators diff --git a/test/algorithm/transform.cpp b/test/algorithm/transform.cpp index fac0c92a..2b3394a3 100644 --- a/test/algorithm/transform.cpp +++ b/test/algorithm/transform.cpp @@ -109,46 +109,46 @@ main() { typedef range_c sequence_type; sequence_type sequence; - std::cout << transform(sequence, square()) << std::endl; - BOOST_TEST((transform(sequence, square()) == make_vector(25, 36, 49, 64))); + std::cout << boost::fusion::transform(sequence, square()) << std::endl; + BOOST_TEST((boost::fusion::transform(sequence, square()) == make_vector(25, 36, 49, 64))); } { typedef range_c mpl_list1; - std::cout << transform(mpl_list1(), square()) << std::endl; - BOOST_TEST((transform(mpl_list1(), square()) == make_vector(25, 36, 49, 64))); + std::cout << boost::fusion::transform(mpl_list1(), square()) << std::endl; + BOOST_TEST((boost::fusion::transform(mpl_list1(), square()) == make_vector(25, 36, 49, 64))); } { vector tup(1, 2, 3); - std::cout << transform(tup, square()) << std::endl; - BOOST_TEST((transform(tup, square()) == make_vector(1, 4, 9))); + std::cout << boost::fusion::transform(tup, square()) << std::endl; + BOOST_TEST((boost::fusion::transform(tup, square()) == make_vector(1, 4, 9))); } { vector tup1(1, 2, 3); vector tup2(4, 5, 6); - std::cout << transform(tup1, tup2, add()) << std::endl; - BOOST_TEST((transform(tup1, tup2, add()) == make_vector(5, 7, 9))); + std::cout << boost::fusion::transform(tup1, tup2, add()) << std::endl; + BOOST_TEST((boost::fusion::transform(tup1, tup2, add()) == make_vector(5, 7, 9))); } { // Unary transform that requires lvalues, just check compilation vector tup1(1, 2, 3); - BOOST_TEST(at_c<0>(transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); - BOOST_TEST(*begin(transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(at_c<0>(boost::fusion::transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(*begin(boost::fusion::transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); } { vector tup1(1, 2, 3); vector tup2(4, 5, 6); - BOOST_TEST(at_c<0>(transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); - BOOST_TEST(*begin(transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(at_c<0>(boost::fusion::transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(*begin(boost::fusion::transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); } { vector tup1(1, 2, 3); - BOOST_TEST(transform(tup1, twice) == make_vector(2,4,6)); + BOOST_TEST(boost::fusion::transform(tup1, twice) == make_vector(2,4,6)); } diff --git a/test/compile_time/vector_intrinsic.cpp b/test/compile_time/vector_intrinsic.cpp index 3fa3a77e..3690a496 100644 --- a/test/compile_time/vector_intrinsic.cpp +++ b/test/compile_time/vector_intrinsic.cpp @@ -38,17 +38,17 @@ namespace fusion::at_c<8>(v); fusion::at_c<9>(v); - typedef typename fusion::result_of::value_at_c::type va0; - typedef typename fusion::result_of::value_at_c::type va1; - typedef typename fusion::result_of::value_at_c::type va2; - typedef typename fusion::result_of::value_at_c::type va3; - typedef typename fusion::result_of::value_at_c::type va4; + typedef typename boost::fusion::result_of::value_at_c::type va0; + typedef typename boost::fusion::result_of::value_at_c::type va1; + typedef typename boost::fusion::result_of::value_at_c::type va2; + typedef typename boost::fusion::result_of::value_at_c::type va3; + typedef typename boost::fusion::result_of::value_at_c::type va4; - typedef typename fusion::result_of::value_at_c::type va5; - typedef typename fusion::result_of::value_at_c::type va6; - typedef typename fusion::result_of::value_at_c::type va7; - typedef typename fusion::result_of::value_at_c::type va8; - typedef typename fusion::result_of::value_at_c::type va9; + typedef typename boost::fusion::result_of::value_at_c::type va5; + typedef typename boost::fusion::result_of::value_at_c::type va6; + typedef typename boost::fusion::result_of::value_at_c::type va7; + typedef typename boost::fusion::result_of::value_at_c::type va8; + typedef typename boost::fusion::result_of::value_at_c::type va9; fusion::begin(v); fusion::end(v); diff --git a/test/functional/invoke.cpp b/test/functional/invoke.cpp index 460e1e29..52740eec 100644 --- a/test/functional/invoke.cpp +++ b/test/functional/invoke.cpp @@ -331,7 +331,7 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>) template void test_sequence(Sequence & seq) { - test_sequence_n(seq, mpl::int_::value>()); + test_sequence_n(seq, mpl::int_::value>()); } @@ -340,18 +340,18 @@ void result_type_tests() using boost::is_same; BOOST_TEST(( is_same< - fusion::result_of::invoke >::type, int + boost::fusion::result_of::invoke >::type, int >::value )); // disabled until boost::result_of supports it // BOOST_TEST(( is_same< -// fusion::result_of::invoke >::type, int +// boost::fusion::result_of::invoke >::type, int // >::value )); BOOST_TEST(( is_same< - fusion::result_of::invoke >::type, int + boost::fusion::result_of::invoke >::type, int >::value )); // disabled until boost::result_of supports it // BOOST_TEST(( is_same< -// fusion::result_of::invoke >::type, int +// boost::fusion::result_of::invoke >::type, int // >::value )); } diff --git a/test/functional/invoke_function_object.cpp b/test/functional/invoke_function_object.cpp index 375bc4c5..31357aa8 100644 --- a/test/functional/invoke_function_object.cpp +++ b/test/functional/invoke_function_object.cpp @@ -182,16 +182,16 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>) template void test_sequence(Sequence & seq) { - test_sequence_n(seq, mpl::int_::value>()); + test_sequence_n(seq, mpl::int_::value>()); } void result_type_tests() { using boost::is_same; - BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< nullary_fobj, fusion::vector<> >::type, int >::value )); - BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); - BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); + BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< nullary_fobj, fusion::vector<> >::type, int >::value )); + BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); + BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); } diff --git a/test/functional/invoke_procedure.cpp b/test/functional/invoke_procedure.cpp index 2dc93c5a..f8db06cc 100644 --- a/test/functional/invoke_procedure.cpp +++ b/test/functional/invoke_procedure.cpp @@ -244,7 +244,7 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>) template void test_sequence(Sequence & seq) { - test_sequence_n(seq, mpl::int_::value>()); + test_sequence_n(seq, mpl::int_::value>()); } int main() diff --git a/test/functional/make_fused.cpp b/test/functional/make_fused.cpp index aab7928a..a207359c 100644 --- a/test/functional/make_fused.cpp +++ b/test/functional/make_fused.cpp @@ -63,7 +63,7 @@ int main() test_func<> f; test_func f_nc; - fusion::result_of::make_fused< test_func<> >::type fused_func + boost::fusion::result_of::make_fused< test_func<> >::type fused_func = fusion::make_fused(f); BOOST_TEST(fused_func(lv_vec) == 1); diff --git a/test/functional/make_fused_function_object.cpp b/test/functional/make_fused_function_object.cpp index dec2411a..87ee8e23 100644 --- a/test/functional/make_fused_function_object.cpp +++ b/test/functional/make_fused_function_object.cpp @@ -73,7 +73,7 @@ int main() test_func<> f; test_func f_nc; - fusion::result_of::make_fused_function_object< test_func<> >::type fused_func + boost::fusion::result_of::make_fused_function_object< test_func<> >::type fused_func = fusion::make_fused_function_object(f); BOOST_TEST(fused_func(lv_vec) == 1); diff --git a/test/functional/make_fused_procedure.cpp b/test/functional/make_fused_procedure.cpp index 754c17bc..ce7e267c 100644 --- a/test/functional/make_fused_procedure.cpp +++ b/test/functional/make_fused_procedure.cpp @@ -69,7 +69,7 @@ int main() test_func<> f; test_func f_nc; - fusion::result_of::make_fused_procedure< test_func<> >::type fused_func + boost::fusion::result_of::make_fused_procedure< test_func<> >::type fused_func = fusion::make_fused_procedure(f); CHECK_EFFECT(fused_func(lv_vec), 1); diff --git a/test/functional/make_unfused.cpp b/test/functional/make_unfused.cpp index ff52e54f..1e286918 100644 --- a/test/functional/make_unfused.cpp +++ b/test/functional/make_unfused.cpp @@ -42,7 +42,7 @@ struct test_func template struct result< Self(Seq &) > - : mpl::if_< mpl::and_< fusion::result_of::empty, RemoveNullary >, + : mpl::if_< mpl::and_< boost::fusion::result_of::empty, RemoveNullary >, boost::blank, mpl::identity >::type { }; @@ -86,14 +86,14 @@ int main() test_func<> f; test_func f_nc; - fusion::result_of::make_unfused< test_func<> >::type unfused_func = + boost::fusion::result_of::make_unfused< test_func<> >::type unfused_func = fusion::make_unfused(f); - fusion::result_of::make_unfused< boost::reference_wrapper< + boost::fusion::result_of::make_unfused< boost::reference_wrapper< test_func > >::type unfused_func_ref = fusion::make_unfused(ref(f_nc)); - fusion::result_of::make_unfused< boost::reference_wrapper< + boost::fusion::result_of::make_unfused< boost::reference_wrapper< test_func const> >::type unfused_func_c_ref = fusion::make_unfused(cref(f_nc)); diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index 9d541880..73868367 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -148,7 +148,7 @@ main() { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } @@ -166,8 +166,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -177,22 +177,22 @@ main() { BOOST_MPL_ASSERT(( boost::is_same< - result_of::front::type, + boost::fusion::result_of::front::type, boost::fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - result_of::front::type::type, + boost::fusion::result_of::front::type::type, int >)); BOOST_MPL_ASSERT(( boost::is_same< - result_of::front::type, + boost::fusion::result_of::front::type, boost::fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - result_of::front::type::type, + boost::fusion::result_of::front::type::type, int >)); } diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index bad876ea..38415633 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -83,8 +83,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -127,7 +127,7 @@ main() { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index 25b55e33..c97e84b0 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -73,8 +73,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -117,12 +117,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point p(5, 3); diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index 173edad0..d68d9904 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -75,8 +75,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -122,12 +122,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point basep(5, 3); adapted::point p(basep); diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 3323fa82..62574a7e 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -79,8 +79,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -116,12 +116,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((fusion::result_of::has_key)); - BOOST_MPL_ASSERT((fusion::result_of::has_key)); - BOOST_MPL_ASSERT((mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point p = {5, 3}; @@ -132,7 +132,7 @@ main() { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } diff --git a/test/sequence/adapt_assoc_struct_named.cpp b/test/sequence/adapt_assoc_struct_named.cpp index 3ae0a380..f24dadd9 100644 --- a/test/sequence/adapt_assoc_struct_named.cpp +++ b/test/sequence/adapt_assoc_struct_named.cpp @@ -61,8 +61,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -102,12 +102,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point basep = {5, 3}; adapted::point p(basep); diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index ceba695c..15e2124c 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -77,8 +77,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -121,12 +121,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); point p(5, 3); diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index ca751283..a327f9e8 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -78,8 +78,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -115,12 +115,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); point p = {5, 3}; diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 2c4b23f4..68240463 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -96,8 +96,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -135,16 +135,16 @@ main() using namespace boost::fusion; using boost::is_same; - typedef result_of::begin::type b; - typedef result_of::end::type e; + typedef boost::fusion::result_of::begin::type b; + typedef boost::fusion::result_of::end::type e; // this fails - BOOST_MPL_ASSERT((is_same::type, e>)); + BOOST_MPL_ASSERT((is_same::type, e>)); } { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index 171d78c0..ef859655 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -75,8 +75,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -118,17 +118,17 @@ main() using namespace boost::fusion; using boost::is_same; - typedef result_of::begin::type b; - typedef result_of::end::type e; + typedef boost::fusion::result_of::begin::type b; + typedef boost::fusion::result_of::end::type e; // this fails - BOOST_MPL_ASSERT((is_same::type, e>)); + BOOST_MPL_ASSERT((is_same::type, e>)); } { BOOST_MPL_ASSERT((mpl::is_sequence)); BOOST_MPL_ASSERT((boost::is_same< - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_c::type , mpl::front::type>)); } diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index 1aa2e2e2..2f0d4c6b 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -85,8 +85,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 7db3bd8a..352cf995 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -73,8 +73,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -111,10 +111,10 @@ main() { // begin/end using namespace boost::fusion; - typedef result_of::begin >::type b; - typedef result_of::end >::type e; + typedef boost::fusion::result_of::begin >::type b; + typedef boost::fusion::result_of::end >::type e; // this fails - BOOST_MPL_ASSERT((boost::is_same::type, e>)); + BOOST_MPL_ASSERT((boost::is_same::type, e>)); } return boost::report_errors(); diff --git a/test/sequence/adt_attribute_proxy.cpp b/test/sequence/adt_attribute_proxy.cpp index 4535bb92..d5a947af 100644 --- a/test/sequence/adt_attribute_proxy.cpp +++ b/test/sequence/adt_attribute_proxy.cpp @@ -82,65 +82,65 @@ int main() BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::value_at_key::type, + boost::fusion::result_of::value_at_key::type, std::string >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::value_at_key::type, - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_key::type, + boost::fusion::result_of::value_at_c::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::value_at_key::type, + boost::fusion::result_of::value_at_key::type, int >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::value_at_key::type, - fusion::result_of::value_at_c::type + boost::fusion::result_of::value_at_key::type, + boost::fusion::result_of::value_at_c::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, + boost::fusion::result_of::at_key::type, fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, + boost::fusion::result_of::at_key::type, fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, - fusion::result_of::front::type + boost::fusion::result_of::at_key::type, + boost::fusion::result_of::front::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, - fusion::result_of::back::type + boost::fusion::result_of::at_key::type, + boost::fusion::result_of::back::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, + boost::fusion::result_of::at_key::type, fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, + boost::fusion::result_of::at_key::type, fusion::extension::adt_attribute_proxy >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, - fusion::result_of::front::type + boost::fusion::result_of::at_key::type, + boost::fusion::result_of::front::type >)); BOOST_MPL_ASSERT(( boost::is_same< - fusion::result_of::at_key::type, - fusion::result_of::back::type + boost::fusion::result_of::at_key::type, + boost::fusion::result_of::back::type >)); BOOST_MPL_ASSERT(( diff --git a/test/sequence/as_map.cpp b/test/sequence/as_map.cpp index 6c18a3cc..65ff5002 100644 --- a/test/sequence/as_map.cpp +++ b/test/sequence/as_map.cpp @@ -36,7 +36,7 @@ main() { typedef pair p1; typedef pair p2; - result_of::as_map >::type map(make_pair('X'), make_pair("Men")); + boost::fusion::result_of::as_map >::type map(make_pair('X'), make_pair("Men")); std::cout << at_key(map) << std::endl; std::cout << at_key(map) << std::endl; BOOST_TEST(at_key(map) == 'X'); diff --git a/test/sequence/as_set.cpp b/test/sequence/as_set.cpp index 935da42d..f93d7d68 100644 --- a/test/sequence/as_set.cpp +++ b/test/sequence/as_set.cpp @@ -40,7 +40,7 @@ main() } { - result_of::as_set >::type set(1, 1.23, "harru"); + boost::fusion::result_of::as_set >::type set(1, 1.23, "harru"); std::cout << at_key(set) << std::endl; BOOST_TEST(at_key(set) == 1); } diff --git a/test/sequence/boost_tuple.cpp b/test/sequence/boost_tuple.cpp index 17b6389c..a0049c31 100644 --- a/test/sequence/boost_tuple.cpp +++ b/test/sequence/boost_tuple.cpp @@ -56,8 +56,8 @@ main() at_c<1>(t) = "mama mia"; BOOST_TEST(t == make_vector(6, "mama mia")); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(t) == 6); } diff --git a/test/sequence/define_assoc_struct.cpp b/test/sequence/define_assoc_struct.cpp index 6f6326ec..ed8dfbe0 100644 --- a/test/sequence/define_assoc_struct.cpp +++ b/test/sequence/define_assoc_struct.cpp @@ -51,8 +51,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -88,12 +88,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point p(5, 3); diff --git a/test/sequence/define_assoc_tpl_struct.cpp b/test/sequence/define_assoc_tpl_struct.cpp index ec3c7f3b..6d0b5bdb 100644 --- a/test/sequence/define_assoc_tpl_struct.cpp +++ b/test/sequence/define_assoc_tpl_struct.cpp @@ -55,8 +55,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -92,12 +92,12 @@ main() { // assoc stuff - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); point p(5, 3); diff --git a/test/sequence/define_struct.cpp b/test/sequence/define_struct.cpp index 8d839781..795fdf6e 100644 --- a/test/sequence/define_struct.cpp +++ b/test/sequence/define_struct.cpp @@ -48,8 +48,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -86,10 +86,10 @@ main() { // begin/end using namespace boost::fusion; - typedef result_of::begin::type b; - typedef result_of::end::type e; + typedef boost::fusion::result_of::begin::type b; + typedef boost::fusion::result_of::end::type e; // this fails - BOOST_MPL_ASSERT((boost::is_same::type, e>)); + BOOST_MPL_ASSERT((boost::is_same::type, e>)); } { diff --git a/test/sequence/define_tpl_struct.cpp b/test/sequence/define_tpl_struct.cpp index a2193709..9896493c 100644 --- a/test/sequence/define_tpl_struct.cpp +++ b/test/sequence/define_tpl_struct.cpp @@ -51,8 +51,8 @@ main() at_c<1>(p) = 9; BOOST_TEST(p == make_vector(6, 9)); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 9); @@ -89,10 +89,10 @@ main() { // begin/end using namespace boost::fusion; - typedef result_of::begin >::type b; - typedef result_of::end >::type e; + typedef boost::fusion::result_of::begin >::type b; + typedef boost::fusion::result_of::end >::type e; // this fails - BOOST_MPL_ASSERT((boost::is_same::type, e>)); + BOOST_MPL_ASSERT((boost::is_same::type, e>)); } diff --git a/test/sequence/filter_view.cpp b/test/sequence/filter_view.cpp index c052a37b..3fb5a2d1 100644 --- a/test/sequence/filter_view.cpp +++ b/test/sequence/filter_view.cpp @@ -77,7 +77,7 @@ main() filter_view_type view(v); std::cout << view << std::endl; BOOST_TEST((view == make_vector('@', 987654, true, 6.6))); - BOOST_STATIC_ASSERT(result_of::size::value == 4); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 4); } //cschmidt: This is illegal C++. ADL instantiates less<_, int_<3> > - which @@ -94,7 +94,7 @@ main() filter_view_type view(v); std::cout << view << std::endl; BOOST_TEST((view == make_vector(1, 2, 0, -1))); - BOOST_STATIC_ASSERT(result_of::size::value == 4); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 4); #endif }*/ @@ -104,7 +104,7 @@ main() typedef vector vec; typedef filter_view filter_view_type; - BOOST_MPL_ASSERT((result_of::equal_to::type, result_of::end::type>)); + BOOST_MPL_ASSERT((boost::fusion::result_of::equal_to::type, boost::fusion::result_of::end::type>)); } { @@ -114,11 +114,11 @@ main() typedef filter_view > > filter_view_type; filter_view_type f(m); - BOOST_MPL_ASSERT((result_of::has_key::type)); - BOOST_MPL_ASSERT_NOT((result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); + BOOST_MPL_ASSERT_NOT((boost::fusion::result_of::has_key::type)); - BOOST_MPL_ASSERT((is_same::type>::type, double>)); - BOOST_MPL_ASSERT((is_same::type>::type, std::string>)); + BOOST_MPL_ASSERT((is_same::type>::type, double>)); + BOOST_MPL_ASSERT((is_same::type>::type, std::string>)); std::cout << deref_data(begin(f)) << std::endl; BOOST_TEST((deref_data(begin(f)) == "Bond")); diff --git a/test/sequence/iterator.hpp b/test/sequence/iterator.hpp index 118bb347..f5c76e47 100644 --- a/test/sequence/iterator.hpp +++ b/test/sequence/iterator.hpp @@ -30,7 +30,7 @@ void test() char const* s = "Hello"; typedef FUSION_SEQUENCE seq_type; seq_type v(1, 'x', 3.3, s); - result_of::begin::type i(v); + boost::fusion::result_of::begin::type i(v); BOOST_TEST(*i == 1); BOOST_TEST(*next(i) == 'x'); @@ -62,7 +62,7 @@ void test() char const* s = "Hello"; typedef FUSION_SEQUENCE const seq_type; seq_type t(1, 'x', 3.3, s); - result_of::begin::type i(t); + boost::fusion::result_of::begin::type i(t); BOOST_TEST(*i == 1); BOOST_TEST(*next(i) == 'x'); @@ -80,22 +80,22 @@ void test() typedef FUSION_SEQUENCE seq_type; typedef FUSION_SEQUENCE const cseq_type; - typedef result_of::begin::type vi1; - typedef result_of::begin::type vi2; - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); - BOOST_STATIC_ASSERT((result_of::equal_to::value)); + typedef boost::fusion::result_of::begin::type vi1; + typedef boost::fusion::result_of::begin::type vi2; + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::equal_to::value)); } { typedef FUSION_SEQUENCE seq_type; - typedef result_of::begin::type begin_type; - typedef result_of::end::type end_type; - typedef result_of::next::type i1; - typedef result_of::next::type i2; + typedef boost::fusion::result_of::begin::type begin_type; + typedef boost::fusion::result_of::end::type end_type; + typedef boost::fusion::result_of::next::type i1; + typedef boost::fusion::result_of::next::type i2; BOOST_STATIC_ASSERT((is_same::value)); } @@ -105,7 +105,7 @@ void test() char const* s = "Hello"; typedef FUSION_SEQUENCE seq_type; seq_type t(1, 'x', 3.3, s); - result_of::begin::type i(t); + boost::fusion::result_of::begin::type i(t); BOOST_TEST(*i == 1); BOOST_TEST(*next(i) == 'x'); @@ -138,34 +138,34 @@ void test() typedef FUSION_SEQUENCE seq_type; seq_type t(1, 'x', 3.3, "Hello"); - BOOST_STATIC_ASSERT((result_of::distance< - result_of::begin::type - , result_of::end::type >::value == 4)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::distance< + boost::fusion::result_of::begin::type + , boost::fusion::result_of::end::type >::value == 4)); BOOST_TEST(distance(begin(t), end(t)).value == 4); } - { // Testing tuple iterator result_of::value_of, result_of::deref, result_of::value_at + { // Testing tuple iterator boost::fusion::result_of::value_of, boost::fusion::result_of::deref, boost::fusion::result_of::value_at typedef FUSION_SEQUENCE seq_type; - typedef result_of::begin::type i0; - typedef result_of::next::type i1; - typedef result_of::next::type>::type i2; + typedef boost::fusion::result_of::begin::type i0; + typedef boost::fusion::result_of::next::type i1; + typedef boost::fusion::result_of::next::type>::type i2; BOOST_STATIC_ASSERT(( - is_same::type, int>::value)); + is_same::type, int>::value)); BOOST_STATIC_ASSERT(( - is_same::type, char&>::value)); + is_same::type, char&>::value)); BOOST_STATIC_ASSERT(( is_same::type, FUSION_TRAVERSAL_TAG>::value)); - BOOST_STATIC_ASSERT((is_same::type, int&>::value)); - BOOST_STATIC_ASSERT((is_same::type, char&>::value)); + BOOST_STATIC_ASSERT((is_same::type, int&>::value)); + BOOST_STATIC_ASSERT((is_same::type, char&>::value)); - BOOST_STATIC_ASSERT((is_same::type, int>::value)); - BOOST_STATIC_ASSERT((is_same::type, char&>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, char&>::value)); } { // Testing advance diff --git a/test/sequence/iterator_range.cpp b/test/sequence/iterator_range.cpp index 51288dbd..cf2c27ef 100644 --- a/test/sequence/iterator_range.cpp +++ b/test/sequence/iterator_range.cpp @@ -50,7 +50,7 @@ main() slice_t slice(i1, i3); std::cout << slice << std::endl; BOOST_TEST((slice == make_vector('x', 3.3))); - BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); } { @@ -64,7 +64,7 @@ main() slice_t slice(i1, i3); std::cout << slice << std::endl; BOOST_TEST(slice == make_vector()); - BOOST_STATIC_ASSERT(result_of::size::value == 0); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 0); } } @@ -82,7 +82,7 @@ main() slice_t slice(f, l); std::cout << slice << std::endl; BOOST_TEST((slice == make_vector(3, 4))); - BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); } { @@ -90,19 +90,19 @@ main() map_type m(make_pair("foo"), make_pair('x'), make_pair(2)); typedef iterator_range< - result_of::begin::type - , result_of::advance_c::type,2>::type + boost::fusion::result_of::begin::type + , boost::fusion::result_of::advance_c::type,2>::type > range_type; range_type r(begin(m), advance_c<2>(begin(m))); - BOOST_MPL_ASSERT((result_of::has_key::type)); - BOOST_MPL_ASSERT((result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); - BOOST_MPL_ASSERT((boost::is_same::type>::type, void>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, double>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, double>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type, std::string>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, char>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, char>)); std::cout << deref_data(begin(r)) << std::endl; std::cout << deref_data(fusion::next(begin(r))) << std::endl; diff --git a/test/sequence/joint_view.cpp b/test/sequence/joint_view.cpp index 900b9a68..f4609b64 100644 --- a/test/sequence/joint_view.cpp +++ b/test/sequence/joint_view.cpp @@ -159,20 +159,20 @@ main() typedef joint_view joint_view_type; joint_view_type j(m,s); - BOOST_MPL_ASSERT((result_of::has_key::type)); - BOOST_MPL_ASSERT((result_of::has_key::type)); - BOOST_MPL_ASSERT((result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key::type)); - BOOST_MPL_ASSERT((boost::is_same::type>::type, void>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, std::string>)); BOOST_MPL_ASSERT((boost::is_same< - result_of::key_of::type>::type>::type>::type + boost::fusion::result_of::key_of::type>::type>::type>::type , float>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type>::type, std::string>)); BOOST_MPL_ASSERT((boost::is_same< - result_of::value_of_data::type>::type>::type>::type + boost::fusion::result_of::value_of_data::type>::type>::type>::type , float>)); std::cout << deref_data(begin(j)) << std::endl; diff --git a/test/sequence/map.cpp b/test/sequence/map.cpp index 2d2e2593..e0105762 100644 --- a/test/sequence/map.cpp +++ b/test/sequence/map.cpp @@ -55,15 +55,15 @@ main() BOOST_TEST(at_key(m) == "Men"); BOOST_STATIC_ASSERT(( - boost::is_same::type, char>::value)); + boost::is_same::type, char>::value)); BOOST_STATIC_ASSERT(( - boost::is_same::type, std::string>::value)); + boost::is_same::type, std::string>::value)); std::cout << m << std::endl; - BOOST_STATIC_ASSERT((result_of::has_key::value)); - BOOST_STATIC_ASSERT((result_of::has_key::value)); - BOOST_STATIC_ASSERT((!result_of::has_key::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key::value)); + BOOST_STATIC_ASSERT((!boost::fusion::result_of::has_key::value)); std::cout << deref_data(begin(m)) << std::endl; std::cout << deref_data(fusion::next(begin(m))) << std::endl; @@ -71,10 +71,10 @@ main() BOOST_TEST(deref_data(begin(m)) == 'X'); BOOST_TEST(deref_data(fusion::next(begin(m))) == "Men"); - BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, double>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type, char>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, double>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type, char>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); } { diff --git a/test/sequence/misc.hpp b/test/sequence/misc.hpp index c5b58b45..3a1ee091 100644 --- a/test/sequence/misc.hpp +++ b/test/sequence/misc.hpp @@ -21,7 +21,7 @@ #endif #if !defined(FUSION_SIZE) -#define FUSION_SIZE result_of::size +#define FUSION_SIZE boost::fusion::result_of::size #endif template @@ -144,8 +144,8 @@ test() BOOST_STATIC_ASSERT(FUSION_SIZE::value == 3); BOOST_STATIC_ASSERT(FUSION_SIZE::value == 0); - BOOST_STATIC_ASSERT(!result_of::empty::value); - BOOST_STATIC_ASSERT(result_of::empty::value); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::empty::value); } { // testing front & back diff --git a/test/sequence/reverse_view.cpp b/test/sequence/reverse_view.cpp index 980bdc78..deb3f6d2 100644 --- a/test/sequence/reverse_view.cpp +++ b/test/sequence/reverse_view.cpp @@ -54,9 +54,9 @@ main() std::cout << rev << std::endl; BOOST_TEST((rev == make_vector(s, 123456789, 'x', 123))); - typedef result_of::begin::type first_type; + typedef boost::fusion::result_of::begin::type first_type; first_type first_it(begin(rev)); - typedef result_of::next::type second_type; + typedef boost::fusion::result_of::next::type second_type; second_type second_it(next(first_it)); BOOST_TEST((*second_it == 123456789)); BOOST_TEST((*prior(second_it) == s)); @@ -69,16 +69,16 @@ main() BOOST_TEST((at_c<3>(rev)==123)); BOOST_MPL_ASSERT(( - boost::is_same::type,char const*> + boost::is_same::type,char const*> )); BOOST_MPL_ASSERT(( - boost::is_same::type,long> + boost::is_same::type,long> )); BOOST_MPL_ASSERT(( - boost::is_same::type,char> + boost::is_same::type,char> )); BOOST_MPL_ASSERT(( - boost::is_same::type,int> + boost::is_same::type,int> )); } diff --git a/test/sequence/segmented_iterator_range.cpp b/test/sequence/segmented_iterator_range.cpp index 7a6e5830..4f75d592 100644 --- a/test/sequence/segmented_iterator_range.cpp +++ b/test/sequence/segmented_iterator_range.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -44,8 +43,8 @@ process_tree(Tree const &tree) using namespace fusion; using mpl::_; - typedef typename fusion::result_of::find_if_s >::type short_iter; - typedef typename fusion::result_of::find_if_s >::type float_iter; + typedef typename boost::fusion::result_of::find_if_s >::type short_iter; + typedef typename boost::fusion::result_of::find_if_s >::type float_iter; typedef iterator_range slice_t; BOOST_STATIC_ASSERT(traits::is_segmented::value); @@ -89,7 +88,7 @@ main() slice_t slice(i1, i3); std::cout << slice << std::endl; BOOST_TEST((slice == make_vector('x', 3.3))); - BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); } { @@ -103,7 +102,7 @@ main() slice_t slice(i1, i3); std::cout << slice << std::endl; BOOST_TEST(slice == make_vector()); - BOOST_STATIC_ASSERT(result_of::size::value == 0); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 0); } } @@ -121,7 +120,7 @@ main() slice_t slice(f, l); std::cout << slice << std::endl; BOOST_TEST((slice == make_vector(3, 4))); - BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); } { diff --git a/test/sequence/set.cpp b/test/sequence/set.cpp index 617135ae..c4b2b6c0 100644 --- a/test/sequence/set.cpp +++ b/test/sequence/set.cpp @@ -50,15 +50,15 @@ main() BOOST_TEST(at_key(m) == "Hola"); BOOST_STATIC_ASSERT(( - boost::is_same::type, int>::value)); + boost::is_same::type, int>::value)); BOOST_STATIC_ASSERT(( - boost::is_same::type, std::string>::value)); + boost::is_same::type, std::string>::value)); std::cout << m << std::endl; - BOOST_STATIC_ASSERT((result_of::has_key::value)); - BOOST_STATIC_ASSERT((result_of::has_key::value)); - BOOST_STATIC_ASSERT((!result_of::has_key::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key::value)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key::value)); + BOOST_STATIC_ASSERT((!boost::fusion::result_of::has_key::value)); std::cout << deref_data(begin(m)) << std::endl; std::cout << deref_data(fusion::next(begin(m))) << std::endl; @@ -66,10 +66,10 @@ main() BOOST_TEST(deref_data(begin(m)) == 123); BOOST_TEST(deref_data(fusion::next(begin(m))) == "Hola"); - BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type, int>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::type>::type, std::string>::value)); } { diff --git a/test/sequence/single_view.cpp b/test/sequence/single_view.cpp index e9322712..f3285e86 100644 --- a/test/sequence/single_view.cpp +++ b/test/sequence/single_view.cpp @@ -76,7 +76,7 @@ main() BOOST_TEST(end(view1) == advance_c<0>(end(view1))); BOOST_TEST(begin(view1) == advance_c<-1>(end(view1))); BOOST_TEST(1 == size(view1)); - BOOST_MPL_ASSERT((boost::is_same, boost::mpl::int_<0> >::type>)); + BOOST_MPL_ASSERT((boost::is_same, boost::mpl::int_<0> >::type>)); single_view view2; std::cout << view2 << std::endl; diff --git a/test/sequence/std_pair.cpp b/test/sequence/std_pair.cpp index 5c335d28..663dc863 100644 --- a/test/sequence/std_pair.cpp +++ b/test/sequence/std_pair.cpp @@ -55,8 +55,8 @@ main() at_c<1>(p) = "mama mia"; BOOST_TEST(p == make_vector(6, "mama mia")); - BOOST_STATIC_ASSERT(result_of::size::value == 2); - BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == "mama mia"); diff --git a/test/sequence/swap.cpp b/test/sequence/swap.cpp index 7df7b822..50c2381d 100644 --- a/test/sequence/swap.cpp +++ b/test/sequence/swap.cpp @@ -22,7 +22,7 @@ int main() namespace fusion = boost::fusion; { typedef fusion::vector, char> test_vector; - BOOST_MPL_ASSERT((boost::is_same::type>)); + BOOST_MPL_ASSERT((boost::is_same::type>)); test_vector v1(std::vector(1, 101), 'a'), v2(std::vector(1, 202), 'b'); diff --git a/test/sequence/tree.hpp b/test/sequence/tree.hpp index 8d62a20a..a345a8f1 100644 --- a/test/sequence/tree.hpp +++ b/test/sequence/tree.hpp @@ -19,18 +19,14 @@ #include #include #include -#include -#include #include -#include -#include -#include +#include namespace boost { namespace fusion { struct tree_tag; - template + template struct tree : sequence_base > { @@ -38,7 +34,7 @@ namespace boost { namespace fusion typedef Left left_type; typedef Right right_type; typedef tree_tag fusion_tag; - typedef bidirectional_traversal_tag category; + typedef forward_traversal_tag category; typedef mpl::false_ is_view; typedef typename mpl::if_< @@ -59,13 +55,13 @@ namespace boost { namespace fusion segments_type segments; }; - template + template tree make_tree(Data const &data) { return tree(data); } - template + template tree make_tree(Data const &data, Left const &left, Right const &right) { return tree(data, left, right); @@ -73,17 +69,17 @@ namespace boost { namespace fusion namespace extension { - template<> + template <> struct is_segmented_impl { - template + template struct apply : mpl::true_ {}; }; - template<> + template <> struct segments_impl { - template + template struct apply { typedef typename mpl::if_< @@ -98,33 +94,6 @@ namespace boost { namespace fusion } }; }; - - template<> - struct begin_impl - { - template - struct apply - : segmented_begin - {}; - }; - - template<> - struct end_impl - { - template - struct apply - : segmented_end - {}; - }; - - template<> - struct size_impl - { - template - struct apply - : segmented_size::type - {}; - }; } }} diff --git a/test/sequence/value_at.hpp b/test/sequence/value_at.hpp index d791fb5e..f14afcb2 100644 --- a/test/sequence/value_at.hpp +++ b/test/sequence/value_at.hpp @@ -16,7 +16,7 @@ #endif #if !defined(FUSION_VALUE_AT) -#define FUSION_VALUE_AT(S, N) result_of::value_at_c +#define FUSION_VALUE_AT(S, N) boost::fusion::result_of::value_at_c #endif namespace test_detail diff --git a/test/sequence/vector_n.cpp b/test/sequence/vector_n.cpp index 5fcd5303..a9d2767a 100644 --- a/test/sequence/vector_n.cpp +++ b/test/sequence/vector_n.cpp @@ -41,10 +41,10 @@ main() { typedef vector1 type; type vec; - BOOST_STATIC_ASSERT(result_of::size::value == 1); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 1); BOOST_TEST(at_c<0>(vec) == 0); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); // prove that it is mutable at_c<0>(vec) = 987; @@ -76,13 +76,13 @@ main() { typedef vector2 type; type vec; - BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); BOOST_TEST(at_c<0>(vec) == 0); BOOST_TEST(at_c<1>(vec) == char()); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); } { @@ -102,15 +102,15 @@ main() { typedef vector3 type; type vec; - BOOST_STATIC_ASSERT(result_of::size::value == 3); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_TEST(at_c<0>(vec) == 0); BOOST_TEST(at_c<1>(vec) == char()); BOOST_TEST(at_c<2>(vec) == double()); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); } { @@ -146,13 +146,13 @@ main() BOOST_TEST(at_c<5>(vec) >= 5.9 && at_c<5>(vec) <= 6.1); BOOST_TEST(at_c<6>(vec) >= 6.9 && at_c<6>(vec) <= 7.1); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); std::cout << "(bool, char, short, int, long, float, double): " << sizeof(vec) << std::endl; } diff --git a/test/sequence/zip_view_ignore.cpp b/test/sequence/zip_view_ignore.cpp index 2a300809..d22bf70f 100644 --- a/test/sequence/zip_view_ignore.cpp +++ b/test/sequence/zip_view_ignore.cpp @@ -34,19 +34,19 @@ int main() BOOST_TEST(at_c<0>(back(v)) == 2); BOOST_TEST(at_c<2>(back(v)) == 'b'); - typedef result_of::begin::type first_iterator; - typedef result_of::value_of::type first_element; + typedef boost::fusion::result_of::begin::type first_iterator; + typedef boost::fusion::result_of::value_of::type first_element; - typedef result_of::at_c::type e0; - typedef result_of::at_c::type e2; + typedef boost::fusion::result_of::at_c::type e0; + typedef boost::fusion::result_of::at_c::type e2; BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same)); BOOST_TEST(size(front(v)) == 3); - typedef result_of::value_at_c::type first_value_at; - typedef result_of::value_at_c::type v0; - typedef result_of::value_at_c::type v2; + typedef boost::fusion::result_of::value_at_c::type first_value_at; + typedef boost::fusion::result_of::value_at_c::type v0; + typedef boost::fusion::result_of::value_at_c::type v2; BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same));