Quickbook: Copy trunk headers into quickbook-dev.

[SVN r75212]
This commit is contained in:
Daniel James
2011-11-01 13:03:44 +00:00
642 changed files with 63144 additions and 697 deletions

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
@ -16,4 +16,10 @@
#include <boost/fusion/adapted/std_pair.hpp> #include <boost/fusion/adapted/std_pair.hpp>
#include <boost/fusion/adapted/struct.hpp> #include <boost/fusion/adapted/struct.hpp>
// The std_tuple_iterator adaptor only supports implementations
// using variadic templates
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
#include <boost/fusion/adapted/std_tuple.hpp>
#endif
#endif #endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2010 Christopher Schmidt Copyright (c) 2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2010 Christopher Schmidt Copyright (c) 2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
@ -17,5 +17,6 @@
#include <boost/fusion/adapted/mpl/detail/has_key_impl.hpp> #include <boost/fusion/adapted/mpl/detail/has_key_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/category_of_impl.hpp> #include <boost/fusion/adapted/mpl/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/is_view_impl.hpp> #include <boost/fusion/adapted/mpl/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/empty_impl.hpp>
#endif #endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,8 +1,8 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#if !defined(BOOST_FUSION_EMPTY_IMPL_31122005_1554) #if !defined(BOOST_FUSION_EMPTY_IMPL_31122005_1554)
@ -10,12 +10,15 @@
#include <boost/mpl/empty.hpp> #include <boost/mpl/empty.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
struct mpl_sequence_tag; struct mpl_sequence_tag;
namespace extension namespace extension
{ {
template <typename Sequence>
struct empty_impl;
template <> template <>
struct empty_impl<mpl_sequence_tag> struct empty_impl<mpl_sequence_tag>
{ {

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt
@ -11,12 +11,7 @@
#define BOOST_FUSION_ADAPTED_STD_PAIR_HPP #define BOOST_FUSION_ADAPTED_STD_PAIR_HPP
#include <boost/fusion/adapted/struct/adapt_struct.hpp> #include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <utility>
namespace std
{
template<class T1, class T2>
struct pair;
}
BOOST_FUSION_ADAPT_TPL_STRUCT( BOOST_FUSION_ADAPT_TPL_STRUCT(
(T1)(T2),(std::pair)(T1)(T2),(T1, first)(T2, second)) (T1)(T2),(std::pair)(T1)(T2),(T1, first)(T2, second))

View File

@ -0,0 +1,21 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_BOOST_TUPLE_09242011_1744)
#define BOOST_FUSION_BOOST_TUPLE_09242011_1744
#include <boost/fusion/adapted/std_tuple/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/is_sequence_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/begin_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/end_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/size_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/at_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/value_at_impl.hpp>
#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
#include <boost/fusion/adapted/std_tuple/tag_of.hpp>
#endif

View File

@ -0,0 +1,52 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_AT_IMPL_09242011_1744)
#define BOOST_FUSION_AT_IMPL_09242011_1744
#include <tuple>
#include <utility>
#include <boost/mpl/eval_if.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct at_impl;
template <>
struct at_impl<std_tuple_tag>
{
template <typename Sequence, typename N>
struct apply
{
typedef typename remove_const<Sequence>::type seq_type;
typedef std::tuple_element<N::value, seq_type> element;
typedef typename
mpl::eval_if<
is_const<Sequence>
, fusion::detail::cref_result<element>
, fusion::detail::ref_result<element>
>::type
type;
static type
call(Sequence& seq)
{
return std::get<N::value>(seq);
}
};
};
}
}}
#endif

View File

@ -0,0 +1,39 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_BEGIN_IMPL_09242011_1744)
#define BOOST_FUSION_BEGIN_IMPL_09242011_1744
#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct begin_impl;
template <>
struct begin_impl<std_tuple_tag>
{
template <typename Sequence>
struct apply
{
typedef std_tuple_iterator<Sequence, 0> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@ -0,0 +1,32 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726)
#define BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726
namespace boost { namespace fusion
{
struct std_tuple_tag;
struct random_access_traversal_tag;
namespace extension
{
template<typename T>
struct category_of_impl;
template<>
struct category_of_impl<std_tuple_tag>
{
template<typename T>
struct apply
{
typedef random_access_traversal_tag type;
};
};
}
}}
#endif

View File

@ -0,0 +1,43 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_END_IMPL_09242011_1744)
#define BOOST_FUSION_END_IMPL_09242011_1744
#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <tuple>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct end_impl;
template <>
struct end_impl<std_tuple_tag>
{
template <typename Sequence>
struct apply
{
typedef typename remove_const<Sequence>::type seq_type;
static int const size = std::tuple_size<seq_type>::value;
typedef std_tuple_iterator<Sequence, size> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_09242011_1744)
#define BOOST_FUSION_IS_SEQUENCE_IMPL_09242011_1744
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<std_tuple_tag>
{
template<typename Sequence>
struct apply : mpl::true_ {};
};
}
}}
#endif

View File

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_IS_VIEW_IMPL_09242011_1744)
#define BOOST_FUSION_IS_VIEW_IMPL_09242011_1744
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<std_tuple_tag>
{
template<typename T>
struct apply : mpl::false_ {};
};
}
}}
#endif

View File

@ -0,0 +1,36 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_SIZE_IMPL_09242011_1744)
#define BOOST_FUSION_SIZE_IMPL_09242011_1744
#include <tuple>
#include <boost/mpl/int.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct size_impl;
template <>
struct size_impl<std_tuple_tag>
{
template <typename Sequence>
struct apply :
mpl::int_<std::tuple_size<
typename remove_const<Sequence>::type>::value
>
{};
};
}
}}
#endif

View File

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_VALUE_AT_IMPL_09242011_1744)
#define BOOST_FUSION_VALUE_AT_IMPL_09242011_1744
#include <tuple>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct value_at_impl;
template <>
struct value_at_impl<std_tuple_tag>
{
template <typename Sequence, typename N>
struct apply : std::tuple_element<N::value, Sequence> {};
};
}
}}
#endif

View File

@ -0,0 +1,107 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_STD_TUPLE_ITERATOR_09112011_1905)
#define FUSION_STD_TUPLE_ITERATOR_09112011_1905
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/eval_if.hpp>
#include <tuple>
#include <utility>
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
template <typename Tuple, int Index>
struct std_tuple_iterator_identity;
template <typename Tuple, int Index>
struct std_tuple_iterator
: iterator_facade<
std_tuple_iterator<Tuple, Index>
, random_access_traversal_tag>
{
typedef Tuple tuple_type;
static int const index = Index;
typedef std_tuple_iterator_identity<
typename add_const<Tuple>::type, Index>
identity;
explicit std_tuple_iterator(Tuple& tuple)
: tuple(tuple) {}
Tuple& tuple;
template <typename Iterator>
struct value_of
: std::tuple_element<Iterator::index,
typename remove_const<typename Iterator::tuple_type>::type> {};
template <typename Iterator>
struct deref
{
typedef value_of<Iterator> element;
typedef typename
mpl::eval_if<
is_const<typename Iterator::tuple_type>
, fusion::detail::cref_result<element>
, fusion::detail::ref_result<element>
>::type
type;
static type
call(Iterator const& iter)
{
return std::get<Index>(iter.tuple);
}
};
template <typename Iterator, typename N>
struct advance
{
static int const index = Iterator::index;
typedef typename Iterator::tuple_type tuple_type;
typedef std_tuple_iterator<tuple_type, index+N::value> type;
static type
call(Iterator const& i)
{
return type(i.tuple);
}
};
template <typename Iterator>
struct next : advance<Iterator, mpl::int_<1>> {};
template <typename Iterator>
struct prior : advance<Iterator, mpl::int_<-1>> {};
template <typename I1, typename I2>
struct equal_to
: is_same<typename I1::identity, typename I2::identity> {};
template <typename First, typename Last>
struct distance
{
typedef mpl::int_<Last::index-First::index> type;
static type
call(First const&, Last const&)
{
return type();
}
};
};
}}
#endif

