#ifndef _LIBCPP___FUNCTIONAL_BIND_H
#define _LIBCPP___FUNCTIONAL_BIND_H
#include <__config>
#include <__functional/invoke.h>
#include <__functional/weak_result_type.h>
#include <__fwd/functional.h>
#include <__type_traits/decay.h>
#include <__type_traits/is_reference_wrapper.h>
#include <__type_traits/is_void.h>
#include <cstddef>
#include <tuple>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct is_bind_expression
: _If< _IsSame<_Tp, __remove_cvref_t<_Tp> >::value, false_type, is_bind_expression<__remove_cvref_t<_Tp> > > { … };
#if _LIBCPP_STD_VER >= 17
is_bind_expression_v;
#endif
template <class _Tp>
struct is_placeholder
: _If< _IsSame<_Tp, __remove_cvref_t<_Tp> >::value,
integral_constant<int, 0>,
is_placeholder<__remove_cvref_t<_Tp> > > { … };
#if _LIBCPP_STD_VER >= 17
is_placeholder_v;
#endif
namespace placeholders {
template <int _Np>
struct __ph { … };
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<1> _1;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<2> _2;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<3> _3;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<4> _4;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<5> _5;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<6> _6;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<7> _7;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<8> _8;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<9> _9;
_LIBCPP_EXPORTED_FROM_ABI extern const __ph<10> _10;
}
is_placeholder<placeholders::__ph<_Np>>;
#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Uj>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& __mu(reference_wrapper<_Tp> __t, _Uj&) { … }
template <class _Ti, class... _Uj, size_t... _Indx>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __invoke_of<_Ti&, _Uj...>::type
__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>) { … }
template <class _Ti, class... _Uj, __enable_if_t<is_bind_expression<_Ti>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __invoke_of<_Ti&, _Uj...>::type
__mu(_Ti& __ti, tuple<_Uj...>& __uj) { … }
template <bool _IsPh, class _Ti, class _Uj>
struct __mu_return2 { … };
__mu_return2<true, _Ti, _Uj>;
template <class _Ti, class _Uj, __enable_if_t<0 < is_placeholder<_Ti>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
__mu(_Ti&, _Uj& __uj) { … }
template <class _Ti,
class _Uj,
__enable_if_t<!is_bind_expression<_Ti>::value && is_placeholder<_Ti>::value == 0 &&
!__is_reference_wrapper<_Ti>::value,
int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Ti& __mu(_Ti& __ti, _Uj&) { … }
template <class _Ti, bool _IsReferenceWrapper, bool _IsBindEx, bool _IsPh, class _TupleUj>
struct __mu_return_impl;
template <bool _Invokable, class _Ti, class... _Uj>
struct __mu_return_invokable
{ … };
__mu_return_invokable<true, _Ti, _Uj...>;
__mu_return_impl<_Ti, false, true, false, tuple<_Uj...>>;
__mu_return_impl<_Ti, false, false, true, _TupleUj>;
__mu_return_impl<_Ti, true, false, false, _TupleUj>;
__mu_return_impl<_Ti, false, false, false, _TupleUj>;
template <class _Ti, class _TupleUj>
struct __mu_return
: public __mu_return_impl<
_Ti,
__is_reference_wrapper<_Ti>::value,
is_bind_expression<_Ti>::value,
0 < is_placeholder<_Ti>::value && is_placeholder<_Ti>::value <= tuple_size<_TupleUj>::value,
_TupleUj> { … };
template <class _Fp, class _BoundArgs, class _TupleUj>
struct __is_valid_bind_return { … };
__is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>;
__is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj>;
template <class _Fp, class _BoundArgs, class _TupleUj, bool = __is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value>
struct __bind_return;
__bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj, true>;
__bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true>;
template <class _Fp, class _BoundArgs, size_t... _Indx, class _Args>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fp, _BoundArgs, _Args>::type
__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, _Args&& __args) { … }
template <class _Fp, class... _BoundArgs>
class __bind : public __weak_result_type<__decay_t<_Fp> > { … };
is_bind_expression<__bind<_Fp, _BoundArgs...>>;
template <class _Rp, class _Fp, class... _BoundArgs>
class __bind_r : public __bind<_Fp, _BoundArgs...> { … };
is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...>>;
template <class _Fp, class... _BoundArgs>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bind<_Fp, _BoundArgs...>
bind(_Fp&& __f, _BoundArgs&&... __bound_args) { … }
template <class _Rp, class _Fp, class... _BoundArgs>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bind_r<_Rp, _Fp, _BoundArgs...>
bind(_Fp&& __f, _BoundArgs&&... __bound_args) { … }
#endif
_LIBCPP_END_NAMESPACE_STD
#endif