You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
libcxx
benchmarks
cmake
docs
fuzzing
include
experimental
ext
support
CMakeLists.txt
__bit_reference
__bsd_locale_defaults.h
__bsd_locale_fallbacks.h
__config
__config_site.in
__debug
__functional_03
__functional_base
__functional_base_03
__hash_table
__libcpp_version
__locale
__mutex_base
__nullptr
__split_buffer
__sso_allocator
__std_stream
__string
__threading_support
__tree
__tuple
__undef_macros
algorithm.REMOVED.git-id
any
array
atomic
bitset
cassert
ccomplex
cctype
cerrno
cfenv
cfloat
chrono
cinttypes
ciso646
climits
clocale
cmath
codecvt
complex
complex.h
condition_variable
csetjmp
csignal
cstdarg
cstdbool
cstddef
cstdint
cstdio
cstdlib
cstring
ctgmath
ctime
ctype.h
cwchar
cwctype
deque.REMOVED.git-id
errno.h
exception
float.h
forward_list
fstream
functional
future
initializer_list
inttypes.h
iomanip
ios
iosfwd
iostream
istream
iterator
limits
limits.h
list
locale.REMOVED.git-id
locale.h
map
math.h
memory.REMOVED.git-id
module.modulemap
mutex
new
numeric
optional
ostream
queue
random.REMOVED.git-id
ratio
regex.REMOVED.git-id
scoped_allocator
set
setjmp.h
shared_mutex
sstream
stack
stdbool.h
stddef.h
stdexcept
stdint.h
stdio.h
stdlib.h
streambuf
string.REMOVED.git-id
string.h
string_view
strstream
system_error
tgmath.h
thread
tuple
type_traits.REMOVED.git-id
typeindex
typeinfo
unordered_map
unordered_set
utility
valarray.REMOVED.git-id
variant
vector.REMOVED.git-id
wchar.h
wctype.h
lib
src
utils
www
.arcconfig
.clang-format
.gitignore
CMakeLists.txt
CREDITS.TXT
LICENSE.TXT
NOTES.TXT
TODO.TXT
appveyor-reqs-install.cmd
appveyor.yml
libcxxabi
libunwind
lld
lldb
llvm
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mk
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
225 lines
6.4 KiB
Plaintext
225 lines
6.4 KiB
Plaintext
![]() |
// -*- C++ -*-
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
//
|
||
|
// The LLVM Compiler Infrastructure
|
||
|
//
|
||
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
||
|
// Source Licenses. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
|
||
|
#ifndef _LIBCPP_FUNCTIONAL_BASE_03
|
||
|
#define _LIBCPP_FUNCTIONAL_BASE_03
|
||
|
|
||
|
// manual variadic expansion for <functional>
|
||
|
|
||
|
// __invoke
|
||
|
|
||
|
template <class _Ret, class _T1, bool _IsFunc, bool _IsBase>
|
||
|
struct __enable_invoke_imp;
|
||
|
|
||
|
template <class _Ret, class _T1>
|
||
|
struct __enable_invoke_imp<_Ret, _T1, true, true> {
|
||
|
typedef _Ret _Bullet1;
|
||
|
typedef _Bullet1 type;
|
||
|
};
|
||
|
|
||
|
template <class _Ret, class _T1>
|
||
|
struct __enable_invoke_imp<_Ret, _T1, true, false> {
|
||
|
typedef _Ret _Bullet2;
|
||
|
typedef _Bullet2 type;
|
||
|
};
|
||
|
|
||
|
template <class _Ret, class _T1>
|
||
|
struct __enable_invoke_imp<_Ret, _T1, false, true> {
|
||
|
typedef typename add_lvalue_reference<
|
||
|
typename __apply_cv<_T1, _Ret>::type
|
||
|
>::type _Bullet3;
|
||
|
typedef _Bullet3 type;
|
||
|
};
|
||
|
|
||
|
template <class _Ret, class _T1>
|
||
|
struct __enable_invoke_imp<_Ret, _T1, false, false> {
|
||
|
typedef typename add_lvalue_reference<
|
||
|
typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _Ret>::type
|
||
|
>::type _Bullet4;
|
||
|
typedef _Bullet4 type;
|
||
|
};
|
||
|
|
||
|
template <class _Ret, class _T1>
|
||
|
struct __enable_invoke_imp<_Ret, _T1*, false, false> {
|
||
|
typedef typename add_lvalue_reference<
|
||
|
typename __apply_cv<_T1, _Ret>::type
|
||
|
>::type _Bullet4;
|
||
|
typedef _Bullet4 type;
|
||
|
};
|
||
|
|
||
|
template <class _Fn, class _T1,
|
||
|
class _Traits = __member_pointer_traits<_Fn>,
|
||
|
class _Ret = typename _Traits::_ReturnType,
|
||
|
class _Class = typename _Traits::_ClassType>
|
||
|
struct __enable_invoke : __enable_invoke_imp<
|
||
|
_Ret, _T1,
|
||
|
is_member_function_pointer<_Fn>::value,
|
||
|
is_base_of<_Class, typename remove_reference<_T1>::type>::value>
|
||
|
{
|
||
|
};
|
||
|
|
||
|
__nat __invoke(__any, ...);
|
||
|
|
||
|
// first bullet
|
||
|
|
||
|
template <class _Fn, class _T1>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet1
|
||
|
__invoke(_Fn __f, _T1& __t1) {
|
||
|
return (__t1.*__f)();
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1, class _A0>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet1
|
||
|
__invoke(_Fn __f, _T1& __t1, _A0& __a0) {
|
||
|
return (__t1.*__f)(__a0);
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1, class _A0, class _A1>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet1
|
||
|
__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) {
|
||
|
return (__t1.*__f)(__a0, __a1);
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1, class _A0, class _A1, class _A2>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet1
|
||
|
__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) {
|
||
|
return (__t1.*__f)(__a0, __a1, __a2);
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet2
|
||
|
__invoke(_Fn __f, _T1& __t1) {
|
||
|
return ((*__t1).*__f)();
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1, class _A0>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet2
|
||
|
__invoke(_Fn __f, _T1& __t1, _A0& __a0) {
|
||
|
return ((*__t1).*__f)(__a0);
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1, class _A0, class _A1>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet2
|
||
|
__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) {
|
||
|
return ((*__t1).*__f)(__a0, __a1);
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1, class _A0, class _A1, class _A2>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet2
|
||
|
__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) {
|
||
|
return ((*__t1).*__f)(__a0, __a1, __a2);
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet3
|
||
|
__invoke(_Fn __f, _T1& __t1) {
|
||
|
return __t1.*__f;
|
||
|
}
|
||
|
|
||
|
template <class _Fn, class _T1>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
typename __enable_invoke<_Fn, _T1>::_Bullet4
|
||
|
__invoke(_Fn __f, _T1& __t1) {
|
||
|
return (*__t1).*__f;
|
||
|
}
|
||
|
|
||
|
// fifth bullet
|
||
|
|
||
|
template <class _Fp>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
decltype(_VSTD::declval<_Fp&>()())
|
||
|
__invoke(_Fp& __f)
|
||
|
{
|
||
|
return __f();
|
||
|
}
|
||
|
|
||
|
template <class _Fp, class _A0>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>()))
|
||
|
__invoke(_Fp& __f, _A0& __a0)
|
||
|
{
|
||
|
return __f(__a0);
|
||
|
}
|
||
|
|
||
|
template <class _Fp, class _A0, class _A1>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>()))
|
||
|
__invoke(_Fp& __f, _A0& __a0, _A1& __a1)
|
||
|
{
|
||
|
return __f(__a0, __a1);
|
||
|
}
|
||
|
|
||
|
template <class _Fp, class _A0, class _A1, class _A2>
|
||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||
|
decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>(), _VSTD::declval<_A2&>()))
|
||
|
__invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2)
|
||
|
{
|
||
|
return __f(__a0, __a1, __a2);
|
||
|
}
|
||
|
|
||
|
template <class _Fp, bool = __has_result_type<__weak_result_type<_Fp> >::value>
|
||
|
struct __invoke_return
|
||
|
{
|
||
|
typedef typename __weak_result_type<_Fp>::result_type type;
|
||
|
};
|
||
|
|
||
|
template <class _Fp>
|
||
|
struct __invoke_return<_Fp, false>
|
||
|
{
|
||
|
typedef decltype(__invoke(_VSTD::declval<_Fp&>())) type;
|
||
|
};
|
||
|
|
||
|
template <class _Tp, class _A0>
|
||
|
struct __invoke_return0
|
||
|
{
|
||
|
typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>())) type;
|
||
|
};
|
||
|
|
||
|
template <class _Rp, class _Tp, class _A0>
|
||
|
struct __invoke_return0<_Rp _Tp::*, _A0>
|
||
|
{
|
||
|
typedef typename __enable_invoke<_Rp _Tp::*, _A0>::type type;
|
||
|
};
|
||
|
|
||
|
template <class _Tp, class _A0, class _A1>
|
||
|
struct __invoke_return1
|
||
|
{
|
||
|
typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(),
|
||
|
_VSTD::declval<_A1&>())) type;
|
||
|
};
|
||
|
|
||
|
template <class _Rp, class _Class, class _A0, class _A1>
|
||
|
struct __invoke_return1<_Rp _Class::*, _A0, _A1> {
|
||
|
typedef typename __enable_invoke<_Rp _Class::*, _A0>::type type;
|
||
|
};
|
||
|
|
||
|
template <class _Tp, class _A0, class _A1, class _A2>
|
||
|
struct __invoke_return2
|
||
|
{
|
||
|
typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(),
|
||
|
_VSTD::declval<_A1&>(),
|
||
|
_VSTD::declval<_A2&>())) type;
|
||
|
};
|
||
|
|
||
|
template <class _Ret, class _Class, class _A0, class _A1, class _A2>
|
||
|
struct __invoke_return2<_Ret _Class::*, _A0, _A1, _A2> {
|
||
|
typedef typename __enable_invoke<_Ret _Class::*, _A0>::type type;
|
||
|
};
|
||
|
#endif // _LIBCPP_FUNCTIONAL_BASE_03
|