View File

@ -0,0 +1,52 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_TAG_OF_09112011_1842)
#define BOOST_FUSION_TAG_OF_09112011_1842
#include <tuple>
#include <boost/fusion/support/tag_of_fwd.hpp>
namespace std
{
template <typename... Elements>
class tuple;
}
namespace boost { namespace fusion
{
struct std_tuple_tag;
struct fusion_sequence_tag;
namespace traits
{
template <typename... Elements>
struct tag_of<std::tuple<Elements...>>
{
typedef std_tuple_tag type;
};
}
}}
namespace boost { namespace mpl
{
template <typename>
struct sequence_tag;
template <typename... Elements>
struct sequence_tag<std::tuple<Elements...>>
{
typedef fusion::fusion_sequence_tag type;
};
template <typename... Elements>
struct sequence_tag<std::tuple<Elements...> const>
{
typedef fusion::fusion_sequence_tag type;
};
}}
#endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -7,6 +7,7 @@
#if !defined(FUSION_ACCUMULATE_09172005_1032) #if !defined(FUSION_ACCUMULATE_09172005_1032)
#define FUSION_ACCUMULATE_09172005_1032 #define FUSION_ACCUMULATE_09172005_1032
#include <boost/fusion/algorithm/iteration/accumulate_fwd.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp> #include <boost/fusion/algorithm/iteration/fold.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion

View File

