merged fusion from the trunk

[SVN r63560]
This commit is contained in:
Christopher Schmidt
2010-07-03 20:10:58 +00:00
parent 649770fdcd
commit 1572e0e9c3
402 changed files with 4874 additions and 5055 deletions

View File

@ -8,11 +8,12 @@
#if !defined(BOOST_FUSION_ADAPTED_30122005_1420)
#define BOOST_FUSION_ADAPTED_30122005_1420
#include <boost/fusion/adapted/boost_tuple.hpp>
#include <boost/fusion/adapted/std_pair.hpp>
#include <boost/fusion/adapted/array.hpp>
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/adapted/struct.hpp>
#include <boost/fusion/adapted/boost_array.hpp>
#include <boost/fusion/adapted/boost_tuple.hpp>
#include <boost/fusion/adapted/class.hpp>
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/adapted/std_pair.hpp>
#include <boost/fusion/adapted/struct.hpp>
#endif

View File

@ -26,7 +26,7 @@ namespace boost { namespace fusion
: iterator_facade<array_iterator<Array, Pos>, random_access_traversal_tag>
{
BOOST_MPL_ASSERT_RELATION(Pos, >=, 0);
BOOST_MPL_ASSERT_RELATION(Pos, <=, Array::static_size);
BOOST_MPL_ASSERT_RELATION(Pos, <=, static_cast<int>(Array::static_size));
typedef mpl::int_<Pos> index;
typedef Array array_type;

View File

@ -47,8 +47,8 @@ namespace boost { namespace fusion
{
typedef Cons cons_type;
explicit boost_tuple_iterator(Cons& cons)
: cons(cons) {}
explicit boost_tuple_iterator(Cons& in_cons)
: cons(in_cons) {}
Cons& cons;
template <typename Iterator>
@ -127,6 +127,10 @@ namespace boost { namespace fusion
return type();
}
};
private:
// silence MSVC warning C4512: assignment operator could not be generated
boost_tuple_iterator& operator= (boost_tuple_iterator const&);
};
template <typename Null>

View File

@ -62,6 +62,7 @@
(1)TEMPLATE_PARAMS_SEQ, \
(1)NAME_SEQ, \
assoc_struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
@ -70,6 +71,16 @@
(0), \
(0)(NAME), \
assoc_struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_AS_VIEW(NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(NAME), \
assoc_struct_tag, \
1, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)

View File

@ -17,7 +17,7 @@
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
\
BOOST_FUSION_ADAPT_ASSOC_CLASS( \
BOOST_FUSION_ADAPT_ASSOC_CLASS_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
ATTRIBUTES)

View File

@ -48,6 +48,7 @@
(1)TEMPLATE_PARAMS_SEQ, \
(1)NAME_SEQ, \
struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_CLASS_C)
@ -56,6 +57,16 @@
(0), \
(0)(NAME), \
struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_CLASS_C)
#define BOOST_FUSION_ADAPT_CLASS_AS_VIEW(NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(NAME), \
struct_tag, \
1, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_CLASS_C)

View File

@ -19,7 +19,7 @@
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
\
BOOST_FUSION_ADAPT_CLASS( \
BOOST_FUSION_ADAPT_CLASS_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
ATTRIBUTES)

View File

@ -1,105 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_CLASS_ITERATOR_OCTOBER_4_2009_839M)
#define FUSION_CLASS_ITERATOR_OCTOBER_4_2009_839M
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/fusion/adapted/class/extension.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/minus.hpp>
#include <boost/config/no_tr1/utility.hpp>
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
template <typename Class, int N_>
struct class_iterator
: iterator_facade<class_iterator<Class, N_>, random_access_traversal_tag>
{
BOOST_MPL_ASSERT_RELATION(N_, >=, 0);
BOOST_MPL_ASSERT_RELATION(N_, <=, extension::class_size<Class>::value);
typedef mpl::int_<N_> index;
typedef Class class_type;
class_iterator(Class& class_)
: class_(class_) {}
Class& class_;
template <typename Iterator>
struct value_of
: extension::class_member<Class, N_>
{
};
template <typename Iterator>
struct deref
{
typedef typename
mpl::if_<
is_const<Class>
, typename extension::class_member<Class, N_>::get_type
, typename extension::class_member<Class, N_>::proxy
>::type
type;
static type
call(Iterator const& iter)
{
return extension::class_member<Class, N_>::
call(iter.class_);
}
};
template <typename Iterator, typename N>
struct advance
{
typedef typename Iterator::index index;
typedef typename Iterator::class_type class_type;
typedef class_iterator<class_type, index::value + N::value> type;
static type
call(Iterator const& iter)
{
return type(iter.class_);
}
};
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 distance : mpl::minus<typename I2::index, typename I1::index>
{
typedef typename
mpl::minus<
typename I2::index, typename I1::index
>::type
type;
static type
call(I1 const&, I2 const&)
{
return type();
}
};
};
}}
#endif

View File

@ -45,8 +45,8 @@
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) rvalue; \
\
class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj)\
: obj(obj) \
class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& o) \
: obj(o) \
{} \
\
template<class Arg> \
@ -63,6 +63,9 @@
} \
\
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
\
private: \
class_member_proxy& operator= (class_member_proxy const&); \
}; \
\
template< \

View File

@ -1,70 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_OCTOBER_4_2009_920PM)
#define BOOST_FUSION_AT_IMPL_OCTOBER_4_2009_920PM
#include <boost/fusion/support/detail/access.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/int.hpp>
namespace boost { namespace fusion
{
struct class_tag;
namespace extension
{
template<typename T>
struct at_impl;
template <typename Class, int N>
struct class_member;
template <typename Class>
struct class_size;
template <>
struct at_impl<class_tag>
{
template <typename Sequence, typename N>
struct apply
{
static int const n_value = N::value;
BOOST_MPL_ASSERT_RELATION(
n_value, <=, extension::class_size<Sequence>::value);
typedef typename
extension::class_member<Sequence, N::value>
element;
typedef typename
mpl::if_<
is_const<Sequence>
, typename class_member<Sequence, N::value>::get_type
, typename class_member<Sequence, N::value>::proxy
>::type
type;
static type
call(Sequence& seq)
{
return extension::
class_member<Sequence, N::value>::call(seq);
}
//~ static typename class_member<Sequence, N::value>::get_type
//~ call(Sequence const& seq)
//~ {
//~ return extension::
//~ class_member<Sequence, N::value>::call(seq);
//~ }
};
};
}
}}
#endif

View File

@ -1,54 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2007 Dan Marsden
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_KEY_IMPL_OCTOBER_4_2009_920PM)
#define BOOST_FUSION_AT_KEY_IMPL_OCTOBER_4_2009_920PM
#include <boost/fusion/support/detail/access.hpp>
namespace boost { namespace fusion
{
struct class_tag;
namespace extension
{
template<typename T>
struct at_key_impl;
template <typename Class, typename Key>
struct class_assoc_member;
template <>
struct at_key_impl<class_tag>
{
template <typename Sequence, typename Key>
struct apply
{
typedef typename
extension::class_assoc_member<Sequence, Key>
element;
typedef typename
mpl::eval_if<
is_const<Sequence>
, detail::cref_result<element>
, detail::ref_result<element>
>::type
type;
static type
call(Sequence& seq)
{
return extension::
class_assoc_member<Sequence, Key>::call(seq);
}
};
};
}
}}
#endif

