forked from boostorg/fusion
big merge from trunk
[SVN r85669]
This commit is contained in:
@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace traits
|
||||
{ };
|
||||
|
||||
// never called, but needed for decltype-based result_of (C++0x)
|
||||
#ifndef BOOST_NO_RVALUE_REFERENCES
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <typename T>
|
||||
typename result< deducer(T) >::type
|
||||
operator()(T&&) const;
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
@ -28,9 +30,26 @@ namespace boost { namespace fusion
|
||||
pair()
|
||||
: second() {}
|
||||
|
||||
pair(pair const& rhs)
|
||||
: second(rhs.second) {}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
pair(pair&& rhs)
|
||||
: second(std::forward<Second>(rhs.second)) {}
|
||||
#endif
|
||||
|
||||
pair(typename detail::call_param<Second>::type val)
|
||||
: second(val) {}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
template <typename Second2>
|
||||
pair(Second2&& val
|
||||
, typename boost::enable_if<is_convertible<Second2, Second> >::type* /*dummy*/ = 0
|
||||
) : second(std::forward<Second2>(val)) {}
|
||||
|
||||
#endif
|
||||
|
||||
template <typename Second2>
|
||||
pair(pair<First, Second2> const& rhs)
|
||||
: second(rhs.second) {}
|
||||
@ -42,6 +61,20 @@ namespace boost { namespace fusion
|
||||
return *this;
|
||||
}
|
||||
|
||||
pair& operator=(pair const& rhs)
|
||||
{
|
||||
second = rhs.second;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
pair& operator=(pair&& rhs)
|
||||
{
|
||||
second = std::forward<Second>(rhs.second);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef First first_type;
|
||||
typedef Second second_type;
|
||||
Second second;
|
||||
@ -105,6 +138,13 @@ namespace boost { namespace fusion
|
||||
{
|
||||
return l.second != r.second;
|
||||
}
|
||||
|
||||
template <typename First, typename SecondL, typename SecondR>
|
||||
inline bool
|
||||
operator<(pair<First, SecondL> const& l, pair<First, SecondR> const& r)
|
||||
{
|
||||
return l.second < r.second;
|
||||
}
|
||||
}}
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
|
@ -20,7 +20,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
//auto segmented_fold_until(seq, state, fun)
|
||||
//{
|
||||
// return first(segmented_fold_until_impl(seq, state, nil, fun));
|
||||
// return first(segmented_fold_until_impl(seq, state, nil_, fun));
|
||||
//}
|
||||
|
||||
namespace result_of
|
||||
@ -32,7 +32,7 @@ namespace boost { namespace fusion
|
||||
detail::segmented_fold_until_impl<
|
||||
Sequence
|
||||
, State
|
||||
, fusion::nil
|
||||
, fusion::nil_
|
||||
, Fun
|
||||
>
|
||||
filter;
|
||||
@ -55,7 +55,7 @@ namespace boost { namespace fusion
|
||||
typename result_of::segmented_fold_until<Sequence, State, Fun>::filter
|
||||
filter;
|
||||
|
||||
return filter::call(seq, state, fusion::nil(), fun);
|
||||
return filter::call(seq, state, fusion::nil_(), fun);
|
||||
}
|
||||
|
||||
template <typename Sequence, typename State, typename Fun>
|
||||
@ -66,7 +66,7 @@ namespace boost { namespace fusion
|
||||
typename result_of::segmented_fold_until<Sequence const, State, Fun>::filter
|
||||
filter;
|
||||
|
||||
return filter::call(seq, state, fusion::nil(), fun);
|
||||
return filter::call(seq, state, fusion::nil_(), fun);
|
||||
}
|
||||
}}
|
||||
|
||||
|
Reference in New Issue
Block a user