@ -0,0 +1,28 @@
/*=============================================================================
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_ACCUMULATE_FWD_HPP_INCLUDED)
#define BOOST_FUSION_ACCUMULATE_FWD_HPP_INCLUDED
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename State, typename F>
struct accumulate;
}
template <typename Sequence, typename State, typename F>
typename result_of::accumulate<Sequence, State const, F>::type
accumulate(Sequence& seq, State const& state, F f);
template <typename Sequence, typename State, typename F>
typename result_of::accumulate<Sequence const, State const, F>::type
accumulate(Sequence const& seq, State const& state, F f);
}}
#endif

View File

@ -1,34 +1,12 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_DETAIL_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_DETAIL_FOLD_HPP
#include <boost/config.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#endif
#ifdef BOOST_FUSION_REVERSE_FOLD #ifdef BOOST_FUSION_REVERSE_FOLD
# ifdef BOOST_FUSION_ITER_FOLD # ifdef BOOST_FUSION_ITER_FOLD
@ -185,7 +163,7 @@ namespace boost { namespace fusion
{ {
template<typename State, typename It0, typename F> template<typename State, typename It0, typename F>
static Result static Result
call(State const& state,It0 const& it0,F f) call(State const& state,It0 const& it0, F)
{ {
return static_cast<Result>(state); return static_cast<Result>(state);
} }
@ -347,53 +325,73 @@ namespace boost { namespace fusion
type; type;
}; };
template<int SeqSize, typename StateRef, typename It0, typename F> template<int SeqSize, typename StateRef, typename Seq, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl) struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)
{ {
typedef typename typedef typename
BOOST_PP_CAT( BOOST_PP_CAT(
result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)< result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)<
StateRef StateRef
, BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(It0) , BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(
typename result_of::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION<Seq>::type
)
, F , F
, SeqSize , SeqSize
>::type >::type
type; type;
static type static type
call(StateRef state, It0 const& it0, F f) call(StateRef state, Seq& seq, F f)
{ {
return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)< typedef
type BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<
, SeqSize type
>::call(state,BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(it0),f); , SeqSize
>
unrolled_impl;
return unrolled_impl::call(
state,
BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(
fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq)),
f);
} }
}; };
template<typename StateRef, typename It0, typename F> template<typename StateRef, typename Seq, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<0,StateRef,It0,F> struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<0,StateRef,Seq,F>
{ {
typedef StateRef type; typedef StateRef type;
static StateRef static StateRef
call(StateRef state, It0 const&, F) call(StateRef state, Seq&, F)
{ {
return static_cast<StateRef>(state); return static_cast<StateRef>(state);
} }
}; };
template<typename Seq, typename State, typename F, bool IsSegmented>
struct BOOST_PP_CAT(result_of_, BOOST_FUSION_FOLD_NAME)
: BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<
result_of::size<Seq>::value
, typename add_reference<
typename add_const<State>::type
>::type
, Seq
, F
>
{};
} }
namespace result_of namespace result_of
{ {
template<typename Seq, typename State, typename F> template<typename Seq, typename State, typename F>
struct BOOST_FUSION_FOLD_NAME struct BOOST_FUSION_FOLD_NAME
: detail::BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)< : detail::BOOST_PP_CAT(result_of_, BOOST_FUSION_FOLD_NAME)<
size<Seq>::value Seq
, typename add_reference< , State
typename add_const<State>::type
>::type
, typename BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION<Seq>::type
, F , F
, traits::is_segmented<Seq>::type::value
> >
{}; {};
} }
@ -404,11 +402,11 @@ namespace boost { namespace fusion
, State const , State const
, F , F
>::type >::type
BOOST_FUSION_FOLD_NAME(Seq& seq,State const& state,F f) BOOST_FUSION_FOLD_NAME(Seq& seq, State const& state, F f)
{ {
return result_of::BOOST_FUSION_FOLD_NAME<Seq,State const,F>::call( return result_of::BOOST_FUSION_FOLD_NAME<Seq,State const,F>::call(
state, state,
fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq), seq,
f); f);
} }
@ -418,11 +416,39 @@ namespace boost { namespace fusion
, State const , State const
, F , F
>::type >::type
BOOST_FUSION_FOLD_NAME(Seq const& seq,State const& state,F f) BOOST_FUSION_FOLD_NAME(Seq const& seq, State const& state, F f)
{ {
return result_of::BOOST_FUSION_FOLD_NAME<Seq const,State const,F>::call( return result_of::BOOST_FUSION_FOLD_NAME<Seq const,State const,F>::call(
state, state,
fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq), seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::BOOST_FUSION_FOLD_NAME<
Seq
, State const
, F
>::type
BOOST_FUSION_FOLD_NAME(Seq& seq, State& state, F f)
{
return result_of::BOOST_FUSION_FOLD_NAME<Seq,State,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::BOOST_FUSION_FOLD_NAME<
Seq const
, State const
, F
>::type
BOOST_FUSION_FOLD_NAME(Seq const& seq, State& state, F f)
{
return result_of::BOOST_FUSION_FOLD_NAME<Seq const,State,F>::call(
state,
seq,
f); f);
} }
}} }}

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -13,6 +13,7 @@
#include <boost/fusion/iterator/next.hpp> #include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/deref.hpp> #include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/distance.hpp> #include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/mpl/bool.hpp> #include <boost/mpl/bool.hpp>
namespace boost { namespace fusion { namespace boost { namespace fusion {
@ -36,7 +37,7 @@ namespace detail
template <typename Sequence, typename F, typename Tag> template <typename Sequence, typename F, typename Tag>
inline void inline void
for_each(Sequence& seq, F const& f, Tag) for_each_dispatch(Sequence& seq, F const& f, Tag)
{ {
detail::for_each_linear( detail::for_each_linear(
fusion::begin(seq) fusion::begin(seq)
@ -117,12 +118,19 @@ namespace detail
template <typename Sequence, typename F> template <typename Sequence, typename F>
inline void inline void
for_each(Sequence& seq, F const& f, random_access_traversal_tag) for_each_dispatch(Sequence& seq, F const& f, random_access_traversal_tag)
{ {
typedef typename result_of::begin<Sequence>::type begin; typedef typename result_of::begin<Sequence>::type begin;
typedef typename result_of::end<Sequence>::type end; typedef typename result_of::end<Sequence>::type end;
for_each_unrolled<result_of::distance<begin, end>::type::value>::call(fusion::begin(seq), f); for_each_unrolled<result_of::distance<begin, end>::type::value>::call(fusion::begin(seq), f);
} }
template <typename Sequence, typename F>
inline void
for_each(Sequence& seq, F const& f, mpl::false_) // unsegmented implementation
{
detail::for_each_dispatch(seq, f, typename traits::category_of<Sequence>::type());
}
}}} }}}

View File

@ -0,0 +1,381 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
namespace detail
{
template<typename State, typename It, typename F>
struct fold_lvalue_state
: boost::result_of<
F(
typename add_reference<typename add_const<State>::type>::type,
typename fusion::result_of::deref<It>::type)
>
{};
template<typename Result,int N>
struct unrolled_fold
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename
result_of::next<
It2
>::type
It3;
It3 it3 = fusion::next(it2);
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
typedef typename fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,fusion::deref(it2));
return unrolled_fold<
Result
, N-4
>::call(
f(state3,fusion::deref(it3)),
fusion::next(it3),
f);
}
};
template<typename Result>
struct unrolled_fold<Result,3>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
return f(state2,fusion::deref(it2));
}
};
template<typename Result>
struct unrolled_fold<Result,2>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
return f(
state1,
fusion::deref( fusion::next(it0)));
}
};
template<typename Result>
struct unrolled_fold<Result,1>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return f(state,
fusion::deref(it0));
}
};
template<typename Result>
struct unrolled_fold<Result,0>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0, F)
{
return static_cast<Result>(state);
}
};
template<typename StateRef, typename It0, typename F, int N>
struct result_of_unrolled_fold
{
typedef typename
fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::next<
It0 const
>::type
it1;
typedef typename
fold_lvalue_state<
rest1
, it1
, F
>::type
rest2;
typedef typename
result_of::next<it1>::type
it2;
typedef typename
fold_lvalue_state<
rest2
, it2
, F
>::type
rest3;
typedef typename
result_of::next<it2>::type
it3;
typedef typename
result_of_unrolled_fold<
typename fold_lvalue_state<
rest3
, it3
, F
>::type
, typename result_of::next<
it3
>::type
, F
, N-4
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_fold<
StateRef
, It0
, F
, 3
>
{
typedef typename
fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::next<
It0 const
>::type
it1;
typedef typename
fold_lvalue_state<
typename fold_lvalue_state<
rest1
, it1
, F
>::type
, typename result_of::next<
it1 const
>::type const
, F
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_fold<
StateRef
, It0
, F
, 2
>
: fold_lvalue_state<
typename fold_lvalue_state<
StateRef
, It0 const
, F
>::type
, typename result_of::next<
It0 const
>::type const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_fold<
StateRef
, It0
, F
, 1
>
: fold_lvalue_state<
StateRef
, It0 const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_fold<
StateRef
, It0
, F
, 0
>
{
typedef StateRef type;
};
template<typename StateRef, typename It0, typename F, int SeqSize>
struct result_of_first_unrolledfold
{
typedef typename
result_of_unrolled_fold<
typename boost::result_of<
F(
StateRef,
typename fusion::result_of::deref< It0 const>::type
)
>::type
, typename result_of::next<
It0 const
>::type
, F
, SeqSize-1
>::type
type;
};
template<int SeqSize, typename StateRef, typename Seq, typename F>
struct fold_impl
{
typedef typename
result_of_first_unrolledfold<
StateRef
, typename result_of::begin<Seq>::type
, F
, SeqSize
>::type
type;
static type
call(StateRef state, Seq& seq, F f)
{
typedef
unrolled_fold<
type
, SeqSize
>
unrolled_impl;
return unrolled_impl::call(
state,
fusion::begin(seq),
f);
}
};
template<typename StateRef, typename Seq, typename F>
struct fold_impl<0,StateRef,Seq,F>
{
typedef StateRef type;
static StateRef
call(StateRef state, Seq&, F)
{
return static_cast<StateRef>(state);
}
};
template<typename Seq, typename State, typename F, bool IsSegmented>
struct result_of_fold
: fold_impl<
result_of::size<Seq>::value
, typename add_reference<
typename add_const<State>::type
>::type
, Seq
, F
>
{};
}
namespace result_of
{
template<typename Seq, typename State, typename F>
struct fold
: detail::result_of_fold<
Seq
, State
, F
, traits::is_segmented<Seq>::type::value
>
{};
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<
Seq
, State const
, F
>::type
fold(Seq& seq, State const& state, F f)
{
return result_of::fold<Seq,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<
Seq const
, State const
, F
>::type
fold(Seq const& seq, State const& state, F f)
{
return result_of::fold<Seq const,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<
Seq
, State const
, F
>::type
fold(Seq& seq, State& state, F f)
{
return result_of::fold<Seq,State,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<
Seq const
, State const
, F
>::type
fold(Seq const& seq, State& state, F f)
{
return result_of::fold<Seq const,State,F>::call(
state,
seq,
f);
}
}}

View File

@ -0,0 +1,380 @@
/*=============================================================================
Copyright (c) 2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
namespace detail
{
template<typename State, typename It, typename F>
struct iter_fold_lvalue_state
: boost::result_of<
F(
typename add_reference<typename add_const<State>::type>::type,
It&)
>
{};
template<typename Result,int N>
struct unrolled_iter_fold
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename
result_of::next<
It2
>::type
It3;
It3 it3 = fusion::next(it2);
typedef typename iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
typedef typename iter_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,it1);
typedef typename iter_fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,it2);
return unrolled_iter_fold<
Result
, N-4
>::call(
f(state3,it3),
fusion::next(it3),
f);
}
};
template<typename Result>
struct unrolled_iter_fold<Result,3>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
typedef typename iter_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,it1);
return f(state2,it2);
}
};
template<typename Result>
struct unrolled_iter_fold<Result,2>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
return f(
state1,
fusion::next(it0));
}
};
template<typename Result>
struct unrolled_iter_fold<Result,1>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return f(state,
it0);
}
};
template<typename Result>
struct unrolled_iter_fold<Result,0>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0, F)
{
return static_cast<Result>(state);
}
};
template<typename StateRef, typename It0, typename F, int N>
struct result_of_unrolled_iter_fold
{
typedef typename
iter_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::next<
It0 const
>::type
it1;
typedef typename
iter_fold_lvalue_state<
rest1
, it1
, F
>::type
rest2;
typedef typename
result_of::next<it1>::type
it2;
typedef typename
iter_fold_lvalue_state<
rest2
, it2
, F
>::type
rest3;
typedef typename
result_of::next<it2>::type
it3;
typedef typename
result_of_unrolled_iter_fold<
typename iter_fold_lvalue_state<
rest3
, it3
, F
>::type
, typename result_of::next<
it3
>::type
, F
, N-4
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_iter_fold<
StateRef
, It0
, F
, 3
>
{
typedef typename
iter_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::next<
It0 const
>::type
it1;
typedef typename
iter_fold_lvalue_state<
typename iter_fold_lvalue_state<
rest1
, it1
, F
>::type
, typename result_of::next<
it1 const
>::type const
, F
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_iter_fold<
StateRef
, It0
, F
, 2
>
: iter_fold_lvalue_state<
typename iter_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
, typename result_of::next<
It0 const
>::type const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_iter_fold<
StateRef
, It0
, F
, 1
>
: iter_fold_lvalue_state<
StateRef
, It0 const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_iter_fold<
StateRef
, It0
, F
, 0
>
{
typedef StateRef type;
};
template<typename StateRef, typename It0, typename F, int SeqSize>
struct result_of_first_unrollediter_fold
{
typedef typename
result_of_unrolled_iter_fold<
typename boost::result_of<
F(
StateRef,
It0 const&
)
>::type
, typename result_of::next<
It0 const
>::type
, F
, SeqSize-1
>::type
type;
};
template<int SeqSize, typename StateRef, typename Seq, typename F>
struct iter_fold_impl
{
typedef typename
result_of_first_unrollediter_fold<
StateRef
, typename result_of::begin<Seq>::type
, F
, SeqSize
>::type
type;
static type
call(StateRef state, Seq& seq, F f)
{
typedef
unrolled_iter_fold<
type
, SeqSize
>
unrolled_impl;
return unrolled_impl::call(
state,
fusion::begin(seq),
f);
}
};
template<typename StateRef, typename Seq, typename F>
struct iter_fold_impl<0,StateRef,Seq,F>
{
typedef StateRef type;
static StateRef
call(StateRef state, Seq&, F)
{
return static_cast<StateRef>(state);
}
};
template<typename Seq, typename State, typename F, bool IsSegmented>
struct result_of_iter_fold
: iter_fold_impl<
result_of::size<Seq>::value
, typename add_reference<
typename add_const<State>::type
>::type
, Seq
, F
>
{};
}
namespace result_of
{
template<typename Seq, typename State, typename F>
struct iter_fold
: detail::result_of_iter_fold<
Seq
, State
, F
, traits::is_segmented<Seq>::type::value
>
{};
}
template<typename Seq, typename State, typename F>
inline typename result_of::iter_fold<
Seq
, State const
, F
>::type
iter_fold(Seq& seq, State const& state, F f)
{
return result_of::iter_fold<Seq,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::iter_fold<
Seq const
, State const
, F
>::type
iter_fold(Seq const& seq, State const& state, F f)
{
return result_of::iter_fold<Seq const,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::iter_fold<
Seq
, State const
, F
>::type
iter_fold(Seq& seq, State& state, F f)
{
return result_of::iter_fold<Seq,State,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::iter_fold<
Seq const
, State const
, F
>::type
iter_fold(Seq const& seq, State& state, F f)
{
return result_of::iter_fold<Seq const,State,F>::call(
state,
seq,
f);
}
}}

View File

@ -0,0 +1,380 @@
/*=============================================================================
Copyright (c) 2009-2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
namespace detail
{
template<typename State, typename It, typename F>
struct reverse_fold_lvalue_state
: boost::result_of<
F(
typename add_reference<typename add_const<State>::type>::type,
typename fusion::result_of::deref<It>::type)
>
{};
template<typename Result,int N>
struct unrolled_reverse_fold
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::prior<
It0 const
>::type
It1;
It1 it1 = fusion::prior(it0);
typedef typename
result_of::prior<
It1
>::type
It2;
It2 it2 = fusion::prior(it1);
typedef typename
result_of::prior<
It2
>::type
It3;
It3 it3 = fusion::prior(it2);
typedef typename reverse_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename reverse_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
typedef typename reverse_fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,fusion::deref(it2));
return unrolled_reverse_fold<
Result
, N-4
>::call(
f(state3,fusion::deref(it3)),
fusion::prior(it3),
f);
}
};
template<typename Result>
struct unrolled_reverse_fold<Result,3>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::prior<
It0 const
>::type
It1;
It1 it1 = fusion::prior(it0);
typedef typename
result_of::prior<
It1
>::type
It2;
It2 it2 = fusion::prior(it1);
typedef typename reverse_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename reverse_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
return f(state2,fusion::deref(it2));
}
};
template<typename Result>
struct unrolled_reverse_fold<Result,2>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename reverse_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
return f(
state1,
fusion::deref( fusion::prior(it0)));
}
};
template<typename Result>
struct unrolled_reverse_fold<Result,1>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return f(state,
fusion::deref(it0));
}
};
template<typename Result>
struct unrolled_reverse_fold<Result,0>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0, F)
{
return static_cast<Result>(state);
}
};
template<typename StateRef, typename It0, typename F, int N>
struct result_of_unrolled_reverse_fold
{
typedef typename
reverse_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::prior<
It0 const
>::type
it1;
typedef typename
reverse_fold_lvalue_state<
rest1
, it1
, F
>::type
rest2;
typedef typename
result_of::prior<it1>::type
it2;
typedef typename
reverse_fold_lvalue_state<
rest2
, it2
, F
>::type
rest3;
typedef typename
result_of::prior<it2>::type
it3;
typedef typename
result_of_unrolled_reverse_fold<
typename reverse_fold_lvalue_state<
rest3
, it3
, F
>::type
, typename result_of::prior<
it3
>::type
, F
, N-4
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_reverse_fold<
StateRef
, It0
, F
, 3
>
{
typedef typename
reverse_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::prior<
It0 const
>::type
it1;
typedef typename
reverse_fold_lvalue_state<
typename reverse_fold_lvalue_state<
rest1
, it1
, F
>::type
, typename result_of::prior<
it1 const
>::type const
, F
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_reverse_fold<
StateRef
, It0
, F
, 2
>
: reverse_fold_lvalue_state<
typename reverse_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
, typename result_of::prior<
It0 const
>::type const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_reverse_fold<
StateRef
, It0
, F
, 1
>
: reverse_fold_lvalue_state<
StateRef
, It0 const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_reverse_fold<
StateRef
, It0
, F
, 0
>
{
typedef StateRef type;
};
template<typename StateRef, typename It0, typename F, int SeqSize>
struct result_of_first_unrolledreverse_fold
{
typedef typename
result_of_unrolled_reverse_fold<
typename boost::result_of<
F(
StateRef,
typename fusion::result_of::deref< It0 const>::type
)
>::type
, typename result_of::prior<
It0 const
>::type
, F
, SeqSize-1
>::type
type;
};
template<int SeqSize, typename StateRef, typename Seq, typename F>
struct reverse_fold_impl
{
typedef typename
result_of_first_unrolledreverse_fold<
StateRef
, typename fusion::result_of::prior< typename result_of::end<Seq>::type >::type
, F
, SeqSize
>::type
type;
static type
call(StateRef state, Seq& seq, F f)
{
typedef
unrolled_reverse_fold<
type
, SeqSize
>
unrolled_impl;
return unrolled_impl::call(
state,
fusion::prior( fusion::end(seq)),
f);
}
};
template<typename StateRef, typename Seq, typename F>
struct reverse_fold_impl<0,StateRef,Seq,F>
{
typedef StateRef type;
static StateRef
call(StateRef state, Seq&, F)
{
return static_cast<StateRef>(state);
}
};
template<typename Seq, typename State, typename F, bool IsSegmented>
struct result_of_reverse_fold
: reverse_fold_impl<
result_of::size<Seq>::value
, typename add_reference<
typename add_const<State>::type
>::type
, Seq
, F
>
{};
}
namespace result_of
{
template<typename Seq, typename State, typename F>
struct reverse_fold
: detail::result_of_reverse_fold<
Seq
, State
, F
, traits::is_segmented<Seq>::type::value
>
{};
}
template<typename Seq, typename State, typename F>
inline typename result_of::reverse_fold<
Seq
, State const
, F
>::type
reverse_fold(Seq& seq, State const& state, F f)
{
return result_of::reverse_fold<Seq,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::reverse_fold<
Seq const
, State const
, F
>::type
reverse_fold(Seq const& seq, State const& state, F f)
{
return result_of::reverse_fold<Seq const,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::reverse_fold<
Seq
, State const
, F
>::type
reverse_fold(Seq& seq, State& state, F f)
{
return result_of::reverse_fold<Seq,State,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::reverse_fold<
Seq const
, State const
, F
>::type
reverse_fold(Seq const& seq, State& state, F f)
{
return result_of::reverse_fold<Seq const,State,F>::call(
state,
seq,
f);
}
}}

View File

@ -0,0 +1,380 @@
/*=============================================================================
Copyright (c) 2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
namespace detail
{
template<typename State, typename It, typename F>
struct reverse_iter_fold_lvalue_state
: boost::result_of<
F(
typename add_reference<typename add_const<State>::type>::type,
It&)
>
{};
template<typename Result,int N>
struct unrolled_reverse_iter_fold
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::prior<
It0 const
>::type
It1;
It1 it1 = fusion::prior(it0);
typedef typename
result_of::prior<
It1
>::type
It2;
It2 it2 = fusion::prior(it1);
typedef typename
result_of::prior<
It2
>::type
It3;
It3 it3 = fusion::prior(it2);
typedef typename reverse_iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
typedef typename reverse_iter_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,it1);
typedef typename reverse_iter_fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,it2);
return unrolled_reverse_iter_fold<
Result
, N-4
>::call(
f(state3,it3),
fusion::prior(it3),
f);
}
};
template<typename Result>
struct unrolled_reverse_iter_fold<Result,3>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::prior<
It0 const
>::type
It1;
It1 it1 = fusion::prior(it0);
typedef typename
result_of::prior<
It1
>::type
It2;
It2 it2 = fusion::prior(it1);
typedef typename reverse_iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
typedef typename reverse_iter_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,it1);
return f(state2,it2);
}
};
template<typename Result>
struct unrolled_reverse_iter_fold<Result,2>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename reverse_iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
return f(
state1,
fusion::prior(it0));
}
};
template<typename Result>
struct unrolled_reverse_iter_fold<Result,1>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return f(state,
it0);
}
};
template<typename Result>
struct unrolled_reverse_iter_fold<Result,0>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0, F)
{
return static_cast<Result>(state);
}
};
template<typename StateRef, typename It0, typename F, int N>
struct result_of_unrolled_reverse_iter_fold
{
typedef typename
reverse_iter_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::prior<
It0 const
>::type
it1;
typedef typename
reverse_iter_fold_lvalue_state<
rest1
, it1
, F
>::type
rest2;
typedef typename
result_of::prior<it1>::type
it2;
typedef typename
reverse_iter_fold_lvalue_state<
rest2
, it2
, F
>::type
rest3;
typedef typename
result_of::prior<it2>::type
it3;
typedef typename
result_of_unrolled_reverse_iter_fold<
typename reverse_iter_fold_lvalue_state<
rest3
, it3
, F
>::type
, typename result_of::prior<
it3
>::type
, F
, N-4
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_reverse_iter_fold<
StateRef
, It0
, F
, 3
>
{
typedef typename
reverse_iter_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::prior<
It0 const
>::type
it1;
typedef typename
reverse_iter_fold_lvalue_state<
typename reverse_iter_fold_lvalue_state<
rest1
, it1
, F
>::type
, typename result_of::prior<
it1 const
>::type const
, F
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_reverse_iter_fold<
StateRef
, It0
, F
, 2
>
: reverse_iter_fold_lvalue_state<
typename reverse_iter_fold_lvalue_state<
StateRef
, It0 const
, F
>::type
, typename result_of::prior<
It0 const
>::type const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_reverse_iter_fold<
StateRef
, It0
, F
, 1
>
: reverse_iter_fold_lvalue_state<
StateRef
, It0 const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_reverse_iter_fold<
StateRef
, It0
, F
, 0
>
{
typedef StateRef type;
};
template<typename StateRef, typename It0, typename F, int SeqSize>
struct result_of_first_unrolledreverse_iter_fold
{
typedef typename
result_of_unrolled_reverse_iter_fold<
typename boost::result_of<
F(
StateRef,
It0 const&
)
>::type
, typename result_of::prior<
It0 const
>::type
, F
, SeqSize-1
>::type
type;
};
template<int SeqSize, typename StateRef, typename Seq, typename F>
struct reverse_iter_fold_impl
{
typedef typename
result_of_first_unrolledreverse_iter_fold<
StateRef
, typename fusion::result_of::prior< typename result_of::end<Seq>::type >::type
, F
, SeqSize
>::type
type;
static type
call(StateRef state, Seq& seq, F f)
{
typedef
unrolled_reverse_iter_fold<
type
, SeqSize
>
unrolled_impl;
return unrolled_impl::call(
state,
fusion::prior( fusion::end(seq)),
f);
}
};
template<typename StateRef, typename Seq, typename F>
struct reverse_iter_fold_impl<0,StateRef,Seq,F>
{
typedef StateRef type;
static StateRef
call(StateRef state, Seq&, F)
{
return static_cast<StateRef>(state);
}
};
template<typename Seq, typename State, typename F, bool IsSegmented>
struct result_of_reverse_iter_fold
: reverse_iter_fold_impl<
result_of::size<Seq>::value
, typename add_reference<
typename add_const<State>::type
>::type
, Seq
, F
>
{};
}
namespace result_of
{
template<typename Seq, typename State, typename F>
struct reverse_iter_fold
: detail::result_of_reverse_iter_fold<
Seq
, State
, F
, traits::is_segmented<Seq>::type::value
>
{};
}
template<typename Seq, typename State, typename F>
inline typename result_of::reverse_iter_fold<
Seq
, State const
, F
>::type
reverse_iter_fold(Seq& seq, State const& state, F f)
{
return result_of::reverse_iter_fold<Seq,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::reverse_iter_fold<
Seq const
, State const
, F
>::type
reverse_iter_fold(Seq const& seq, State const& state, F f)
{
return result_of::reverse_iter_fold<Seq const,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::reverse_iter_fold<
Seq
, State const
, F
>::type
reverse_iter_fold(Seq& seq, State& state, F f)
{
return result_of::reverse_iter_fold<Seq,State,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::reverse_iter_fold<
Seq const
, State const
, F
>::type
reverse_iter_fold(Seq const& seq, State& state, F f)
{
return result_of::reverse_iter_fold<Seq const,State,F>::call(
state,
seq,
f);
}
}}

View File

@ -0,0 +1,59 @@
/*=============================================================================
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_FOLD_S_HPP_INCLUDED)
#define BOOST_FUSION_FOLD_S_HPP_INCLUDED
#include <boost/fusion/algorithm/iteration/fold_fwd.hpp>
#include <boost/fusion/support/segmented_fold_until.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Fun>
struct segmented_fold_fun
{
explicit segmented_fold_fun(Fun const& f)
: fun(f)
{}
Fun const& fun;
template <typename Sequence, typename State, typename Context>
struct apply
{
typedef typename result_of::fold<Sequence, State, Fun>::type type;
typedef mpl::true_ continue_type;
static type call(Sequence& seq, State const& state, Context const&, segmented_fold_fun const& fun)
{
return fusion::fold(seq, state, fun.fun);
}
};
};
// The default implementation of this lives in detail/fold.hpp
template <typename Sequence, typename State, typename Fun, bool IsSegmented>
struct result_of_fold;
template <typename Sequence, typename State, typename Fun>
struct result_of_fold<Sequence, State, Fun, true>
{
typedef
typename result_of::segmented_fold_until<
Sequence,
State,
segmented_fold_fun<Fun>
>::type
type;
static type call(State& state, Sequence& seq, Fun fun)
{
return fusion::segmented_fold_until(seq, state, segmented_fold_fun<Fun>(fun));
}
};
}}}
#endif

View File

@ -0,0 +1,48 @@
/*=============================================================================
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_FOR_EACH_HPP_INCLUDED)
#define BOOST_FUSION_SEGMENTED_FOR_EACH_HPP_INCLUDED
#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/algorithm/iteration/for_each_fwd.hpp>
#include <boost/fusion/support/segmented_fold_until.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Fun>
struct segmented_for_each_fun
{
explicit segmented_for_each_fun(Fun const& f)
: fun(f)
{}
Fun const& fun;
template <typename Sequence, typename State, typename Context>
struct apply
{
typedef void_ type;
typedef mpl::true_ continue_type;
static type call(Sequence& seq, State const&, Context const&, segmented_for_each_fun const& fun)
{
fusion::for_each(seq, fun.fun);
return void_();
}
};
};
template <typename Sequence, typename F>
inline void
for_each(Sequence& seq, F const& f, mpl::true_) // segmented implementation
{
fusion::segmented_fold_until(seq, void_(), segmented_for_each_fun<F>(f));
}
}}}
#endif

View File

@ -1,15 +1,63 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt Copyright (c) 2009-2010 Christopher Schmidt
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP #ifndef BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP #define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
#include <boost/fusion/algorithm/iteration/fold_fwd.hpp>
#include <boost/config.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/support/is_segmented.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/fold.hpp")
#endif
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#include <boost/fusion/algorithm/iteration/detail/fold.hpp> #include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#include <boost/fusion/algorithm/iteration/detail/segmented_fold.hpp>
#endif #endif

View File

@ -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)
==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_FOLD_FWD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_FWD_HPP
namespace boost { namespace fusion
{
namespace result_of
{
template<typename Seq, typename State, typename F>
struct fold;
}
template<typename Seq, typename State, typename F>
typename result_of::fold<
Seq
, State const
, F
>::type
fold(Seq& seq, State const& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::fold<
Seq const
, State const
, F
>::type
fold(Seq const& seq, State const& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::fold<
Seq
, State const
, F
>::type
fold(Seq& seq, State& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::fold<
Seq const
, State const
, F
>::type
fold(Seq const& seq, State& state, F f);
}}
#endif

View File

@ -9,11 +9,11 @@
#define BOOST_FUSION_FOR_EACH_20070527_0943 #define BOOST_FUSION_FOR_EACH_20070527_0943
#include <boost/fusion/algorithm/iteration/detail/for_each.hpp> #include <boost/fusion/algorithm/iteration/detail/for_each.hpp>
#include <boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp>
#include <boost/fusion/support/is_segmented.hpp>
#include <boost/fusion/support/category_of.hpp> namespace boost { namespace fusion
{
namespace boost { namespace fusion {
namespace result_of namespace result_of
{ {
template <typename Sequence, typename F> template <typename Sequence, typename F>
@ -23,20 +23,18 @@ namespace boost { namespace fusion {
}; };
} }
struct random_access_traversal_tag;
template <typename Sequence, typename F> template <typename Sequence, typename F>
inline void inline void
for_each(Sequence& seq, F const& f) for_each(Sequence& seq, F const& f)
{ {
detail::for_each(seq, f, typename traits::category_of<Sequence>::type()); detail::for_each(seq, f, typename traits::is_segmented<Sequence>::type());
} }
template <typename Sequence, typename F> template <typename Sequence, typename F>
inline void inline void
for_each(Sequence const& seq, F const& f) for_each(Sequence const& seq, F const& f)
{ {
detail::for_each(seq, f, typename traits::category_of<Sequence>::type()); detail::for_each(seq, f, typename traits::is_segmented<Sequence>::type());
} }
}} }}

View File

@ -0,0 +1,27 @@
/*=============================================================================
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_FOR_EACH_FWD_HPP_INCLUDED)
#define BOOST_FUSION_FOR_EACH_FWD_HPP_INCLUDED
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename F>
struct for_each;
}
template <typename Sequence, typename F>
void
for_each(Sequence& seq, F const& f);
template <typename Sequence, typename F>
void
for_each(Sequence const& seq, F const& f);
}}
#endif

View File

@ -1,5 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2010 Christopher Schmidt Copyright (c) 2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -8,10 +9,56 @@
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_HPP #ifndef BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_HPP #define BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_HPP
#include <boost/fusion/algorithm/iteration/iter_fold_fwd.hpp>
#include <boost/config.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/support/is_segmented.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#define BOOST_FUSION_ITER_FOLD #define BOOST_FUSION_ITER_FOLD
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/algorithm/iteration/detail/preprocessed/iter_fold.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/iter_fold.hpp")
#endif
/*=============================================================================
Copyright (c) 2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#include <boost/fusion/algorithm/iteration/detail/fold.hpp> #include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#undef BOOST_FUSION_ITER_FOLD #undef BOOST_FUSION_ITER_FOLD
#endif #endif

View File

@ -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)
==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_FWD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_FWD_HPP
namespace boost { namespace fusion
{
namespace result_of
{
template<typename Seq, typename State, typename F>
struct iter_fold;
}
template<typename Seq, typename State, typename F>
typename result_of::iter_fold<
Seq
, State const
, F
>::type
iter_fold(Seq& seq, State const& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::iter_fold<
Seq const
, State const
, F
>::type
iter_fold(Seq const& seq, State const& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::iter_fold<
Seq
, State const
, F
>::type
iter_fold(Seq& seq, State& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::iter_fold<
Seq const
, State const
, F
>::type
iter_fold(Seq const& seq, State& state, F f);
}}
#endif

View File

@ -1,5 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2010 Christopher Schmidt Copyright (c) 2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -8,10 +9,56 @@
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP #ifndef BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP #define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP
#include <boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp>
#include <boost/config.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/support/is_segmented.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#define BOOST_FUSION_REVERSE_FOLD #define BOOST_FUSION_REVERSE_FOLD
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/algorithm/iteration/detail/preprocessed/reverse_fold.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/reverse_fold.hpp")
#endif
/*=============================================================================
Copyright (c) 2009-2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#include <boost/fusion/algorithm/iteration/detail/fold.hpp> #include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#undef BOOST_FUSION_REVERSE_FOLD #undef BOOST_FUSION_REVERSE_FOLD
#endif #endif

View File

@ -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)
==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_FWD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_FWD_HPP
namespace boost { namespace fusion
{
namespace result_of
{
template<typename Seq, typename State, typename F>
struct reverse_fold;
}
template<typename Seq, typename State, typename F>
typename result_of::reverse_fold<
Seq
, State const
, F
>::type
reverse_fold(Seq& seq, State const& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::reverse_fold<
Seq const
, State const
, F
>::type
reverse_fold(Seq const& seq, State const& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::reverse_fold<
Seq
, State const
, F
>::type
reverse_fold(Seq& seq, State& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::reverse_fold<
Seq const
, State const
, F
>::type
reverse_fold(Seq const& seq, State& state, F f);
}}
#endif

View File

@ -1,18 +1,64 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2010 Christopher Schmidt Copyright (c) 2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP #ifndef BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP #define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP
#include <boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp>
#include <boost/config.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/support/is_segmented.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#define BOOST_FUSION_REVERSE_FOLD #define BOOST_FUSION_REVERSE_FOLD
#define BOOST_FUSION_ITER_FOLD #define BOOST_FUSION_ITER_FOLD
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/algorithm/iteration/detail/preprocessed/reverse_iter_fold.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/reverse_iter_fold.hpp")
#endif
/*=============================================================================
Copyright (c) 2010 Christopher Schmidt
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#include <boost/fusion/algorithm/iteration/detail/fold.hpp> #include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#undef BOOST_FUSION_REVERSE_FOLD #undef BOOST_FUSION_REVERSE_FOLD
#undef BOOST_FUSION_ITER_FOLD #undef BOOST_FUSION_ITER_FOLD

View File

@ -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)
==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_FWD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_FWD_HPP
namespace boost { namespace fusion
{
namespace result_of
{
template<typename Seq, typename State, typename F>
struct reverse_iter_fold;
}
template<typename Seq, typename State, typename F>
typename result_of::reverse_iter_fold<
Seq
, State const
, F
>::type
reverse_iter_fold(Seq& seq, State const& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::reverse_iter_fold<
Seq const
, State const
, F
>::type
reverse_iter_fold(Seq const& seq, State const& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::reverse_iter_fold<
Seq
, State const
, F
>::type
reverse_iter_fold(Seq& seq, State& state, F f);
template<typename Seq, typename State, typename F>
typename result_of::reverse_iter_fold<
Seq const
, State const
, F
>::type
reverse_iter_fold(Seq const& seq, State& state, F f);
}}
#endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005 Eric Niebler Copyright (c) 2005 Eric Niebler
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Copyright (c) 2007
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005 Eric Niebler Copyright (c) 2005 Eric Niebler
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Copyright (c) 2009 Christopher Schmidt Copyright (c) 2009 Christopher Schmidt
@ -9,19 +9,18 @@
#if !defined(FUSION_FIND_IF_05052005_1107) #if !defined(FUSION_FIND_IF_05052005_1107)
#define FUSION_FIND_IF_05052005_1107 #define FUSION_FIND_IF_05052005_1107
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/apply.hpp> #include <boost/mpl/apply.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp> #include <boost/mpl/identity.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/or.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/iterator/equal_to.hpp> #include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/next.hpp> #include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp> #include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/iterator/advance.hpp> #include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/support/category_of.hpp> #include <boost/fusion/support/category_of.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace fusion { namespace boost { namespace fusion {
struct random_access_traversal_tag; struct random_access_traversal_tag;
@ -222,10 +221,31 @@ namespace detail
template <typename Iterator> template <typename Iterator>
static type static type
call(Iterator const& iter) iter_call(Iterator const& iter)
{ {
return choose_call(iter, typename traits::category_of<Iterator>::type()); return choose_call(iter, typename traits::category_of<Iterator>::type());
} }
template <typename Sequence>
static type
call(Sequence& seq)
{
return iter_call(fusion::begin(seq));
}
};
template <typename Sequence, typename Pred>
struct result_of_find_if
{
typedef
static_find_if<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type
, Pred
>
filter;
typedef typename filter::type type;
}; };
}}} }}}

View File

@ -0,0 +1,90 @@
/*=============================================================================
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_FIND_HPP_INCLUDED)
#define BOOST_FUSION_SEGMENTED_FIND_HPP_INCLUDED
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/fusion/algorithm/query/find_fwd.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/support/segmented_fold_until.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename T>
struct segmented_find_fun
{
template <typename Sequence, typename State, typename Context>
struct apply
{
typedef
typename result_of::find<Sequence, T>::type
iterator_type;
typedef
typename result_of::equal_to<
iterator_type
, typename result_of::end<Sequence>::type
>::type
continue_type;
typedef
typename mpl::eval_if<
continue_type
, mpl::identity<State>
, result_of::make_segmented_iterator<
iterator_type
, Context
>
>::type
type;
static type call(Sequence& seq, State const&state, Context const& context, segmented_find_fun)
{
return call_impl(seq, state, context, continue_type());
}
static type call_impl(Sequence&, State const&state, Context const&, mpl::true_)
{
return state;
}
static type call_impl(Sequence& seq, State const&, Context const& context, mpl::false_)
{
return fusion::make_segmented_iterator(fusion::find<T>(seq), context);
}
};
};
template <typename Sequence, typename T>
struct result_of_segmented_find
{
struct filter
{
typedef
typename result_of::segmented_fold_until<
Sequence
, typename result_of::end<Sequence>::type
, segmented_find_fun<T>
>::type
type;
static type call(Sequence& seq)
{
return fusion::segmented_fold_until(
seq
, fusion::end(seq)
, detail::segmented_find_fun<T>());
}
};
typedef typename filter::type type;
};
}}}
#endif

View File

@ -0,0 +1,90 @@
/*=============================================================================
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_FIND_IF_HPP_INCLUDED)
#define BOOST_FUSION_SEGMENTED_FIND_IF_HPP_INCLUDED
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/fusion/algorithm/query/find_if_fwd.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/support/segmented_fold_until.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Pred>
struct segmented_find_if_fun
{
template <typename Sequence, typename State, typename Context>
struct apply
{
typedef
typename result_of::find_if<Sequence, Pred>::type
iterator_type;
typedef
typename result_of::equal_to<
iterator_type
, typename result_of::end<Sequence>::type
>::type
continue_type;
typedef
typename mpl::eval_if<
continue_type
, mpl::identity<State>
, result_of::make_segmented_iterator<
iterator_type
, Context
>
>::type
type;
static type call(Sequence& seq, State const&state, Context const& context, segmented_find_if_fun)
{
return call_impl(seq, state, context, continue_type());
}
static type call_impl(Sequence&, State const&state, Context const&, mpl::true_)
{
return state;
}
static type call_impl(Sequence& seq, State const&, Context const& context, mpl::false_)
{
return fusion::make_segmented_iterator(fusion::find_if<Pred>(seq), context);
}
};
};
template <typename Sequence, typename Pred>
struct result_of_segmented_find_if
{
struct filter
{
typedef
typename result_of::segmented_fold_until<
Sequence
, typename result_of::end<Sequence>::type
, segmented_find_if_fun<Pred>
>::type
type;
static type call(Sequence& seq)
{
return fusion::segmented_fold_until(
seq
, fusion::end(seq)
, segmented_find_if_fun<Pred>());
}
};
typedef typename filter::type type;
};
}}}
#endif

View File

@ -1,5 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2011 Eric Niebler
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -7,13 +8,15 @@
#if !defined(FUSION_FIND_05052005_1107) #if !defined(FUSION_FIND_05052005_1107)
#define FUSION_FIND_05052005_1107 #define FUSION_FIND_05052005_1107
#include <boost/fusion/algorithm/query/find_if_fwd.hpp>
#include <boost/fusion/algorithm/query/detail/find_if.hpp> #include <boost/fusion/algorithm/query/detail/find_if.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp> #include <boost/fusion/algorithm/query/detail/segmented_find.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/iterator/key_of.hpp> #include <boost/fusion/iterator/key_of.hpp>
#include <boost/fusion/iterator/value_of.hpp> #include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/support/category_of.hpp> #include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/support/is_segmented.hpp>
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
@ -22,17 +25,14 @@ namespace boost { namespace fusion
{ {
namespace result_of namespace result_of
{ {
template < template <typename Sequence, typename T>
typename Sequence
, typename T
>
struct find struct find
{ : mpl::if_<
typedef traits::is_segmented<Sequence>
detail::static_find_if< , detail::result_of_segmented_find<Sequence, T>
typename result_of::begin<Sequence>::type , detail::result_of_find_if<
, typename result_of::end<Sequence>::type Sequence,
, is_same< is_same<
typename mpl::if_< typename mpl::if_<
traits::is_associative<Sequence> traits::is_associative<Sequence>
, key_of<mpl::_1> , key_of<mpl::_1>
@ -41,10 +41,8 @@ namespace boost { namespace fusion
, T , T
> >
> >
filter; >::type
{};
typedef typename filter::type type;
};
} }
template <typename T, typename Sequence> template <typename T, typename Sequence>
@ -56,7 +54,7 @@ namespace boost { namespace fusion
find(Sequence& seq) find(Sequence& seq)
{ {
typedef typename result_of::find<Sequence, T>::filter filter; typedef typename result_of::find<Sequence, T>::filter filter;
return filter::call(fusion::begin(seq)); return filter::call(seq);
} }
template <typename T, typename Sequence> template <typename T, typename Sequence>
@ -64,9 +62,8 @@ namespace boost { namespace fusion
find(Sequence const& seq) find(Sequence const& seq)
{ {
typedef typename result_of::find<Sequence const, T>::filter filter; typedef typename result_of::find<Sequence const, T>::filter filter;
return filter::call(fusion::begin(seq)); return filter::call(seq);
} }
}} }}
#endif #endif

View File

@ -0,0 +1,34 @@
/*=============================================================================
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_FIND_FWD_HPP_INCLUDED)
#define BOOST_FUSION_FIND_FWD_HPP_INCLUDED
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_const.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename T>
struct find;
}
template <typename T, typename Sequence>
inline typename
lazy_disable_if<
is_const<Sequence>
, result_of::find<Sequence, T>
>::type const
find(Sequence& seq);
template <typename T, typename Sequence>
inline typename result_of::find<Sequence const, T>::type const
find(Sequence const& seq);
}}
#endif

View File

@ -1,5 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2011 Eric Niebler
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -7,15 +8,17 @@
#if !defined(FUSION_FIND_IF_05052005_1108) #if !defined(FUSION_FIND_IF_05052005_1108)
#define FUSION_FIND_IF_05052005_1108 #define FUSION_FIND_IF_05052005_1108
#include <boost/fusion/algorithm/query/find_if_fwd.hpp>
#include <boost/fusion/algorithm/query/detail/find_if.hpp> #include <boost/fusion/algorithm/query/detail/find_if.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp> #include <boost/fusion/algorithm/query/detail/segmented_find_if.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/iterator/value_of.hpp> #include <boost/fusion/iterator/value_of.hpp>
#include <boost/mpl/bind.hpp> #include <boost/fusion/support/is_segmented.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/quote.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/mpl/bind.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/quote.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -23,20 +26,18 @@ namespace boost { namespace fusion
{ {
template <typename Sequence, typename Pred> template <typename Sequence, typename Pred>
struct find_if struct find_if
{ : mpl::if_<
typedef traits::is_segmented<Sequence>
detail::static_find_if< , detail::result_of_segmented_find_if<Sequence, Pred>
typename result_of::begin<Sequence>::type , detail::result_of_find_if<
, typename result_of::end<Sequence>::type Sequence,
, mpl::bind1< mpl::bind1<
typename mpl::lambda<Pred>::type typename mpl::lambda<Pred>::type
, mpl::bind1<mpl::quote1<value_of>,mpl::_1> , mpl::bind1<mpl::quote1<value_of>, mpl::_1>
> >
> >
filter; >::type
{};
typedef typename filter::type type;
};
} }
template <typename Pred, typename Sequence> template <typename Pred, typename Sequence>
@ -48,7 +49,7 @@ namespace boost { namespace fusion
find_if(Sequence& seq) find_if(Sequence& seq)
{ {
typedef typename result_of::find_if<Sequence, Pred>::filter filter; typedef typename result_of::find_if<Sequence, Pred>::filter filter;
return filter::call(fusion::begin(seq)); return filter::call(seq);
} }
template <typename Pred, typename Sequence> template <typename Pred, typename Sequence>
@ -56,9 +57,8 @@ namespace boost { namespace fusion
find_if(Sequence const& seq) find_if(Sequence const& seq)
{ {
typedef typename result_of::find_if<Sequence const, Pred>::filter filter; typedef typename result_of::find_if<Sequence const, Pred>::filter filter;
return filter::call(fusion::begin(seq)); return filter::call(seq);
} }
}} }}
#endif #endif

View File

@ -0,0 +1,35 @@
/*=============================================================================
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_FIND_IF_FWD_HPP_INCLUDED)
#define BOOST_FUSION_FIND_IF_FWD_HPP_INCLUDED
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_const.hpp>
// Forward declaration of find_if algorithm
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename Pred>
struct find_if;
}
template <typename Pred, typename Sequence>
typename
lazy_disable_if<
is_const<Sequence>
, result_of::find_if<Sequence, Pred>
>::type
find_if(Sequence& seq);
template <typename Pred, typename Sequence>
typename result_of::find_if<Sequence const, Pred>::type const
find_if(Sequence const& seq);
}}
#endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -0,0 +1,22 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if FUSION_MAX_ZIP_SEQUENCES <= 10
#include <boost/fusion/algorithm/transformation/detail/preprocessed/zip10.hpp>
#elif FUSION_MAX_ZIP_SEQUENCES <= 20
#include <boost/fusion/algorithm/transformation/detail/preprocessed/zip20.hpp>
#elif FUSION_MAX_ZIP_SEQUENCES <= 30
#include <boost/fusion/algorithm/transformation/detail/preprocessed/zip30.hpp>
#elif FUSION_MAX_ZIP_SEQUENCES <= 40
#include <boost/fusion/algorithm/transformation/detail/preprocessed/zip40.hpp>
#elif FUSION_MAX_ZIP_SEQUENCES <= 50
#include <boost/fusion/algorithm/transformation/detail/preprocessed/zip50.hpp>
#else
#error "FUSION_MAX_ZIP_SEQUENCES out of bounds for preprocessed headers"
#endif

Some files were not shown because too many files have changed in this diff Show More