View File

@ -1,40 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_OCTOBER_4_2009_920PM)
#define BOOST_FUSION_BEGIN_IMPL_OCTOBER_4_2009_920PM
#include <boost/fusion/adapted/class/class_iterator.hpp>
namespace boost { namespace fusion
{
struct class_tag;
namespace extension
{
template<typename T>
struct begin_impl;
template <>
struct begin_impl<class_tag>
{
template <typename Sequence>
struct apply
{
typedef class_iterator<Sequence, 0> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@ -1,35 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_OCTOBER_4_2009_919PM)
#define BOOST_FUSION_CATEGORY_OF_IMPL_OCTOBER_4_2009_919PM
#include <boost/config/no_tr1/utility.hpp>
namespace boost { namespace fusion
{
struct class_tag;
struct random_access_traversal_tag;
namespace extension
{
template<typename T>
struct category_of_impl;
template<>
struct category_of_impl<class_tag>
{
template<typename T>
struct apply
{
typedef random_access_traversal_tag type;
};
};
}
}}
#endif

View File

@ -1,48 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_OCTOBER_4_2009_919PM)
#define BOOST_FUSION_END_IMPL_OCTOBER_4_2009_919PM
#include <boost/fusion/adapted/class/class_iterator.hpp>
namespace boost { namespace fusion
{
struct class_tag;
namespace extension
{
template <typename Tag>
struct end_impl;
template <typename Class>
struct class_size;
template <>
struct end_impl<class_tag>
{
template <typename Sequence>
struct apply
{
typedef
class_iterator<
Sequence
, class_size<Sequence>::value
>
type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@ -1,40 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2007 Dan Marsden
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_HAS_KEY_IMPL_OCTOBER_4_2009_919PM)
#define BOOST_FUSION_HAS_KEY_IMPL_OCTOBER_4_2009_919PM
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/not.hpp>
namespace boost { namespace fusion {
struct class_tag;
namespace extension
{
struct no_such_member;
template<typename T>
struct has_key_impl;
template<typename Class, typename Key>
struct class_assoc_member;
template<>
struct has_key_impl<class_tag>
{
template<typename Sequence, typename Key>
struct apply
: mpl::not_<is_same<no_such_member, typename class_assoc_member<Sequence, Key>::type> >
{
};
};
}
}}
#endif

View File

@ -1,31 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_OCTOBER_4_2009_919PM)
#define BOOST_FUSION_IS_SEQUENCE_IMPL_OCTOBER_4_2009_919PM
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct class_tag;
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<class_tag>
{
template<typename Sequence>
struct apply : mpl::true_ {};
};
}
}}
#endif

View File

@ -1,32 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_OCTOBER_4_2009_919PM)
#define BOOST_FUSION_IS_VIEW_IMPL_OCTOBER_4_2009_919PM
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct class_tag;
namespace extension
{
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<class_tag>
{
template<typename T>
struct apply : mpl::false_
{};
};
}
}}
#endif

View File

@ -1,37 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_OCTOBER_4_2009_919PM)
#define BOOST_FUSION_SIZE_IMPL_OCTOBER_4_2009_919PM
#include <boost/mpl/int.hpp>
namespace boost { namespace fusion
{
namespace extension
{
template <typename Class>
struct class_size;
}
struct class_tag;
namespace extension
{
template<typename T>
struct size_impl;
template <>
struct size_impl<class_tag>
{
template <typename Sequence>
struct apply : extension::class_size<Sequence> {};
};
}
}}
#endif

View File

@ -1,47 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_OCTOBER_4_2009_918PM)
#define BOOST_FUSION_VALUE_AT_IMPL_OCTOBER_4_2009_918PM
#include <boost/mpl/if.hpp>
#include <boost/static_assert.hpp>
namespace boost { namespace fusion
{
struct class_tag;
namespace extension
{
template<typename T>
struct value_at_impl;
template <typename Class, int N>
struct class_member;
template <typename Class>
struct class_size;
template <>
struct value_at_impl<class_tag>
{
template <typename Sequence, typename N>
struct apply
{
static int const n_value = N::value;
BOOST_MPL_ASSERT_RELATION(
n_value, <=, extension::class_size<Sequence>::value);
typedef typename
extension::class_member<Sequence, N::value>::type
type;
};
};
}
}}
#endif

View File

@ -1,39 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2007 Dan Marsden
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_KEY_IMPL_OCTOBER_4_2009_918PM)
#define BOOST_FUSION_VALUE_AT_KEY_IMPL_OCTOBER_4_2009_918PM
#include <boost/mpl/if.hpp>
namespace boost { namespace fusion
{
struct class_tag;
namespace extension
{
template<typename T>
struct value_at_key_impl;
template <typename Class, typename Key>
struct class_assoc_member;
template <>
struct value_at_key_impl<class_tag>
{
template <typename Sequence, typename Key>
struct apply
{
typedef typename
extension::class_assoc_member<Sequence, Key>::type
type;
};
};
}
}}
#endif

View File

@ -1,68 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_CLASS_EXTENSION_OCTOBER_4_2009_839PM)
#define FUSION_CLASS_EXTENSION_OCTOBER_4_2009_839PM
#include <boost/type_traits/add_const.hpp>
namespace boost { namespace fusion { namespace extension
{
template <typename Class, int N>
struct class_member;
template <typename Class>
struct class_size;
template <typename Class, int N>
struct class_member<Class const, N> : class_member<Class, N> {};
//~ {
//~ typedef typename class_member<Class, N>::type type;
//~ typedef typename class_member<Class, N>::get_type get_type;
//~ typedef typename class_member<Class, N>::proxy proxy;
//~ static get_type&
//~ call(Class const& class_)
//~ {
//~ return class_member<Class, N>::call(
//~ const_cast<Class&>(class_));
//~ }
//~ };
template <typename Class>
struct class_size<Class const>
: class_size<Class>
{};
struct no_such_member;
template<typename Class, typename Key>
struct class_assoc_member
{
typedef no_such_member type;
};
template<typename Class, typename Key>
struct class_assoc_member<Class const, Key>
{
typedef typename
add_const<typename class_assoc_member<Class, Key>::type>::type
type;
static type&
call(Class const& class_)
{
return class_assoc_member<Class, Key>::call(
const_cast<Class&>(class_));
}
};
}}}
#endif

View File

@ -80,7 +80,7 @@ namespace boost { namespace fusion
type;
static type
call(Iterator const& i)
call(Iterator const& /*i*/)
{
return type();
}

View File

@ -34,9 +34,9 @@
#include <boost/fusion/adapted/struct/detail/key_of_impl.hpp>
#include <boost/fusion/adapted/struct/detail/value_of_data_impl.hpp>
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z)\
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \
((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z)\
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \
((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
@ -59,7 +59,7 @@
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \
\
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE)
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE)
#define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
@ -68,6 +68,7 @@
(1)TEMPLATE_PARAMS_SEQ, \
(1)NAME_SEQ, \
assoc_struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
@ -76,6 +77,16 @@
(0), \
(0)(NAME), \
assoc_struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(NAME), \
assoc_struct_tag, \
1, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)

View File

