mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-29 20:17:32 +02:00
@ -536,13 +536,13 @@ Finds the first element of a given type within a sequence.
|
||||
typename T,
|
||||
typename Sequence
|
||||
>
|
||||
__unspecified__ find(Sequence const& seq);
|
||||
typename __result_of_find__<Sequence const, T>::type find(Sequence const& seq);
|
||||
|
||||
template<
|
||||
typename T,
|
||||
typename Sequence
|
||||
>
|
||||
__unspecified__ find(Sequence& seq);
|
||||
typename __result_of_find__<Sequence, T>::type find(Sequence& seq);
|
||||
|
||||
[table Parameters
|
||||
[[Parameter][Requirement][Description]]
|
||||
@ -574,23 +574,23 @@ Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||
[endsect]
|
||||
|
||||
[section find_if]
|
||||
Finds the first element within a sequence with a type for which a given __mpl_lambda_expression__ evaluates to
|
||||
`boost::mpl::true_`.
|
||||
|
||||
[heading Description]
|
||||
Finds the first element within a sequence with a type for which a given __mpl_lambda_expression__ evaluates to
|
||||
`boost::mpl::true_`.
|
||||
|
||||
[heading Synopsis]
|
||||
template<
|
||||
typename F,
|
||||
typename Sequence
|
||||
>
|
||||
__unspecified__ find_if(Sequence const& seq);
|
||||
typename __result_of_find_if__<Sequence const, F>::type find_if(Sequence const& seq);
|
||||
|
||||
template<
|
||||
typename F,
|
||||
typename Sequence
|
||||
>
|
||||
__unspecified__ find_if(Sequence& seq);
|
||||
typename __result_of_find_if__<Sequence, F>::type find_if(Sequence& seq);
|
||||
|
||||
[table Parameters
|
||||
[[Parameter][Requirement][Description]]
|
||||
|
@ -42,12 +42,18 @@ namespace boost { namespace fusion
|
||||
struct boost_tuple_is_empty<tuples::tuple<> const> : mpl::true_ {};
|
||||
}
|
||||
|
||||
template <typename Cons>
|
||||
struct boost_tuple_iterator_identity;
|
||||
|
||||
template <typename Cons = tuples::null_type>
|
||||
struct boost_tuple_iterator
|
||||
: iterator_facade<boost_tuple_iterator<Cons>, forward_traversal_tag>
|
||||
{
|
||||
typedef Cons cons_type;
|
||||
|
||||
typedef boost_tuple_iterator_identity<
|
||||
typename add_const<Cons>::type> identity;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
explicit boost_tuple_iterator(Cons& in_cons)
|
||||
: cons(in_cons) {}
|
||||
@ -98,7 +104,7 @@ namespace boost { namespace fusion
|
||||
return type(iter.cons.get_tail());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct distance;
|
||||
|
||||
@ -115,7 +121,7 @@ namespace boost { namespace fusion
|
||||
>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct distance
|
||||
{
|
||||
@ -124,7 +130,7 @@ namespace boost { namespace fusion
|
||||
mpl::int_<0>,
|
||||
lazy_next_distance<I1, I2>
|
||||
>::type type;
|
||||
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(I1 const&, I2 const&)
|
||||
@ -133,6 +139,11 @@ namespace boost { namespace fusion
|
||||
}
|
||||
};
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct equal_to
|
||||
: is_same<typename I1::identity, typename I2::identity>
|
||||
{};
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
boost_tuple_iterator& operator= (boost_tuple_iterator const&);
|
||||
@ -144,6 +155,9 @@ namespace boost { namespace fusion
|
||||
{
|
||||
typedef Null cons_type;
|
||||
|
||||
typedef boost_tuple_iterator_identity<
|
||||
typename add_const<Null>::type> identity;
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct equal_to
|
||||
: mpl::or_<
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
@ -62,15 +62,10 @@ namespace boost { namespace fusion
|
||||
|
||||
template <typename Seq1, typename Seq2>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
inline
|
||||
typename
|
||||
enable_if_c<
|
||||
type_traits::ice_and<
|
||||
traits::is_sequence<Seq1>::value
|
||||
, traits::is_sequence<Seq2>::value
|
||||
>::value,
|
||||
void
|
||||
>::type
|
||||
inline typename enable_if<mpl::and_<
|
||||
traits::is_sequence<Seq1>,
|
||||
traits::is_sequence<Seq2>
|
||||
> >::type
|
||||
copy(Seq1 const& src, Seq2& dest)
|
||||
{
|
||||
BOOST_STATIC_ASSERT(
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
#include <boost/mpl/and_.hpp>
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
@ -62,15 +62,10 @@ namespace boost { namespace fusion
|
||||
|
||||
template <typename Seq1, typename Seq2>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
inline
|
||||
typename
|
||||
enable_if_c<
|
||||
type_traits::ice_and<
|
||||
traits::is_sequence<Seq1>::value
|
||||
, traits::is_sequence<Seq2>::value
|
||||
>::value,
|
||||
void
|
||||
>::type
|
||||
inline typename enable_if<mpl::and_<
|
||||
traits::is_sequence<Seq1>,
|
||||
traits::is_sequence<Seq2>
|
||||
> >::type
|
||||
move(Seq1&& src, Seq2& dest)
|
||||
{
|
||||
BOOST_STATIC_ASSERT(
|
||||
|
@ -1,14 +0,0 @@
|
||||
/*=============================================================================
|
||||
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_ADAPT_ASSOC_CLASS_NAMED_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class_named.hpp>
|
||||
|
||||
#endif
|
@ -132,7 +132,7 @@ namespace boost { namespace fusion
|
||||
{}
|
||||
|
||||
template<typename OtherSeq>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
basic_iterator&
|
||||
operator=(basic_iterator<Tag,Category,OtherSeq,Index> const& it)
|
||||
{
|
||||
|
@ -8,14 +8,21 @@
|
||||
#define FUSION_ITERATOR_ADAPTER_08112011_0942
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/detail/advance.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/iterator/distance.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/iterator/iterator_facade.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
template <typename Derived_, typename Iterator_,
|
||||
typename Category = typename Iterator_::category>
|
||||
typename Category = typename traits::category_of<Iterator_>::type>
|
||||
struct iterator_adapter
|
||||
: iterator_facade<Derived_, Category>
|
||||
{
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
|
@ -8,8 +8,8 @@
|
||||
#define FUSION_BEGIN_04052005_1132
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic_fwd.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
@ -36,7 +36,7 @@ namespace boost { namespace fusion
|
||||
: mpl::if_<
|
||||
traits::is_segmented<Sequence>
|
||||
, detail::segmented_begin<Sequence>
|
||||
, blank
|
||||
, mpl::empty_base
|
||||
>::type
|
||||
{};
|
||||
};
|
||||
|
@ -48,11 +48,18 @@ namespace boost { namespace fusion { namespace detail
|
||||
typedef iterator_range<end_type, end_type> pair_type;
|
||||
typedef cons<pair_type, Stack> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static pair_type make_pair(end_type end)
|
||||
{
|
||||
return pair_type(end, end);
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Sequence & seq, Stack stack)
|
||||
{
|
||||
end_type end = fusion::end(fusion::segments(seq));
|
||||
return type(pair_type(end, end), stack);
|
||||
return type(
|
||||
make_pair(fusion::end(fusion::segments(seq))),
|
||||
stack);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
#define FUSION_END_04052005_1141
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic_fwd.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
@ -36,7 +36,7 @@ namespace boost { namespace fusion
|
||||
: mpl::if_<
|
||||
traits::is_segmented<Sequence>
|
||||
, detail::segmented_end<Sequence>
|
||||
, blank
|
||||
, mpl::empty_base
|
||||
>::type
|
||||
{};
|
||||
};
|
||||
|
@ -60,6 +60,7 @@ project
|
||||
[ run sequence/as_set.cpp : : : : ]
|
||||
[ run sequence/as_vector.cpp : : : : ]
|
||||
[ run sequence/boost_tuple.cpp : : : : ]
|
||||
[ run sequence/boost_tuple_iterator.cpp : : : : ]
|
||||
[ run sequence/cons.cpp : : : : ]
|
||||
[ run sequence/filter_view.cpp : : : : ]
|
||||
[ run sequence/hash.cpp : : : : ]
|
||||
|
@ -10,18 +10,18 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
|
||||
namespace fusion = boost::fusion;
|
||||
using boost::noncopyable;
|
||||
|
||||
template <class Base = boost::blank>
|
||||
template <class Base = boost::mpl::empty_base>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
@ -18,7 +18,7 @@
|
||||
namespace fusion = boost::fusion;
|
||||
using boost::noncopyable;
|
||||
|
||||
template <class Base = boost::blank>
|
||||
template <class Base = boost::mpl::empty_base>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
@ -26,7 +26,7 @@ int effect;
|
||||
BOOST_TEST(effect == e); \
|
||||
}
|
||||
|
||||
template <class Base = boost::blank>
|
||||
template <class Base = boost::mpl::empty_base>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
@ -20,7 +20,7 @@ using boost::noncopyable;
|
||||
using boost::cref;
|
||||
using boost::ref;
|
||||
|
||||
template <class Base = boost::blank>
|
||||
template <class Base = boost::mpl::empty_base>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
@ -20,7 +20,7 @@ using boost::noncopyable;
|
||||
using boost::cref;
|
||||
using boost::ref;
|
||||
|
||||
template <class Base = boost::blank>
|
||||
template <class Base = boost::mpl::empty_base>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
@ -28,7 +28,7 @@ int effect;
|
||||
BOOST_TEST(effect == e); \
|
||||
}
|
||||
|
||||
template <class Base = boost::blank>
|
||||
template <class Base = boost::mpl::empty_base>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
|
@ -10,14 +10,15 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
#include <boost/utility/result_of.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/algorithm/iteration/fold.hpp>
|
||||
@ -33,17 +34,18 @@ typedef mpl::true_ no_nullary_call;
|
||||
using boost::ref;
|
||||
using boost::cref;
|
||||
|
||||
template <class Base = boost::blank, class RemoveNullary = mpl::false_>
|
||||
template <class Base = mpl::empty_base, class RemoveNullary = mpl::false_>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
template <typename Sig>
|
||||
struct result;
|
||||
|
||||
template <class Self, class Seq>
|
||||
template <class Self, class Seq>
|
||||
struct result< Self(Seq &) >
|
||||
: mpl::if_< mpl::and_< boost::fusion::result_of::empty<Seq>, RemoveNullary >,
|
||||
boost::blank, mpl::identity<long> >::type
|
||||
: boost::enable_if<
|
||||
mpl::not_<mpl::and_<boost::fusion::result_of::empty<Seq>, RemoveNullary> >,
|
||||
long>
|
||||
{ };
|
||||
|
||||
template <typename Seq>
|
||||
|
@ -10,8 +10,8 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/blank.hpp>
|
||||
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
#include <boost/utility/result_of.hpp>
|
||||
@ -24,7 +24,7 @@ namespace mpl = boost::mpl;
|
||||
|
||||
using boost::noncopyable;
|
||||
|
||||
template <class Base = boost::blank>
|
||||
template <class Base = boost::mpl::empty_base>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
|
@ -9,11 +9,9 @@
|
||||
#include <boost/fusion/functional/adapter/unfused_typed.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/blank.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
@ -31,7 +29,7 @@ typedef fusion::vector<> types0;
|
||||
typedef fusion::vector<long &> types1;
|
||||
typedef fusion::vector<long &,int,char> types3;
|
||||
|
||||
template <class Base = boost::blank>
|
||||
template <class Base = boost::mpl::empty_base>
|
||||
struct test_func
|
||||
: Base
|
||||
{
|
||||
|
@ -1,14 +1,21 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2010 Christopher Schmidt
|
||||
Copyright (c) 2014 Kohei Takahashi
|
||||
|
||||
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_ADAPT_ASSOC_CLASS_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_HPP
|
||||
#include <boost/fusion/adapted/boost_tuple.hpp>
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
|
||||
#define FUSION_SEQUENCE boost::tuple
|
||||
#define FUSION_TRAVERSAL_TAG forward_traversal_tag
|
||||
#define FUSION_NO_PRIOR
|
||||
#include "./iterator.hpp"
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user