整理
This commit is contained in:
29
include/boost/bind/apply.hpp
Normal file
29
include/boost/bind/apply.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef BOOST_BIND_APPLY_HPP_INCLUDED
|
||||
#define BOOST_BIND_APPLY_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// apply.hpp
|
||||
//
|
||||
// Copyright 2002, 2003, 2024 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class R> struct apply
|
||||
{
|
||||
typedef R result_type;
|
||||
|
||||
template<class F, class... A> result_type operator()( F&& f, A&&... a ) const
|
||||
{
|
||||
return static_cast<F&&>( f )( static_cast<A&&>( a )... );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_APPLY_HPP_INCLUDED
|
||||
69
include/boost/bind/arg.hpp
Normal file
69
include/boost/bind/arg.hpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef BOOST_BIND_ARG_HPP_INCLUDED
|
||||
#define BOOST_BIND_ARG_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// bind/arg.hpp
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/is_placeholder.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<bool Eq> struct _arg_eq
|
||||
{
|
||||
};
|
||||
|
||||
template<> struct _arg_eq<true>
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template< int I > struct arg
|
||||
{
|
||||
BOOST_CONSTEXPR arg()
|
||||
{
|
||||
}
|
||||
|
||||
template< class T > BOOST_CONSTEXPR arg( T const & /* t */, typename _arg_eq< I == is_placeholder<T>::value >::type * = 0 )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template< int I > BOOST_CONSTEXPR bool operator==( arg<I> const &, arg<I> const & )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template< int I > struct is_placeholder< arg<I> >
|
||||
{
|
||||
enum _vt { value = I };
|
||||
};
|
||||
|
||||
template< int I > struct is_placeholder< arg<I> (*) () >
|
||||
{
|
||||
enum _vt { value = I };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_ARG_HPP_INCLUDED
|
||||
813
include/boost/bind/bind.hpp
Normal file
813
include/boost/bind/bind.hpp
Normal file
@@ -0,0 +1,813 @@
|
||||
#ifndef BOOST_BIND_BIND_HPP_INCLUDED
|
||||
#define BOOST_BIND_BIND_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// bind.hpp - binds function objects to arguments
|
||||
//
|
||||
// Copyright 2001-2005, 2024 Peter Dimov
|
||||
// Copyright 2001 David Abrahams
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/bind for documentation.
|
||||
//
|
||||
|
||||
#include <boost/bind/mem_fn.hpp>
|
||||
#include <boost/bind/arg.hpp>
|
||||
#include <boost/bind/std_placeholders.hpp>
|
||||
#include <boost/bind/detail/result_traits.hpp>
|
||||
#include <boost/bind/detail/tuple_for_each.hpp>
|
||||
#include <boost/bind/detail/integer_sequence.hpp>
|
||||
#include <boost/visit_each.hpp>
|
||||
#include <boost/is_placeholder.hpp>
|
||||
#include <boost/type.hpp>
|
||||
#include <boost/core/ref.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4512) // assignment operator could not be generated
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class T> class weak_ptr;
|
||||
|
||||
namespace _bi // implementation details
|
||||
{
|
||||
|
||||
// ref_compare
|
||||
|
||||
template<class T> bool ref_compare( T const & a, T const & b )
|
||||
{
|
||||
return a == b;
|
||||
}
|
||||
|
||||
template<int I> bool ref_compare( arg<I> const &, arg<I> const & )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template<int I> bool ref_compare( arg<I> (*) (), arg<I> (*) () )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T> bool ref_compare( reference_wrapper<T> const & a, reference_wrapper<T> const & b )
|
||||
{
|
||||
return a.get_pointer() == b.get_pointer();
|
||||
}
|
||||
|
||||
// bind_t forward declaration for listN
|
||||
|
||||
template<class R, class F, class L> class bind_t;
|
||||
|
||||
template<class R, class F, class L> bool ref_compare( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
|
||||
{
|
||||
return a.compare( b );
|
||||
}
|
||||
|
||||
// value
|
||||
|
||||
template<class T> class value
|
||||
{
|
||||
public:
|
||||
|
||||
value(T const & t): t_(t) {}
|
||||
|
||||
T & get() { return t_; }
|
||||
T const & get() const { return t_; }
|
||||
|
||||
bool operator==(value const & rhs) const
|
||||
{
|
||||
return t_ == rhs.t_;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
T t_;
|
||||
};
|
||||
|
||||
// ref_compare for weak_ptr
|
||||
|
||||
template<class T> bool ref_compare( value< weak_ptr<T> > const & a, value< weak_ptr<T> > const & b )
|
||||
{
|
||||
return !(a.get() < b.get()) && !(b.get() < a.get());
|
||||
}
|
||||
|
||||
// type
|
||||
|
||||
template<class T> class type {};
|
||||
|
||||
// unwrap
|
||||
|
||||
template<class F> struct unwrapper
|
||||
{
|
||||
static inline F & unwrap( F & f, long )
|
||||
{
|
||||
return f;
|
||||
}
|
||||
|
||||
template<class F2> static inline F2 & unwrap( reference_wrapper<F2> rf, int )
|
||||
{
|
||||
return rf.get();
|
||||
}
|
||||
|
||||
template<class R, class T> static inline _mfi::dm<R, T> unwrap( R T::* pm, int )
|
||||
{
|
||||
return _mfi::dm<R, T>( pm );
|
||||
}
|
||||
};
|
||||
|
||||
// list
|
||||
|
||||
template<class V> struct accept_lambda
|
||||
{
|
||||
V& v_;
|
||||
|
||||
explicit accept_lambda( V& v ): v_( v ) {}
|
||||
|
||||
template<class A> void operator()( A& a ) const
|
||||
{
|
||||
visit_each( v_, a, 0 );
|
||||
}
|
||||
};
|
||||
|
||||
struct equal_lambda
|
||||
{
|
||||
bool result;
|
||||
|
||||
equal_lambda(): result( true ) {}
|
||||
|
||||
template<class A1, class A2> void operator()( A1& a1, A2& a2 )
|
||||
{
|
||||
result = result && ref_compare( a1, a2 );
|
||||
}
|
||||
};
|
||||
|
||||
struct logical_and;
|
||||
struct logical_or;
|
||||
|
||||
template<class... A> class list
|
||||
{
|
||||
private:
|
||||
|
||||
typedef std::tuple<A...> data_type;
|
||||
data_type data_;
|
||||
|
||||
public:
|
||||
|
||||
list( A... a ): data_( a... ) {}
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable: 4100 ) // unreferenced formal parameter 'a2'
|
||||
#endif
|
||||
|
||||
template<class R, class F, class A2, std::size_t... I> R call_impl( type<R>, F & f, A2 & a2, _bi::index_sequence<I...> )
|
||||
{
|
||||
return unwrapper<F>::unwrap( f, 0 )( a2[ std::get<I>( data_ ) ]... );
|
||||
}
|
||||
|
||||
template<class R, class F, class A2, std::size_t... I> R call_impl( type<R>, F & f, A2 & a2, _bi::index_sequence<I...> ) const
|
||||
{
|
||||
return unwrapper<F>::unwrap( f, 0 )( a2[ std::get<I>( data_ ) ]... );
|
||||
}
|
||||
|
||||
template<class F, class A2, std::size_t... I> void call_impl( type<void>, F & f, A2 & a2, _bi::index_sequence<I...> )
|
||||
{
|
||||
unwrapper<F>::unwrap( f, 0 )( a2[ std::get<I>( data_ ) ]... );
|
||||
}
|
||||
|
||||
template<class F, class A2, std::size_t... I> void call_impl( type<void>, F & f, A2 & a2, _bi::index_sequence<I...> ) const
|
||||
{
|
||||
unwrapper<F>::unwrap( f, 0 )( a2[ std::get<I>( data_ ) ]... );
|
||||
}
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
template<class R, class F, class A2> R operator()( type<R>, F & f, A2 & a2 )
|
||||
{
|
||||
return call_impl( type<R>(), f, a2, _bi::index_sequence_for<A...>() );
|
||||
}
|
||||
|
||||
template<class R, class F, class A2> R operator()( type<R>, F & f, A2 & a2 ) const
|
||||
{
|
||||
return call_impl( type<R>(), f, a2, _bi::index_sequence_for<A...>() );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
template<class A2> bool operator()( type<bool>, logical_and & /*f*/, A2 & a2 )
|
||||
{
|
||||
static_assert( sizeof...(A) == 2, "operator&& must have two arguments" );
|
||||
return a2[ std::get<0>( data_ ) ] && a2[ std::get<1>( data_ ) ];
|
||||
}
|
||||
|
||||
template<class A2> bool operator()( type<bool>, logical_and const & /*f*/, A2 & a2 ) const
|
||||
{
|
||||
static_assert( sizeof...(A) == 2, "operator&& must have two arguments" );
|
||||
return a2[ std::get<0>( data_ ) ] && a2[ std::get<1>( data_ ) ];
|
||||
}
|
||||
|
||||
template<class A2> bool operator()( type<bool>, logical_or & /*f*/, A2 & a2 )
|
||||
{
|
||||
static_assert( sizeof...(A) == 2, "operator|| must have two arguments" );
|
||||
return a2[ std::get<0>( data_ ) ] || a2[ std::get<1>( data_ ) ];
|
||||
}
|
||||
|
||||
template<class A2> bool operator()( type<bool>, logical_or const & /*f*/, A2 & a2 ) const
|
||||
{
|
||||
static_assert( sizeof...(A) == 2, "operator|| must have two arguments" );
|
||||
return a2[ std::get<0>( data_ ) ] || a2[ std::get<1>( data_ ) ];
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
template<class V> void accept( V & v ) const
|
||||
{
|
||||
_bi::tuple_for_each( accept_lambda<V>( v ), data_ );
|
||||
}
|
||||
|
||||
bool operator==( list const & rhs ) const
|
||||
{
|
||||
return _bi::tuple_for_each( equal_lambda(), data_, rhs.data_ ).result;
|
||||
}
|
||||
};
|
||||
|
||||
// bind_t
|
||||
|
||||
template<class... A> class rrlist
|
||||
{
|
||||
private:
|
||||
|
||||
using args_type = std::tuple<A...>;
|
||||
|
||||
using data_type = std::tuple<A&...>;
|
||||
data_type data_;
|
||||
|
||||
template<class...> friend class rrlist;
|
||||
|
||||
public:
|
||||
|
||||
explicit rrlist( A&... a ): data_( a... ) {}
|
||||
template<class... B> explicit rrlist( rrlist<B...> const& r ): data_( r.data_ ) {}
|
||||
|
||||
template<int I> typename std::tuple_element<I-1, args_type>::type&& operator[] ( boost::arg<I> ) const
|
||||
{
|
||||
return std::forward<typename std::tuple_element<I-1, args_type>::type>( std::get<I-1>( data_ ) );
|
||||
}
|
||||
|
||||
template<int I> typename std::tuple_element<I-1, args_type>::type&& operator[] ( boost::arg<I>(*)() ) const
|
||||
{
|
||||
return std::forward<typename std::tuple_element<I-1, args_type>::type>( std::get<I-1>( data_ ) );
|
||||
}
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] ( reference_wrapper<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] ( bind_t<R, F, L> & b ) const
|
||||
{
|
||||
rrlist<A&...> a2( *this );
|
||||
return b.eval( a2 );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] ( bind_t<R, F, L> const & b ) const
|
||||
{
|
||||
rrlist<A&...> a2( *this );
|
||||
return b.eval( a2 );
|
||||
}
|
||||
};
|
||||
|
||||
template<class R, class F, class L> class bind_t
|
||||
{
|
||||
private:
|
||||
|
||||
F f_;
|
||||
L l_;
|
||||
|
||||
public:
|
||||
|
||||
typedef typename result_traits<R, F>::type result_type;
|
||||
typedef bind_t this_type;
|
||||
|
||||
bind_t( F f, L const & l ): f_( std::move(f) ), l_( l ) {}
|
||||
|
||||
//
|
||||
|
||||
template<class... A> result_type operator()( A&&... a )
|
||||
{
|
||||
rrlist<A...> a2( a... );
|
||||
return l_( type<result_type>(), f_, a2 );
|
||||
}
|
||||
|
||||
template<class... A> result_type operator()( A&&... a ) const
|
||||
{
|
||||
rrlist<A...> a2( a... );
|
||||
return l_( type<result_type>(), f_, a2 );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
template<class A> result_type eval( A & a )
|
||||
{
|
||||
return l_( type<result_type>(), f_, a );
|
||||
}
|
||||
|
||||
template<class A> result_type eval( A & a ) const
|
||||
{
|
||||
return l_( type<result_type>(), f_, a );
|
||||
}
|
||||
|
||||
template<class V> void accept( V & v ) const
|
||||
{
|
||||
using boost::visit_each;
|
||||
visit_each( v, f_, 0 );
|
||||
l_.accept( v );
|
||||
}
|
||||
|
||||
bool compare( this_type const & rhs ) const
|
||||
{
|
||||
return ref_compare( f_, rhs.f_ ) && l_ == rhs.l_;
|
||||
}
|
||||
};
|
||||
|
||||
// function_equal
|
||||
|
||||
template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
|
||||
{
|
||||
return a.compare(b);
|
||||
}
|
||||
|
||||
// add_value
|
||||
|
||||
template< class T, int I > struct add_value_2
|
||||
{
|
||||
typedef boost::arg<I> type;
|
||||
};
|
||||
|
||||
template< class T > struct add_value_2< T, 0 >
|
||||
{
|
||||
typedef _bi::value< T > type;
|
||||
};
|
||||
|
||||
template<class T> struct add_value
|
||||
{
|
||||
typedef typename add_value_2< T, boost::is_placeholder< T >::value >::type type;
|
||||
};
|
||||
|
||||
template<class T> struct add_value< value<T> >
|
||||
{
|
||||
typedef _bi::value<T> type;
|
||||
};
|
||||
|
||||
template<class T> struct add_value< reference_wrapper<T> >
|
||||
{
|
||||
typedef reference_wrapper<T> type;
|
||||
};
|
||||
|
||||
template<int I> struct add_value< arg<I> >
|
||||
{
|
||||
typedef boost::arg<I> type;
|
||||
};
|
||||
|
||||
template<int I> struct add_value< arg<I> (*) () >
|
||||
{
|
||||
typedef boost::arg<I> (*type) ();
|
||||
};
|
||||
|
||||
template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
|
||||
{
|
||||
typedef bind_t<R, F, L> type;
|
||||
};
|
||||
|
||||
// list_av
|
||||
|
||||
template<class... A> struct list_av
|
||||
{
|
||||
typedef list< typename add_value<A>::type... > type;
|
||||
};
|
||||
|
||||
// operator!
|
||||
|
||||
struct logical_not
|
||||
{
|
||||
template<class V> bool operator()(V const & v) const { return !v; }
|
||||
};
|
||||
|
||||
template<class R, class F, class L>
|
||||
bind_t< bool, logical_not, list< bind_t<R, F, L> > >
|
||||
operator! (bind_t<R, F, L> const & f)
|
||||
{
|
||||
typedef list< bind_t<R, F, L> > list_type;
|
||||
return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
|
||||
}
|
||||
|
||||
// relational operators
|
||||
|
||||
#define BOOST_BIND_OPERATOR( op, name ) \
|
||||
\
|
||||
struct name \
|
||||
{ \
|
||||
template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
|
||||
}; \
|
||||
\
|
||||
template<class R, class F, class L, class A2> \
|
||||
bind_t< bool, name, list< bind_t<R, F, L>, typename add_value<A2>::type > > \
|
||||
operator op (bind_t<R, F, L> const & f, A2 a2) \
|
||||
{ \
|
||||
typedef typename add_value<A2>::type B2; \
|
||||
typedef list< bind_t<R, F, L>, B2> list_type; \
|
||||
return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
|
||||
}
|
||||
|
||||
BOOST_BIND_OPERATOR( ==, equal )
|
||||
BOOST_BIND_OPERATOR( !=, not_equal )
|
||||
|
||||
BOOST_BIND_OPERATOR( <, less )
|
||||
BOOST_BIND_OPERATOR( <=, less_equal )
|
||||
|
||||
BOOST_BIND_OPERATOR( >, greater )
|
||||
BOOST_BIND_OPERATOR( >=, greater_equal )
|
||||
|
||||
BOOST_BIND_OPERATOR( &&, logical_and )
|
||||
BOOST_BIND_OPERATOR( ||, logical_or )
|
||||
|
||||
#undef BOOST_BIND_OPERATOR
|
||||
|
||||
// visit_each
|
||||
|
||||
template<class V, class T> void visit_each( V & v, value<T> const & t, int )
|
||||
{
|
||||
using boost::visit_each;
|
||||
visit_each( v, t.get(), 0 );
|
||||
}
|
||||
|
||||
template<class V, class R, class F, class L> void visit_each( V & v, bind_t<R, F, L> const & t, int )
|
||||
{
|
||||
t.accept( v );
|
||||
}
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
// is_bind_expression
|
||||
|
||||
template< class T > struct is_bind_expression
|
||||
{
|
||||
enum _vt { value = 0 };
|
||||
};
|
||||
|
||||
template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, F, L > >
|
||||
{
|
||||
enum _vt { value = 1 };
|
||||
};
|
||||
|
||||
// bind
|
||||
|
||||
#ifndef BOOST_BIND
|
||||
#define BOOST_BIND bind
|
||||
#endif
|
||||
|
||||
// generic function objects
|
||||
|
||||
#if !BOOST_WORKAROUND(__GNUC__, < 6)
|
||||
|
||||
template<class R, class F, class... A>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A...>::type>
|
||||
BOOST_BIND( F f, A... a )
|
||||
{
|
||||
typedef typename _bi::list_av<A...>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a... ) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// g++ 4.x (and some 5.x) consider boost::bind<void>( &X::f )
|
||||
// ambiguous if the variadic form above is used
|
||||
|
||||
template<class R, class F>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<>::type>
|
||||
BOOST_BIND( F f )
|
||||
{
|
||||
typedef typename _bi::list_av<>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type() );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1>::type>
|
||||
BOOST_BIND( F f, A1 a1 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1 ) );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1, class A2>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1, A2>::type>
|
||||
BOOST_BIND( F f, A1 a1, A2 a2 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1, A2>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1, a2 ) );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1, class A2, class A3>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1, A2, A3>::type>
|
||||
BOOST_BIND( F f, A1 a1, A2 a2, A3 a3 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1, A2, A3>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1, a2, a3 ) );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1, class A2, class A3, class A4>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1, A2, A3, A4>::type>
|
||||
BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1, a2, a3, a4 ) );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1, class A2, class A3, class A4, class A5>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1, A2, A3, A4, A5>::type>
|
||||
BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1, a2, a3, a4, a5 ) );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1, A2, A3, A4, A5, A6>::type>
|
||||
BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1, a2, a3, a4, a5, a6 ) );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7>::type>
|
||||
BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1, a2, a3, a4, a5, a6, a7 ) );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7, A8>::type>
|
||||
BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1, a2, a3, a4, a5, a6, a7, a8 ) );
|
||||
}
|
||||
|
||||
template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
|
||||
BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 )
|
||||
{
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// generic function objects, alternative syntax
|
||||
|
||||
template<class R, class F, class... A>
|
||||
_bi::bind_t<R, F, typename _bi::list_av<A...>::type>
|
||||
BOOST_BIND( boost::type<R>, F f, A... a )
|
||||
{
|
||||
typedef typename _bi::list_av<A...>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>( std::move(f), list_type( a... ) );
|
||||
}
|
||||
|
||||
// adaptable function objects
|
||||
|
||||
template<class F, class... A>
|
||||
_bi::bind_t<_bi::unspecified, F, typename _bi::list_av<A...>::type>
|
||||
BOOST_BIND( F f, A... a )
|
||||
{
|
||||
typedef typename _bi::list_av<A...>::type list_type;
|
||||
return _bi::bind_t<_bi::unspecified, F, list_type>( std::move(f), list_type( a... ) );
|
||||
}
|
||||
|
||||
// function pointers
|
||||
|
||||
#define BOOST_BIND_CC
|
||||
#define BOOST_BIND_ST
|
||||
#define BOOST_BIND_NOEXCEPT
|
||||
|
||||
#include <boost/bind/detail/bind_cc.hpp>
|
||||
|
||||
# if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
|
||||
# undef BOOST_BIND_NOEXCEPT
|
||||
# define BOOST_BIND_NOEXCEPT noexcept
|
||||
# include <boost/bind/detail/bind_cc.hpp>
|
||||
# endif
|
||||
|
||||
#undef BOOST_BIND_CC
|
||||
#undef BOOST_BIND_ST
|
||||
#undef BOOST_BIND_NOEXCEPT
|
||||
|
||||
#if defined(BOOST_BIND_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_CC __stdcall
|
||||
#define BOOST_BIND_ST
|
||||
#define BOOST_BIND_NOEXCEPT
|
||||
|
||||
#include <boost/bind/detail/bind_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_CC
|
||||
#undef BOOST_BIND_ST
|
||||
#undef BOOST_BIND_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_BIND_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_CC __fastcall
|
||||
#define BOOST_BIND_ST
|
||||
#define BOOST_BIND_NOEXCEPT
|
||||
|
||||
#include <boost/bind/detail/bind_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_CC
|
||||
#undef BOOST_BIND_ST
|
||||
#undef BOOST_BIND_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_BIND_ENABLE_PASCAL
|
||||
|
||||
#define BOOST_BIND_ST pascal
|
||||
#define BOOST_BIND_CC
|
||||
#define BOOST_BIND_NOEXCEPT
|
||||
|
||||
#include <boost/bind/detail/bind_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_ST
|
||||
#undef BOOST_BIND_CC
|
||||
#undef BOOST_BIND_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
// member function pointers
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X
|
||||
#define BOOST_BIND_MF_CC
|
||||
#define BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#include <boost/bind/detail/bind_mf_cc.hpp>
|
||||
#include <boost/bind/detail/bind_mf2_cc.hpp>
|
||||
|
||||
# if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
|
||||
# undef BOOST_BIND_MF_NOEXCEPT
|
||||
# define BOOST_BIND_MF_NOEXCEPT noexcept
|
||||
# include <boost/bind/detail/bind_mf_cc.hpp>
|
||||
# include <boost/bind/detail/bind_mf2_cc.hpp>
|
||||
# endif
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
#undef BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X##_cdecl
|
||||
#define BOOST_BIND_MF_CC __cdecl
|
||||
#define BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#include <boost/bind/detail/bind_mf_cc.hpp>
|
||||
#include <boost/bind/detail/bind_mf2_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
#undef BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X##_stdcall
|
||||
#define BOOST_BIND_MF_CC __stdcall
|
||||
#define BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#include <boost/bind/detail/bind_mf_cc.hpp>
|
||||
#include <boost/bind/detail/bind_mf2_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
#undef BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X##_fastcall
|
||||
#define BOOST_BIND_MF_CC __fastcall
|
||||
#define BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#include <boost/bind/detail/bind_mf_cc.hpp>
|
||||
#include <boost/bind/detail/bind_mf2_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
#undef BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
// data member pointers
|
||||
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
template<class M, int I> struct add_cref;
|
||||
|
||||
template<class M> struct add_cref<M, 0>
|
||||
{
|
||||
typedef M type;
|
||||
};
|
||||
|
||||
template<class M> struct add_cref<M, 1>
|
||||
{
|
||||
typedef M const& type;
|
||||
};
|
||||
|
||||
template<class R> struct isref
|
||||
{
|
||||
enum value_type { value = 0 };
|
||||
};
|
||||
|
||||
template<class R> struct isref< R& >
|
||||
{
|
||||
enum value_type { value = 1 };
|
||||
};
|
||||
|
||||
template<class R> struct isref< R* >
|
||||
{
|
||||
enum value_type { value = 1 };
|
||||
};
|
||||
|
||||
template<class M, class A1, bool fn = std::is_function<M>::value> struct dm_result
|
||||
{
|
||||
};
|
||||
|
||||
template<class M, class A1> struct dm_result<M, A1, false>
|
||||
{
|
||||
typedef typename add_cref< M, 1 >::type type;
|
||||
};
|
||||
|
||||
template<class M, class R, class F, class L> struct dm_result<M, bind_t<R, F, L>, false>
|
||||
{
|
||||
typedef typename bind_t<R, F, L>::result_type result_type;
|
||||
typedef typename add_cref< M, isref< result_type >::value >::type type;
|
||||
};
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
template<class A1, class M, class T>
|
||||
|
||||
_bi::bind_t<
|
||||
typename _bi::dm_result<M, A1>::type,
|
||||
_mfi::dm<M, T>,
|
||||
typename _bi::list_av<A1>::type
|
||||
>
|
||||
|
||||
BOOST_BIND( M T::*f, A1 a1 )
|
||||
{
|
||||
typedef typename _bi::dm_result<M, A1>::type result_type;
|
||||
typedef _mfi::dm<M, T> F;
|
||||
typedef typename _bi::list_av<A1>::type list_type;
|
||||
return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) );
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifndef BOOST_BIND_NO_PLACEHOLDERS
|
||||
|
||||
# include <boost/bind/placeholders.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(default: 4512) // assignment operator could not be generated
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_BIND_BIND_HPP_INCLUDED
|
||||
117
include/boost/bind/detail/bind_cc.hpp
Normal file
117
include/boost/bind/detail/bind_cc.hpp
Normal file
@@ -0,0 +1,117 @@
|
||||
//
|
||||
// bind/bind_cc.hpp - support for different calling conventions
|
||||
//
|
||||
// Do not include this header directly.
|
||||
//
|
||||
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
|
||||
template<class R>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) () BOOST_BIND_NOEXCEPT, typename _bi::list_av<>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) () BOOST_BIND_NOEXCEPT)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) () BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type> (f, list_type());
|
||||
}
|
||||
|
||||
template<class R, class B1, class A1>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1) BOOST_BIND_NOEXCEPT, A1 a1)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type> (f, list_type(a1));
|
||||
}
|
||||
|
||||
template<class R, class B1, class B2, class A1, class A2>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1, A2>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1, A2>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
|
||||
}
|
||||
|
||||
template<class R,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1, A2, A3>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1, A2, A3>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
|
||||
}
|
||||
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1, A2, A3, A4>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
|
||||
}
|
||||
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1, A2, A3, A4, A5>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
|
||||
}
|
||||
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1, A2, A3, A4, A5, A6>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
|
||||
}
|
||||
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
|
||||
}
|
||||
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7, A8>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
|
||||
}
|
||||
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT, typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
|
||||
}
|
||||
210
include/boost/bind/detail/bind_mf2_cc.hpp
Normal file
210
include/boost/bind/detail/bind_mf2_cc.hpp
Normal file
@@ -0,0 +1,210 @@
|
||||
//
|
||||
// bind/bind_mf2_cc.hpp - member functions, type<> syntax
|
||||
//
|
||||
// Do not include this header directly.
|
||||
//
|
||||
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2008 Peter Dimov
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
|
||||
// 0
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class A1>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class A1>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1 );
|
||||
}
|
||||
|
||||
// 1
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1,
|
||||
class A1, class A2>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1,
|
||||
class A1, class A2>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2 );
|
||||
}
|
||||
|
||||
// 2
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2,
|
||||
class A1, class A2, class A3>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2,
|
||||
class A1, class A2, class A3>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3 );
|
||||
}
|
||||
|
||||
// 3
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3, class A4>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3, class A4>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4 );
|
||||
}
|
||||
|
||||
// 4
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5 );
|
||||
}
|
||||
|
||||
// 5
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 );
|
||||
}
|
||||
|
||||
// 6
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 );
|
||||
}
|
||||
|
||||
// 7
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
}
|
||||
|
||||
// 8
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
auto
|
||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
-> decltype( boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::type<Rt2>(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
}
|
||||
405
include/boost/bind/detail/bind_mf_cc.hpp
Normal file
405
include/boost/bind/detail/bind_mf_cc.hpp
Normal file
@@ -0,0 +1,405 @@
|
||||
//
|
||||
// bind/bind_mf_cc.hpp - support for different calling conventions
|
||||
//
|
||||
// Do not include this header directly.
|
||||
//
|
||||
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
|
||||
// 0
|
||||
|
||||
template<class R, class T,
|
||||
class A1>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class A1>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class A1,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class A1,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1 );
|
||||
}
|
||||
|
||||
// 1
|
||||
|
||||
template<class R, class T,
|
||||
class B1,
|
||||
class A1, class A2>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class B1,
|
||||
class A1, class A2>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1,
|
||||
class A1, class A2,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1,
|
||||
class A1, class A2,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2 );
|
||||
}
|
||||
|
||||
// 2
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2,
|
||||
class A1, class A2, class A3>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2,
|
||||
class A1, class A2, class A3>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2,
|
||||
class A1, class A2, class A3,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2,
|
||||
class A1, class A2, class A3,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3 );
|
||||
}
|
||||
|
||||
// 3
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3, class A4>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3, class A4>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3, class A4,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3, class A4,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4 );
|
||||
}
|
||||
|
||||
// 4
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4, class A5,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4, class A5,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5 );
|
||||
}
|
||||
|
||||
// 5
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 );
|
||||
}
|
||||
|
||||
// 6
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 );
|
||||
}
|
||||
|
||||
// 7
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
}
|
||||
|
||||
// 8
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
}
|
||||
|
||||
template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
-> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) )
|
||||
{
|
||||
return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
}
|
||||
|
||||
template<class Rt2, class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9,
|
||||
class En = typename std::enable_if< !std::is_same<Rt2, R>::value >::type>
|
||||
auto
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
-> decltype( boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) )
|
||||
{
|
||||
return boost::BOOST_BIND<Rt2>( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
}
|
||||
111
include/boost/bind/detail/integer_sequence.hpp
Normal file
111
include/boost/bind/detail/integer_sequence.hpp
Normal file
@@ -0,0 +1,111 @@
|
||||
#ifndef BOOST_BIND_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED
|
||||
#define BOOST_BIND_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED
|
||||
|
||||
// Copyright 2015, 2017, 2019 Peter Dimov.
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#if defined(__has_builtin)
|
||||
# if __has_builtin(__make_integer_seq)
|
||||
# define BOOST_BIND_DETAIL_HAS_MAKE_INTEGER_SEQ
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
// integer_sequence
|
||||
template<class T, T... I> struct integer_sequence
|
||||
{
|
||||
};
|
||||
|
||||
#if defined(BOOST_BIND_DETAIL_HAS_MAKE_INTEGER_SEQ)
|
||||
|
||||
template<class T, T N> using make_integer_sequence = __make_integer_seq<integer_sequence, T, N>;
|
||||
|
||||
#else
|
||||
|
||||
// detail::make_integer_sequence_impl
|
||||
namespace detail
|
||||
{
|
||||
|
||||
// iseq_if_c
|
||||
template<bool C, class T, class E> struct iseq_if_c_impl;
|
||||
|
||||
template<class T, class E> struct iseq_if_c_impl<true, T, E>
|
||||
{
|
||||
using type = T;
|
||||
};
|
||||
|
||||
template<class T, class E> struct iseq_if_c_impl<false, T, E>
|
||||
{
|
||||
using type = E;
|
||||
};
|
||||
|
||||
template<bool C, class T, class E> using iseq_if_c = typename iseq_if_c_impl<C, T, E>::type;
|
||||
|
||||
// iseq_identity
|
||||
template<class T> struct iseq_identity
|
||||
{
|
||||
using type = T;
|
||||
};
|
||||
|
||||
template<class S1, class S2> struct append_integer_sequence;
|
||||
|
||||
template<class T, T... I, T... J> struct append_integer_sequence<integer_sequence<T, I...>, integer_sequence<T, J...>>
|
||||
{
|
||||
using type = integer_sequence< T, I..., ( J + sizeof...(I) )... >;
|
||||
};
|
||||
|
||||
template<class T, T N> struct make_integer_sequence_impl;
|
||||
|
||||
template<class T, T N> struct make_integer_sequence_impl_
|
||||
{
|
||||
private:
|
||||
|
||||
static_assert( N >= 0, "make_integer_sequence<T, N>: N must not be negative" );
|
||||
|
||||
static T const M = N / 2;
|
||||
static T const R = N % 2;
|
||||
|
||||
using S1 = typename make_integer_sequence_impl<T, M>::type;
|
||||
using S2 = typename append_integer_sequence<S1, S1>::type;
|
||||
using S3 = typename make_integer_sequence_impl<T, R>::type;
|
||||
using S4 = typename append_integer_sequence<S2, S3>::type;
|
||||
|
||||
public:
|
||||
|
||||
using type = S4;
|
||||
};
|
||||
|
||||
template<class T, T N> struct make_integer_sequence_impl: iseq_if_c<N == 0, iseq_identity<integer_sequence<T>>, iseq_if_c<N == 1, iseq_identity<integer_sequence<T, 0>>, make_integer_sequence_impl_<T, N> > >
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// make_integer_sequence
|
||||
template<class T, T N> using make_integer_sequence = typename detail::make_integer_sequence_impl<T, N>::type;
|
||||
|
||||
#endif // defined(BOOST_BIND_DETAIL_HAS_MAKE_INTEGER_SEQ)
|
||||
|
||||
// index_sequence
|
||||
template<std::size_t... I> using index_sequence = integer_sequence<std::size_t, I...>;
|
||||
|
||||
// make_index_sequence
|
||||
template<std::size_t N> using make_index_sequence = make_integer_sequence<std::size_t, N>;
|
||||
|
||||
// index_sequence_for
|
||||
template<class... T> using index_sequence_for = make_integer_sequence<std::size_t, sizeof...(T)>;
|
||||
|
||||
} // namespace _bi
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED
|
||||
165
include/boost/bind/detail/result_traits.hpp
Normal file
165
include/boost/bind/detail/result_traits.hpp
Normal file
@@ -0,0 +1,165 @@
|
||||
#ifndef BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED
|
||||
#define BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// bind/detail/result_traits.hpp
|
||||
//
|
||||
// boost/bind.hpp support header, return type deduction
|
||||
//
|
||||
// Copyright 2006, 2020 Peter Dimov
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/core/ref.hpp>
|
||||
|
||||
#if BOOST_CXX_VERSION >= 201700L
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
template<class R, class F> struct result_traits
|
||||
{
|
||||
typedef R type;
|
||||
};
|
||||
|
||||
struct unspecified {};
|
||||
|
||||
template<class F> struct result_traits<unspecified, F>
|
||||
{
|
||||
typedef typename F::result_type type;
|
||||
};
|
||||
|
||||
template<class F> struct result_traits< unspecified, reference_wrapper<F> >
|
||||
{
|
||||
typedef typename F::result_type type;
|
||||
};
|
||||
|
||||
#if BOOST_CXX_VERSION >= 201700L
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::plus<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::minus<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::multiplies<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::divides<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::modulus<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::negate<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::equal_to<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::not_equal_to<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::greater<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::less<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::greater_equal<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::less_equal<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::logical_and<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::logical_or<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::logical_not<T> >
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::bit_and<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::bit_or<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::bit_xor<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 40900
|
||||
|
||||
// libstdc++ 4.8 and below don't have std::bit_not
|
||||
|
||||
#else
|
||||
|
||||
template<class T> struct result_traits< unspecified, std::bit_not<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED
|
||||
64
include/boost/bind/detail/tuple_for_each.hpp
Normal file
64
include/boost/bind/detail/tuple_for_each.hpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED
|
||||
#define BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED
|
||||
|
||||
// Copyright 2015-2020, 2024 Peter Dimov.
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <boost/bind/detail/integer_sequence.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
#include <cstddef>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable: 4100 ) // unreferenced formal parameter 'tp'
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
// tuple_for_each( f, tp )
|
||||
|
||||
template<class F, class Tp, std::size_t... J> F tuple_for_each_impl( F&& f, Tp&& tp, integer_sequence<std::size_t, J...> )
|
||||
{
|
||||
using A = int[ 1 + sizeof...(J) ];
|
||||
using std::get;
|
||||
return (void)A{ 0, ((void)f(get<J>(std::forward<Tp>(tp))), 0)... }, std::forward<F>(f);
|
||||
}
|
||||
|
||||
template<class F, class Tp> F tuple_for_each( F&& f, Tp&& tp )
|
||||
{
|
||||
using seq = make_index_sequence<std::tuple_size<typename std::remove_reference<Tp>::type>::value>;
|
||||
return _bi::tuple_for_each_impl( std::forward<F>(f), std::forward<Tp>(tp), seq() );
|
||||
}
|
||||
|
||||
// tuple_for_each( f, tp1, tp2 )
|
||||
|
||||
template<class F, class Tp1, class Tp2, std::size_t... J> F tuple_for_each_impl( F&& f, Tp1&& tp1, Tp2&& tp2, integer_sequence<std::size_t, J...> )
|
||||
{
|
||||
using A = int[ 1 + sizeof...(J) ];
|
||||
using std::get;
|
||||
return (void)A{ 0, ((void)f( get<J>(std::forward<Tp1>(tp1)), get<J>(std::forward<Tp2>(tp2)) ), 0)... }, std::forward<F>(f);
|
||||
}
|
||||
|
||||
template<class F, class Tp1, class Tp2> F tuple_for_each( F&& f, Tp1&& tp1, Tp2&& tp2 )
|
||||
{
|
||||
using seq = make_index_sequence<std::tuple_size<typename std::remove_reference<Tp1>::type>::value>;
|
||||
return _bi::tuple_for_each_impl( std::forward<F>(f), std::forward<Tp1>(tp1), std::forward<Tp2>(tp2), seq() );
|
||||
}
|
||||
|
||||
} // namespace _bi
|
||||
} // namespace boost
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED
|
||||
187
include/boost/bind/make_adaptable.hpp
Normal file
187
include/boost/bind/make_adaptable.hpp
Normal file
@@ -0,0 +1,187 @@
|
||||
#ifndef BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
|
||||
#define BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// make_adaptable.hpp
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
template<class R, class F> class af0
|
||||
{
|
||||
public:
|
||||
|
||||
typedef R result_type;
|
||||
|
||||
explicit af0(F f): f_(f)
|
||||
{
|
||||
}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return f_();
|
||||
}
|
||||
|
||||
result_type operator()() const
|
||||
{
|
||||
return f_();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
F f_;
|
||||
};
|
||||
|
||||
template<class R, class A1, class F> class af1
|
||||
{
|
||||
public:
|
||||
|
||||
typedef R result_type;
|
||||
typedef A1 argument_type;
|
||||
typedef A1 arg1_type;
|
||||
|
||||
explicit af1(F f): f_(f)
|
||||
{
|
||||
}
|
||||
|
||||
result_type operator()(A1 a1)
|
||||
{
|
||||
return f_(a1);
|
||||
}
|
||||
|
||||
result_type operator()(A1 a1) const
|
||||
{
|
||||
return f_(a1);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
F f_;
|
||||
};
|
||||
|
||||
template<class R, class A1, class A2, class F> class af2
|
||||
{
|
||||
public:
|
||||
|
||||
typedef R result_type;
|
||||
typedef A1 first_argument_type;
|
||||
typedef A2 second_argument_type;
|
||||
typedef A1 arg1_type;
|
||||
typedef A2 arg2_type;
|
||||
|
||||
explicit af2(F f): f_(f)
|
||||
{
|
||||
}
|
||||
|
||||
result_type operator()(A1 a1, A2 a2)
|
||||
{
|
||||
return f_(a1, a2);
|
||||
}
|
||||
|
||||
result_type operator()(A1 a1, A2 a2) const
|
||||
{
|
||||
return f_(a1, a2);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
F f_;
|
||||
};
|
||||
|
||||
template<class R, class A1, class A2, class A3, class F> class af3
|
||||
{
|
||||
public:
|
||||
|
||||
typedef R result_type;
|
||||
typedef A1 arg1_type;
|
||||
typedef A2 arg2_type;
|
||||
typedef A3 arg3_type;
|
||||
|
||||
explicit af3(F f): f_(f)
|
||||
{
|
||||
}
|
||||
|
||||
result_type operator()(A1 a1, A2 a2, A3 a3)
|
||||
{
|
||||
return f_(a1, a2, a3);
|
||||
}
|
||||
|
||||
result_type operator()(A1 a1, A2 a2, A3 a3) const
|
||||
{
|
||||
return f_(a1, a2, a3);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
F f_;
|
||||
};
|
||||
|
||||
template<class R, class A1, class A2, class A3, class A4, class F> class af4
|
||||
{
|
||||
public:
|
||||
|
||||
typedef R result_type;
|
||||
typedef A1 arg1_type;
|
||||
typedef A2 arg2_type;
|
||||
typedef A3 arg3_type;
|
||||
typedef A4 arg4_type;
|
||||
|
||||
explicit af4(F f): f_(f)
|
||||
{
|
||||
}
|
||||
|
||||
result_type operator()(A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
{
|
||||
return f_(a1, a2, a3, a4);
|
||||
}
|
||||
|
||||
result_type operator()(A1 a1, A2 a2, A3 a3, A4 a4) const
|
||||
{
|
||||
return f_(a1, a2, a3, a4);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
F f_;
|
||||
};
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
template<class R, class F> _bi::af0<R, F> make_adaptable(F f)
|
||||
{
|
||||
return _bi::af0<R, F>(f);
|
||||
}
|
||||
|
||||
template<class R, class A1, class F> _bi::af1<R, A1, F> make_adaptable(F f)
|
||||
{
|
||||
return _bi::af1<R, A1, F>(f);
|
||||
}
|
||||
|
||||
template<class R, class A1, class A2, class F> _bi::af2<R, A1, A2, F> make_adaptable(F f)
|
||||
{
|
||||
return _bi::af2<R, A1, A2, F>(f);
|
||||
}
|
||||
|
||||
template<class R, class A1, class A2, class A3, class F> _bi::af3<R, A1, A2, A3, F> make_adaptable(F f)
|
||||
{
|
||||
return _bi::af3<R, A1, A2, A3, F>(f);
|
||||
}
|
||||
|
||||
template<class R, class A1, class A2, class A3, class A4, class F> _bi::af4<R, A1, A2, A3, A4, F> make_adaptable(F f)
|
||||
{
|
||||
return _bi::af4<R, A1, A2, A3, A4, F>(f);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
|
||||
253
include/boost/bind/mem_fn.hpp
Normal file
253
include/boost/bind/mem_fn.hpp
Normal file
@@ -0,0 +1,253 @@
|
||||
#ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED
|
||||
#define BOOST_BIND_MEM_FN_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// mem_fn.hpp - a generalization of std::mem_fun[_ref]
|
||||
//
|
||||
// Copyright 2001-2005, 2024 Peter Dimov
|
||||
// Copyright 2001 David Abrahams
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
|
||||
//
|
||||
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace _mfi
|
||||
{
|
||||
|
||||
template<class T> struct remove_cvref: std::remove_cv< typename std::remove_reference<T>::type >
|
||||
{
|
||||
};
|
||||
|
||||
template<class Pm, class R, class T, class... A> class mf
|
||||
{
|
||||
public:
|
||||
|
||||
typedef R result_type;
|
||||
|
||||
private:
|
||||
|
||||
Pm pm_;
|
||||
|
||||
public:
|
||||
|
||||
mf( Pm pm ): pm_( pm ) {}
|
||||
|
||||
template<class U,
|
||||
class Ud = typename _mfi::remove_cvref<U>::type,
|
||||
class En = typename std::enable_if<
|
||||
std::is_same<T, Ud>::value || std::is_base_of<T, Ud>::value
|
||||
>::type
|
||||
>
|
||||
|
||||
R operator()( U&& u, A... a ) const
|
||||
{
|
||||
return (std::forward<U>( u ).*pm_)( std::forward<A>( a )... );
|
||||
}
|
||||
|
||||
template<class U,
|
||||
class Ud = typename _mfi::remove_cvref<U>::type,
|
||||
class E1 = void,
|
||||
class En = typename std::enable_if<
|
||||
!(std::is_same<T, Ud>::value || std::is_base_of<T, Ud>::value)
|
||||
>::type
|
||||
>
|
||||
|
||||
R operator()( U&& u, A... a ) const
|
||||
{
|
||||
return (get_pointer( std::forward<U>( u ) )->*pm_)( std::forward<A>( a )... );
|
||||
}
|
||||
|
||||
bool operator==( mf const & rhs ) const
|
||||
{
|
||||
return pm_ == rhs.pm_;
|
||||
}
|
||||
|
||||
bool operator!=( mf const & rhs ) const
|
||||
{
|
||||
return pm_ != rhs.pm_;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace _mfi
|
||||
|
||||
//
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
#if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (T::*pmf) (A...) noexcept ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (T::*pmf) (A...) const noexcept ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
#endif // #if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
|
||||
|
||||
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (__cdecl T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (__cdecl T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
#endif // #if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (__stdcall T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (__stdcall T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
#endif // #if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (__fastcall T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
template<class R, class T, class... A>
|
||||
auto mem_fn( R (__fastcall T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
|
||||
{
|
||||
return pmf;
|
||||
}
|
||||
|
||||
#endif // #if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
// data member support
|
||||
|
||||
namespace _mfi
|
||||
{
|
||||
|
||||
template<class R, class T> class dm
|
||||
{
|
||||
public:
|
||||
|
||||
typedef R const & result_type;
|
||||
typedef T const * argument_type;
|
||||
|
||||
private:
|
||||
|
||||
typedef R (T::*Pm);
|
||||
Pm pm_;
|
||||
|
||||
public:
|
||||
|
||||
dm( Pm pm ): pm_( pm ) {}
|
||||
|
||||
template<class U,
|
||||
class Ud = typename _mfi::remove_cvref<U>::type,
|
||||
class En = typename std::enable_if<
|
||||
std::is_same<T, Ud>::value || std::is_base_of<T, Ud>::value
|
||||
>::type
|
||||
>
|
||||
|
||||
auto operator()( U&& u ) const -> decltype( std::forward<U>( u ).*pm_ )
|
||||
{
|
||||
return std::forward<U>( u ).*pm_;
|
||||
}
|
||||
|
||||
template<class U,
|
||||
class Ud = typename _mfi::remove_cvref<U>::type,
|
||||
class E1 = void,
|
||||
class En = typename std::enable_if<
|
||||
!(std::is_same<T, Ud>::value || std::is_base_of<T, Ud>::value)
|
||||
>::type
|
||||
>
|
||||
|
||||
auto operator()( U&& u ) const -> decltype( get_pointer( std::forward<U>( u ) )->*pm_ )
|
||||
{
|
||||
return get_pointer( std::forward<U>( u ) )->*pm_;
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
||||
|
||||
template<class U>
|
||||
R& operator()( U* u ) const
|
||||
{
|
||||
return u->*pm_;
|
||||
}
|
||||
|
||||
template<class U>
|
||||
R const& operator()( U const* u ) const
|
||||
{
|
||||
return u->*pm_;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool operator==( dm const & rhs ) const
|
||||
{
|
||||
return pm_ == rhs.pm_;
|
||||
}
|
||||
|
||||
bool operator!=( dm const & rhs ) const
|
||||
{
|
||||
return pm_ != rhs.pm_;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace _mfi
|
||||
|
||||
template<class R, class T,
|
||||
class E = typename std::enable_if< !std::is_function<R>::value >::type
|
||||
>
|
||||
_mfi::dm<R, T> mem_fn( R T::*pm )
|
||||
{
|
||||
return pm;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED
|
||||
61
include/boost/bind/placeholders.hpp
Normal file
61
include/boost/bind/placeholders.hpp
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// bind/placeholders.hpp - _N definitions
|
||||
//
|
||||
// Copyright 2002, 2015, 2024 Peter Dimov
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// See http://www.boost.org/libs/bind for documentation.
|
||||
//
|
||||
|
||||
#include <boost/bind/arg.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace placeholders
|
||||
{
|
||||
|
||||
#if !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<1> _1;
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<2> _2;
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<3> _3;
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<4> _4;
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<5> _5;
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<6> _6;
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<7> _7;
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<8> _8;
|
||||
BOOST_INLINE_CONSTEXPR boost::arg<9> _9;
|
||||
|
||||
#else
|
||||
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<1> _1;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<2> _2;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<3> _3;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<4> _4;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<5> _5;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<6> _6;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<7> _7;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<8> _8;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<9> _9;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace placeholders
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
69
include/boost/bind/protect.hpp
Normal file
69
include/boost/bind/protect.hpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef BOOST_BIND_PROTECT_HPP_INCLUDED
|
||||
#define BOOST_BIND_PROTECT_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// protect.hpp
|
||||
//
|
||||
// Copyright 2002, 2020 Peter Dimov
|
||||
// Copyright 2009 Steven Watanabe
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
template<class T> struct protect_make_void
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template<class F, class E = void> struct protect_result_type
|
||||
{
|
||||
};
|
||||
|
||||
template<class F> struct protect_result_type< F, typename protect_make_void<typename F::result_type>::type >
|
||||
{
|
||||
typedef typename F::result_type result_type;
|
||||
};
|
||||
|
||||
template<class F> class protected_bind_t: public protect_result_type<F>
|
||||
{
|
||||
private:
|
||||
|
||||
F f_;
|
||||
|
||||
public:
|
||||
|
||||
explicit protected_bind_t( F f ): f_( f )
|
||||
{
|
||||
}
|
||||
|
||||
template<class... A> auto operator()( A&&... a ) -> decltype( f_( std::forward<A>(a)... ) )
|
||||
{
|
||||
return f_( std::forward<A>(a)... );
|
||||
}
|
||||
|
||||
template<class... A> auto operator()( A&&... a ) const -> decltype( f_( std::forward<A>(a)... ) )
|
||||
{
|
||||
return f_( std::forward<A>(a)... );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
template<class F> _bi::protected_bind_t<F> protect(F f)
|
||||
{
|
||||
return _bi::protected_bind_t<F>(f);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_PROTECT_HPP_INCLUDED
|
||||
33
include/boost/bind/std_placeholders.hpp
Normal file
33
include/boost/bind/std_placeholders.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||
#define BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// Copyright 2021 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/is_placeholder.hpp>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_1)>::type > { enum _vt { value = 1 }; };
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_2)>::type > { enum _vt { value = 2 }; };
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_3)>::type > { enum _vt { value = 3 }; };
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_4)>::type > { enum _vt { value = 4 }; };
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_5)>::type > { enum _vt { value = 5 }; };
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_6)>::type > { enum _vt { value = 6 }; };
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_7)>::type > { enum _vt { value = 7 }; };
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_8)>::type > { enum _vt { value = 8 }; };
|
||||
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_9)>::type > { enum _vt { value = 9 }; };
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||
Reference in New Issue
Block a user