@ -11,11 +11,12 @@
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_C( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \
\
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, obj., ATTRIBUTE)
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0(X, Y, Z) \
(X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1(X, Y, Z) \
(X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0_END
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1_END
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
@ -23,13 +24,10 @@
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
\
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
(0)NAMESPACE_SEQ)NAME), \
assoc_struct_tag, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_C)
BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 ATTRIBUTES,_END))
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \

View File

@ -38,13 +38,14 @@
#define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE,2)
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE,2)
#define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(1)TEMPLATE_PARAMS_SEQ, \
(1)NAME_SEQ, \
struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_STRUCT_C)
@ -53,6 +54,16 @@
(0), \
(0)(NAME), \
struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_STRUCT_C)
#define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(NAME), \
struct_tag, \
1, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_STRUCT_C)

View File

@ -14,11 +14,12 @@
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
#include <boost/preprocessor/empty.hpp>
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_C( \
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
\
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, obj., ATTRIBUTE, 2)
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0(X, Y) \
(X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1(X, Y) \
(X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0_END
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1_END
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
@ -26,13 +27,9 @@
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
\
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
(0)NAMESPACE_SEQ)NAME), \
struct_tag, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_STRUCT_NAMED_C)
BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0 ATTRIBUTES,_END))
#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \

View File

@ -23,6 +23,7 @@
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/tag.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
@ -116,7 +117,7 @@
static type \
call(Seq& seq) \
{ \
return seq.PREFIX \
return seq.PREFIX() \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \
} \
}; \
@ -141,7 +142,12 @@
};
#define BOOST_FUSION_ADAPT_STRUCT_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG,ATTRIBUTES_SEQ,ATTRIBUTES_CALLBACK) \
TEMPLATE_PARAMS_SEQ, \
NAME_SEQ, \
TAG, \
IS_VIEW, \
ATTRIBUTES_SEQ, \
ATTRIBUTES_CALLBACK) \
\
namespace boost \
{ \
@ -169,6 +175,16 @@ namespace boost
> \
struct struct_size<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)> \
: mpl::int_<BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)> \
{}; \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct struct_is_view< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
> \
: mpl::BOOST_PP_IF(IS_VIEW,true_,false_) \
{}; \
} \
} \

View File

@ -17,6 +17,7 @@
#include <boost/fusion/adapted/struct/detail/namespace.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/expr_if.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/logical/not.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
@ -42,7 +43,7 @@
#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I_, ATTRIBUTE) \
\
BOOST_PP_IF( \
BOOST_PP_EXPR_IF( \
I_, \
typedef typename \
boost::fusion::result_of::next< \
@ -50,9 +51,8 @@
>::type \
BOOST_PP_CAT(I,I_); \
BOOST_PP_CAT(I,I_) BOOST_PP_CAT(i,I_)= \
boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_)));, \
BOOST_PP_EMPTY() \
) \
boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_))); \
) \
\
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)= \
boost::fusion::deref(BOOST_PP_CAT(i,I_));

View File

@ -33,11 +33,15 @@ namespace boost { namespace fusion
template<typename Seq, int N>
struct struct_member_name;
template<typename Seq>
struct struct_size;
template<typename Seq>
struct struct_is_view;
template<typename Seq, int N>
struct struct_assoc_key;
template<typename Seq>
struct struct_size;
}
}}

View File

