diff --git a/include/boost/fusion/container/vector/vector10.hpp b/include/boost/fusion/container/vector/vector10.hpp index f1af70d7..57dee09e 100644 --- a/include/boost/fusion/container/vector/vector10.hpp +++ b/include/boost/fusion/container/vector/vector10.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_VECTOR10_05042005_0257) #define FUSION_VECTOR10_05042005_0257 +#include #include #include #include @@ -39,7 +40,7 @@ namespace boost { namespace fusion struct fusion_sequence_tag; struct random_access_traversal_tag; - template + template struct vector0 : sequence_base > { typedef mpl::vector0<> types; diff --git a/include/boost/fusion/container/vector/vector10_fwd.hpp b/include/boost/fusion/container/vector/vector10_fwd.hpp new file mode 100644 index 00000000..b656cea4 --- /dev/null +++ b/include/boost/fusion/container/vector/vector10_fwd.hpp @@ -0,0 +1,34 @@ +#ifndef BOOST_PP_IS_ITERATING +/*============================================================================= + 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_VECTOR10_FWD_HPP_INCLUDED) +#define BOOST_FUSION_VECTOR10_FWD_HPP_INCLUDED + +#include +#include +#include + +namespace boost { namespace fusion +{ + template + struct vector0; + + // expand vector1 to vector10 + #define BOOST_PP_FILENAME_1 + #define BOOST_PP_ITERATION_LIMITS (1, 10) + #include BOOST_PP_ITERATE() + +}} + +#endif + +#else + + template + struct BOOST_PP_CAT(vector, BOOST_PP_ITERATION()); + +#endif diff --git a/include/boost/fusion/container/vector/vector20.hpp b/include/boost/fusion/container/vector/vector20.hpp index be711006..06649840 100644 --- a/include/boost/fusion/container/vector/vector20.hpp +++ b/include/boost/fusion/container/vector/vector20.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_VECTOR20_05052005_0205) #define FUSION_VECTOR20_05052005_0205 +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector20_fwd.hpp b/include/boost/fusion/container/vector/vector20_fwd.hpp new file mode 100644 index 00000000..982911eb --- /dev/null +++ b/include/boost/fusion/container/vector/vector20_fwd.hpp @@ -0,0 +1,31 @@ +#ifndef BOOST_PP_IS_ITERATING +/*============================================================================= + 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_VECTOR20_FWD_HPP_INCLUDED) +#define BOOST_FUSION_VECTOR20_FWD_HPP_INCLUDED + +#include +#include +#include + +namespace boost { namespace fusion +{ + // expand vector11 to vector20 + #define BOOST_PP_FILENAME_1 + #define BOOST_PP_ITERATION_LIMITS (11, 20) + #include BOOST_PP_ITERATE() + +}} + +#endif + +#else + + template + struct BOOST_PP_CAT(vector, BOOST_PP_ITERATION()); + +#endif diff --git a/include/boost/fusion/container/vector/vector30.hpp b/include/boost/fusion/container/vector/vector30.hpp index efbe9293..d6614b14 100644 --- a/include/boost/fusion/container/vector/vector30.hpp +++ b/include/boost/fusion/container/vector/vector30.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_VECTOR30_05052005_0206) #define FUSION_VECTOR30_05052005_0206 +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector30_fwd.hpp b/include/boost/fusion/container/vector/vector30_fwd.hpp new file mode 100644 index 00000000..5458b7d4 --- /dev/null +++ b/include/boost/fusion/container/vector/vector30_fwd.hpp @@ -0,0 +1,31 @@ +#ifndef BOOST_PP_IS_ITERATING +/*============================================================================= + 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_VECTOR30_FWD_HPP_INCLUDED) +#define BOOST_FUSION_VECTOR30_FWD_HPP_INCLUDED + +#include +#include +#include + +namespace boost { namespace fusion +{ + // expand vector21 to vector30 + #define BOOST_PP_FILENAME_1 + #define BOOST_PP_ITERATION_LIMITS (21, 30) + #include BOOST_PP_ITERATE() + +}} + +#endif + +#else + + template + struct BOOST_PP_CAT(vector, BOOST_PP_ITERATION()); + +#endif diff --git a/include/boost/fusion/container/vector/vector40.hpp b/include/boost/fusion/container/vector/vector40.hpp index b72a23c5..eb965f69 100644 --- a/include/boost/fusion/container/vector/vector40.hpp +++ b/include/boost/fusion/container/vector/vector40.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_VECTOR40_05052005_0208) #define FUSION_VECTOR40_05052005_0208 +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector40_fwd.hpp b/include/boost/fusion/container/vector/vector40_fwd.hpp new file mode 100644 index 00000000..e7b4251d --- /dev/null +++ b/include/boost/fusion/container/vector/vector40_fwd.hpp @@ -0,0 +1,31 @@ +#ifndef BOOST_PP_IS_ITERATING +/*============================================================================= + 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_VECTOR40_FWD_HPP_INCLUDED) +#define BOOST_FUSION_VECTOR40_FWD_HPP_INCLUDED + +#include +#include +#include + +namespace boost { namespace fusion +{ + // expand vector31 to vector40 + #define BOOST_PP_FILENAME_1 + #define BOOST_PP_ITERATION_LIMITS (31, 40) + #include BOOST_PP_ITERATE() + +}} + +#endif + +#else + + template + struct BOOST_PP_CAT(vector, BOOST_PP_ITERATION()); + +#endif diff --git a/include/boost/fusion/container/vector/vector50.hpp b/include/boost/fusion/container/vector/vector50.hpp index ab8515d7..506e1a0a 100644 --- a/include/boost/fusion/container/vector/vector50.hpp +++ b/include/boost/fusion/container/vector/vector50.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_VECTOR50_05052005_0207) #define FUSION_VECTOR50_05052005_0207 +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector50_fwd.hpp b/include/boost/fusion/container/vector/vector50_fwd.hpp new file mode 100644 index 00000000..58f68e07 --- /dev/null +++ b/include/boost/fusion/container/vector/vector50_fwd.hpp @@ -0,0 +1,31 @@ +#ifndef BOOST_PP_IS_ITERATING +/*============================================================================= + 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_VECTOR50_FWD_HPP_INCLUDED) +#define BOOST_FUSION_VECTOR50_FWD_HPP_INCLUDED + +#include +#include +#include + +namespace boost { namespace fusion +{ + // expand vector41 to vector50 + #define BOOST_PP_FILENAME_1 + #define BOOST_PP_ITERATION_LIMITS (41, 50) + #include BOOST_PP_ITERATE() + +}} + +#endif + +#else + + template + struct BOOST_PP_CAT(vector, BOOST_PP_ITERATION()); + +#endif diff --git a/include/boost/fusion/container/vector/vector_fwd.hpp b/include/boost/fusion/container/vector/vector_fwd.hpp index 2c4848db..903cda17 100644 --- a/include/boost/fusion/container/vector/vector_fwd.hpp +++ b/include/boost/fusion/container/vector/vector_fwd.hpp @@ -10,6 +10,11 @@ #include #include +#include +#include +#include +#include +#include namespace boost { namespace fusion { diff --git a/include/boost/fusion/iterator/detail/segmented_iterator.hpp b/include/boost/fusion/iterator/detail/segmented_iterator.hpp index f150f4ae..270fd089 100644 --- a/include/boost/fusion/iterator/detail/segmented_iterator.hpp +++ b/include/boost/fusion/iterator/detail/segmented_iterator.hpp @@ -10,6 +10,10 @@ #include #include #include +#include +#include +#include +#include #include #include @@ -26,7 +30,7 @@ namespace boost { namespace fusion // 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. - template + template struct segmented_iterator : iterator_facade, forward_traversal_tag> { @@ -38,7 +42,7 @@ namespace boost { namespace fusion //{ // return deref(begin(car(it.context))) //} - template + template struct deref { typedef @@ -53,9 +57,70 @@ namespace boost { namespace fusion } }; + //auto deref_data(it) + //{ + // return deref_data(begin(car(it.context))) + //} + template + struct deref_data + { + typedef + typename result_of::deref_data< + typename It::context_type::car_type::begin_type + >::type + type; + + static type call(It const& it) + { + return fusion::deref_data(it.context.car.first); + } + }; + + //auto key_of(it) + //{ + // return key_of(begin(car(it.context))) + //} + template + struct key_of + { + typedef + typename result_of::key_of< + typename It::context_type::car_type::begin_type + >::type + type; + }; + + //auto value_of(it) + //{ + // return value_of(begin(car(it.context))) + //} + template + struct value_of + { + typedef + typename result_of::value_of< + typename It::context_type::car_type::begin_type + >::type + type; + }; + + //auto value_of_data(it) + //{ + // return value_of_data(begin(car(it.context))) + //} + template + struct value_of_data + { + typedef + typename result_of::value_of_data< + typename It::context_type::car_type::begin_type + >::type + type; + }; + // Compare all the segment iterators in each stack, starting with // the bottom-most. - template + template struct equal_to : detail::segmented_equal_to< typename detail::reverse_cons::type, @@ -63,7 +128,7 @@ namespace boost { namespace fusion > {}; - template + template struct next { typedef detail::segmented_next_impl impl; diff --git a/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp index 2e407c6b..e4da6171 100644 --- a/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp @@ -9,6 +9,11 @@ #include #include +#include +#include +#include +#include +#include namespace boost { namespace fusion { namespace detail { diff --git a/include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp index 2af69735..03cef28f 100644 --- a/include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion { namespace detail >::type >::type , mpl::size_t<0> - , mpl::plus > + , mpl::plus > > >::type {}; diff --git a/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp b/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp index 344db69a..08096c16 100644 --- a/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp +++ b/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -83,9 +82,7 @@ namespace boost { namespace fusion , typename State , typename Context , typename Fun - , bool IsEmpty = result_of::empty< - typename result_of::value_of::type - >::type::value + , bool IsEmpty > struct segmented_fold_until_iterate_skip_empty; @@ -331,7 +328,15 @@ namespace boost { namespace fusion struct segmented_fold_until_iterate { typedef - segmented_fold_until_iterate_skip_empty + typename result_of::empty< + typename remove_reference< + typename result_of::deref::type + >::type + >::type + empty_type; + + typedef + segmented_fold_until_iterate_skip_empty impl; typedef typename impl::type type; 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 e7765b2f..d63c2b32 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 @@ -122,7 +122,7 @@ namespace boost { namespace fusion { namespace detail > type; - static type call(Stack stack) + static type call(Stack const& stack) { //return segment_sequence( // push_front( @@ -168,7 +168,7 @@ namespace boost { namespace fusion { namespace detail > type; - static type call(Stack stack) + static type call(Stack const& stack) { // return iterator_range(begin(car(cdr(stack_begin))), end(front(car(stack_begin)))); return type(stack.cdr.car.first, fusion::end(*stack.car.first)); @@ -178,10 +178,11 @@ namespace boost { namespace fusion { namespace detail template struct make_segment_sequence_front { - typedef nil type; - static type call(Stack const &) + typedef typename Stack::cdr_type type; // nil + + static type call(Stack const &stack) { - return nil(); + return stack.cdr; } }; @@ -264,7 +265,7 @@ namespace boost { namespace fusion { namespace detail > type; - static type call(Stack stack) + static type call(Stack const& stack) { // return segment_sequence( // push_back( @@ -310,7 +311,7 @@ namespace boost { namespace fusion { namespace detail > type; - static type call(Stack stack) + static type call(Stack const& stack) { // return iterator_range(begin(front(car(stack_end))), begin(car(cdr(stack_end)))); return type(fusion::begin(*stack.car.first), stack.cdr.car.first); @@ -320,10 +321,11 @@ namespace boost { namespace fusion { namespace detail template struct make_segment_sequence_back { - typedef nil type; - static type call(Stack const &) + typedef typename Stack::cdr_type type; // nil + + static type call(Stack const& stack) { - return nil(); + return stack.cdr; } }; @@ -490,7 +492,7 @@ namespace boost { namespace fusion { namespace detail typedef typename impl::type type; - static type call(Begin const & begin, End const & end) + static type call(Begin const& begin, End const& end) { return impl::call( reverse_begin_cons::call(begin.context) diff --git a/include/boost/fusion/view/joint_view/joint_view.hpp b/include/boost/fusion/view/joint_view/joint_view.hpp index 2a2051b1..3452d77f 100644 --- a/include/boost/fusion/view/joint_view/joint_view.hpp +++ b/include/boost/fusion/view/joint_view/joint_view.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_JOINT_VIEW_07162005_0140) #define FUSION_JOINT_VIEW_07162005_0140 +#include #include #include #include diff --git a/include/boost/fusion/view/joint_view/joint_view_fwd.hpp b/include/boost/fusion/view/joint_view/joint_view_fwd.hpp new file mode 100644 index 00000000..c3e3b45e --- /dev/null +++ b/include/boost/fusion/view/joint_view/joint_view_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + 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_JOINT_VIEW_FWD_HPP_INCLUDED) +#define BOOST_FUSION_JOINT_VIEW_FWD_HPP_INCLUDED + +namespace boost { namespace fusion +{ + struct joint_view_tag; + + template + struct joint_view; +}} + +#endif