@ -10,8 +10,6 @@
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
@ -22,7 +20,7 @@ namespace boost { namespace fusion { namespace extension
{
template<typename Seq>
struct apply
: mpl::false_
: struct_is_view<typename remove_const<Seq>::type>
{};
};

View File

@ -18,11 +18,14 @@
\
struct NAME \
{ \
NAME(WRAPPED_TYPE& obj) \
: obj(obj) \
NAME(WRAPPED_TYPE& in_obj) \
: obj(in_obj) \
{} \
\
WRAPPED_TYPE& obj; \
\
private: \
NAME& operator= (NAME const&); \
}; \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)

View File

@ -10,5 +10,8 @@
#include <boost/fusion/algorithm/iteration/accumulate.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
#include <boost/fusion/algorithm/iteration/for_each.hpp>
#include <boost/fusion/algorithm/iteration/iter_fold.hpp>
#include <boost/fusion/algorithm/iteration/reverse_fold.hpp>
#include <boost/fusion/algorithm/iteration/reverse_iter_fold.hpp>
#endif

View File

@ -22,14 +22,14 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename State, typename F>
inline typename result_of::accumulate<Sequence, State, F>::type
inline typename result_of::accumulate<Sequence, State const, F>::type
accumulate(Sequence& seq, State const& state, F f)
{
return fusion::fold(seq, state, f);
}
template <typename Sequence, typename State, typename F>
inline typename result_of::accumulate<Sequence const, State, F>::type
inline typename result_of::accumulate<Sequence const, State const, F>::type
accumulate(Sequence const& seq, State const& state, F f)
{
return fusion::fold(seq, state, f);

View File

@ -1,278 +1,434 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2006 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)
==============================================================================*/
#if !defined(BOOST_FUSION_FOLD_HPP_20070528_1253)
#define BOOST_FUSION_FOLD_HPP_20070528_1253
#include <boost/mpl/bool.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#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/fusion/iterator/distance.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>
namespace boost { namespace fusion {
namespace result_of
{
template <typename Sequence, typename State, typename F>
struct fold;
}
namespace detail
{
template <typename F>
struct apply_fold_result
{
template <typename State, typename Value>
struct apply
: boost::result_of<F(State, Value)>
{};
};
template <typename State, typename Iterator, typename F>
struct fold_apply
{
typedef typename result_of::deref<Iterator>::type dereferenced;
typedef typename add_reference<typename add_const<State>::type>::type lvalue_state;
typedef typename boost::result_of<F(lvalue_state, dereferenced)>::type type;
};
template <typename First, typename Last, typename State, typename F>
struct static_fold;
template <typename First, typename Last, typename State, typename F>
struct next_result_of_fold
{
typedef typename
static_fold<
typename result_of::next<First>::type
, Last
, typename fold_apply<State, First, F>::type
, F
>::type
type;
};
template <typename First, typename Last, typename State, typename F>
struct static_fold
{
typedef typename
mpl::if_<
result_of::equal_to<First, Last>
, mpl::identity<State>
, next_result_of_fold<First, Last, State, F>
>::type
result;
typedef typename result::type type;
};
template<typename State, typename I0, typename F, int N>
struct result_of_unrolled_fold;
template<int N>
struct unrolled_fold
{
template<typename State, typename I0, typename F>
static typename result_of_unrolled_fold<State, I0, F, N>::type
call(State const& state, I0 const& i0, F f)
{
typedef typename result_of::next<I0>::type I1;
I1 i1 = fusion::next(i0);
typedef typename result_of::next<I1>::type I2;
I2 i2 = fusion::next(i1);
typedef typename result_of::next<I2>::type I3;
I3 i3 = fusion::next(i2);
typedef typename result_of::next<I3>::type I4;
I4 i4 = fusion::next(i3);
return unrolled_fold<N-4>::call(f(f(f(f(state, *i0), *i1), *i2), *i3), i4, f);
}
};
template<>
struct unrolled_fold<3>
{
template<typename State, typename I0, typename F>
static typename result_of_unrolled_fold<State, I0, F, 3>::type
call(State const& state, I0 const& i0, F f)
{
typedef typename result_of::next<I0>::type I1;
I1 i1 = fusion::next(i0);
typedef typename result_of::next<I1>::type I2;
I2 i2 = fusion::next(i1);
return f(f(f(state, *i0), *i1), *i2);
}
};
template<>
struct unrolled_fold<2>
{
template<typename State, typename I0, typename F>
static typename result_of_unrolled_fold<State, I0, F, 2>::type
call(State const& state, I0 const& i0, F f)
{
typedef typename result_of::next<I0>::type I1;
I1 i1 = fusion::next(i0);
return f(f(state, *i0), *i1);
}
};
template<>
struct unrolled_fold<1>
{
template<typename State, typename I0, typename F>
static typename result_of_unrolled_fold<State, I0, F, 1>::type
call(State const& state, I0 const& i0, F f)
{
return f(state, *i0);
}
};
template<>
struct unrolled_fold<0>
{
template<typename State, typename I0, typename F>
static State call(State const& state, I0 const&, F)
{
return state;
}
};
// terminal case
template <typename First, typename Last, typename State, typename F>
inline State const&
linear_fold(First const&, Last const&, State const& state, F, mpl::true_)
{
return state;
}
// non-terminal case
template <typename First, typename Last, typename State, typename F>
inline typename static_fold<First, Last, State, F>::type
linear_fold(
First const& first
, Last const& last
, State const& state
, F f
, mpl::false_)
{
return detail::linear_fold(
fusion::next(first)
, last
, f(state, *first)
, f
, result_of::equal_to<typename result_of::next<First>::type, Last>()
);
}
template<typename State, typename I0, typename F, int N>
struct result_of_unrolled_fold
{
typedef typename result_of::next<I0>::type I1;
typedef typename result_of::next<I1>::type I2;
typedef typename result_of::next<I2>::type I3;
typedef typename result_of::next<I3>::type I4;
typedef typename fold_apply<State, I0, F>::type Rest1;
typedef typename fold_apply<Rest1, I1, F>::type Rest2;
typedef typename fold_apply<Rest2, I2, F>::type Rest3;
typedef typename fold_apply<Rest3, I3, F>::type Rest4;
typedef typename result_of_unrolled_fold<Rest4, I4, F, N-4>::type type;
};
template<typename State, typename I0, typename F>
struct result_of_unrolled_fold<State, I0, F, 3>
{
typedef typename result_of::next<I0>::type I1;
typedef typename result_of::next<I1>::type I2;
typedef typename fold_apply<State, I0, F>::type Rest;
typedef typename fold_apply<Rest, I1, F>::type Rest2;
typedef typename fold_apply<Rest2, I2, F>::type type;
};
template<typename State, typename I0, typename F>
struct result_of_unrolled_fold<State, I0, F, 2>
{
typedef typename result_of::next<I0>::type I1;
typedef typename fold_apply<State, I0, F>::type Rest;
typedef typename fold_apply<Rest, I1, F>::type type;
};
template<typename State, typename I0, typename F>
struct result_of_unrolled_fold<State, I0, F, 1>
{
typedef typename fold_apply<State, I0, F>::type type;
};
template<typename State, typename I0, typename F>
struct result_of_unrolled_fold<State, I0, F, 0>
{
typedef State type;
};
template<typename Sequence, typename State, typename F, bool>
struct choose_fold;
template<typename Sequence, typename State, typename F>
struct choose_fold<Sequence, State, F, true>
{
typedef typename result_of::begin<Sequence>::type begin;
typedef typename result_of::end<Sequence>::type end;
typedef typename result_of_unrolled_fold<
State, begin, F, result_of::distance<begin, end>::type::value>::type type;
};
template<typename Sequence, typename State, typename F>
struct choose_fold<Sequence, State, F, false>
{
typedef typename
detail::static_fold<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type
, State
, F
>::type
type;
};
template<typename Sequence, typename State, typename F, typename Tag>
typename result_of::fold<Sequence, State, F>::type
fold(Sequence& seq, State const& state, F f, Tag)
{
return linear_fold(
fusion::begin(seq)
, fusion::end(seq)
, state
, f
, result_of::equal_to<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type>()
);
}
template<typename Sequence, typename State, typename F>
typename result_of::fold<Sequence, State, F>::type
fold(Sequence& seq, State const& state, F f, random_access_traversal_tag)
{
typedef typename result_of::begin<Sequence>::type begin;
typedef typename result_of::end<Sequence>::type end;
return unrolled_fold<result_of::distance<begin, end>::type::value>::call(
state
, fusion::begin(seq)
, f);
}
}}}
#endif
#ifdef BOOST_FUSION_REVERSE_FOLD
# ifdef BOOST_FUSION_ITER_FOLD
# define BOOST_FUSION_FOLD_NAME reverse_iter_fold
# else
# define BOOST_FUSION_FOLD_NAME reverse_fold
# endif
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION end
# define BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION prior
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(IT) \
typename fusion::result_of::prior<IT>::type
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(IT) fusion::prior(IT)
#else
# ifdef BOOST_FUSION_ITER_FOLD
# define BOOST_FUSION_FOLD_NAME iter_fold
# else
# define BOOST_FUSION_FOLD_NAME fold
# endif
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION begin
# define BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION next
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(IT) IT
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(IT) IT
#endif
#ifdef BOOST_FUSION_ITER_FOLD
# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(IT) IT&
# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(IT) IT
#else
# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(IT) \
typename fusion::result_of::deref<IT>::type
# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(IT) fusion::deref(IT)
#endif
namespace boost { namespace fusion
{
namespace detail
{
template<typename State, typename It, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)
: boost::result_of<
F(
typename add_reference<typename add_const<State>::type>::type,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It))
>
{};
template<typename Result,int N>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
It1;
It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It1
>::type
It2;
It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It2
>::type
It3;
It3 it3 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it2);
return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<
Result
, N-4
>::call(
f(
f(
f(
f(
state,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(
it0)
),
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1)
),
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2)
),
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it3)
),
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it3),
f);
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,3>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
It1;
It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It1
>::type
It2;
It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1);
return f(
f(
f(
state,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)
),
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1)
),
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1)
));
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,2>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return f(
f(state,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)),
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0)));
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,1>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return f(state,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0));
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,0>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return static_cast<Result>(state);
}
};
template<typename StateRef, typename It0, typename F, int N>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)
{
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
it1;
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
rest1
, it1
, F
>::type
rest2;
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<it1>::type
it2;
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
rest2
, it2
, F
>::type
rest3;
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<it2>::type
it3;
typedef typename
BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
typename BOOST_PP_CAT(
BOOST_FUSION_FOLD_NAME, _rvalue_state)<
rest3
, it3
, F
>::type
, typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
it3
>::type
, F
, N-4
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
StateRef
, It0
, F
, 3
>
{
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
it1;
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
typename BOOST_PP_CAT(
BOOST_FUSION_FOLD_NAME, _rvalue_state)<
rest1
, it1
, F
>::type
, typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
it1 const
>::type const
, F
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
StateRef
, It0
, F
, 2
>
: BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
StateRef
, It0 const
, F
>::type
, typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
StateRef
, It0
, F
, 1
>
: BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
StateRef
, It0 const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
StateRef
, It0
, F
, 0
>
{
typedef StateRef type;
};
template<typename StateRef, typename It0, typename F, int SeqSize>
struct BOOST_PP_CAT(result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)
{
typedef typename
BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
typename boost::result_of<
F(
StateRef,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(
It0 const)
)
>::type
, typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
, F
, SeqSize-1
>::type
type;
};
template<int SeqSize, typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)
{
typedef typename
BOOST_PP_CAT(
result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)<
StateRef
, BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(It0)
, F
, SeqSize
>::type
type;
static type
call(StateRef state, It0 const& it0, F f)
{
return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<
type
, SeqSize
>::call(state,BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(it0),f);
}
};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<0,StateRef,It0,F>
{
typedef StateRef type;
static StateRef
call(StateRef state, It0 const&, F)
{
return static_cast<StateRef>(state);
}
};
}
namespace result_of
{
template<typename Seq, typename State, typename F>
struct BOOST_FUSION_FOLD_NAME
: detail::BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<
size<Seq>::value
, typename add_reference<
typename add_const<State>::type
>::type
, typename BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION<Seq>::type
, F
>
{};
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<Seq,State const,F>::type
BOOST_FUSION_FOLD_NAME(Seq& seq,State const& state,F f)
{
return result_of::BOOST_FUSION_FOLD_NAME<Seq,State const,F>::call(
state,
fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq),
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<Seq const,State const,F>::type
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(
state,
fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq),
f);
}
}}
#undef BOOST_FUSION_FOLD_NAME
#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION
#undef BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION
#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM
#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM
#undef BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM
#undef BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM

View File

@ -1,48 +1,15 @@
/*=============================================================================
Copyright (c) 2001-2007 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
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_05052005_1214)
#define BOOST_FUSION_FOLD_05052005_1214
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
#include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/static_assert.hpp>
namespace boost { namespace fusion {
struct random_access_traversal_tag;
namespace result_of
{
template <typename Sequence, typename State, typename F>
struct fold
: fusion::detail::choose_fold<
Sequence, State, F
, is_base_of<random_access_traversal_tag, typename traits::category_of<Sequence>::type>::value>
{};
}
template <typename Sequence, typename State, typename F>
inline typename result_of::fold<Sequence, State, F>::type
fold(Sequence& seq, State const& state, F f)
{
return detail::fold(seq, state, f, typename traits::category_of<Sequence>::type());
}
template <typename Sequence, typename State, typename F>
inline typename result_of::fold<Sequence const, State, F>::type
fold(Sequence const& seq, State const& state, F f)
{
return detail::fold(seq, state, f, typename traits::category_of<Sequence>::type());
}
}}
#endif

View File

@ -0,0 +1,17 @@
/*=============================================================================
Copyright (c) 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)
==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_HPP
#define BOOST_FUSION_ITER_FOLD
#include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#undef BOOST_FUSION_ITER_FOLD
#endif

View File

@ -0,0 +1,17 @@
/*=============================================================================
Copyright (c) 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)
==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP
#define BOOST_FUSION_REVERSE_FOLD
#include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#undef BOOST_FUSION_REVERSE_FOLD
#endif

View File

@ -0,0 +1,19 @@
/*=============================================================================
Copyright (c) 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)
==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP
#define BOOST_FUSION_REVERSE_FOLD
#define BOOST_FUSION_ITER_FOLD
#include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#undef BOOST_FUSION_REVERSE_FOLD
#undef BOOST_FUSION_ITER_FOLD
#endif

View File

@ -106,7 +106,7 @@ namespace boost { namespace fusion { namespace detail
struct unrolled_all<0>
{
template <typename It, typename F>
static bool call(It const& it, F f)
static bool call(It const& /*it*/, F /*f*/)
{
return true;
}

View File

@ -7,10 +7,16 @@
#if !defined(FUSION_COUNT_09162005_0158)
#define FUSION_COUNT_09162005_0158
#include <boost/config.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/fusion/support/detail/access.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion { namespace detail
{
template <bool is_convertible>
@ -44,8 +50,8 @@ namespace boost { namespace fusion { namespace detail
struct count_compare
{
typedef typename detail::call_param<T1>::type param;
count_compare(param x)
: x(x) {}
count_compare(param in_x)
: x(in_x) {}
template <typename T2>
bool
@ -64,5 +70,9 @@ namespace boost { namespace fusion { namespace detail
};
}}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -22,7 +22,7 @@ namespace boost { namespace fusion
template <typename Sequence>
inline typename result_of::clear<Sequence const>::type
clear(Sequence const& seq)
clear(Sequence const& /*seq*/)
{
return vector0<>();
}

View File

@ -41,8 +41,8 @@ namespace boost { namespace fusion { namespace detail
template <typename T>
struct replacer
{
replacer(T const& old_value, T const& new_value)
: old_value(old_value), new_value(new_value) {}
replacer(T const& in_old_value, T const& in_new_value)
: old_value(in_old_value), new_value(in_new_value) {}
template<typename Sig>
struct result;

View File

@ -41,8 +41,8 @@ namespace boost { namespace fusion { namespace detail
template <typename F, typename T>
struct replacer_if
{
replacer_if(F f, T const& new_value)
: f(f), new_value(new_value) {}
replacer_if(F in_f, T const& in_new_value)
: f(in_f), new_value(in_new_value) {}
template<typename Params>
struct result;

View File

@ -68,7 +68,7 @@ namespace boost { namespace fusion {
{}
template<typename Sequence>
deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* dummy = 0)
deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
: base(base::from_iterator(fusion::begin(seq)))
{}

View File

@ -100,6 +100,10 @@ namespace boost { namespace fusion {
{};
Seq& seq_;
private:
// silence MSVC warning C4512: assignment operator could not be generated
deque_iterator& operator= (deque_iterator const&);
};
}}

View File

@ -46,11 +46,11 @@ namespace boost { namespace fusion
nil() {}
template <typename Iterator>
nil(Iterator const& iter, mpl::true_ /*this_is_an_iterator*/)
nil(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/)
{}
template <typename Iterator>
void assign_from_iter(Iterator const& iter)
void assign_from_iter(Iterator const& /*iter*/)
{
}
};
@ -69,13 +69,13 @@ namespace boost { namespace fusion
cons()
: car(), cdr() {}
explicit cons(typename detail::call_param<Car>::type car)
: car(car), cdr() {}
explicit cons(typename detail::call_param<Car>::type in_car)
: car(in_car), cdr() {}
cons(
typename detail::call_param<Car>::type car
, typename detail::call_param<Cdr>::type cdr)
: car(car), cdr(cdr) {}
typename detail::call_param<Car>::type in_car
, typename detail::call_param<Cdr>::type in_cdr)
: car(in_car), cdr(in_cdr) {}
template <typename Car2, typename Cdr2>
cons(cons<Car2, Cdr2> const& rhs)
@ -92,7 +92,7 @@ namespace boost { namespace fusion
is_convertible<Sequence, cons> // use copy ctor instead
, is_convertible<Sequence, Car> // use copy to car instead
>
>::type* dummy = 0
>::type* /*dummy*/ = 0
)
: car(*fusion::begin(seq))
, cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {}

View File

@ -35,8 +35,8 @@ namespace boost { namespace fusion
typename add_const<Cons>::type>
identity;
explicit cons_iterator(cons_type& cons)
: cons(cons) {}
explicit cons_iterator(cons_type& in_cons)
: cons(in_cons) {}
cons_type& cons;

View File

@ -111,7 +111,7 @@ namespace boost { namespace fusion
typename add_reference<
typename mpl::at<types, I>::type
>::type
at_impl(I index)
at_impl(I /*index*/)
{
return vec.at_impl(mpl::int_<I::value>());
}
@ -122,7 +122,7 @@ namespace boost { namespace fusion
typename mpl::at<types, I>::type
>::type
>::type
at_impl(I index) const
at_impl(I /*index*/) const
{
return vec.at_impl(mpl::int_<I::value>());
}

View File

@ -52,7 +52,7 @@ namespace boost { namespace fusion
vector0() {}
template<typename Sequence>
vector0(Sequence const& seq)
vector0(Sequence const& /*seq*/)
{}
};

View File

@ -7,11 +7,6 @@
#if !defined(FUSION_VECTOR_ITERATOR_05042005_0635)
#define FUSION_VECTOR_ITERATOR_05042005_0635
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
#include <boost/fusion/support/iterator_base.hpp>
#include <boost/fusion/container/vector/detail/deref_impl.hpp>
#include <boost/fusion/container/vector/detail/value_of_impl.hpp>
@ -41,15 +36,15 @@ namespace boost { namespace fusion
typedef vector_iterator_identity<
typename add_const<Vector>::type, N> identity;
vector_iterator(Vector& vec)
: vec(vec) {}
vector_iterator(Vector& in_vec)
: vec(in_vec) {}
Vector& vec;
private:
// silence MSVC warning C4512: assignment operator could not be generated
vector_iterator& operator= (vector_iterator const&);
};
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -10,10 +10,16 @@
#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_HPP_INCLUDED
#include <boost/type_traits/add_reference.hpp>
#include <boost/config.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#include <boost/fusion/functional/invocation/invoke.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <typename Function> class fused;
@ -81,5 +87,9 @@ namespace boost { namespace fusion
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -10,10 +10,16 @@
#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP_INCLUDED
#include <boost/type_traits/add_reference.hpp>
#include <boost/config.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#include <boost/fusion/functional/invocation/invoke_function_object.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <class Function> class fused_function_object;
@ -86,5 +92,9 @@ namespace boost { namespace fusion
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -10,10 +10,16 @@
#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_PROCEDURE_HPP_INCLUDED
#include <boost/type_traits/add_reference.hpp>
#include <boost/config.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#include <boost/fusion/functional/invocation/invoke_procedure.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <typename Function> class fused_procedure;
@ -66,5 +72,9 @@ namespace boost { namespace fusion
};
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -17,11 +17,18 @@
#include <boost/utility/result_of.hpp>
#include <boost/config.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/functional/adapter/limits.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <class Function, bool AllowNullary = true>
@ -87,6 +94,10 @@ namespace boost { namespace fusion
};
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
namespace boost
{
template<class F>

View File

@ -28,6 +28,11 @@
#include <boost/fusion/functional/adapter/limits.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -69,6 +74,10 @@ namespace boost { namespace fusion
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
namespace boost
{
template<class F, class Seq>

View File

@ -199,6 +199,8 @@ namespace boost { namespace fusion
Function(BOOST_PP_ENUM(N,M,~)) >::type result_type;
#undef M
#if N > 0
template <typename F>
static inline result_type
call(F & f, Sequence & s)
@ -206,6 +208,17 @@ namespace boost { namespace fusion
#define M(z,j,data) fusion::at_c<j>(s)
return f( BOOST_PP_ENUM(N,M,~) );
}
#else
template <typename F>
static inline result_type
call(F & f, Sequence & /*s*/)
{
return f();
}
#endif
};
@ -245,16 +258,28 @@ namespace boost { namespace fusion
Function(BOOST_PP_ENUM_PARAMS(N,typename seq::T))
>::type result_type;
#if N > 0
template <typename F>
static inline result_type
call(F & f, Sequence & s)
{
#if N > 0
typename seq::I0 i0 = fusion::begin(s);
BOOST_PP_REPEAT_FROM_TO(1,N,M,~)
#endif
return f( BOOST_PP_ENUM_PARAMS(N,*i) );
}
#else
template <typename F>
static inline result_type
call(F & f, Sequence & /*s*/)
{
return f();
}
#endif
};
#if N > 0

View File

@ -118,6 +118,8 @@ namespace boost { namespace fusion
Function (BOOST_PP_ENUM(N,M,~)) >::type result_type;
#undef M
#if N > 0
template <class F>
static inline result_type
call(F & f, Sequence & s)
@ -126,6 +128,18 @@ namespace boost { namespace fusion
return f( BOOST_PP_ENUM(N,M,~) );
#undef M
}
#else
template <class F>
static inline result_type
call(F & f, Sequence & /*s*/)
{
return f();
}
#endif
};
template <class Function, class Sequence>
@ -138,20 +152,32 @@ namespace boost { namespace fusion
Function (BOOST_PP_ENUM_PARAMS(N,typename seq::T))
>::type result_type;
#if N > 0
template <class F>
static inline result_type
call(F & f, Sequence & s)
{
#if N > 0
typename seq::I0 i0 = fusion::begin(s);
#define M(z,j,data) \
typename seq::I##j i##j = \
fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(j)));
BOOST_PP_REPEAT_FROM_TO(1,N,M,~)
#undef M
#endif
return f( BOOST_PP_ENUM_PARAMS(N,*i) );
}
#else
template <class F>
static inline result_type
call(F & f, Sequence & /*s*/)
{
return f();
}
#endif
};
template <class Sequence>

View File

@ -106,10 +106,23 @@ namespace boost { namespace fusion
template <typename Function, class Sequence>
struct invoke_procedure_impl<Function,Sequence,N,false,true>
{
#if N > 0
static inline void call(Function & f, Sequence & s)
{
f(BOOST_PP_ENUM(N,M,~));
}
#else
static inline void call(Function & f, Sequence & /*s*/)
{
f();
}
#endif
};
#if N > 0
@ -135,15 +148,25 @@ namespace boost { namespace fusion
template <typename Function, class Sequence>
struct invoke_procedure_impl<Function,Sequence,N,false,false>
{
#if N > 0
static inline void call(Function & f, Sequence & s)
{
#if N > 0
typedef typename result_of::begin<Sequence>::type I0;
I0 i0 = fusion::begin(s);
BOOST_PP_REPEAT_FROM_TO(1,N,M,~)
#endif
f( BOOST_PP_ENUM_PARAMS(N,*i) );
}
#else
static inline void call(Function & f, Sequence & /*s*/)
{
f();
}
#endif
};
#if N > 0

View File

@ -5,7 +5,7 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_INCLUDE_HAS_KEY)
#define FUSION_INCLUDE_EMPTY
#define FUSION_INCLUDE_HAS_KEY
#include <boost/fusion/sequence/intrinsic/has_key.hpp>

View File

@ -0,0 +1,13 @@
/*=============================================================================
Copyright (c) 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)
==============================================================================*/
#ifndef BOOST_FUSION_INCLUDE_ITER_FOLD_HPP
#define BOOST_FUSION_INCLUDE_ITER_FOLD_HPP
#include <boost/fusion/algorithm/iteration/iter_fold.hpp>
#endif

View File

@ -0,0 +1,13 @@
/*=============================================================================
Copyright (c) 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)
==============================================================================*/
#ifndef BOOST_FUSION_INCLUDE_REVERSE_FOLD_HPP
#define BOOST_FUSION_INCLUDE_REVERSE_FOLD_HPP
#include <boost/fusion/algorithm/iteration/reverse_fold.hpp>
#endif

View File

@ -0,0 +1,13 @@
/*=============================================================================
Copyright (c) 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)
==============================================================================*/
#ifndef BOOST_FUSION_INCLUDE_REVERSE_ITER_FOLD_HPP
#define BOOST_FUSION_INCLUDE_REVERSE_ITER_FOLD_HPP
#include <boost/fusion/algorithm/iteration/reverse_iter_fold.hpp>
#endif

View File

@ -122,8 +122,8 @@ namespace boost { namespace fusion
: seq(it.seq)
{}
basic_iterator(Seq& seq, int)
: seq(&seq)
basic_iterator(Seq& in_seq, int)
: seq(&in_seq)
{}
template<typename OtherSeq>

View File

@ -37,7 +37,7 @@ namespace boost { namespace fusion
}
static mpl_iterator<T>
call(T const& x, mpl::false_)
call(T const& /*x*/, mpl::false_)
{
return mpl_iterator<T>();
}

View File

@ -16,6 +16,27 @@
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/advance_fwd.hpp>
#include <boost/mpl/distance_fwd.hpp>
#include <boost/mpl/iterator_tags.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/type_traits/is_base_of.hpp>
namespace boost { namespace fusion { namespace detail
{
template<class Category>
struct to_mpl_category {
typedef typename mpl::eval_if<
is_base_of<random_access_traversal_tag, Category>,
mpl::random_access_iterator_tag,
mpl::eval_if<
is_base_of<bidirectional_traversal_tag, Category>,
mpl::bidirectional_iterator_tag,
mpl::forward_iterator_tag
>
>::type type;
};
}}}
namespace boost { namespace mpl
{
@ -23,7 +44,8 @@ namespace boost { namespace mpl
struct fusion_iterator
{
typedef typename fusion::result_of::value_of<Iterator>::type type;
typedef typename fusion::traits::category_of<Iterator>::type category;
typedef typename fusion::traits::category_of<Iterator>::type fusion_category;
typedef typename fusion::detail::to_mpl_category<fusion_category>::type category;
typedef Iterator iterator;
};

View File

@ -50,7 +50,7 @@ namespace boost { namespace fusion { namespace detail
{
template <typename I1, typename I2>
static bool
call(I1 const& a, I2 const& b)
call(I1 const& /*a*/, I2 const& /*b*/)
{
return false;
}

View File

@ -13,6 +13,12 @@
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/comparison/detail/equal_to.hpp>
#include <boost/fusion/sequence/comparison/detail/enable_comparison.hpp>
#include <boost/config.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4100) // unreferenced formal parameter
#endif
namespace boost { namespace fusion
{
@ -43,4 +49,8 @@ namespace boost { namespace fusion
using operators::operator==;
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -10,6 +10,12 @@
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/support/detail/as_fusion_element.hpp>
#include <boost/config.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -99,4 +105,8 @@ namespace boost { namespace fusion
}
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -46,39 +46,6 @@ namespace boost { namespace fusion
namespace detail
{
BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag)
template<typename Sequence>
struct is_specialized
: mpl::false_
{};
template <
class T0, class T1, class T2, class T3, class T4,
class T5, class T6, class T7, class T8, class T9
>
struct is_specialized<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
: mpl::true_
{};
template <class Head, class Tail>
struct is_specialized<tuples::cons<Head, Tail> >
: mpl::true_
{};
template <>
struct is_specialized<tuples::null_type>
: mpl::true_
{};
template <typename T, std::size_t N>
struct is_specialized<boost::array<T, N> >
: mpl::true_
{};
template<typename T1, typename T2>
struct is_specialized<std::pair<T1, T2> >
: mpl::true_
{};
}
namespace traits
@ -88,9 +55,7 @@ namespace boost { namespace fusion
: mpl::if_< fusion::detail::is_mpl_sequence<Sequence>,
mpl::identity<mpl_sequence_tag>,
mpl::identity<non_fusion_tag> >::type
{
BOOST_MPL_ASSERT_NOT((fusion::detail::is_specialized<Sequence>));
};
{};
template <typename Sequence>
struct tag_of<Sequence, typename boost::enable_if<detail::has_fusion_tag<Sequence> >::type>

View File

@ -10,8 +10,10 @@
#include <boost/fusion/view/filter_view.hpp>
#include <boost/fusion/view/iterator_range.hpp>
#include <boost/fusion/view/joint_view.hpp>
#include <boost/fusion/view/transform_view.hpp>
#include <boost/fusion/view/nview.hpp>
#include <boost/fusion/view/single_view.hpp>
#include <boost/fusion/view/reverse_view.hpp>
#include <boost/fusion/view/transform_view.hpp>
#include <boost/fusion/view/zip_view.hpp>
#endif

View File

@ -21,7 +21,6 @@
#include <boost/mpl/inherit.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace fusion
{
struct filter_view_tag;
@ -46,8 +45,8 @@ namespace boost { namespace fusion
typedef typename result_of::end<Sequence>::type last_type;
typedef Pred pred_type;
filter_view(Sequence& seq)
: seq(seq)
filter_view(Sequence& in_seq)
: seq(in_seq)
{}
first_type first() const { return fusion::begin(seq); }

View File

@ -54,10 +54,14 @@ namespace boost { namespace fusion
typedef last_iter last_type;
typedef Pred pred_type;
filter_iterator(First const& first)
: first(filter::call(first_converter::call(first))) {}
filter_iterator(First const& in_first)
: first(filter::call(first_converter::call(in_first))) {}
first_type first;
private:
// silence MSVC warning C4512: assignment operator could not be generated
filter_iterator& operator= (filter_iterator const&);
};
}}

View File

@ -17,6 +17,12 @@
#include <boost/fusion/view/iterator_range/detail/at_impl.hpp>
#include <boost/fusion/view/iterator_range/detail/value_at_impl.hpp>
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
#include <boost/config.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -35,15 +41,19 @@ namespace boost { namespace fusion
typedef typename traits::category_of<begin_type>::type category;
iterator_range(First const& first, Last const& last)
: first(convert_iterator<First>::call(first))
, last(convert_iterator<Last>::call(last)) {}
iterator_range(First const& in_first, Last const& in_last)
: first(convert_iterator<First>::call(in_first))
, last(convert_iterator<Last>::call(in_last)) {}
begin_type first;
end_type last;
};
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -52,9 +52,9 @@ namespace boost { namespace fusion
typedef typename result_of::end<Sequence2>::type concat_last_type;
typedef typename mpl::plus<result_of::size<Sequence1>, result_of::size<Sequence2> >::type size;
joint_view(Sequence1& seq1, Sequence2& seq2)
: seq1(seq1)
, seq2(seq2)
joint_view(Sequence1& in_seq1, Sequence2& in_seq2)
: seq1(in_seq1)
, seq2(in_seq2)
{}
first_type first() const { return fusion::begin(seq1); }
@ -62,6 +62,8 @@ namespace boost { namespace fusion
concat_last_type concat_last() const { return fusion::end(seq2); }
private:
// silence MSVC warning C4512: assignment operator could not be generated
joint_view& operator= (joint_view const&);
typename mpl::if_<traits::is_view<Sequence1>, Sequence1, Sequence1&>::type seq1;
typename mpl::if_<traits::is_view<Sequence2>, Sequence2, Sequence2&>::type seq2;

View File

@ -40,13 +40,17 @@ namespace boost { namespace fusion
typedef Category category;
BOOST_STATIC_ASSERT((!result_of::equal_to<first_type, last_type>::value));
joint_view_iterator(First const& first, Concat const& concat)
: first(first_converter::call(first))
, concat(concat_converter::call(concat))
joint_view_iterator(First const& in_first, Concat const& in_concat)
: first(first_converter::call(in_first))
, concat(concat_converter::call(in_concat))
{}
first_type first;
concat_type concat;
private:
// silence MSVC warning C4512: assignment operator could not be generated
joint_view_iterator& operator= (joint_view_iterator const&);
};
}}

View File

@ -31,7 +31,7 @@ namespace boost { namespace fusion
>::type type;
static type
call(First const& first, Last const& last)
call(First const& /*first*/, Last const& /*last*/)
{
return type();
}

View File

@ -41,8 +41,8 @@ namespace boost { namespace fusion
typedef Sequence sequence_type;
typedef mpl_iterator<Pos> first_type;
explicit nview_iterator(Sequence& seq)
: seq(seq) {}
explicit nview_iterator(Sequence& in_seq)
: seq(in_seq) {}
Sequence& seq;

View File

@ -37,10 +37,14 @@ namespace boost { namespace fusion
mpl::if_<traits::is_view<Sequence>, Sequence, sequence_type&>::type
stored_seq_type;
repetitive_view(Sequence& seq)
: seq(seq) {}
repetitive_view(Sequence& in_seq)
: seq(in_seq) {}
stored_seq_type seq;
private:
// silence MSVC warning C4512: assignment operator could not be generated
repetitive_view& operator= (repetitive_view const&);
};
}}

View File

@ -35,15 +35,19 @@ namespace boost { namespace fusion
typedef typename convert_iterator<typename result_of::end<Sequence>::type>::type end_type;
typedef single_pass_traversal_tag category;
explicit repetitive_view_iterator(Sequence& seq)
: seq(seq), pos(begin(seq)) {}
explicit repetitive_view_iterator(Sequence& in_seq)
: seq(in_seq), pos(begin(in_seq)) {}
repetitive_view_iterator(Sequence& seq, pos_type const& pos)
: seq(seq), pos(pos) {}
repetitive_view_iterator(Sequence& in_seq, pos_type const& in_pos)
: seq(in_seq), pos(in_pos) {}
Sequence& seq;
pos_type pos;
private:
// silence MSVC warning C4512: assignment operator could not be generated
repetitive_view_iterator& operator= (repetitive_view_iterator const&);
};
}}

View File

@ -49,13 +49,17 @@ namespace boost { namespace fusion
bidirectional_traversal_tag
, typename traits::category_of<first_type>::type>::value));
reverse_view(Sequence& seq)
: seq(seq)
reverse_view(Sequence& in_seq)
: seq(in_seq)
{}
first_type first() const { return fusion::begin(seq); }
last_type last() const { return fusion::end(seq); }
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
private:
// silence MSVC warning C4512: assignment operator could not be generated
reverse_view& operator= (reverse_view const&);
};
}}

View File

@ -41,10 +41,14 @@ namespace boost { namespace fusion
bidirectional_traversal_tag
, category>::value));
reverse_view_iterator(First const& first)
: first(converter::call(first)) {}
reverse_view_iterator(First const& in_first)
: first(converter::call(in_first)) {}
first_type first;
private:
// silence MSVC warning C4512: assignment operator could not be generated
reverse_view_iterator& operator= (reverse_view_iterator const&);
};
}}

View File

@ -15,6 +15,12 @@
#include <boost/fusion/view/single_view/detail/end_impl.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/int.hpp>
#include <boost/config.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -35,8 +41,8 @@ namespace boost { namespace fusion
single_view()
: val() {}
explicit single_view(typename detail::call_param<T>::type val)
: val(val) {}
explicit single_view(typename detail::call_param<T>::type in_val)
: val(in_val) {}
value_type val;
};
@ -49,6 +55,10 @@ namespace boost { namespace fusion
}
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -12,6 +12,12 @@
#include <boost/fusion/view/single_view/detail/deref_impl.hpp>
#include <boost/fusion/view/single_view/detail/next_impl.hpp>
#include <boost/fusion/view/single_view/detail/value_of_impl.hpp>
#include <boost/config.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -42,6 +48,10 @@ namespace boost { namespace fusion
};
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -55,10 +55,10 @@ namespace boost { namespace fusion
typedef Sequence2 sequence2_type;
typedef F transform_type;
transform_view(Sequence1& seq1, Sequence2& seq2, F const& binop)
transform_view(Sequence1& in_seq1, Sequence2& in_seq2, F const& binop)
: f(binop)
, seq1(seq1)
, seq2(seq2)
, seq1(in_seq1)
, seq2(in_seq2)
{}
first1_type first1() const { return fusion::begin(seq1); }
@ -69,6 +69,10 @@ namespace boost { namespace fusion
transform_type f;
typename mpl::if_<traits::is_view<Sequence1>, Sequence1, Sequence1&>::type seq1;
typename mpl::if_<traits::is_view<Sequence2>, Sequence2, Sequence2&>::type seq2;
private:
// silence MSVC warning C4512: assignment operator could not be generated
transform_view& operator= (transform_view const&);
};
// Unary Version
@ -90,9 +94,9 @@ namespace boost { namespace fusion
typedef Sequence sequence_type;
typedef F transform_type;
transform_view(Sequence& seq, F const& f)
: seq(seq)
, f(f)
transform_view(Sequence& in_seq, F const& in_f)
: seq(in_seq)
, f(in_f)
{}
first_type first() const { return fusion::begin(seq); }

View File

@ -34,8 +34,8 @@ namespace boost { namespace fusion
typedef typename traits::category_of<first_type>::type category;
typedef F transform_type;
transform_view_iterator(First const& first, F const& f)
: first(converter::call(first)), f(f) {}
transform_view_iterator(First const& in_first, F const& in_f)
: first(converter::call(in_first)), f(in_f) {}
first_type first;
transform_type f;
@ -60,8 +60,8 @@ namespace boost { namespace fusion
typedef typename traits::category_of<first1_type>::type category;
typedef F transform_type;
transform_view_iterator2(First1 const& first1, First2 const& first2, F const& f)
: first1(converter1::call(first1)), first2(converter2::call(first2)), f(f) {}
transform_view_iterator2(First1 const& in_first1, First2 const& in_first2, F const& in_f)
: first1(converter1::call(in_first1)), first2(converter2::call(in_first2)), f(in_f) {}
first1_type first1;
first2_type first2;

View File

@ -70,7 +70,7 @@ namespace boost { namespace fusion {
: detail::zip_view_iterator_distance<It1, It2>::type
{
static typename detail::zip_view_iterator_distance<It1, It2>::type
call(It1 const& it1, It2 const& it2)
call(It1 const& /*it1*/, It2 const& /*it2*/)
{
return typename detail::zip_view_iterator_distance<It1, It2>::type();
}