Created
December 13, 2021 17:32
-
-
Save ldionne/5659c766d3a0416281cb3799ced96a9a to your computer and use it in GitHub Desktop.
Long reproducer for https://stackoverflow.com/q/69520633/627587
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
clang++ -std=c++14 -stdlib=libc++ -c string16.ii | |
clang++ -std=c++14 -stdlib=libc++ -c utf_string_conversions.ii | |
clang++ -std=c++14 -stdlib=libc++ string16.o utf_string_conversions.o |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define LDIONNE_HIDDEN //__attribute__ ((__visibility__("hidden"))) | |
namespace std { inline namespace __1 { } } | |
typedef long int ptrdiff_t; | |
typedef long unsigned int size_t; | |
typedef long double max_align_t; | |
extern "C++" { | |
namespace std | |
{ | |
typedef decltype(nullptr) nullptr_t; | |
} | |
using std::nullptr_t; | |
} | |
typedef signed char int8_t; | |
typedef short int16_t; | |
typedef int int32_t; | |
typedef long long int64_t; | |
typedef unsigned char uint8_t; | |
typedef unsigned short uint16_t; | |
typedef unsigned int uint32_t; | |
typedef unsigned long long uint64_t; | |
typedef int8_t int_least8_t; | |
typedef int16_t int_least16_t; | |
typedef int32_t int_least32_t; | |
typedef int64_t int_least64_t; | |
typedef uint8_t uint_least8_t; | |
typedef uint16_t uint_least16_t; | |
typedef uint32_t uint_least32_t; | |
typedef uint64_t uint_least64_t; | |
typedef int8_t int_fast8_t; | |
typedef int16_t int_fast16_t; | |
typedef int32_t int_fast32_t; | |
typedef int64_t int_fast64_t; | |
typedef uint8_t uint_fast8_t; | |
typedef uint16_t uint_fast16_t; | |
typedef uint32_t uint_fast32_t; | |
typedef uint64_t uint_fast64_t; | |
typedef signed char __int8_t; | |
typedef unsigned char __uint8_t; | |
typedef short __int16_t; | |
typedef unsigned short __uint16_t; | |
typedef int __int32_t; | |
typedef unsigned int __uint32_t; | |
typedef long long __int64_t; | |
typedef unsigned long long __uint64_t; | |
typedef long __darwin_intptr_t; | |
typedef unsigned int __darwin_natural_t; | |
typedef int __darwin_ct_rune_t; | |
typedef union { | |
char __mbstate8[128]; | |
long long _mbstateL; | |
} __mbstate_t; | |
typedef __mbstate_t __darwin_mbstate_t; | |
typedef long int __darwin_ptrdiff_t; | |
typedef long unsigned int __darwin_size_t; | |
typedef __builtin_va_list __darwin_va_list; | |
typedef int __darwin_wchar_t; | |
typedef __darwin_wchar_t __darwin_rune_t; | |
typedef int __darwin_wint_t; | |
typedef unsigned long __darwin_clock_t; | |
typedef __uint32_t __darwin_socklen_t; | |
typedef long __darwin_ssize_t; | |
typedef long __darwin_time_t; | |
typedef __int64_t __darwin_blkcnt_t; | |
typedef __int32_t __darwin_blksize_t; | |
typedef __int32_t __darwin_dev_t; | |
typedef unsigned int __darwin_fsblkcnt_t; | |
typedef unsigned int __darwin_fsfilcnt_t; | |
typedef __uint32_t __darwin_gid_t; | |
typedef __uint32_t __darwin_id_t; | |
typedef __uint64_t __darwin_ino64_t; | |
typedef __darwin_ino64_t __darwin_ino_t; | |
typedef __darwin_natural_t __darwin_mach_port_name_t; | |
typedef __darwin_mach_port_name_t __darwin_mach_port_t; | |
typedef __uint16_t __darwin_mode_t; | |
typedef __int64_t __darwin_off_t; | |
typedef __int32_t __darwin_pid_t; | |
typedef __uint32_t __darwin_sigset_t; | |
typedef __int32_t __darwin_suseconds_t; | |
typedef __uint32_t __darwin_uid_t; | |
typedef __uint32_t __darwin_useconds_t; | |
typedef unsigned char __darwin_uuid_t[16]; | |
typedef char __darwin_uuid_string_t[37]; | |
struct __darwin_pthread_handler_rec { | |
void (*__routine)(void *); | |
void *__arg; | |
struct __darwin_pthread_handler_rec *__next; | |
}; | |
struct _opaque_pthread_attr_t { | |
long __sig; | |
char __opaque[56]; | |
}; | |
struct _opaque_pthread_cond_t { | |
long __sig; | |
char __opaque[40]; | |
}; | |
struct _opaque_pthread_condattr_t { | |
long __sig; | |
char __opaque[8]; | |
}; | |
struct _opaque_pthread_mutex_t { | |
long __sig; | |
char __opaque[56]; | |
}; | |
struct _opaque_pthread_mutexattr_t { | |
long __sig; | |
char __opaque[8]; | |
}; | |
struct _opaque_pthread_once_t { | |
long __sig; | |
char __opaque[8]; | |
}; | |
struct _opaque_pthread_rwlock_t { | |
long __sig; | |
char __opaque[192]; | |
}; | |
struct _opaque_pthread_rwlockattr_t { | |
long __sig; | |
char __opaque[16]; | |
}; | |
struct _opaque_pthread_t { | |
long __sig; | |
struct __darwin_pthread_handler_rec *__cleanup_stack; | |
char __opaque[8176]; | |
}; | |
typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t; | |
typedef struct _opaque_pthread_cond_t __darwin_pthread_cond_t; | |
typedef struct _opaque_pthread_condattr_t __darwin_pthread_condattr_t; | |
typedef unsigned long __darwin_pthread_key_t; | |
typedef struct _opaque_pthread_mutex_t __darwin_pthread_mutex_t; | |
typedef struct _opaque_pthread_mutexattr_t __darwin_pthread_mutexattr_t; | |
typedef struct _opaque_pthread_once_t __darwin_pthread_once_t; | |
typedef struct _opaque_pthread_rwlock_t __darwin_pthread_rwlock_t; | |
typedef struct _opaque_pthread_rwlockattr_t __darwin_pthread_rwlockattr_t; | |
typedef struct _opaque_pthread_t *__darwin_pthread_t; | |
typedef unsigned char u_int8_t; | |
typedef unsigned short u_int16_t; | |
typedef unsigned int u_int32_t; | |
typedef unsigned long long u_int64_t; | |
typedef int64_t register_t; | |
typedef unsigned long uintptr_t; | |
typedef u_int64_t user_addr_t; | |
typedef u_int64_t user_size_t; | |
typedef int64_t user_ssize_t; | |
typedef int64_t user_long_t; | |
typedef u_int64_t user_ulong_t; | |
typedef int64_t user_time_t; | |
typedef int64_t user_off_t; | |
typedef u_int64_t syscall_arg_t; | |
typedef __darwin_intptr_t intptr_t; | |
typedef long int intmax_t; | |
typedef long unsigned int uintmax_t; | |
typedef int __darwin_nl_item; | |
typedef int __darwin_wctrans_t; | |
typedef __uint32_t __darwin_wctype_t; | |
typedef __darwin_va_list va_list; | |
extern "C" { | |
int renameat(int, const char *, int, const char *) __attribute__((availability(macosx,introduced=10.10))); | |
int renamex_np(const char *, const char *, unsigned int) __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); | |
int renameatx_np(int, const char *, int, const char *, unsigned int) __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); | |
} | |
typedef __darwin_off_t fpos_t; | |
struct __sbuf { | |
unsigned char *_base; | |
int _size; | |
}; | |
struct __sFILEX; | |
typedef struct __sFILE { | |
unsigned char *_p; | |
int _r; | |
int _w; | |
short _flags; | |
short _file; | |
struct __sbuf _bf; | |
int _lbfsize; | |
void *_cookie; | |
int (* _Nullable _close)(void *); | |
int (* _Nullable _read) (void *, char *, int); | |
fpos_t (* _Nullable _seek) (void *, fpos_t, int); | |
int (* _Nullable _write)(void *, const char *, int); | |
struct __sbuf _ub; | |
struct __sFILEX *_extra; | |
int _ur; | |
unsigned char _ubuf[3]; | |
unsigned char _nbuf[1]; | |
struct __sbuf _lb; | |
int _blksize; | |
fpos_t _offset; | |
} FILE; | |
extern "C" { | |
extern FILE *__stdinp; | |
extern FILE *__stdoutp; | |
extern FILE *__stderrp; | |
} | |
extern "C" { | |
void clearerr(FILE *); | |
int fclose(FILE *); | |
int feof(FILE *); | |
int ferror(FILE *); | |
int fflush(FILE *); | |
int fgetc(FILE *); | |
int fgetpos(FILE * , fpos_t *); | |
char *fgets(char * , int, FILE *); | |
FILE *fopen(const char * __filename, const char * __mode) __asm("_" "fopen" ); | |
int fprintf(FILE * , const char * , ...) __attribute__((__format__ (__printf__, 2, 3))); | |
int fputc(int, FILE *); | |
int fputs(const char * , FILE * ) __asm("_" "fputs" ); | |
size_t fread(void * __ptr, size_t __size, size_t __nitems, FILE * __stream); | |
FILE *freopen(const char * , const char * , | |
FILE * ) __asm("_" "freopen" ); | |
int fscanf(FILE * , const char * , ...) __attribute__((__format__ (__scanf__, 2, 3))); | |
int fseek(FILE *, long, int); | |
int fsetpos(FILE *, const fpos_t *); | |
long ftell(FILE *); | |
size_t fwrite(const void * __ptr, size_t __size, size_t __nitems, FILE * __stream) __asm("_" "fwrite" ); | |
int getc(FILE *); | |
int getchar(void); | |
char *gets(char *); | |
void perror(const char *) __attribute__((__cold__)); | |
int printf(const char * , ...) __attribute__((__format__ (__printf__, 1, 2))); | |
int putc(int, FILE *); | |
int putchar(int); | |
int puts(const char *); | |
int remove(const char *); | |
int rename (const char *__old, const char *__new); | |
void rewind(FILE *); | |
int scanf(const char * , ...) __attribute__((__format__ (__scanf__, 1, 2))); | |
void setbuf(FILE * , char * ); | |
int setvbuf(FILE * , char * , int, size_t); | |
int sprintf(char * , const char * , ...) __attribute__((__format__ (__printf__, 2, 3))) __attribute__((__availability__(swift, unavailable, message="Use snprintf instead."))); | |
int sscanf(const char * , const char * , ...) __attribute__((__format__ (__scanf__, 2, 3))); | |
FILE *tmpfile(void); | |
__attribute__((__availability__(swift, unavailable, message="Use mkstemp(3) instead."))) | |
__attribute__((__deprecated__("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead."))) | |
char *tmpnam(char *); | |
int ungetc(int, FILE *); | |
int vfprintf(FILE * , const char * , va_list) __attribute__((__format__ (__printf__, 2, 0))); | |
int vprintf(const char * , va_list) __attribute__((__format__ (__printf__, 1, 0))); | |
int vsprintf(char * , const char * , va_list) __attribute__((__format__ (__printf__, 2, 0))) __attribute__((__availability__(swift, unavailable, message="Use vsnprintf instead."))); | |
} | |
extern "C" { | |
extern "C" { | |
char *ctermid(char *); | |
} | |
FILE *fdopen(int, const char *) __asm("_" "fdopen" ); | |
int fileno(FILE *); | |
} | |
extern "C" { | |
int pclose(FILE *) __attribute__((__availability__(swift, unavailable, message="Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)"))); | |
FILE *popen(const char *, const char *) __asm("_" "popen" ) __attribute__((__availability__(swift, unavailable, message="Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)"))); | |
} | |
extern "C" { | |
int __srget(FILE *); | |
int __svfscanf(FILE *, const char *, va_list) __attribute__((__format__ (__scanf__, 2, 0))); | |
int __swbuf(int, FILE *); | |
} | |
inline __attribute__ ((__always_inline__)) int __sputc(int _c, FILE *_p) { | |
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) | |
return (*_p->_p++ = _c); | |
else | |
return (__swbuf(_c, _p)); | |
} | |
extern "C" { | |
void flockfile(FILE *); | |
int ftrylockfile(FILE *); | |
void funlockfile(FILE *); | |
int getc_unlocked(FILE *); | |
int getchar_unlocked(void); | |
int putc_unlocked(int, FILE *); | |
int putchar_unlocked(int); | |
int getw(FILE *); | |
int putw(int, FILE *); | |
__attribute__((__availability__(swift, unavailable, message="Use mkstemp(3) instead."))) | |
__attribute__((__deprecated__("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead."))) | |
char *tempnam(const char *__dir, const char *__prefix) __asm("_" "tempnam" ); | |
} | |
typedef __darwin_off_t off_t; | |
extern "C" { | |
int fseeko(FILE * __stream, off_t __offset, int __whence); | |
off_t ftello(FILE * __stream); | |
} | |
extern "C" { | |
int snprintf(char * __str, size_t __size, const char * __format, ...) __attribute__((__format__ (__printf__, 3, 4))); | |
int vfscanf(FILE * __stream, const char * __format, va_list) __attribute__((__format__ (__scanf__, 2, 0))); | |
int vscanf(const char * __format, va_list) __attribute__((__format__ (__scanf__, 1, 0))); | |
int vsnprintf(char * __str, size_t __size, const char * __format, va_list) __attribute__((__format__ (__printf__, 3, 0))); | |
int vsscanf(const char * __str, const char * __format, va_list) __attribute__((__format__ (__scanf__, 2, 0))); | |
} | |
typedef __darwin_ssize_t ssize_t; | |
extern "C" { | |
int dprintf(int, const char * , ...) __attribute__((__format__ (__printf__, 2, 3))) __attribute__((availability(macosx,introduced=10.7))); | |
int vdprintf(int, const char * , va_list) __attribute__((__format__ (__printf__, 2, 0))) __attribute__((availability(macosx,introduced=10.7))); | |
ssize_t getdelim(char ** __linep, size_t * __linecapp, int __delimiter, FILE * __stream) __attribute__((availability(macosx,introduced=10.7))); | |
ssize_t getline(char ** __linep, size_t * __linecapp, FILE * __stream) __attribute__((availability(macosx,introduced=10.7))); | |
FILE *fmemopen(void * __buf, size_t __size, const char * __mode) __attribute__((availability(macos,introduced=10.13))) __attribute__((availability(ios,introduced=11.0))) __attribute__((availability(tvos,introduced=11.0))) __attribute__((availability(watchos,introduced=4.0))); | |
FILE *open_memstream(char **__bufp, size_t *__sizep) __attribute__((availability(macos,introduced=10.13))) __attribute__((availability(ios,introduced=11.0))) __attribute__((availability(tvos,introduced=11.0))) __attribute__((availability(watchos,introduced=4.0))); | |
} | |
extern "C" { | |
extern const int sys_nerr; | |
extern const char *const sys_errlist[]; | |
int asprintf(char ** , const char * , ...) __attribute__((__format__ (__printf__, 2, 3))); | |
char *ctermid_r(char *); | |
char *fgetln(FILE *, size_t *); | |
const char *fmtcheck(const char *, const char *); | |
int fpurge(FILE *); | |
void setbuffer(FILE *, char *, int); | |
int setlinebuf(FILE *); | |
int vasprintf(char ** , const char * , va_list) __attribute__((__format__ (__printf__, 2, 0))); | |
FILE *funopen(const void *, | |
int (* _Nullable)(void *, char *, int), | |
int (* _Nullable)(void *, const char *, int), | |
fpos_t (* _Nullable)(void *, fpos_t, int), | |
int (* _Nullable)(void *)); | |
} | |
namespace std { inline namespace __1 { | |
using ::ptrdiff_t; | |
using ::size_t; | |
using ::max_align_t; | |
template <class _Tp> struct __libcpp_is_integral { enum { value = 0 }; }; | |
template <> struct __libcpp_is_integral<bool> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<char> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<signed char> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<unsigned char> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<wchar_t> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<char16_t> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<char32_t> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<short> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<unsigned short> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<int> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<unsigned int> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<long> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<unsigned long> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<long long> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<unsigned long long> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<__int128_t> { enum { value = 1 }; }; | |
template <> struct __libcpp_is_integral<__uint128_t> { enum { value = 1 }; }; | |
} } | |
namespace std { inline namespace __1 { | |
template <class _T1, class _T2> struct __attribute__ ((__type_visibility__("default"))) pair; | |
template <class _Tp> class __attribute__ ((__type_visibility__("default"))) reference_wrapper; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) hash; | |
template <class _Tp, _Tp __v> | |
struct __attribute__ ((__type_visibility__("default"))) integral_constant | |
{ | |
static constexpr const _Tp value = __v; | |
typedef _Tp value_type; | |
typedef integral_constant type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr operator value_type() const noexcept {return value;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr value_type operator ()() const noexcept {return value;} | |
}; | |
template <class _Tp, _Tp __v> | |
constexpr const _Tp integral_constant<_Tp, __v>::value; | |
typedef integral_constant<bool,(true)> true_type; | |
typedef integral_constant<bool,(false)> false_type; | |
template <bool _Val> | |
using _BoolConstant = integral_constant<bool, _Val>; | |
template <bool> struct _MetaBase; | |
template <> | |
struct _MetaBase<true> { | |
template <class _Tp, class _Up> | |
using _SelectImpl = _Tp; | |
template <template <class...> class _FirstFn, template <class...> class, class ..._Args> | |
using _SelectApplyImpl = _FirstFn<_Args...>; | |
template <class _First, class...> | |
using _FirstImpl = _First; | |
template <class, class _Second, class...> | |
using _SecondImpl = _Second; | |
template <class _Tp = void> | |
using _EnableIfImpl = _Tp; | |
template <class _Result, class _First, class ..._Rest> | |
using _OrImpl = typename _MetaBase<_First::value != true && sizeof...(_Rest) != 0>::template _OrImpl<_First, _Rest...>; | |
template <class _Result, class _First, class ..._Rest> | |
using _AndImpl = typename _MetaBase<_First::value == true && sizeof...(_Rest) != 0>::template _AndImpl<_First, _Rest...>; | |
}; | |
template <> | |
struct _MetaBase<false> { | |
template <class _Tp, class _Up> | |
using _SelectImpl = _Up; | |
template <template <class...> class, template <class...> class _SecondFn, class ..._Args> | |
using _SelectApplyImpl = _SecondFn<_Args...>; | |
template <class _Result, class ...> | |
using _OrImpl = _Result; | |
template <class _Result, class ...> | |
using _AndImpl = _Result; | |
}; | |
template <bool _Cond, class _Ret = void> | |
using _EnableIf = typename _MetaBase<_Cond>::template _EnableIfImpl<_Ret>; | |
template <bool _Cond, class _IfRes, class _ElseRes> | |
using _If = typename _MetaBase<_Cond>::template _SelectImpl<_IfRes, _ElseRes>; | |
template <class ..._Rest> | |
using _Or = typename _MetaBase< sizeof...(_Rest) != 0 >::template _OrImpl<false_type, _Rest...>; | |
template <class ..._Rest> | |
using _And = typename _MetaBase< sizeof...(_Rest) != 0 >::template _AndImpl<true_type, _Rest...>; | |
template <class _Pred> | |
struct _Not : _BoolConstant<!_Pred::value> {}; | |
template <class ..._Args> | |
using _FirstType = typename _MetaBase<(sizeof...(_Args) >= 1)>::template _FirstImpl<_Args...>; | |
template <class ..._Args> | |
using _SecondType = typename _MetaBase<(sizeof...(_Args) >= 2)>::template _SecondImpl<_Args...>; | |
template <template <class...> class _Func, class ..._Args> | |
struct _Lazy : _Func<_Args...> {}; | |
template <template <class...> class _Templ, class ..._Args, class = _Templ<_Args...> > | |
true_type __sfinae_test_impl(int); | |
template <template <class...> class, class ...> | |
false_type __sfinae_test_impl(...); | |
template <template <class ...> class _Templ, class ..._Args> | |
using _IsValidExpansion = decltype(__sfinae_test_impl<_Templ, _Args...>(0)); | |
template <class> | |
struct __void_t { typedef void type; }; | |
template <class _Tp> | |
struct __identity { typedef _Tp type; }; | |
template <class _Tp, bool> | |
struct __attribute__ ((__type_visibility__("default"))) __dependent_type : public _Tp {}; | |
template <bool _Bp, class _If, class _Then> | |
struct __attribute__ ((__type_visibility__("default"))) conditional {typedef _If type;}; | |
template <class _If, class _Then> | |
struct __attribute__ ((__type_visibility__("default"))) conditional<false, _If, _Then> {typedef _Then type;}; | |
template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type; | |
template <bool, class _Tp = void> struct __attribute__ ((__type_visibility__("default"))) enable_if {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) enable_if<true, _Tp> {typedef _Tp type;}; | |
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type; | |
template <class _Tp, class _Up> | |
struct __attribute__ ((__type_visibility__("default"))) is_same : _BoolConstant<__is_same(_Tp, _Up)> { }; | |
template <class _Tp, class _Up> | |
using _IsSame = _BoolConstant< | |
__is_same(_Tp, _Up) | |
>; | |
template <class _Tp, class _Up> | |
using _IsNotSame = _BoolConstant< | |
!__is_same(_Tp, _Up) | |
>; | |
template <class _Tp> | |
using __test_for_primary_template = _EnableIf< | |
_IsSame<_Tp, typename _Tp::__primary_template>::value | |
>; | |
template <class _Tp> | |
using __is_primary_template = _IsValidExpansion< | |
__test_for_primary_template, _Tp | |
>; | |
struct __two {char __lx[2];}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_const : _BoolConstant<__is_const(_Tp)> { }; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_volatile : _BoolConstant<__is_volatile(_Tp)> { }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_const {typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_const<const _Tp> {typedef _Tp type;}; | |
template <class _Tp> using remove_const_t = typename remove_const<_Tp>::type; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_volatile {typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_volatile<volatile _Tp> {typedef _Tp type;}; | |
template <class _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_cv | |
{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;}; | |
template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_void : _BoolConstant<__is_void(_Tp)> { }; | |
template <class _Tp> struct __is_nullptr_t_impl : public false_type {}; | |
template <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) __is_nullptr_t | |
: public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_null_pointer | |
: public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_integral : _BoolConstant<__is_integral(_Tp)> { }; | |
template <class _Tp> struct __libcpp_is_floating_point : public false_type {}; | |
template <> struct __libcpp_is_floating_point<float> : public true_type {}; | |
template <> struct __libcpp_is_floating_point<double> : public true_type {}; | |
template <> struct __libcpp_is_floating_point<long double> : public true_type {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_floating_point | |
: public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_array : _BoolConstant<__is_array(_Tp)> { }; | |
template <class _Tp> struct __libcpp_is_pointer : public false_type {}; | |
template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {}; | |
template <class _Tp> struct __libcpp_remove_objc_qualifiers { typedef _Tp type; }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_pointer | |
: public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<typename remove_cv<_Tp>::type>::type> {}; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { }; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_rvalue_reference : _BoolConstant<__is_rvalue_reference(_Tp)> { }; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_reference : _BoolConstant<__is_reference(_Tp)> { }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_union | |
: public integral_constant<bool, __is_union(_Tp)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_class | |
: public integral_constant<bool, __is_class(_Tp)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_function | |
: public _BoolConstant< | |
__is_function(_Tp) | |
> {}; | |
template <class _Tp> struct __libcpp_is_member_pointer { | |
enum { | |
__is_member = false, | |
__is_func = false, | |
__is_obj = false | |
}; | |
}; | |
template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> { | |
enum { | |
__is_member = true, | |
__is_func = is_function<_Tp>::value, | |
__is_obj = !__is_func, | |
}; | |
}; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_member_function_pointer | |
: _BoolConstant<__is_member_function_pointer(_Tp)> { }; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_member_pointer : _BoolConstant<__is_member_pointer(_Tp)> { }; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_member_object_pointer | |
: _BoolConstant<__is_member_object_pointer(_Tp)> { }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_enum | |
: public integral_constant<bool, __is_enum(_Tp)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_arithmetic | |
: public integral_constant<bool, is_integral<_Tp>::value || | |
is_floating_point<_Tp>::value> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_fundamental | |
: public integral_constant<bool, is_void<_Tp>::value || | |
__is_nullptr_t<_Tp>::value || | |
is_arithmetic<_Tp>::value> {}; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_scalar : _BoolConstant<__is_scalar(_Tp)> { }; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_object : _BoolConstant<__is_object(_Tp)> { }; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_compound : _BoolConstant<__is_compound(_Tp)> { }; | |
struct __is_referenceable_impl { | |
template <class _Tp> static _Tp& __test(int); | |
template <class _Tp> static __two __test(...); | |
}; | |
template <class _Tp> | |
struct __is_referenceable : integral_constant<bool, | |
_IsNotSame<decltype(__is_referenceable_impl::__test<_Tp>(0)), __two>::value> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) add_const { | |
typedef const _Tp type; | |
}; | |
template <class _Tp> using add_const_t = typename add_const<_Tp>::type; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) add_volatile { | |
typedef volatile _Tp type; | |
}; | |
template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) add_cv { | |
typedef const volatile _Tp type; | |
}; | |
template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_reference {typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_reference<_Tp&> {typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_reference<_Tp&&> {typedef _Tp type;}; | |
template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::type; | |
template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_lvalue_reference_impl { typedef _Tp type; }; | |
template <class _Tp > struct __add_lvalue_reference_impl<_Tp, true> { typedef _Tp& type; }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) add_lvalue_reference | |
{typedef typename __add_lvalue_reference_impl<_Tp>::type type;}; | |
template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; | |
template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_impl { typedef _Tp type; }; | |
template <class _Tp > struct __add_rvalue_reference_impl<_Tp, true> { typedef _Tp&& type; }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) add_rvalue_reference | |
{typedef typename __add_rvalue_reference_impl<_Tp>::type type;}; | |
template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated" | |
template <class _Tp> _Tp&& __declval(int); | |
template <class _Tp> _Tp __declval(long); | |
#pragma GCC diagnostic pop | |
template <class _Tp> | |
decltype(std::__1::__declval<_Tp>(0)) | |
declval() noexcept; | |
template <class _Tp> | |
struct __uncvref { | |
typedef typename remove_cv<typename remove_reference<_Tp>::type>::type type; | |
}; | |
template <class _Tp> | |
struct __unconstref { | |
typedef typename remove_const<typename remove_reference<_Tp>::type>::type type; | |
}; | |
template <class _Tp> | |
using __uncvref_t = typename __uncvref<_Tp>::type; | |
template <class _Tp, class _Up> | |
struct __is_same_uncvref : _IsSame<typename __uncvref<_Tp>::type, | |
typename __uncvref<_Up>::type> {}; | |
struct __any | |
{ | |
__any(...); | |
}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_pointer {typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_pointer<_Tp*> {typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_pointer<_Tp* const> {typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_pointer<_Tp* volatile> {typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_pointer<_Tp* const volatile> {typedef _Tp type;}; | |
template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type; | |
template <class _Tp, | |
bool = __is_referenceable<_Tp>::value || | |
_IsSame<typename remove_cv<_Tp>::type, void>::value> | |
struct __add_pointer_impl | |
{typedef typename remove_reference<_Tp>::type* type;}; | |
template <class _Tp> struct __add_pointer_impl<_Tp, false> | |
{typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) add_pointer | |
{typedef typename __add_pointer_impl<_Tp>::type type;}; | |
template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type; | |
template <class _Tp, bool = is_integral<_Tp>::value> | |
struct __libcpp_is_signed_impl : public integral_constant<bool,(_Tp(-1) < _Tp(0))> {}; | |
template <class _Tp> | |
struct __libcpp_is_signed_impl<_Tp, false> : public true_type {}; | |
template <class _Tp, bool = is_arithmetic<_Tp>::value> | |
struct __libcpp_is_signed : public __libcpp_is_signed_impl<_Tp> {}; | |
template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_signed : public __libcpp_is_signed<_Tp> {}; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_unsigned : _BoolConstant<__is_unsigned(_Tp)> { }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) rank | |
: public integral_constant<size_t, 0> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) rank<_Tp[]> | |
: public integral_constant<size_t, rank<_Tp>::value + 1> {}; | |
template <class _Tp, size_t _Np> struct __attribute__ ((__type_visibility__("default"))) rank<_Tp[_Np]> | |
: public integral_constant<size_t, rank<_Tp>::value + 1> {}; | |
template<class _Tp, size_t _Dim = 0> | |
struct __attribute__ ((__type_visibility__("default"))) extent | |
: integral_constant<size_t, __array_extent(_Tp, _Dim)> { }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_extent | |
{typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_extent<_Tp[]> | |
{typedef _Tp type;}; | |
template <class _Tp, size_t _Np> struct __attribute__ ((__type_visibility__("default"))) remove_extent<_Tp[_Np]> | |
{typedef _Tp type;}; | |
template <class _Tp> using remove_extent_t = typename remove_extent<_Tp>::type; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_all_extents | |
{typedef _Tp type;}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) remove_all_extents<_Tp[]> | |
{typedef typename remove_all_extents<_Tp>::type type;}; | |
template <class _Tp, size_t _Np> struct __attribute__ ((__type_visibility__("default"))) remove_all_extents<_Tp[_Np]> | |
{typedef typename remove_all_extents<_Tp>::type type;}; | |
template <class _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type; | |
template <class _Up, bool> | |
struct __decay { | |
typedef typename remove_cv<_Up>::type type; | |
}; | |
template <class _Up> | |
struct __decay<_Up, true> { | |
public: | |
typedef typename conditional | |
< | |
is_array<_Up>::value, | |
typename remove_extent<_Up>::type*, | |
typename conditional | |
< | |
is_function<_Up>::value, | |
typename add_pointer<_Up>::type, | |
typename remove_cv<_Up>::type | |
>::type | |
>::type type; | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) decay | |
{ | |
private: | |
typedef typename remove_reference<_Tp>::type _Up; | |
public: | |
typedef typename __decay<_Up, __is_referenceable<_Up>::value>::type type; | |
}; | |
template <class _Tp> using decay_t = typename decay<_Tp>::type; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_abstract | |
: public integral_constant<bool, __is_abstract(_Tp)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) | |
__libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) | |
is_final : public integral_constant<bool, __is_final(_Tp)> {}; | |
template <class _Bp, class _Dp> | |
struct __attribute__ ((__type_visibility__("default"))) is_base_of | |
: public integral_constant<bool, __is_base_of(_Bp, _Dp)> {}; | |
template <class _Tp, class _Up, class = void> | |
struct __is_core_convertible : public false_type {}; | |
template <class _Tp, class _Up> | |
struct __is_core_convertible<_Tp, _Up, decltype( | |
static_cast<void(*)(_Up)>(0) ( static_cast<_Tp(*)()>(0)() ) | |
)> : public true_type {}; | |
template <class _T1, class _T2> struct __attribute__ ((__type_visibility__("default"))) is_convertible | |
: public integral_constant<bool, __is_convertible_to(_T1, _T2)> {}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_empty | |
: public integral_constant<bool, __is_empty(_Tp)> {}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_polymorphic | |
: public integral_constant<bool, __is_polymorphic(_Tp)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) has_virtual_destructor | |
: public integral_constant<bool, __has_virtual_destructor(_Tp)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) alignment_of | |
: public integral_constant<size_t, alignof(_Tp)> {}; | |
template <class _Hp, class _Tp> | |
struct __type_list | |
{ | |
typedef _Hp _Head; | |
typedef _Tp _Tail; | |
}; | |
struct __nat | |
{ | |
__nat() = delete; | |
__nat(const __nat&) = delete; | |
__nat& operator=(const __nat&) = delete; | |
~__nat() = delete; | |
}; | |
template <class _Tp> | |
struct __align_type | |
{ | |
static const size_t value = __alignof(_Tp); | |
typedef _Tp type; | |
}; | |
struct __struct_double {long double __lx;}; | |
struct __struct_double4 {double __lx[4];}; | |
typedef | |
__type_list<__align_type<unsigned char>, | |
__type_list<__align_type<unsigned short>, | |
__type_list<__align_type<unsigned int>, | |
__type_list<__align_type<unsigned long>, | |
__type_list<__align_type<unsigned long long>, | |
__type_list<__align_type<double>, | |
__type_list<__align_type<long double>, | |
__type_list<__align_type<__struct_double>, | |
__type_list<__align_type<__struct_double4>, | |
__type_list<__align_type<int*>, | |
__nat | |
> > > > > > > > > > __all_types; | |
template <size_t _Align> | |
struct alignas(_Align) __fallback_overaligned {}; | |
template <class _TL, size_t _Align> struct __find_pod; | |
template <class _Hp, size_t _Align> | |
struct __find_pod<__type_list<_Hp, __nat>, _Align> | |
{ | |
typedef typename conditional< | |
_Align == _Hp::value, | |
typename _Hp::type, | |
__fallback_overaligned<_Align> | |
>::type type; | |
}; | |
template <class _Hp, class _Tp, size_t _Align> | |
struct __find_pod<__type_list<_Hp, _Tp>, _Align> | |
{ | |
typedef typename conditional< | |
_Align == _Hp::value, | |
typename _Hp::type, | |
typename __find_pod<_Tp, _Align>::type | |
>::type type; | |
}; | |
template <class _TL, size_t _Len> struct __find_max_align; | |
template <class _Hp, size_t _Len> | |
struct __find_max_align<__type_list<_Hp, __nat>, _Len> : public integral_constant<size_t, _Hp::value> {}; | |
template <size_t _Len, size_t _A1, size_t _A2> | |
struct __select_align | |
{ | |
private: | |
static const size_t __min = _A2 < _A1 ? _A2 : _A1; | |
static const size_t __max = _A1 < _A2 ? _A2 : _A1; | |
public: | |
static const size_t value = _Len < __max ? __min : __max; | |
}; | |
template <class _Hp, class _Tp, size_t _Len> | |
struct __find_max_align<__type_list<_Hp, _Tp>, _Len> | |
: public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {}; | |
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value> | |
struct __attribute__ ((__type_visibility__("default"))) aligned_storage | |
{ | |
typedef typename __find_pod<__all_types, _Align>::type _Aligner; | |
union type | |
{ | |
_Aligner __align; | |
unsigned char __data[(_Len + _Align - 1)/_Align * _Align]; | |
}; | |
}; | |
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value> | |
using aligned_storage_t = typename aligned_storage<_Len, _Align>::type; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x1>{ struct alignas(0x1) type { unsigned char __lx[(_Len + 0x1 - 1)/0x1 * 0x1]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x2>{ struct alignas(0x2) type { unsigned char __lx[(_Len + 0x2 - 1)/0x2 * 0x2]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x4>{ struct alignas(0x4) type { unsigned char __lx[(_Len + 0x4 - 1)/0x4 * 0x4]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x8>{ struct alignas(0x8) type { unsigned char __lx[(_Len + 0x8 - 1)/0x8 * 0x8]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x10>{ struct alignas(0x10) type { unsigned char __lx[(_Len + 0x10 - 1)/0x10 * 0x10]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x20>{ struct alignas(0x20) type { unsigned char __lx[(_Len + 0x20 - 1)/0x20 * 0x20]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x40>{ struct alignas(0x40) type { unsigned char __lx[(_Len + 0x40 - 1)/0x40 * 0x40]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x80>{ struct alignas(0x80) type { unsigned char __lx[(_Len + 0x80 - 1)/0x80 * 0x80]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x100>{ struct alignas(0x100) type { unsigned char __lx[(_Len + 0x100 - 1)/0x100 * 0x100]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x200>{ struct alignas(0x200) type { unsigned char __lx[(_Len + 0x200 - 1)/0x200 * 0x200]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x400>{ struct alignas(0x400) type { unsigned char __lx[(_Len + 0x400 - 1)/0x400 * 0x400]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x800>{ struct alignas(0x800) type { unsigned char __lx[(_Len + 0x800 - 1)/0x800 * 0x800]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x1000>{ struct alignas(0x1000) type { unsigned char __lx[(_Len + 0x1000 - 1)/0x1000 * 0x1000]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x2000>{ struct alignas(0x2000) type { unsigned char __lx[(_Len + 0x2000 - 1)/0x2000 * 0x2000]; };}; | |
template <size_t _Len>struct __attribute__ ((__type_visibility__("default"))) aligned_storage<_Len, 0x4000>{ struct alignas(0x4000) type { unsigned char __lx[(_Len + 0x4000 - 1)/0x4000 * 0x4000]; };}; | |
template <size_t _I0, size_t ..._In> | |
struct __static_max; | |
template <size_t _I0> | |
struct __static_max<_I0> | |
{ | |
static const size_t value = _I0; | |
}; | |
template <size_t _I0, size_t _I1, size_t ..._In> | |
struct __static_max<_I0, _I1, _In...> | |
{ | |
static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value : | |
__static_max<_I1, _In...>::value; | |
}; | |
template <size_t _Len, class _Type0, class ..._Types> | |
struct aligned_union | |
{ | |
static const size_t alignment_value = __static_max<__alignof(_Type0), | |
__alignof(_Types)...>::value; | |
static const size_t __len = __static_max<_Len, sizeof(_Type0), | |
sizeof(_Types)...>::value; | |
typedef typename aligned_storage<__len, alignment_value>::type type; | |
}; | |
template <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type; | |
template <class _Tp> | |
struct __numeric_type | |
{ | |
static void __test(...); | |
static float __test(float); | |
static double __test(char); | |
static double __test(int); | |
static double __test(unsigned); | |
static double __test(long); | |
static double __test(unsigned long); | |
static double __test(long long); | |
static double __test(unsigned long long); | |
static double __test(double); | |
static long double __test(long double); | |
typedef decltype(__test(declval<_Tp>())) type; | |
static const bool value = _IsNotSame<type, void>::value; | |
}; | |
template <> | |
struct __numeric_type<void> | |
{ | |
static const bool value = true; | |
}; | |
template <class _A1, class _A2 = void, class _A3 = void, | |
bool = __numeric_type<_A1>::value && | |
__numeric_type<_A2>::value && | |
__numeric_type<_A3>::value> | |
class __promote_imp | |
{ | |
public: | |
static const bool value = false; | |
}; | |
template <class _A1, class _A2, class _A3> | |
class __promote_imp<_A1, _A2, _A3, true> | |
{ | |
private: | |
typedef typename __promote_imp<_A1>::type __type1; | |
typedef typename __promote_imp<_A2>::type __type2; | |
typedef typename __promote_imp<_A3>::type __type3; | |
public: | |
typedef decltype(__type1() + __type2() + __type3()) type; | |
static const bool value = true; | |
}; | |
template <class _A1, class _A2> | |
class __promote_imp<_A1, _A2, void, true> | |
{ | |
private: | |
typedef typename __promote_imp<_A1>::type __type1; | |
typedef typename __promote_imp<_A2>::type __type2; | |
public: | |
typedef decltype(__type1() + __type2()) type; | |
static const bool value = true; | |
}; | |
template <class _A1> | |
class __promote_imp<_A1, void, void, true> | |
{ | |
public: | |
typedef typename __numeric_type<_A1>::type type; | |
static const bool value = true; | |
}; | |
template <class _A1, class _A2 = void, class _A3 = void> | |
class __promote : public __promote_imp<_A1, _A2, _A3> {}; | |
typedef | |
__type_list<signed char, | |
__type_list<signed short, | |
__type_list<signed int, | |
__type_list<signed long, | |
__type_list<signed long long, | |
__type_list<__int128_t, | |
__nat | |
> | |
> > > > > __signed_types; | |
typedef | |
__type_list<unsigned char, | |
__type_list<unsigned short, | |
__type_list<unsigned int, | |
__type_list<unsigned long, | |
__type_list<unsigned long long, | |
__type_list<__uint128_t, | |
__nat | |
> | |
> > > > > __unsigned_types; | |
template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeList::_Head)> struct __find_first; | |
template <class _Hp, class _Tp, size_t _Size> | |
struct __find_first<__type_list<_Hp, _Tp>, _Size, true> | |
{ | |
typedef _Hp type; | |
}; | |
template <class _Hp, class _Tp, size_t _Size> | |
struct __find_first<__type_list<_Hp, _Tp>, _Size, false> | |
{ | |
typedef typename __find_first<_Tp, _Size>::type type; | |
}; | |
template <class _Tp, class _Up, bool = is_const<typename remove_reference<_Tp>::type>::value, | |
bool = is_volatile<typename remove_reference<_Tp>::type>::value> | |
struct __apply_cv | |
{ | |
typedef _Up type; | |
}; | |
template <class _Tp, class _Up> | |
struct __apply_cv<_Tp, _Up, true, false> | |
{ | |
typedef const _Up type; | |
}; | |
template <class _Tp, class _Up> | |
struct __apply_cv<_Tp, _Up, false, true> | |
{ | |
typedef volatile _Up type; | |
}; | |
template <class _Tp, class _Up> | |
struct __apply_cv<_Tp, _Up, true, true> | |
{ | |
typedef const volatile _Up type; | |
}; | |
template <class _Tp, class _Up> | |
struct __apply_cv<_Tp&, _Up, false, false> | |
{ | |
typedef _Up& type; | |
}; | |
template <class _Tp, class _Up> | |
struct __apply_cv<_Tp&, _Up, true, false> | |
{ | |
typedef const _Up& type; | |
}; | |
template <class _Tp, class _Up> | |
struct __apply_cv<_Tp&, _Up, false, true> | |
{ | |
typedef volatile _Up& type; | |
}; | |
template <class _Tp, class _Up> | |
struct __apply_cv<_Tp&, _Up, true, true> | |
{ | |
typedef const volatile _Up& type; | |
}; | |
template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value> | |
struct __make_signed {}; | |
template <class _Tp> | |
struct __make_signed<_Tp, true> | |
{ | |
typedef typename __find_first<__signed_types, sizeof(_Tp)>::type type; | |
}; | |
template <> struct __make_signed<bool, true> {}; | |
template <> struct __make_signed< signed short, true> {typedef short type;}; | |
template <> struct __make_signed<unsigned short, true> {typedef short type;}; | |
template <> struct __make_signed< signed int, true> {typedef int type;}; | |
template <> struct __make_signed<unsigned int, true> {typedef int type;}; | |
template <> struct __make_signed< signed long, true> {typedef long type;}; | |
template <> struct __make_signed<unsigned long, true> {typedef long type;}; | |
template <> struct __make_signed< signed long long, true> {typedef long long type;}; | |
template <> struct __make_signed<unsigned long long, true> {typedef long long type;}; | |
template <> struct __make_signed<__int128_t, true> {typedef __int128_t type;}; | |
template <> struct __make_signed<__uint128_t, true> {typedef __int128_t type;}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) make_signed | |
{ | |
typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type; | |
}; | |
template <class _Tp> using make_signed_t = typename make_signed<_Tp>::type; | |
template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value> | |
struct __make_unsigned {}; | |
template <class _Tp> | |
struct __make_unsigned<_Tp, true> | |
{ | |
typedef typename __find_first<__unsigned_types, sizeof(_Tp)>::type type; | |
}; | |
template <> struct __make_unsigned<bool, true> {}; | |
template <> struct __make_unsigned< signed short, true> {typedef unsigned short type;}; | |
template <> struct __make_unsigned<unsigned short, true> {typedef unsigned short type;}; | |
template <> struct __make_unsigned< signed int, true> {typedef unsigned int type;}; | |
template <> struct __make_unsigned<unsigned int, true> {typedef unsigned int type;}; | |
template <> struct __make_unsigned< signed long, true> {typedef unsigned long type;}; | |
template <> struct __make_unsigned<unsigned long, true> {typedef unsigned long type;}; | |
template <> struct __make_unsigned< signed long long, true> {typedef unsigned long long type;}; | |
template <> struct __make_unsigned<unsigned long long, true> {typedef unsigned long long type;}; | |
template <> struct __make_unsigned<__int128_t, true> {typedef __uint128_t type;}; | |
template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_t type;}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) make_unsigned | |
{ | |
typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type; | |
}; | |
template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type; | |
template <class _Tp, class _Up, class = void> | |
struct __common_type2_imp {}; | |
template <class _Tp, class _Up> | |
struct __common_type2_imp<_Tp, _Up, | |
typename __void_t<decltype( | |
true ? std::__1::declval<_Tp>() : std::__1::declval<_Up>() | |
)>::type> | |
{ | |
typedef typename decay<decltype( | |
true ? std::__1::declval<_Tp>() : std::__1::declval<_Up>() | |
)>::type type; | |
}; | |
template <class, class = void> | |
struct __common_type_impl {}; | |
template <class... Tp> | |
struct __common_types; | |
template <class... _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) common_type; | |
template <class _Tp, class _Up> | |
struct __common_type_impl< | |
__common_types<_Tp, _Up>, | |
typename __void_t<typename common_type<_Tp, _Up>::type>::type> | |
{ | |
typedef typename common_type<_Tp, _Up>::type type; | |
}; | |
template <class _Tp, class _Up, class _Vp , class... _Rest> | |
struct __common_type_impl< | |
__common_types<_Tp, _Up, _Vp , _Rest...>, | |
typename __void_t<typename common_type<_Tp, _Up>::type>::type> | |
: __common_type_impl<__common_types<typename common_type<_Tp, _Up>::type, | |
_Vp , _Rest...> > { | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) common_type<> {}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) common_type<_Tp> | |
: public common_type<_Tp, _Tp> {}; | |
template <class _Tp, class _Up> | |
struct __attribute__ ((__type_visibility__("default"))) common_type<_Tp, _Up> | |
: conditional< | |
_IsSame<_Tp, typename decay<_Tp>::type>::value && _IsSame<_Up, typename decay<_Up>::type>::value, | |
__common_type2_imp<_Tp, _Up>, | |
common_type<typename decay<_Tp>::type, typename decay<_Up>::type> | |
>::type | |
{}; | |
template <class _Tp, class _Up, class _Vp , class... _Rest> | |
struct __attribute__ ((__type_visibility__("default"))) | |
common_type<_Tp, _Up, _Vp , _Rest...> | |
: __common_type_impl< | |
__common_types<_Tp, _Up, _Vp , _Rest...> > {}; | |
template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type; | |
template<typename, typename _Tp> struct __select_2nd { typedef _Tp type; }; | |
template<class _Tp, class _Up> | |
struct __attribute__ ((__type_visibility__("default"))) is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> { }; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_copy_assignable | |
: public is_assignable<typename add_lvalue_reference<_Tp>::type, | |
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_move_assignable | |
: public is_assignable<typename add_lvalue_reference<_Tp>::type, | |
typename add_rvalue_reference<_Tp>::type> {}; | |
template <class> | |
struct __is_destructible_apply { typedef int type; }; | |
template <typename _Tp> | |
struct __is_destructor_wellformed { | |
template <typename _Tp1> | |
static char __test ( | |
typename __is_destructible_apply<decltype(std::__1::declval<_Tp1&>().~_Tp1())>::type | |
); | |
template <typename _Tp1> | |
static __two __test (...); | |
static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char); | |
}; | |
template <class _Tp, bool> | |
struct __destructible_imp; | |
template <class _Tp> | |
struct __destructible_imp<_Tp, false> | |
: public std::__1::integral_constant<bool, | |
__is_destructor_wellformed<typename std::__1::remove_all_extents<_Tp>::type>::value> {}; | |
template <class _Tp> | |
struct __destructible_imp<_Tp, true> | |
: public std::__1::true_type {}; | |
template <class _Tp, bool> | |
struct __destructible_false; | |
template <class _Tp> | |
struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, std::__1::is_reference<_Tp>::value> {}; | |
template <class _Tp> | |
struct __destructible_false<_Tp, true> : public std::__1::false_type {}; | |
template <class _Tp> | |
struct is_destructible | |
: public __destructible_false<_Tp, std::__1::is_function<_Tp>::value> {}; | |
template <class _Tp> | |
struct is_destructible<_Tp[]> | |
: public std::__1::false_type {}; | |
template <> | |
struct is_destructible<void> | |
: public std::__1::false_type {}; | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename remove_reference<_Tp>::type&& | |
move(_Tp&& __t) noexcept | |
{ | |
typedef typename remove_reference<_Tp>::type _Up; | |
return static_cast<_Up&&>(__t); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp&& | |
forward(typename remove_reference<_Tp>::type& __t) noexcept | |
{ | |
return static_cast<_Tp&&>(__t); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp&& | |
forward(typename remove_reference<_Tp>::type&& __t) noexcept | |
{ | |
static_assert(!is_lvalue_reference<_Tp>::value, | |
"can not forward an rvalue as an lvalue"); | |
return static_cast<_Tp&&>(__t); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename decay<_Tp>::type | |
__decay_copy(_Tp&& __t) | |
{ | |
return std::__1::forward<_Tp>(__t); | |
} | |
template <class _MP, bool _IsMemberFunctionPtr, bool _IsMemberObjectPtr> | |
struct __member_pointer_traits_imp | |
{ | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> | |
{ | |
typedef _Class _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...), true, false> | |
{ | |
typedef _Class _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false> | |
{ | |
typedef _Class const _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const, true, false> | |
{ | |
typedef _Class const _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false> | |
{ | |
typedef _Class volatile _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile, true, false> | |
{ | |
typedef _Class volatile _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false> | |
{ | |
typedef _Class const volatile _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile, true, false> | |
{ | |
typedef _Class const volatile _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false> | |
{ | |
typedef _Class& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &, true, false> | |
{ | |
typedef _Class& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false> | |
{ | |
typedef _Class const& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&, true, false> | |
{ | |
typedef _Class const& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false> | |
{ | |
typedef _Class volatile& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&, true, false> | |
{ | |
typedef _Class volatile& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false> | |
{ | |
typedef _Class const volatile& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&, true, false> | |
{ | |
typedef _Class const volatile& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false> | |
{ | |
typedef _Class&& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &&, true, false> | |
{ | |
typedef _Class&& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false> | |
{ | |
typedef _Class const&& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&&, true, false> | |
{ | |
typedef _Class const&& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false> | |
{ | |
typedef _Class volatile&& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&&, true, false> | |
{ | |
typedef _Class volatile&& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false> | |
{ | |
typedef _Class const volatile&& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param...); | |
}; | |
template <class _Rp, class _Class, class ..._Param> | |
struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&&, true, false> | |
{ | |
typedef _Class const volatile&& _ClassType; | |
typedef _Rp _ReturnType; | |
typedef _Rp (_FnType) (_Param..., ...); | |
}; | |
template <class _Rp, class _Class> | |
struct __member_pointer_traits_imp<_Rp _Class::*, false, true> | |
{ | |
typedef _Class _ClassType; | |
typedef _Rp _ReturnType; | |
}; | |
template <class _MP> | |
struct __member_pointer_traits | |
: public __member_pointer_traits_imp<typename remove_cv<_MP>::type, | |
is_member_function_pointer<_MP>::value, | |
is_member_object_pointer<_MP>::value> | |
{ | |
}; | |
template <class _DecayedFp> | |
struct __member_pointer_class_type {}; | |
template <class _Ret, class _ClassType> | |
struct __member_pointer_class_type<_Ret _ClassType::*> { | |
typedef _ClassType type; | |
}; | |
template <class _Tp, class ..._Args> | |
struct __attribute__ ((__type_visibility__("default"))) is_constructible | |
: public integral_constant<bool, __is_constructible(_Tp, _Args...)> | |
{}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_default_constructible | |
: public is_constructible<_Tp> | |
{}; | |
template <class _Tp> | |
void __test_implicit_default_constructible(_Tp); | |
template <class _Tp, class = void, bool = is_default_constructible<_Tp>::value> | |
struct __is_implicitly_default_constructible | |
: false_type | |
{ }; | |
template <class _Tp> | |
struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), true> | |
: true_type | |
{ }; | |
template <class _Tp> | |
struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), false> | |
: false_type | |
{ }; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_copy_constructible | |
: public is_constructible<_Tp, | |
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_move_constructible | |
: public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> | |
{}; | |
template <class _Tp, class... _Args> | |
struct __attribute__ ((__type_visibility__("default"))) is_trivially_constructible | |
: integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)> | |
{ | |
}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_trivially_default_constructible | |
: public is_trivially_constructible<_Tp> | |
{}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_trivially_copy_constructible | |
: public is_trivially_constructible<_Tp, typename add_lvalue_reference<const _Tp>::type> | |
{}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_trivially_move_constructible | |
: public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> | |
{}; | |
template <class _Tp, class _Arg> | |
struct is_trivially_assignable | |
: integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)> | |
{ | |
}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_trivially_copy_assignable | |
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type, | |
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_trivially_move_assignable | |
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type, | |
typename add_rvalue_reference<_Tp>::type> | |
{}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_trivially_destructible | |
: public integral_constant<bool, __is_trivially_destructible(_Tp)> {}; | |
template <class _Tp, class... _Args> | |
struct __attribute__ ((__type_visibility__("default"))) is_nothrow_constructible | |
: public integral_constant<bool, __is_nothrow_constructible(_Tp, _Args...)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_nothrow_default_constructible | |
: public is_nothrow_constructible<_Tp> | |
{}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_nothrow_copy_constructible | |
: public is_nothrow_constructible<_Tp, | |
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_nothrow_move_constructible | |
: public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> | |
{}; | |
template <class _Tp, class _Arg> | |
struct __attribute__ ((__type_visibility__("default"))) is_nothrow_assignable | |
: public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_nothrow_copy_assignable | |
: public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type, | |
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_nothrow_move_assignable | |
: public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type, | |
typename add_rvalue_reference<_Tp>::type> | |
{}; | |
template <bool, class _Tp> struct __libcpp_is_nothrow_destructible; | |
template <class _Tp> | |
struct __libcpp_is_nothrow_destructible<false, _Tp> | |
: public false_type | |
{ | |
}; | |
template <class _Tp> | |
struct __libcpp_is_nothrow_destructible<true, _Tp> | |
: public integral_constant<bool, noexcept(std::__1::declval<_Tp>().~_Tp()) > | |
{ | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_nothrow_destructible | |
: public __libcpp_is_nothrow_destructible<is_destructible<_Tp>::value, _Tp> | |
{ | |
}; | |
template <class _Tp, size_t _Ns> | |
struct __attribute__ ((__type_visibility__("default"))) is_nothrow_destructible<_Tp[_Ns]> | |
: public is_nothrow_destructible<_Tp> | |
{ | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_nothrow_destructible<_Tp&> | |
: public true_type | |
{ | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) is_nothrow_destructible<_Tp&&> | |
: public true_type | |
{ | |
}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_pod | |
: public integral_constant<bool, __is_pod(_Tp)> {}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_literal_type | |
: public integral_constant<bool, __is_literal_type(_Tp)> | |
{}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_standard_layout | |
: public integral_constant<bool, __is_standard_layout(_Tp)> | |
{}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_trivially_copyable | |
: public integral_constant<bool, __is_trivially_copyable(_Tp)> | |
{}; | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_trivial | |
: public integral_constant<bool, __is_trivial(_Tp)> | |
{}; | |
template <class _Tp> struct __is_reference_wrapper_impl : public false_type {}; | |
template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {}; | |
template <class _Tp> struct __is_reference_wrapper | |
: public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {}; | |
template <class _Fp, class _A0, | |
class _DecayFp = typename decay<_Fp>::type, | |
class _DecayA0 = typename decay<_A0>::type, | |
class _ClassT = typename __member_pointer_class_type<_DecayFp>::type> | |
using __enable_if_bullet1 = typename enable_if | |
< | |
is_member_function_pointer<_DecayFp>::value | |
&& is_base_of<_ClassT, _DecayA0>::value | |
>::type; | |
template <class _Fp, class _A0, | |
class _DecayFp = typename decay<_Fp>::type, | |
class _DecayA0 = typename decay<_A0>::type> | |
using __enable_if_bullet2 = typename enable_if | |
< | |
is_member_function_pointer<_DecayFp>::value | |
&& __is_reference_wrapper<_DecayA0>::value | |
>::type; | |
template <class _Fp, class _A0, | |
class _DecayFp = typename decay<_Fp>::type, | |
class _DecayA0 = typename decay<_A0>::type, | |
class _ClassT = typename __member_pointer_class_type<_DecayFp>::type> | |
using __enable_if_bullet3 = typename enable_if | |
< | |
is_member_function_pointer<_DecayFp>::value | |
&& !is_base_of<_ClassT, _DecayA0>::value | |
&& !__is_reference_wrapper<_DecayA0>::value | |
>::type; | |
template <class _Fp, class _A0, | |
class _DecayFp = typename decay<_Fp>::type, | |
class _DecayA0 = typename decay<_A0>::type, | |
class _ClassT = typename __member_pointer_class_type<_DecayFp>::type> | |
using __enable_if_bullet4 = typename enable_if | |
< | |
is_member_object_pointer<_DecayFp>::value | |
&& is_base_of<_ClassT, _DecayA0>::value | |
>::type; | |
template <class _Fp, class _A0, | |
class _DecayFp = typename decay<_Fp>::type, | |
class _DecayA0 = typename decay<_A0>::type> | |
using __enable_if_bullet5 = typename enable_if | |
< | |
is_member_object_pointer<_DecayFp>::value | |
&& __is_reference_wrapper<_DecayA0>::value | |
>::type; | |
template <class _Fp, class _A0, | |
class _DecayFp = typename decay<_Fp>::type, | |
class _DecayA0 = typename decay<_A0>::type, | |
class _ClassT = typename __member_pointer_class_type<_DecayFp>::type> | |
using __enable_if_bullet6 = typename enable_if | |
< | |
is_member_object_pointer<_DecayFp>::value | |
&& !is_base_of<_ClassT, _DecayA0>::value | |
&& !__is_reference_wrapper<_DecayA0>::value | |
>::type; | |
template <class ..._Args> | |
auto __invoke(__any, _Args&& ...__args) -> __nat; | |
template <class ..._Args> | |
auto __invoke_constexpr(__any, _Args&& ...__args) -> __nat; | |
template <class _Fp, class _A0, class ..._Args, | |
class = __enable_if_bullet1<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) | |
noexcept(noexcept((std::__1::forward<_A0>(__a0).*__f)(std::__1::forward<_Args>(__args)...))) -> decltype((std::__1::forward<_A0>(__a0).*__f)(std::__1::forward<_Args>(__args)...)) { return (std::__1::forward<_A0>(__a0).*__f)(std::__1::forward<_Args>(__args)...); } | |
template <class _Fp, class _A0, class ..._Args, | |
class = __enable_if_bullet1<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr auto | |
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args) | |
noexcept(noexcept((std::__1::forward<_A0>(__a0).*__f)(std::__1::forward<_Args>(__args)...))) -> decltype((std::__1::forward<_A0>(__a0).*__f)(std::__1::forward<_Args>(__args)...)) { return (std::__1::forward<_A0>(__a0).*__f)(std::__1::forward<_Args>(__args)...); } | |
template <class _Fp, class _A0, class ..._Args, | |
class = __enable_if_bullet2<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) | |
noexcept(noexcept((__a0.get().*__f)(std::__1::forward<_Args>(__args)...))) -> decltype((__a0.get().*__f)(std::__1::forward<_Args>(__args)...)) { return (__a0.get().*__f)(std::__1::forward<_Args>(__args)...); } | |
template <class _Fp, class _A0, class ..._Args, | |
class = __enable_if_bullet2<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr auto | |
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args) | |
noexcept(noexcept((__a0.get().*__f)(std::__1::forward<_Args>(__args)...))) -> decltype((__a0.get().*__f)(std::__1::forward<_Args>(__args)...)) { return (__a0.get().*__f)(std::__1::forward<_Args>(__args)...); } | |
template <class _Fp, class _A0, class ..._Args, | |
class = __enable_if_bullet3<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) | |
noexcept(noexcept(((*std::__1::forward<_A0>(__a0)).*__f)(std::__1::forward<_Args>(__args)...))) -> decltype(((*std::__1::forward<_A0>(__a0)).*__f)(std::__1::forward<_Args>(__args)...)) { return ((*std::__1::forward<_A0>(__a0)).*__f)(std::__1::forward<_Args>(__args)...); } | |
template <class _Fp, class _A0, class ..._Args, | |
class = __enable_if_bullet3<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr auto | |
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args) | |
noexcept(noexcept(((*std::__1::forward<_A0>(__a0)).*__f)(std::__1::forward<_Args>(__args)...))) -> decltype(((*std::__1::forward<_A0>(__a0)).*__f)(std::__1::forward<_Args>(__args)...)) { return ((*std::__1::forward<_A0>(__a0)).*__f)(std::__1::forward<_Args>(__args)...); } | |
template <class _Fp, class _A0, | |
class = __enable_if_bullet4<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
__invoke(_Fp&& __f, _A0&& __a0) | |
noexcept(noexcept(std::__1::forward<_A0>(__a0).*__f)) -> decltype(std::__1::forward<_A0>(__a0).*__f) { return std::__1::forward<_A0>(__a0).*__f; } | |
template <class _Fp, class _A0, | |
class = __enable_if_bullet4<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr auto | |
__invoke_constexpr(_Fp&& __f, _A0&& __a0) | |
noexcept(noexcept(std::__1::forward<_A0>(__a0).*__f)) -> decltype(std::__1::forward<_A0>(__a0).*__f) { return std::__1::forward<_A0>(__a0).*__f; } | |
template <class _Fp, class _A0, | |
class = __enable_if_bullet5<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
__invoke(_Fp&& __f, _A0&& __a0) | |
noexcept(noexcept(__a0.get().*__f)) -> decltype(__a0.get().*__f) { return __a0.get().*__f; } | |
template <class _Fp, class _A0, | |
class = __enable_if_bullet5<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr auto | |
__invoke_constexpr(_Fp&& __f, _A0&& __a0) | |
noexcept(noexcept(__a0.get().*__f)) -> decltype(__a0.get().*__f) { return __a0.get().*__f; } | |
template <class _Fp, class _A0, | |
class = __enable_if_bullet6<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
__invoke(_Fp&& __f, _A0&& __a0) | |
noexcept(noexcept((*std::__1::forward<_A0>(__a0)).*__f)) -> decltype((*std::__1::forward<_A0>(__a0)).*__f) { return (*std::__1::forward<_A0>(__a0)).*__f; } | |
template <class _Fp, class _A0, | |
class = __enable_if_bullet6<_Fp, _A0>> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr auto | |
__invoke_constexpr(_Fp&& __f, _A0&& __a0) | |
noexcept(noexcept((*std::__1::forward<_A0>(__a0)).*__f)) -> decltype((*std::__1::forward<_A0>(__a0)).*__f) { return (*std::__1::forward<_A0>(__a0)).*__f; } | |
template <class _Fp, class ..._Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
__invoke(_Fp&& __f, _Args&& ...__args) | |
noexcept(noexcept(std::__1::forward<_Fp>(__f)(std::__1::forward<_Args>(__args)...))) -> decltype(std::__1::forward<_Fp>(__f)(std::__1::forward<_Args>(__args)...)) { return std::__1::forward<_Fp>(__f)(std::__1::forward<_Args>(__args)...); } | |
template <class _Fp, class ..._Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr auto | |
__invoke_constexpr(_Fp&& __f, _Args&& ...__args) | |
noexcept(noexcept(std::__1::forward<_Fp>(__f)(std::__1::forward<_Args>(__args)...))) -> decltype(std::__1::forward<_Fp>(__f)(std::__1::forward<_Args>(__args)...)) { return std::__1::forward<_Fp>(__f)(std::__1::forward<_Args>(__args)...); } | |
template <class _Ret, class _Fp, class ..._Args> | |
struct __invokable_r | |
{ | |
template <class _XFp, class ..._XArgs> | |
static auto __try_call(int) -> decltype( | |
std::__1::__invoke(std::__1::declval<_XFp>(), std::__1::declval<_XArgs>()...)); | |
template <class _XFp, class ..._XArgs> | |
static __nat __try_call(...); | |
using _Result = decltype(__try_call<_Fp, _Args...>(0)); | |
using type = | |
typename conditional< | |
_IsNotSame<_Result, __nat>::value, | |
typename conditional< | |
is_void<_Ret>::value, | |
true_type, | |
is_convertible<_Result, _Ret> | |
>::type, | |
false_type | |
>::type; | |
static const bool value = type::value; | |
}; | |
template <class _Fp, class ..._Args> | |
using __invokable = __invokable_r<void, _Fp, _Args...>; | |
template <bool _IsInvokable, bool _IsCVVoid, class _Ret, class _Fp, class ..._Args> | |
struct __nothrow_invokable_r_imp { | |
static const bool value = false; | |
}; | |
template <class _Ret, class _Fp, class ..._Args> | |
struct __nothrow_invokable_r_imp<true, false, _Ret, _Fp, _Args...> | |
{ | |
typedef __nothrow_invokable_r_imp _ThisT; | |
template <class _Tp> | |
static void __test_noexcept(_Tp) noexcept; | |
static const bool value = noexcept(_ThisT::__test_noexcept<_Ret>( | |
std::__1::__invoke(std::__1::declval<_Fp>(), std::__1::declval<_Args>()...))); | |
}; | |
template <class _Ret, class _Fp, class ..._Args> | |
struct __nothrow_invokable_r_imp<true, true, _Ret, _Fp, _Args...> | |
{ | |
static const bool value = noexcept( | |
std::__1::__invoke(std::__1::declval<_Fp>(), std::__1::declval<_Args>()...)); | |
}; | |
template <class _Ret, class _Fp, class ..._Args> | |
using __nothrow_invokable_r = | |
__nothrow_invokable_r_imp< | |
__invokable_r<_Ret, _Fp, _Args...>::value, | |
is_void<_Ret>::value, | |
_Ret, _Fp, _Args... | |
>; | |
template <class _Fp, class ..._Args> | |
using __nothrow_invokable = | |
__nothrow_invokable_r_imp< | |
__invokable<_Fp, _Args...>::value, | |
true, void, _Fp, _Args... | |
>; | |
template <class _Fp, class ..._Args> | |
struct __invoke_of | |
: public enable_if< | |
__invokable<_Fp, _Args...>::value, | |
typename __invokable_r<void, _Fp, _Args...>::_Result> | |
{ | |
}; | |
template <class _Callable> class result_of; | |
template <class _Fp, class ..._Args> | |
class __attribute__ ((__type_visibility__("default"))) result_of<_Fp(_Args...)> | |
: public __invoke_of<_Fp, _Args...> | |
{ | |
}; | |
template <class _Tp> using result_of_t = typename result_of<_Tp>::type; | |
template <class _Tp> struct __is_swappable; | |
template <class _Tp> struct __is_nothrow_swappable; | |
template <class _ForwardIterator1, class _ForwardIterator2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator2 | |
swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2); | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_move_constructible<_Tp>::value && | |
is_move_assignable<_Tp>::value | |
>::type | |
swap(_Tp& __x, _Tp& __y) noexcept(is_nothrow_move_constructible<_Tp>::value && is_nothrow_move_assignable<_Tp>::value) | |
{ | |
_Tp __t(std::__1::move(__x)); | |
__x = std::__1::move(__y); | |
__y = std::__1::move(__t); | |
} | |
template<class _Tp, size_t _Np> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if< | |
__is_swappable<_Tp>::value | |
>::type | |
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) noexcept(__is_nothrow_swappable<_Tp>::value) | |
{ | |
std::__1::swap_ranges(__a, __a + _Np, __b); | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator2 | |
swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) | |
{ | |
for(; __first1 != __last1; ++__first1, (void) ++__first2) | |
swap(*__first1, *__first2); | |
return __first2; | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) | |
noexcept(noexcept(swap(*std::__1::declval<_ForwardIterator1>(), *std::__1::declval<_ForwardIterator2>()))) | |
{ | |
swap(*__a, *__b); | |
} | |
namespace __detail | |
{ | |
template <class _Tp, class _Up = _Tp, | |
bool _NotVoid = !is_void<_Tp>::value && !is_void<_Up>::value> | |
struct __swappable_with | |
{ | |
template <class _LHS, class _RHS> | |
static decltype(swap(std::__1::declval<_LHS>(), std::__1::declval<_RHS>())) | |
__test_swap(int); | |
template <class, class> | |
static __nat __test_swap(long); | |
typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1; | |
typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2; | |
static const bool value = _IsNotSame<__swap1, __nat>::value | |
&& _IsNotSame<__swap2, __nat>::value; | |
}; | |
template <class _Tp, class _Up> | |
struct __swappable_with<_Tp, _Up, false> : false_type {}; | |
template <class _Tp, class _Up = _Tp, bool _Swappable = __swappable_with<_Tp, _Up>::value> | |
struct __nothrow_swappable_with { | |
static const bool value = | |
noexcept(swap(std::__1::declval<_Tp>(), std::__1::declval<_Up>())) | |
&& noexcept(swap(std::__1::declval<_Up>(), std::__1::declval<_Tp>())); | |
}; | |
template <class _Tp, class _Up> | |
struct __nothrow_swappable_with<_Tp, _Up, false> : false_type {}; | |
} | |
template <class _Tp> | |
struct __is_swappable | |
: public integral_constant<bool, __detail::__swappable_with<_Tp&>::value> | |
{ | |
}; | |
template <class _Tp> | |
struct __is_nothrow_swappable | |
: public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp&>::value> | |
{ | |
}; | |
template <class _Tp, bool = is_enum<_Tp>::value> struct __underlying_type_impl; | |
template <class _Tp> | |
struct __underlying_type_impl<_Tp, false> {}; | |
template <class _Tp> | |
struct __underlying_type_impl<_Tp, true> | |
{ | |
typedef __underlying_type(_Tp) type; | |
}; | |
template <class _Tp> | |
struct underlying_type : __underlying_type_impl<_Tp, is_enum<_Tp>::value> {}; | |
template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type; | |
template <class _Tp, bool = is_enum<_Tp>::value> | |
struct __sfinae_underlying_type | |
{ | |
typedef typename underlying_type<_Tp>::type type; | |
typedef decltype(((type)1) + 0) __promoted_type; | |
}; | |
template <class _Tp> | |
struct __sfinae_underlying_type<_Tp, false> {}; | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __convert_to_integral(int __val) { return __val; } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
unsigned __convert_to_integral(unsigned __val) { return __val; } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
long __convert_to_integral(long __val) { return __val; } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
unsigned long __convert_to_integral(unsigned long __val) { return __val; } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
long long __convert_to_integral(long long __val) { return __val; } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
unsigned long long __convert_to_integral(unsigned long long __val) {return __val; } | |
template<typename _Fp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename enable_if<is_floating_point<_Fp>::value, long long>::type | |
__convert_to_integral(_Fp __val) { return __val; } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__int128_t __convert_to_integral(__int128_t __val) { return __val; } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__uint128_t __convert_to_integral(__uint128_t __val) { return __val; } | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename __sfinae_underlying_type<_Tp>::__promoted_type | |
__convert_to_integral(_Tp __val) { return __val; } | |
template <class _Tp> | |
struct __has_operator_addressof_member_imp | |
{ | |
template <class _Up> | |
static auto __test(int) | |
-> typename __select_2nd<decltype(std::__1::declval<_Up>().operator&()), true_type>::type; | |
template <class> | |
static auto __test(long) -> false_type; | |
static const bool value = decltype(__test<_Tp>(0))::value; | |
}; | |
template <class _Tp> | |
struct __has_operator_addressof_free_imp | |
{ | |
template <class _Up> | |
static auto __test(int) | |
-> typename __select_2nd<decltype(operator&(std::__1::declval<_Up>())), true_type>::type; | |
template <class> | |
static auto __test(long) -> false_type; | |
static const bool value = decltype(__test<_Tp>(0))::value; | |
}; | |
template <class _Tp> | |
struct __has_operator_addressof | |
: public integral_constant<bool, __has_operator_addressof_member_imp<_Tp>::value | |
|| __has_operator_addressof_free_imp<_Tp>::value> | |
{}; | |
struct __extract_key_fail_tag {}; | |
struct __extract_key_self_tag {}; | |
struct __extract_key_first_tag {}; | |
template <class _ValTy, class _Key, | |
class _RawValTy = typename __unconstref<_ValTy>::type> | |
struct __can_extract_key | |
: conditional<_IsSame<_RawValTy, _Key>::value, __extract_key_self_tag, | |
__extract_key_fail_tag>::type {}; | |
template <class _Pair, class _Key, class _First, class _Second> | |
struct __can_extract_key<_Pair, _Key, pair<_First, _Second> > | |
: conditional<_IsSame<typename remove_const<_First>::type, _Key>::value, | |
__extract_key_first_tag, __extract_key_fail_tag>::type {}; | |
template <class _ValTy, class _Key, class _ContainerValueTy, | |
class _RawValTy = typename __unconstref<_ValTy>::type> | |
struct __can_extract_map_key | |
: integral_constant<bool, _IsSame<_RawValTy, _Key>::value> {}; | |
template <class _ValTy, class _Key, class _RawValTy> | |
struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy> | |
: false_type {}; | |
inline constexpr | |
bool __libcpp_is_constant_evaluated() noexcept { return __builtin_is_constant_evaluated(); } | |
template <class _CharT> | |
using _IsCharLikeType = _And<is_standard_layout<_CharT>, is_trivial<_CharT> >; | |
} } | |
typedef __darwin_mbstate_t mbstate_t; | |
typedef __darwin_ct_rune_t ct_rune_t; | |
typedef __darwin_rune_t rune_t; | |
typedef __builtin_va_list va_list; | |
typedef __builtin_va_list __gnuc_va_list; | |
typedef __darwin_clock_t clock_t; | |
typedef __darwin_time_t time_t; | |
struct timespec | |
{ | |
__darwin_time_t tv_sec; | |
long tv_nsec; | |
}; | |
struct tm { | |
int tm_sec; | |
int tm_min; | |
int tm_hour; | |
int tm_mday; | |
int tm_mon; | |
int tm_year; | |
int tm_wday; | |
int tm_yday; | |
int tm_isdst; | |
long tm_gmtoff; | |
char *tm_zone; | |
}; | |
extern char *tzname[]; | |
extern int getdate_err; | |
extern long timezone __asm("_" "timezone" ); | |
extern int daylight; | |
extern "C" { | |
char *asctime(const struct tm *); | |
clock_t clock(void) __asm("_" "clock" ); | |
char *ctime(const time_t *); | |
double difftime(time_t, time_t); | |
struct tm *getdate(const char *); | |
struct tm *gmtime(const time_t *); | |
struct tm *localtime(const time_t *); | |
time_t mktime(struct tm *) __asm("_" "mktime" ); | |
size_t strftime(char * , size_t, const char * , const struct tm * ) __asm("_" "strftime" ); | |
char *strptime(const char * , const char * , struct tm * ) __asm("_" "strptime" ); | |
time_t time(time_t *); | |
void tzset(void); | |
char *asctime_r(const struct tm * , char * ); | |
char *ctime_r(const time_t *, char *); | |
struct tm *gmtime_r(const time_t * , struct tm * ); | |
struct tm *localtime_r(const time_t * , struct tm * ); | |
time_t posix2time(time_t); | |
void tzsetwall(void); | |
time_t time2posix(time_t); | |
time_t timelocal(struct tm * const); | |
time_t timegm(struct tm * const); | |
int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __asm("_" "nanosleep" ); | |
typedef enum { | |
_CLOCK_REALTIME __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 0, | |
_CLOCK_MONOTONIC __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 6, | |
_CLOCK_MONOTONIC_RAW __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 4, | |
_CLOCK_MONOTONIC_RAW_APPROX __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 5, | |
_CLOCK_UPTIME_RAW __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 8, | |
_CLOCK_UPTIME_RAW_APPROX __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 9, | |
_CLOCK_PROCESS_CPUTIME_ID __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 12, | |
_CLOCK_THREAD_CPUTIME_ID __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 16 | |
} clockid_t; | |
__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) | |
int clock_getres(clockid_t __clock_id, struct timespec *__res); | |
__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) | |
int clock_gettime(clockid_t __clock_id, struct timespec *__tp); | |
__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) | |
__uint64_t clock_gettime_nsec_np(clockid_t __clock_id); | |
__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,unavailable))) | |
__attribute__((availability(tvos,unavailable))) __attribute__((availability(watchos,unavailable))) | |
int clock_settime(clockid_t __clock_id, const struct timespec *__tp); | |
__attribute__((availability(macosx,introduced=10.15))) __attribute__((availability(ios,introduced=13.0))) __attribute__((availability(tvos,introduced=13.0))) __attribute__((availability(watchos,introduced=6.0))) | |
int timespec_get(struct timespec *ts, int base); | |
} | |
typedef __darwin_wint_t wint_t; | |
typedef __darwin_wctype_t wctype_t; | |
typedef struct { | |
__darwin_rune_t __min; | |
__darwin_rune_t __max; | |
__darwin_rune_t __map; | |
__uint32_t *__types; | |
} _RuneEntry; | |
typedef struct { | |
int __nranges; | |
_RuneEntry *__ranges; | |
} _RuneRange; | |
typedef struct { | |
char __name[14]; | |
__uint32_t __mask; | |
} _RuneCharClass; | |
typedef struct { | |
char __magic[8]; | |
char __encoding[32]; | |
__darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **); | |
int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **); | |
__darwin_rune_t __invalid_rune; | |
__uint32_t __runetype[(1 <<8 )]; | |
__darwin_rune_t __maplower[(1 <<8 )]; | |
__darwin_rune_t __mapupper[(1 <<8 )]; | |
_RuneRange __runetype_ext; | |
_RuneRange __maplower_ext; | |
_RuneRange __mapupper_ext; | |
void *__variable; | |
int __variable_len; | |
int __ncharclasses; | |
_RuneCharClass *__charclasses; | |
} _RuneLocale; | |
extern "C" { | |
extern _RuneLocale _DefaultRuneLocale; | |
extern _RuneLocale *_CurrentRuneLocale; | |
} | |
extern "C" { | |
unsigned long ___runetype(__darwin_ct_rune_t); | |
__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t); | |
__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t); | |
} | |
inline int | |
isascii(int _c) | |
{ | |
return ((_c & ~0x7F) == 0); | |
} | |
extern "C" { | |
int __maskrune(__darwin_ct_rune_t, unsigned long); | |
} | |
inline int | |
__istype(__darwin_ct_rune_t _c, unsigned long _f) | |
{ | |
return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f) | |
: !!__maskrune(_c, _f)); | |
} | |
inline __darwin_ct_rune_t | |
__isctype(__darwin_ct_rune_t _c, unsigned long _f) | |
{ | |
return (_c < 0 || _c >= (1 <<8 )) ? 0 : | |
!!(_DefaultRuneLocale.__runetype[_c] & _f); | |
} | |
extern "C" { | |
__darwin_ct_rune_t __toupper(__darwin_ct_rune_t); | |
__darwin_ct_rune_t __tolower(__darwin_ct_rune_t); | |
} | |
inline int | |
__wcwidth(__darwin_ct_rune_t _c) | |
{ | |
unsigned int _x; | |
if (_c == 0) | |
return (0); | |
_x = (unsigned int)__maskrune(_c, 0xe0000000L|0x00040000L); | |
if ((_x & 0xe0000000L) != 0) | |
return ((_x & 0xe0000000L) >> 30); | |
return ((_x & 0x00040000L) != 0 ? 1 : -1); | |
} | |
inline int | |
isalnum(int _c) | |
{ | |
return (__istype(_c, 0x00000100L|0x00000400L)); | |
} | |
inline int | |
isalpha(int _c) | |
{ | |
return (__istype(_c, 0x00000100L)); | |
} | |
inline int | |
isblank(int _c) | |
{ | |
return (__istype(_c, 0x00020000L)); | |
} | |
inline int | |
iscntrl(int _c) | |
{ | |
return (__istype(_c, 0x00000200L)); | |
} | |
inline int | |
isdigit(int _c) | |
{ | |
return (__isctype(_c, 0x00000400L)); | |
} | |
inline int | |
isgraph(int _c) | |
{ | |
return (__istype(_c, 0x00000800L)); | |
} | |
inline int | |
islower(int _c) | |
{ | |
return (__istype(_c, 0x00001000L)); | |
} | |
inline int | |
isprint(int _c) | |
{ | |
return (__istype(_c, 0x00040000L)); | |
} | |
inline int | |
ispunct(int _c) | |
{ | |
return (__istype(_c, 0x00002000L)); | |
} | |
inline int | |
isspace(int _c) | |
{ | |
return (__istype(_c, 0x00004000L)); | |
} | |
inline int | |
isupper(int _c) | |
{ | |
return (__istype(_c, 0x00008000L)); | |
} | |
inline int | |
isxdigit(int _c) | |
{ | |
return (__isctype(_c, 0x00010000L)); | |
} | |
inline int | |
toascii(int _c) | |
{ | |
return (_c & 0x7F); | |
} | |
inline int | |
tolower(int _c) | |
{ | |
return (__tolower(_c)); | |
} | |
inline int | |
toupper(int _c) | |
{ | |
return (__toupper(_c)); | |
} | |
inline int | |
digittoint(int _c) | |
{ | |
return (__maskrune(_c, 0x0F)); | |
} | |
inline int | |
ishexnumber(int _c) | |
{ | |
return (__istype(_c, 0x00010000L)); | |
} | |
inline int | |
isideogram(int _c) | |
{ | |
return (__istype(_c, 0x00080000L)); | |
} | |
inline int | |
isnumber(int _c) | |
{ | |
return (__istype(_c, 0x00000400L)); | |
} | |
inline int | |
isphonogram(int _c) | |
{ | |
return (__istype(_c, 0x00200000L)); | |
} | |
inline int | |
isrune(int _c) | |
{ | |
return (__istype(_c, 0xFFFFFFF0L)); | |
} | |
inline int | |
isspecial(int _c) | |
{ | |
return (__istype(_c, 0x00100000L)); | |
} | |
inline int | |
iswalnum(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00000100L|0x00000400L)); | |
} | |
inline int | |
iswalpha(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00000100L)); | |
} | |
inline int | |
iswcntrl(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00000200L)); | |
} | |
inline int | |
iswctype(wint_t _wc, wctype_t _charclass) | |
{ | |
return (__istype(_wc, _charclass)); | |
} | |
inline int | |
iswdigit(wint_t _wc) | |
{ | |
return (__isctype(_wc, 0x00000400L)); | |
} | |
inline int | |
iswgraph(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00000800L)); | |
} | |
inline int | |
iswlower(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00001000L)); | |
} | |
inline int | |
iswprint(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00040000L)); | |
} | |
inline int | |
iswpunct(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00002000L)); | |
} | |
inline int | |
iswspace(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00004000L)); | |
} | |
inline int | |
iswupper(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00008000L)); | |
} | |
inline int | |
iswxdigit(wint_t _wc) | |
{ | |
return (__isctype(_wc, 0x00010000L)); | |
} | |
inline wint_t | |
towlower(wint_t _wc) | |
{ | |
return (__tolower(_wc)); | |
} | |
inline wint_t | |
towupper(wint_t _wc) | |
{ | |
return (__toupper(_wc)); | |
} | |
extern "C" { | |
wctype_t | |
wctype(const char *); | |
} | |
extern "C" { | |
wint_t btowc(int); | |
wint_t fgetwc(FILE *); | |
wchar_t *fgetws(wchar_t * , int, FILE * ); | |
wint_t fputwc(wchar_t, FILE *); | |
int fputws(const wchar_t * , FILE * ); | |
int fwide(FILE *, int); | |
int fwprintf(FILE * , const wchar_t * , ...); | |
int fwscanf(FILE * , const wchar_t * , ...); | |
wint_t getwc(FILE *); | |
wint_t getwchar(void); | |
size_t mbrlen(const char * , size_t, mbstate_t * ); | |
size_t mbrtowc(wchar_t * , const char * , size_t, | |
mbstate_t * ); | |
int mbsinit(const mbstate_t *); | |
size_t mbsrtowcs(wchar_t * , const char ** , size_t, | |
mbstate_t * ); | |
wint_t putwc(wchar_t, FILE *); | |
wint_t putwchar(wchar_t); | |
int swprintf(wchar_t * , size_t, const wchar_t * , ...); | |
int swscanf(const wchar_t * , const wchar_t * , ...); | |
wint_t ungetwc(wint_t, FILE *); | |
int vfwprintf(FILE * , const wchar_t * , | |
__darwin_va_list); | |
int vswprintf(wchar_t * , size_t, const wchar_t * , | |
__darwin_va_list); | |
int vwprintf(const wchar_t * , __darwin_va_list); | |
size_t wcrtomb(char * , wchar_t, mbstate_t * ); | |
wchar_t *wcscat(wchar_t * , const wchar_t * ); | |
wchar_t *wcschr(const wchar_t *, wchar_t); | |
int wcscmp(const wchar_t *, const wchar_t *); | |
int wcscoll(const wchar_t *, const wchar_t *); | |
wchar_t *wcscpy(wchar_t * , const wchar_t * ); | |
size_t wcscspn(const wchar_t *, const wchar_t *); | |
size_t wcsftime(wchar_t * , size_t, const wchar_t * , | |
const struct tm * ) __asm("_" "wcsftime" ); | |
size_t wcslen(const wchar_t *); | |
wchar_t *wcsncat(wchar_t * , const wchar_t * , size_t); | |
int wcsncmp(const wchar_t *, const wchar_t *, size_t); | |
wchar_t *wcsncpy(wchar_t * , const wchar_t * , size_t); | |
wchar_t *wcspbrk(const wchar_t *, const wchar_t *); | |
wchar_t *wcsrchr(const wchar_t *, wchar_t); | |
size_t wcsrtombs(char * , const wchar_t ** , size_t, | |
mbstate_t * ); | |
size_t wcsspn(const wchar_t *, const wchar_t *); | |
wchar_t *wcsstr(const wchar_t * , const wchar_t * ); | |
size_t wcsxfrm(wchar_t * , const wchar_t * , size_t); | |
int wctob(wint_t); | |
double wcstod(const wchar_t * , wchar_t ** ); | |
wchar_t *wcstok(wchar_t * , const wchar_t * , | |
wchar_t ** ); | |
long wcstol(const wchar_t * , wchar_t ** , int); | |
unsigned long | |
wcstoul(const wchar_t * , wchar_t ** , int); | |
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); | |
int wmemcmp(const wchar_t *, const wchar_t *, size_t); | |
wchar_t *wmemcpy(wchar_t * , const wchar_t * , size_t); | |
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); | |
wchar_t *wmemset(wchar_t *, wchar_t, size_t); | |
int wprintf(const wchar_t * , ...); | |
int wscanf(const wchar_t * , ...); | |
int wcswidth(const wchar_t *, size_t); | |
int wcwidth(wchar_t); | |
} | |
extern "C" { | |
int vfwscanf(FILE * , const wchar_t * , | |
__darwin_va_list); | |
int vswscanf(const wchar_t * , const wchar_t * , | |
__darwin_va_list); | |
int vwscanf(const wchar_t * , __darwin_va_list); | |
float wcstof(const wchar_t * , wchar_t ** ); | |
long double | |
wcstold(const wchar_t * , wchar_t ** ); | |
long long | |
wcstoll(const wchar_t * , wchar_t ** , int); | |
unsigned long long | |
wcstoull(const wchar_t * , wchar_t ** , int); | |
} | |
extern "C" { | |
size_t mbsnrtowcs(wchar_t * , const char ** , size_t, | |
size_t, mbstate_t * ); | |
wchar_t *wcpcpy(wchar_t * , const wchar_t * ) __attribute__((availability(macosx,introduced=10.7))); | |
wchar_t *wcpncpy(wchar_t * , const wchar_t * , size_t) __attribute__((availability(macosx,introduced=10.7))); | |
wchar_t *wcsdup(const wchar_t *) __attribute__((availability(macosx,introduced=10.7))); | |
int wcscasecmp(const wchar_t *, const wchar_t *) __attribute__((availability(macosx,introduced=10.7))); | |
int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) __attribute__((availability(macosx,introduced=10.7))); | |
size_t wcsnlen(const wchar_t *, size_t) __attribute__((availability(macosx,introduced=10.7))); | |
size_t wcsnrtombs(char * , const wchar_t ** , size_t, | |
size_t, mbstate_t * ); | |
FILE *open_wmemstream(wchar_t ** __bufp, size_t * __sizep) __attribute__((availability(macos,introduced=10.13))) __attribute__((availability(ios,introduced=11.0))) __attribute__((availability(tvos,introduced=11.0))) __attribute__((availability(watchos,introduced=4.0))); | |
} | |
extern "C" { | |
wchar_t *fgetwln(FILE * , size_t *) __attribute__((availability(macosx,introduced=10.7))); | |
size_t wcslcat(wchar_t *, const wchar_t *, size_t); | |
size_t wcslcpy(wchar_t *, const wchar_t *, size_t); | |
} | |
extern "C++" { | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcschr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcspbrk(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcspbrk(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcspbrk(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcsrchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcsrchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return __libcpp_wcsrchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcsstr(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcsstr(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return (wchar_t*)wmemchr(__s, __c, __n);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);} | |
} | |
namespace std { inline namespace __1 { | |
class __attribute__ ((__visibility__("default"))) ios_base; | |
template<class _CharT> struct __attribute__ ((__type_visibility__("default"))) char_traits; | |
template<> struct char_traits<char>; | |
template<> struct char_traits<char16_t>; | |
template<> struct char_traits<char32_t>; | |
template<> struct char_traits<wchar_t>; | |
template<class _Tp> class __attribute__ ((__type_visibility__("default"))) allocator; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_ios; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_streambuf; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_istream; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_ostream; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_iostream; | |
template <class _CharT, class _Traits = char_traits<_CharT>, | |
class _Allocator = allocator<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_stringbuf; | |
template <class _CharT, class _Traits = char_traits<_CharT>, | |
class _Allocator = allocator<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_istringstream; | |
template <class _CharT, class _Traits = char_traits<_CharT>, | |
class _Allocator = allocator<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_ostringstream; | |
template <class _CharT, class _Traits = char_traits<_CharT>, | |
class _Allocator = allocator<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_stringstream; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_filebuf; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_ifstream; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_ofstream; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_fstream; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) istreambuf_iterator; | |
template <class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) ostreambuf_iterator; | |
typedef basic_ios<char> ios; | |
typedef basic_ios<wchar_t> wios; | |
typedef basic_streambuf<char> streambuf; | |
typedef basic_istream<char> istream; | |
typedef basic_ostream<char> ostream; | |
typedef basic_iostream<char> iostream; | |
typedef basic_stringbuf<char> stringbuf; | |
typedef basic_istringstream<char> istringstream; | |
typedef basic_ostringstream<char> ostringstream; | |
typedef basic_stringstream<char> stringstream; | |
typedef basic_filebuf<char> filebuf; | |
typedef basic_ifstream<char> ifstream; | |
typedef basic_ofstream<char> ofstream; | |
typedef basic_fstream<char> fstream; | |
typedef basic_streambuf<wchar_t> wstreambuf; | |
typedef basic_istream<wchar_t> wistream; | |
typedef basic_ostream<wchar_t> wostream; | |
typedef basic_iostream<wchar_t> wiostream; | |
typedef basic_stringbuf<wchar_t> wstringbuf; | |
typedef basic_istringstream<wchar_t> wistringstream; | |
typedef basic_ostringstream<wchar_t> wostringstream; | |
typedef basic_stringstream<wchar_t> wstringstream; | |
typedef basic_filebuf<wchar_t> wfilebuf; | |
typedef basic_ifstream<wchar_t> wifstream; | |
typedef basic_ofstream<wchar_t> wofstream; | |
typedef basic_fstream<wchar_t> wfstream; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(ios))) __attribute__((__preferred_name__(wios))) basic_ios; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(streambuf))) __attribute__((__preferred_name__(wstreambuf))) basic_streambuf; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(istream))) __attribute__((__preferred_name__(wistream))) basic_istream; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(ostream))) __attribute__((__preferred_name__(wostream))) basic_ostream; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(iostream))) __attribute__((__preferred_name__(wiostream))) basic_iostream; | |
template <class _CharT, class _Traits, class _Allocator> | |
class __attribute__((__preferred_name__(stringbuf))) __attribute__((__preferred_name__(wstringbuf))) basic_stringbuf; | |
template <class _CharT, class _Traits, class _Allocator> | |
class __attribute__((__preferred_name__(istringstream))) __attribute__((__preferred_name__(wistringstream))) basic_istringstream; | |
template <class _CharT, class _Traits, class _Allocator> | |
class __attribute__((__preferred_name__(ostringstream))) __attribute__((__preferred_name__(wostringstream))) basic_ostringstream; | |
template <class _CharT, class _Traits, class _Allocator> | |
class __attribute__((__preferred_name__(stringstream))) __attribute__((__preferred_name__(wstringstream))) basic_stringstream; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(filebuf))) __attribute__((__preferred_name__(wfilebuf))) basic_filebuf; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(ifstream))) __attribute__((__preferred_name__(wifstream))) basic_ifstream; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(ofstream))) __attribute__((__preferred_name__(wofstream))) basic_ofstream; | |
template <class _CharT, class _Traits> | |
class __attribute__((__preferred_name__(fstream))) __attribute__((__preferred_name__(wfstream))) basic_fstream; | |
template <class _State> class __attribute__ ((__type_visibility__("default"))) fpos; | |
typedef fpos<mbstate_t> streampos; | |
typedef fpos<mbstate_t> wstreampos; | |
typedef fpos<mbstate_t> u16streampos; | |
typedef fpos<mbstate_t> u32streampos; | |
typedef long long streamoff; | |
template <class _CharT, | |
class _Traits = char_traits<_CharT>, | |
class _Allocator = allocator<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_string; | |
typedef basic_string<char, char_traits<char>, allocator<char> > string; | |
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring; | |
template <class _CharT, class _Traits, class _Allocator> | |
class __attribute__((__preferred_name__(string))) __attribute__((__preferred_name__(wstring))) basic_string; | |
template <class _Tp, class _Alloc = allocator<_Tp> > | |
class __attribute__ ((__type_visibility__("default"))) vector; | |
template <class _CharT, class _Traits> | |
class __save_flags | |
{ | |
typedef basic_ios<_CharT, _Traits> __stream_type; | |
typedef typename __stream_type::fmtflags fmtflags; | |
__stream_type& __stream_; | |
fmtflags __fmtflags_; | |
_CharT __fill_; | |
__save_flags(const __save_flags&); | |
__save_flags& operator=(const __save_flags&); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __save_flags(__stream_type& __stream) | |
: __stream_(__stream), | |
__fmtflags_(__stream.flags()), | |
__fill_(__stream.fill()) | |
{} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
~__save_flags() | |
{ | |
__stream_.flags(__fmtflags_); | |
__stream_.fill(__fill_); | |
} | |
}; | |
} } | |
namespace std { inline namespace __1 { | |
struct __attribute__ ((__type_visibility__("default"))) __libcpp_debug_info { | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__libcpp_debug_info() | |
: __file_(nullptr), __line_(-1), __pred_(nullptr), __msg_(nullptr) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m) | |
: __file_(__f), __line_(__l), __pred_(__p), __msg_(__m) {} | |
__attribute__ ((__visibility__("default"))) string what() const; | |
const char* __file_; | |
int __line_; | |
const char* __pred_; | |
const char* __msg_; | |
}; | |
typedef void(*__libcpp_debug_function_type)(__libcpp_debug_info const&); | |
extern __attribute__((__visibility__("default"))) __libcpp_debug_function_type __libcpp_debug_function; | |
[[noreturn]] __attribute__ ((__visibility__("default"))) | |
void __libcpp_abort_debug_function(__libcpp_debug_info const&); | |
__attribute__ ((__visibility__("default"))) | |
bool __libcpp_set_debug_function(__libcpp_debug_function_type __func); | |
} } | |
namespace std { inline namespace __1 { | |
template <class _Tp> | |
inline | |
__attribute__((__no_sanitize__("cfi"))) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
addressof(_Tp& __x) noexcept | |
{ | |
return __builtin_addressof(__x); | |
} | |
template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete; | |
} } | |
typedef enum { | |
P_ALL, | |
P_PID, | |
P_PGID | |
} idtype_t; | |
typedef __darwin_pid_t pid_t; | |
typedef __darwin_id_t id_t; | |
typedef int sig_atomic_t; | |
struct __darwin_i386_thread_state | |
{ | |
unsigned int __eax; | |
unsigned int __ebx; | |
unsigned int __ecx; | |
unsigned int __edx; | |
unsigned int __edi; | |
unsigned int __esi; | |
unsigned int __ebp; | |
unsigned int __esp; | |
unsigned int __ss; | |
unsigned int __eflags; | |
unsigned int __eip; | |
unsigned int __cs; | |
unsigned int __ds; | |
unsigned int __es; | |
unsigned int __fs; | |
unsigned int __gs; | |
}; | |
struct __darwin_fp_control | |
{ | |
unsigned short __invalid :1, | |
__denorm :1, | |
__zdiv :1, | |
__ovrfl :1, | |
__undfl :1, | |
__precis :1, | |
:2, | |
__pc :2, | |
__rc :2, | |
:1, | |
:3; | |
}; | |
typedef struct __darwin_fp_control __darwin_fp_control_t; | |
struct __darwin_fp_status | |
{ | |
unsigned short __invalid :1, | |
__denorm :1, | |
__zdiv :1, | |
__ovrfl :1, | |
__undfl :1, | |
__precis :1, | |
__stkflt :1, | |
__errsumm :1, | |
__c0 :1, | |
__c1 :1, | |
__c2 :1, | |
__tos :3, | |
__c3 :1, | |
__busy :1; | |
}; | |
typedef struct __darwin_fp_status __darwin_fp_status_t; | |
struct __darwin_mmst_reg | |
{ | |
char __mmst_reg[10]; | |
char __mmst_rsrv[6]; | |
}; | |
struct __darwin_xmm_reg | |
{ | |
char __xmm_reg[16]; | |
}; | |
struct __darwin_ymm_reg | |
{ | |
char __ymm_reg[32]; | |
}; | |
struct __darwin_zmm_reg | |
{ | |
char __zmm_reg[64]; | |
}; | |
struct __darwin_opmask_reg | |
{ | |
char __opmask_reg[8]; | |
}; | |
struct __darwin_i386_float_state | |
{ | |
int __fpu_reserved[2]; | |
struct __darwin_fp_control __fpu_fcw; | |
struct __darwin_fp_status __fpu_fsw; | |
__uint8_t __fpu_ftw; | |
__uint8_t __fpu_rsrv1; | |
__uint16_t __fpu_fop; | |
__uint32_t __fpu_ip; | |
__uint16_t __fpu_cs; | |
__uint16_t __fpu_rsrv2; | |
__uint32_t __fpu_dp; | |
__uint16_t __fpu_ds; | |
__uint16_t __fpu_rsrv3; | |
__uint32_t __fpu_mxcsr; | |
__uint32_t __fpu_mxcsrmask; | |
struct __darwin_mmst_reg __fpu_stmm0; | |
struct __darwin_mmst_reg __fpu_stmm1; | |
struct __darwin_mmst_reg __fpu_stmm2; | |
struct __darwin_mmst_reg __fpu_stmm3; | |
struct __darwin_mmst_reg __fpu_stmm4; | |
struct __darwin_mmst_reg __fpu_stmm5; | |
struct __darwin_mmst_reg __fpu_stmm6; | |
struct __darwin_mmst_reg __fpu_stmm7; | |
struct __darwin_xmm_reg __fpu_xmm0; | |
struct __darwin_xmm_reg __fpu_xmm1; | |
struct __darwin_xmm_reg __fpu_xmm2; | |
struct __darwin_xmm_reg __fpu_xmm3; | |
struct __darwin_xmm_reg __fpu_xmm4; | |
struct __darwin_xmm_reg __fpu_xmm5; | |
struct __darwin_xmm_reg __fpu_xmm6; | |
struct __darwin_xmm_reg __fpu_xmm7; | |
char __fpu_rsrv4[14*16]; | |
int __fpu_reserved1; | |
}; | |
struct __darwin_i386_avx_state | |
{ | |
int __fpu_reserved[2]; | |
struct __darwin_fp_control __fpu_fcw; | |
struct __darwin_fp_status __fpu_fsw; | |
__uint8_t __fpu_ftw; | |
__uint8_t __fpu_rsrv1; | |
__uint16_t __fpu_fop; | |
__uint32_t __fpu_ip; | |
__uint16_t __fpu_cs; | |
__uint16_t __fpu_rsrv2; | |
__uint32_t __fpu_dp; | |
__uint16_t __fpu_ds; | |
__uint16_t __fpu_rsrv3; | |
__uint32_t __fpu_mxcsr; | |
__uint32_t __fpu_mxcsrmask; | |
struct __darwin_mmst_reg __fpu_stmm0; | |
struct __darwin_mmst_reg __fpu_stmm1; | |
struct __darwin_mmst_reg __fpu_stmm2; | |
struct __darwin_mmst_reg __fpu_stmm3; | |
struct __darwin_mmst_reg __fpu_stmm4; | |
struct __darwin_mmst_reg __fpu_stmm5; | |
struct __darwin_mmst_reg __fpu_stmm6; | |
struct __darwin_mmst_reg __fpu_stmm7; | |
struct __darwin_xmm_reg __fpu_xmm0; | |
struct __darwin_xmm_reg __fpu_xmm1; | |
struct __darwin_xmm_reg __fpu_xmm2; | |
struct __darwin_xmm_reg __fpu_xmm3; | |
struct __darwin_xmm_reg __fpu_xmm4; | |
struct __darwin_xmm_reg __fpu_xmm5; | |
struct __darwin_xmm_reg __fpu_xmm6; | |
struct __darwin_xmm_reg __fpu_xmm7; | |
char __fpu_rsrv4[14*16]; | |
int __fpu_reserved1; | |
char __avx_reserved1[64]; | |
struct __darwin_xmm_reg __fpu_ymmh0; | |
struct __darwin_xmm_reg __fpu_ymmh1; | |
struct __darwin_xmm_reg __fpu_ymmh2; | |
struct __darwin_xmm_reg __fpu_ymmh3; | |
struct __darwin_xmm_reg __fpu_ymmh4; | |
struct __darwin_xmm_reg __fpu_ymmh5; | |
struct __darwin_xmm_reg __fpu_ymmh6; | |
struct __darwin_xmm_reg __fpu_ymmh7; | |
}; | |
struct __darwin_i386_avx512_state | |
{ | |
int __fpu_reserved[2]; | |
struct __darwin_fp_control __fpu_fcw; | |
struct __darwin_fp_status __fpu_fsw; | |
__uint8_t __fpu_ftw; | |
__uint8_t __fpu_rsrv1; | |
__uint16_t __fpu_fop; | |
__uint32_t __fpu_ip; | |
__uint16_t __fpu_cs; | |
__uint16_t __fpu_rsrv2; | |
__uint32_t __fpu_dp; | |
__uint16_t __fpu_ds; | |
__uint16_t __fpu_rsrv3; | |
__uint32_t __fpu_mxcsr; | |
__uint32_t __fpu_mxcsrmask; | |
struct __darwin_mmst_reg __fpu_stmm0; | |
struct __darwin_mmst_reg __fpu_stmm1; | |
struct __darwin_mmst_reg __fpu_stmm2; | |
struct __darwin_mmst_reg __fpu_stmm3; | |
struct __darwin_mmst_reg __fpu_stmm4; | |
struct __darwin_mmst_reg __fpu_stmm5; | |
struct __darwin_mmst_reg __fpu_stmm6; | |
struct __darwin_mmst_reg __fpu_stmm7; | |
struct __darwin_xmm_reg __fpu_xmm0; | |
struct __darwin_xmm_reg __fpu_xmm1; | |
struct __darwin_xmm_reg __fpu_xmm2; | |
struct __darwin_xmm_reg __fpu_xmm3; | |
struct __darwin_xmm_reg __fpu_xmm4; | |
struct __darwin_xmm_reg __fpu_xmm5; | |
struct __darwin_xmm_reg __fpu_xmm6; | |
struct __darwin_xmm_reg __fpu_xmm7; | |
char __fpu_rsrv4[14*16]; | |
int __fpu_reserved1; | |
char __avx_reserved1[64]; | |
struct __darwin_xmm_reg __fpu_ymmh0; | |
struct __darwin_xmm_reg __fpu_ymmh1; | |
struct __darwin_xmm_reg __fpu_ymmh2; | |
struct __darwin_xmm_reg __fpu_ymmh3; | |
struct __darwin_xmm_reg __fpu_ymmh4; | |
struct __darwin_xmm_reg __fpu_ymmh5; | |
struct __darwin_xmm_reg __fpu_ymmh6; | |
struct __darwin_xmm_reg __fpu_ymmh7; | |
struct __darwin_opmask_reg __fpu_k0; | |
struct __darwin_opmask_reg __fpu_k1; | |
struct __darwin_opmask_reg __fpu_k2; | |
struct __darwin_opmask_reg __fpu_k3; | |
struct __darwin_opmask_reg __fpu_k4; | |
struct __darwin_opmask_reg __fpu_k5; | |
struct __darwin_opmask_reg __fpu_k6; | |
struct __darwin_opmask_reg __fpu_k7; | |
struct __darwin_ymm_reg __fpu_zmmh0; | |
struct __darwin_ymm_reg __fpu_zmmh1; | |
struct __darwin_ymm_reg __fpu_zmmh2; | |
struct __darwin_ymm_reg __fpu_zmmh3; | |
struct __darwin_ymm_reg __fpu_zmmh4; | |
struct __darwin_ymm_reg __fpu_zmmh5; | |
struct __darwin_ymm_reg __fpu_zmmh6; | |
struct __darwin_ymm_reg __fpu_zmmh7; | |
}; | |
struct __darwin_i386_exception_state | |
{ | |
__uint16_t __trapno; | |
__uint16_t __cpu; | |
__uint32_t __err; | |
__uint32_t __faultvaddr; | |
}; | |
struct __darwin_x86_debug_state32 | |
{ | |
unsigned int __dr0; | |
unsigned int __dr1; | |
unsigned int __dr2; | |
unsigned int __dr3; | |
unsigned int __dr4; | |
unsigned int __dr5; | |
unsigned int __dr6; | |
unsigned int __dr7; | |
}; | |
struct __x86_instruction_state | |
{ | |
int __insn_stream_valid_bytes; | |
int __insn_offset; | |
int __out_of_synch; | |
__uint8_t __insn_bytes[(2448 - 64 - 4)]; | |
__uint8_t __insn_cacheline[64]; | |
}; | |
struct __last_branch_record | |
{ | |
__uint64_t __from_ip; | |
__uint64_t __to_ip; | |
__uint32_t __mispredict : 1, | |
__tsx_abort : 1, | |
__in_tsx : 1, | |
__cycle_count: 16, | |
__reserved : 13; | |
}; | |
struct __last_branch_state | |
{ | |
int __lbr_count; | |
__uint32_t __lbr_supported_tsx : 1, | |
__lbr_supported_cycle_count : 1, | |
__reserved : 30; | |
struct __last_branch_record __lbrs[32]; | |
}; | |
struct __x86_pagein_state | |
{ | |
int __pagein_error; | |
}; | |
struct __darwin_x86_thread_state64 | |
{ | |
__uint64_t __rax; | |
__uint64_t __rbx; | |
__uint64_t __rcx; | |
__uint64_t __rdx; | |
__uint64_t __rdi; | |
__uint64_t __rsi; | |
__uint64_t __rbp; | |
__uint64_t __rsp; | |
__uint64_t __r8; | |
__uint64_t __r9; | |
__uint64_t __r10; | |
__uint64_t __r11; | |
__uint64_t __r12; | |
__uint64_t __r13; | |
__uint64_t __r14; | |
__uint64_t __r15; | |
__uint64_t __rip; | |
__uint64_t __rflags; | |
__uint64_t __cs; | |
__uint64_t __fs; | |
__uint64_t __gs; | |
}; | |
struct __darwin_x86_thread_full_state64 | |
{ | |
struct __darwin_x86_thread_state64 __ss64; | |
__uint64_t __ds; | |
__uint64_t __es; | |
__uint64_t __ss; | |
__uint64_t __gsbase; | |
}; | |
struct __darwin_x86_float_state64 | |
{ | |
int __fpu_reserved[2]; | |
struct __darwin_fp_control __fpu_fcw; | |
struct __darwin_fp_status __fpu_fsw; | |
__uint8_t __fpu_ftw; | |
__uint8_t __fpu_rsrv1; | |
__uint16_t __fpu_fop; | |
__uint32_t __fpu_ip; | |
__uint16_t __fpu_cs; | |
__uint16_t __fpu_rsrv2; | |
__uint32_t __fpu_dp; | |
__uint16_t __fpu_ds; | |
__uint16_t __fpu_rsrv3; | |
__uint32_t __fpu_mxcsr; | |
__uint32_t __fpu_mxcsrmask; | |
struct __darwin_mmst_reg __fpu_stmm0; | |
struct __darwin_mmst_reg __fpu_stmm1; | |
struct __darwin_mmst_reg __fpu_stmm2; | |
struct __darwin_mmst_reg __fpu_stmm3; | |
struct __darwin_mmst_reg __fpu_stmm4; | |
struct __darwin_mmst_reg __fpu_stmm5; | |
struct __darwin_mmst_reg __fpu_stmm6; | |
struct __darwin_mmst_reg __fpu_stmm7; | |
struct __darwin_xmm_reg __fpu_xmm0; | |
struct __darwin_xmm_reg __fpu_xmm1; | |
struct __darwin_xmm_reg __fpu_xmm2; | |
struct __darwin_xmm_reg __fpu_xmm3; | |
struct __darwin_xmm_reg __fpu_xmm4; | |
struct __darwin_xmm_reg __fpu_xmm5; | |
struct __darwin_xmm_reg __fpu_xmm6; | |
struct __darwin_xmm_reg __fpu_xmm7; | |
struct __darwin_xmm_reg __fpu_xmm8; | |
struct __darwin_xmm_reg __fpu_xmm9; | |
struct __darwin_xmm_reg __fpu_xmm10; | |
struct __darwin_xmm_reg __fpu_xmm11; | |
struct __darwin_xmm_reg __fpu_xmm12; | |
struct __darwin_xmm_reg __fpu_xmm13; | |
struct __darwin_xmm_reg __fpu_xmm14; | |
struct __darwin_xmm_reg __fpu_xmm15; | |
char __fpu_rsrv4[6*16]; | |
int __fpu_reserved1; | |
}; | |
struct __darwin_x86_avx_state64 | |
{ | |
int __fpu_reserved[2]; | |
struct __darwin_fp_control __fpu_fcw; | |
struct __darwin_fp_status __fpu_fsw; | |
__uint8_t __fpu_ftw; | |
__uint8_t __fpu_rsrv1; | |
__uint16_t __fpu_fop; | |
__uint32_t __fpu_ip; | |
__uint16_t __fpu_cs; | |
__uint16_t __fpu_rsrv2; | |
__uint32_t __fpu_dp; | |
__uint16_t __fpu_ds; | |
__uint16_t __fpu_rsrv3; | |
__uint32_t __fpu_mxcsr; | |
__uint32_t __fpu_mxcsrmask; | |
struct __darwin_mmst_reg __fpu_stmm0; | |
struct __darwin_mmst_reg __fpu_stmm1; | |
struct __darwin_mmst_reg __fpu_stmm2; | |
struct __darwin_mmst_reg __fpu_stmm3; | |
struct __darwin_mmst_reg __fpu_stmm4; | |
struct __darwin_mmst_reg __fpu_stmm5; | |
struct __darwin_mmst_reg __fpu_stmm6; | |
struct __darwin_mmst_reg __fpu_stmm7; | |
struct __darwin_xmm_reg __fpu_xmm0; | |
struct __darwin_xmm_reg __fpu_xmm1; | |
struct __darwin_xmm_reg __fpu_xmm2; | |
struct __darwin_xmm_reg __fpu_xmm3; | |
struct __darwin_xmm_reg __fpu_xmm4; | |
struct __darwin_xmm_reg __fpu_xmm5; | |
struct __darwin_xmm_reg __fpu_xmm6; | |
struct __darwin_xmm_reg __fpu_xmm7; | |
struct __darwin_xmm_reg __fpu_xmm8; | |
struct __darwin_xmm_reg __fpu_xmm9; | |
struct __darwin_xmm_reg __fpu_xmm10; | |
struct __darwin_xmm_reg __fpu_xmm11; | |
struct __darwin_xmm_reg __fpu_xmm12; | |
struct __darwin_xmm_reg __fpu_xmm13; | |
struct __darwin_xmm_reg __fpu_xmm14; | |
struct __darwin_xmm_reg __fpu_xmm15; | |
char __fpu_rsrv4[6*16]; | |
int __fpu_reserved1; | |
char __avx_reserved1[64]; | |
struct __darwin_xmm_reg __fpu_ymmh0; | |
struct __darwin_xmm_reg __fpu_ymmh1; | |
struct __darwin_xmm_reg __fpu_ymmh2; | |
struct __darwin_xmm_reg __fpu_ymmh3; | |
struct __darwin_xmm_reg __fpu_ymmh4; | |
struct __darwin_xmm_reg __fpu_ymmh5; | |
struct __darwin_xmm_reg __fpu_ymmh6; | |
struct __darwin_xmm_reg __fpu_ymmh7; | |
struct __darwin_xmm_reg __fpu_ymmh8; | |
struct __darwin_xmm_reg __fpu_ymmh9; | |
struct __darwin_xmm_reg __fpu_ymmh10; | |
struct __darwin_xmm_reg __fpu_ymmh11; | |
struct __darwin_xmm_reg __fpu_ymmh12; | |
struct __darwin_xmm_reg __fpu_ymmh13; | |
struct __darwin_xmm_reg __fpu_ymmh14; | |
struct __darwin_xmm_reg __fpu_ymmh15; | |
}; | |
struct __darwin_x86_avx512_state64 | |
{ | |
int __fpu_reserved[2]; | |
struct __darwin_fp_control __fpu_fcw; | |
struct __darwin_fp_status __fpu_fsw; | |
__uint8_t __fpu_ftw; | |
__uint8_t __fpu_rsrv1; | |
__uint16_t __fpu_fop; | |
__uint32_t __fpu_ip; | |
__uint16_t __fpu_cs; | |
__uint16_t __fpu_rsrv2; | |
__uint32_t __fpu_dp; | |
__uint16_t __fpu_ds; | |
__uint16_t __fpu_rsrv3; | |
__uint32_t __fpu_mxcsr; | |
__uint32_t __fpu_mxcsrmask; | |
struct __darwin_mmst_reg __fpu_stmm0; | |
struct __darwin_mmst_reg __fpu_stmm1; | |
struct __darwin_mmst_reg __fpu_stmm2; | |
struct __darwin_mmst_reg __fpu_stmm3; | |
struct __darwin_mmst_reg __fpu_stmm4; | |
struct __darwin_mmst_reg __fpu_stmm5; | |
struct __darwin_mmst_reg __fpu_stmm6; | |
struct __darwin_mmst_reg __fpu_stmm7; | |
struct __darwin_xmm_reg __fpu_xmm0; | |
struct __darwin_xmm_reg __fpu_xmm1; | |
struct __darwin_xmm_reg __fpu_xmm2; | |
struct __darwin_xmm_reg __fpu_xmm3; | |
struct __darwin_xmm_reg __fpu_xmm4; | |
struct __darwin_xmm_reg __fpu_xmm5; | |
struct __darwin_xmm_reg __fpu_xmm6; | |
struct __darwin_xmm_reg __fpu_xmm7; | |
struct __darwin_xmm_reg __fpu_xmm8; | |
struct __darwin_xmm_reg __fpu_xmm9; | |
struct __darwin_xmm_reg __fpu_xmm10; | |
struct __darwin_xmm_reg __fpu_xmm11; | |
struct __darwin_xmm_reg __fpu_xmm12; | |
struct __darwin_xmm_reg __fpu_xmm13; | |
struct __darwin_xmm_reg __fpu_xmm14; | |
struct __darwin_xmm_reg __fpu_xmm15; | |
char __fpu_rsrv4[6*16]; | |
int __fpu_reserved1; | |
char __avx_reserved1[64]; | |
struct __darwin_xmm_reg __fpu_ymmh0; | |
struct __darwin_xmm_reg __fpu_ymmh1; | |
struct __darwin_xmm_reg __fpu_ymmh2; | |
struct __darwin_xmm_reg __fpu_ymmh3; | |
struct __darwin_xmm_reg __fpu_ymmh4; | |
struct __darwin_xmm_reg __fpu_ymmh5; | |
struct __darwin_xmm_reg __fpu_ymmh6; | |
struct __darwin_xmm_reg __fpu_ymmh7; | |
struct __darwin_xmm_reg __fpu_ymmh8; | |
struct __darwin_xmm_reg __fpu_ymmh9; | |
struct __darwin_xmm_reg __fpu_ymmh10; | |
struct __darwin_xmm_reg __fpu_ymmh11; | |
struct __darwin_xmm_reg __fpu_ymmh12; | |
struct __darwin_xmm_reg __fpu_ymmh13; | |
struct __darwin_xmm_reg __fpu_ymmh14; | |
struct __darwin_xmm_reg __fpu_ymmh15; | |
struct __darwin_opmask_reg __fpu_k0; | |
struct __darwin_opmask_reg __fpu_k1; | |
struct __darwin_opmask_reg __fpu_k2; | |
struct __darwin_opmask_reg __fpu_k3; | |
struct __darwin_opmask_reg __fpu_k4; | |
struct __darwin_opmask_reg __fpu_k5; | |
struct __darwin_opmask_reg __fpu_k6; | |
struct __darwin_opmask_reg __fpu_k7; | |
struct __darwin_ymm_reg __fpu_zmmh0; | |
struct __darwin_ymm_reg __fpu_zmmh1; | |
struct __darwin_ymm_reg __fpu_zmmh2; | |
struct __darwin_ymm_reg __fpu_zmmh3; | |
struct __darwin_ymm_reg __fpu_zmmh4; | |
struct __darwin_ymm_reg __fpu_zmmh5; | |
struct __darwin_ymm_reg __fpu_zmmh6; | |
struct __darwin_ymm_reg __fpu_zmmh7; | |
struct __darwin_ymm_reg __fpu_zmmh8; | |
struct __darwin_ymm_reg __fpu_zmmh9; | |
struct __darwin_ymm_reg __fpu_zmmh10; | |
struct __darwin_ymm_reg __fpu_zmmh11; | |
struct __darwin_ymm_reg __fpu_zmmh12; | |
struct __darwin_ymm_reg __fpu_zmmh13; | |
struct __darwin_ymm_reg __fpu_zmmh14; | |
struct __darwin_ymm_reg __fpu_zmmh15; | |
struct __darwin_zmm_reg __fpu_zmm16; | |
struct __darwin_zmm_reg __fpu_zmm17; | |
struct __darwin_zmm_reg __fpu_zmm18; | |
struct __darwin_zmm_reg __fpu_zmm19; | |
struct __darwin_zmm_reg __fpu_zmm20; | |
struct __darwin_zmm_reg __fpu_zmm21; | |
struct __darwin_zmm_reg __fpu_zmm22; | |
struct __darwin_zmm_reg __fpu_zmm23; | |
struct __darwin_zmm_reg __fpu_zmm24; | |
struct __darwin_zmm_reg __fpu_zmm25; | |
struct __darwin_zmm_reg __fpu_zmm26; | |
struct __darwin_zmm_reg __fpu_zmm27; | |
struct __darwin_zmm_reg __fpu_zmm28; | |
struct __darwin_zmm_reg __fpu_zmm29; | |
struct __darwin_zmm_reg __fpu_zmm30; | |
struct __darwin_zmm_reg __fpu_zmm31; | |
}; | |
struct __darwin_x86_exception_state64 | |
{ | |
__uint16_t __trapno; | |
__uint16_t __cpu; | |
__uint32_t __err; | |
__uint64_t __faultvaddr; | |
}; | |
struct __darwin_x86_debug_state64 | |
{ | |
__uint64_t __dr0; | |
__uint64_t __dr1; | |
__uint64_t __dr2; | |
__uint64_t __dr3; | |
__uint64_t __dr4; | |
__uint64_t __dr5; | |
__uint64_t __dr6; | |
__uint64_t __dr7; | |
}; | |
struct __darwin_x86_cpmu_state64 | |
{ | |
__uint64_t __ctrs[16]; | |
}; | |
struct __darwin_mcontext32 | |
{ | |
struct __darwin_i386_exception_state __es; | |
struct __darwin_i386_thread_state __ss; | |
struct __darwin_i386_float_state __fs; | |
}; | |
struct __darwin_mcontext_avx32 | |
{ | |
struct __darwin_i386_exception_state __es; | |
struct __darwin_i386_thread_state __ss; | |
struct __darwin_i386_avx_state __fs; | |
}; | |
struct __darwin_mcontext_avx512_32 | |
{ | |
struct __darwin_i386_exception_state __es; | |
struct __darwin_i386_thread_state __ss; | |
struct __darwin_i386_avx512_state __fs; | |
}; | |
struct __darwin_mcontext64 | |
{ | |
struct __darwin_x86_exception_state64 __es; | |
struct __darwin_x86_thread_state64 __ss; | |
struct __darwin_x86_float_state64 __fs; | |
}; | |
struct __darwin_mcontext64_full | |
{ | |
struct __darwin_x86_exception_state64 __es; | |
struct __darwin_x86_thread_full_state64 __ss; | |
struct __darwin_x86_float_state64 __fs; | |
}; | |
struct __darwin_mcontext_avx64 | |
{ | |
struct __darwin_x86_exception_state64 __es; | |
struct __darwin_x86_thread_state64 __ss; | |
struct __darwin_x86_avx_state64 __fs; | |
}; | |
struct __darwin_mcontext_avx64_full | |
{ | |
struct __darwin_x86_exception_state64 __es; | |
struct __darwin_x86_thread_full_state64 __ss; | |
struct __darwin_x86_avx_state64 __fs; | |
}; | |
struct __darwin_mcontext_avx512_64 | |
{ | |
struct __darwin_x86_exception_state64 __es; | |
struct __darwin_x86_thread_state64 __ss; | |
struct __darwin_x86_avx512_state64 __fs; | |
}; | |
struct __darwin_mcontext_avx512_64_full | |
{ | |
struct __darwin_x86_exception_state64 __es; | |
struct __darwin_x86_thread_full_state64 __ss; | |
struct __darwin_x86_avx512_state64 __fs; | |
}; | |
typedef struct __darwin_mcontext64 *mcontext_t; | |
typedef __darwin_pthread_attr_t pthread_attr_t; | |
struct __darwin_sigaltstack | |
{ | |
void *ss_sp; | |
__darwin_size_t ss_size; | |
int ss_flags; | |
}; | |
typedef struct __darwin_sigaltstack stack_t; | |
struct __darwin_ucontext | |
{ | |
int uc_onstack; | |
__darwin_sigset_t uc_sigmask; | |
struct __darwin_sigaltstack uc_stack; | |
struct __darwin_ucontext *uc_link; | |
__darwin_size_t uc_mcsize; | |
struct __darwin_mcontext64 *uc_mcontext; | |
}; | |
typedef struct __darwin_ucontext ucontext_t; | |
typedef __darwin_sigset_t sigset_t; | |
typedef __darwin_uid_t uid_t; | |
union sigval { | |
int sival_int; | |
void *sival_ptr; | |
}; | |
struct sigevent { | |
int sigev_notify; | |
int sigev_signo; | |
union sigval sigev_value; | |
void (*sigev_notify_function)(union sigval); | |
pthread_attr_t *sigev_notify_attributes; | |
}; | |
typedef struct __siginfo { | |
int si_signo; | |
int si_errno; | |
int si_code; | |
pid_t si_pid; | |
uid_t si_uid; | |
int si_status; | |
void *si_addr; | |
union sigval si_value; | |
long si_band; | |
unsigned long __pad[7]; | |
} siginfo_t; | |
union __sigaction_u { | |
void (*__sa_handler)(int); | |
void (*__sa_sigaction)(int, struct __siginfo *, | |
void *); | |
}; | |
struct __sigaction { | |
union __sigaction_u __sigaction_u; | |
void (*sa_tramp)(void *, int, int, siginfo_t *, void *); | |
sigset_t sa_mask; | |
int sa_flags; | |
}; | |
struct sigaction { | |
union __sigaction_u __sigaction_u; | |
sigset_t sa_mask; | |
int sa_flags; | |
}; | |
typedef void (*sig_t)(int); | |
struct sigvec { | |
void (*sv_handler)(int); | |
int sv_mask; | |
int sv_flags; | |
}; | |
struct sigstack { | |
char *ss_sp; | |
int ss_onstack; | |
}; | |
extern "C" { | |
void(*signal(int, void (*)(int)))(int); | |
} | |
struct timeval | |
{ | |
__darwin_time_t tv_sec; | |
__darwin_suseconds_t tv_usec; | |
}; | |
typedef __uint64_t rlim_t; | |
struct rusage { | |
struct timeval ru_utime; | |
struct timeval ru_stime; | |
long ru_maxrss; | |
long ru_ixrss; | |
long ru_idrss; | |
long ru_isrss; | |
long ru_minflt; | |
long ru_majflt; | |
long ru_nswap; | |
long ru_inblock; | |
long ru_oublock; | |
long ru_msgsnd; | |
long ru_msgrcv; | |
long ru_nsignals; | |
long ru_nvcsw; | |
long ru_nivcsw; | |
}; | |
typedef void *rusage_info_t; | |
struct rusage_info_v0 { | |
uint8_t ri_uuid[16]; | |
uint64_t ri_user_time; | |
uint64_t ri_system_time; | |
uint64_t ri_pkg_idle_wkups; | |
uint64_t ri_interrupt_wkups; | |
uint64_t ri_pageins; | |
uint64_t ri_wired_size; | |
uint64_t ri_resident_size; | |
uint64_t ri_phys_footprint; | |
uint64_t ri_proc_start_abstime; | |
uint64_t ri_proc_exit_abstime; | |
}; | |
struct rusage_info_v1 { | |
uint8_t ri_uuid[16]; | |
uint64_t ri_user_time; | |
uint64_t ri_system_time; | |
uint64_t ri_pkg_idle_wkups; | |
uint64_t ri_interrupt_wkups; | |
uint64_t ri_pageins; | |
uint64_t ri_wired_size; | |
uint64_t ri_resident_size; | |
uint64_t ri_phys_footprint; | |
uint64_t ri_proc_start_abstime; | |
uint64_t ri_proc_exit_abstime; | |
uint64_t ri_child_user_time; | |
uint64_t ri_child_system_time; | |
uint64_t ri_child_pkg_idle_wkups; | |
uint64_t ri_child_interrupt_wkups; | |
uint64_t ri_child_pageins; | |
uint64_t ri_child_elapsed_abstime; | |
}; | |
struct rusage_info_v2 { | |
uint8_t ri_uuid[16]; | |
uint64_t ri_user_time; | |
uint64_t ri_system_time; | |
uint64_t ri_pkg_idle_wkups; | |
uint64_t ri_interrupt_wkups; | |
uint64_t ri_pageins; | |
uint64_t ri_wired_size; | |
uint64_t ri_resident_size; | |
uint64_t ri_phys_footprint; | |
uint64_t ri_proc_start_abstime; | |
uint64_t ri_proc_exit_abstime; | |
uint64_t ri_child_user_time; | |
uint64_t ri_child_system_time; | |
uint64_t ri_child_pkg_idle_wkups; | |
uint64_t ri_child_interrupt_wkups; | |
uint64_t ri_child_pageins; | |
uint64_t ri_child_elapsed_abstime; | |
uint64_t ri_diskio_bytesread; | |
uint64_t ri_diskio_byteswritten; | |
}; | |
struct rusage_info_v3 { | |
uint8_t ri_uuid[16]; | |
uint64_t ri_user_time; | |
uint64_t ri_system_time; | |
uint64_t ri_pkg_idle_wkups; | |
uint64_t ri_interrupt_wkups; | |
uint64_t ri_pageins; | |
uint64_t ri_wired_size; | |
uint64_t ri_resident_size; | |
uint64_t ri_phys_footprint; | |
uint64_t ri_proc_start_abstime; | |
uint64_t ri_proc_exit_abstime; | |
uint64_t ri_child_user_time; | |
uint64_t ri_child_system_time; | |
uint64_t ri_child_pkg_idle_wkups; | |
uint64_t ri_child_interrupt_wkups; | |
uint64_t ri_child_pageins; | |
uint64_t ri_child_elapsed_abstime; | |
uint64_t ri_diskio_bytesread; | |
uint64_t ri_diskio_byteswritten; | |
uint64_t ri_cpu_time_qos_default; | |
uint64_t ri_cpu_time_qos_maintenance; | |
uint64_t ri_cpu_time_qos_background; | |
uint64_t ri_cpu_time_qos_utility; | |
uint64_t ri_cpu_time_qos_legacy; | |
uint64_t ri_cpu_time_qos_user_initiated; | |
uint64_t ri_cpu_time_qos_user_interactive; | |
uint64_t ri_billed_system_time; | |
uint64_t ri_serviced_system_time; | |
}; | |
struct rusage_info_v4 { | |
uint8_t ri_uuid[16]; | |
uint64_t ri_user_time; | |
uint64_t ri_system_time; | |
uint64_t ri_pkg_idle_wkups; | |
uint64_t ri_interrupt_wkups; | |
uint64_t ri_pageins; | |
uint64_t ri_wired_size; | |
uint64_t ri_resident_size; | |
uint64_t ri_phys_footprint; | |
uint64_t ri_proc_start_abstime; | |
uint64_t ri_proc_exit_abstime; | |
uint64_t ri_child_user_time; | |
uint64_t ri_child_system_time; | |
uint64_t ri_child_pkg_idle_wkups; | |
uint64_t ri_child_interrupt_wkups; | |
uint64_t ri_child_pageins; | |
uint64_t ri_child_elapsed_abstime; | |
uint64_t ri_diskio_bytesread; | |
uint64_t ri_diskio_byteswritten; | |
uint64_t ri_cpu_time_qos_default; | |
uint64_t ri_cpu_time_qos_maintenance; | |
uint64_t ri_cpu_time_qos_background; | |
uint64_t ri_cpu_time_qos_utility; | |
uint64_t ri_cpu_time_qos_legacy; | |
uint64_t ri_cpu_time_qos_user_initiated; | |
uint64_t ri_cpu_time_qos_user_interactive; | |
uint64_t ri_billed_system_time; | |
uint64_t ri_serviced_system_time; | |
uint64_t ri_logical_writes; | |
uint64_t ri_lifetime_max_phys_footprint; | |
uint64_t ri_instructions; | |
uint64_t ri_cycles; | |
uint64_t ri_billed_energy; | |
uint64_t ri_serviced_energy; | |
uint64_t ri_interval_max_phys_footprint; | |
uint64_t ri_runnable_time; | |
}; | |
struct rusage_info_v5 { | |
uint8_t ri_uuid[16]; | |
uint64_t ri_user_time; | |
uint64_t ri_system_time; | |
uint64_t ri_pkg_idle_wkups; | |
uint64_t ri_interrupt_wkups; | |
uint64_t ri_pageins; | |
uint64_t ri_wired_size; | |
uint64_t ri_resident_size; | |
uint64_t ri_phys_footprint; | |
uint64_t ri_proc_start_abstime; | |
uint64_t ri_proc_exit_abstime; | |
uint64_t ri_child_user_time; | |
uint64_t ri_child_system_time; | |
uint64_t ri_child_pkg_idle_wkups; | |
uint64_t ri_child_interrupt_wkups; | |
uint64_t ri_child_pageins; | |
uint64_t ri_child_elapsed_abstime; | |
uint64_t ri_diskio_bytesread; | |
uint64_t ri_diskio_byteswritten; | |
uint64_t ri_cpu_time_qos_default; | |
uint64_t ri_cpu_time_qos_maintenance; | |
uint64_t ri_cpu_time_qos_background; | |
uint64_t ri_cpu_time_qos_utility; | |
uint64_t ri_cpu_time_qos_legacy; | |
uint64_t ri_cpu_time_qos_user_initiated; | |
uint64_t ri_cpu_time_qos_user_interactive; | |
uint64_t ri_billed_system_time; | |
uint64_t ri_serviced_system_time; | |
uint64_t ri_logical_writes; | |
uint64_t ri_lifetime_max_phys_footprint; | |
uint64_t ri_instructions; | |
uint64_t ri_cycles; | |
uint64_t ri_billed_energy; | |
uint64_t ri_serviced_energy; | |
uint64_t ri_interval_max_phys_footprint; | |
uint64_t ri_runnable_time; | |
uint64_t ri_flags; | |
}; | |
typedef struct rusage_info_v5 rusage_info_current; | |
struct rlimit { | |
rlim_t rlim_cur; | |
rlim_t rlim_max; | |
}; | |
struct proc_rlimit_control_wakeupmon { | |
uint32_t wm_flags; | |
int32_t wm_rate; | |
}; | |
extern "C" { | |
int getpriority(int, id_t); | |
int getiopolicy_np(int, int) __attribute__((availability(macosx,introduced=10.5))); | |
int getrlimit(int, struct rlimit *) __asm("_" "getrlimit" ); | |
int getrusage(int, struct rusage *); | |
int setpriority(int, id_t, int); | |
int setiopolicy_np(int, int, int) __attribute__((availability(macosx,introduced=10.5))); | |
int setrlimit(int, const struct rlimit *) __asm("_" "setrlimit" ); | |
} | |
static inline | |
__uint16_t | |
_OSSwapInt16( | |
__uint16_t _data | |
) | |
{ | |
return (__uint16_t)((_data << 8) | (_data >> 8)); | |
} | |
static inline | |
__uint32_t | |
_OSSwapInt32( | |
__uint32_t _data | |
) | |
{ | |
return __builtin_bswap32(_data); | |
} | |
static inline | |
__uint64_t | |
_OSSwapInt64( | |
__uint64_t _data | |
) | |
{ | |
return __builtin_bswap64(_data); | |
} | |
union wait { | |
int w_status; | |
struct { | |
unsigned int w_Termsig:7, | |
w_Coredump:1, | |
w_Retcode:8, | |
w_Filler:16; | |
} w_T; | |
struct { | |
unsigned int w_Stopval:8, | |
w_Stopsig:8, | |
w_Filler:16; | |
} w_S; | |
}; | |
extern "C" { | |
pid_t wait(int *) __asm("_" "wait" ); | |
pid_t waitpid(pid_t, int *, int) __asm("_" "waitpid" ); | |
int waitid(idtype_t, id_t, siginfo_t *, int) __asm("_" "waitid" ); | |
pid_t wait3(int *, int, struct rusage *); | |
pid_t wait4(pid_t, int *, int, struct rusage *); | |
} | |
extern "C" { | |
void *alloca(size_t); | |
} | |
typedef struct { | |
int quot; | |
int rem; | |
} div_t; | |
typedef struct { | |
long quot; | |
long rem; | |
} ldiv_t; | |
typedef struct { | |
long long quot; | |
long long rem; | |
} lldiv_t; | |
extern int __mb_cur_max; | |
extern "C" { | |
void *malloc(size_t __size) __attribute__((__warn_unused_result__)) __attribute__((alloc_size(1))); | |
void *calloc(size_t __count, size_t __size) __attribute__((__warn_unused_result__)) __attribute__((alloc_size(1,2))); | |
void free(void *); | |
void *realloc(void *__ptr, size_t __size) __attribute__((__warn_unused_result__)) __attribute__((alloc_size(2))); | |
void *valloc(size_t) __attribute__((alloc_size(1))); | |
void *aligned_alloc(size_t __alignment, size_t __size) __attribute__((__warn_unused_result__)) __attribute__((alloc_size(2))) __attribute__((availability(macosx,introduced=10.15))) __attribute__((availability(ios,introduced=13.0))) __attribute__((availability(tvos,introduced=13.0))) __attribute__((availability(watchos,introduced=6.0))); | |
int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __attribute__((availability(macosx,introduced=10.6))); | |
} | |
extern "C" { | |
void abort(void) __attribute__((__cold__)) __attribute__((__noreturn__)); | |
int abs(int) __attribute__((__const__)); | |
int atexit(void (* _Nonnull)(void)); | |
double atof(const char *); | |
int atoi(const char *); | |
long atol(const char *); | |
long long | |
atoll(const char *); | |
void *bsearch(const void *__key, const void *__base, size_t __nel, | |
size_t __width, int (* _Nonnull __compar)(const void *, const void *)); | |
div_t div(int, int) __attribute__((__const__)); | |
void exit(int) __attribute__((__noreturn__)); | |
char *getenv(const char *); | |
long labs(long) __attribute__((__const__)); | |
ldiv_t ldiv(long, long) __attribute__((__const__)); | |
long long | |
llabs(long long); | |
lldiv_t lldiv(long long, long long); | |
int mblen(const char *__s, size_t __n); | |
size_t mbstowcs(wchar_t * , const char * , size_t); | |
int mbtowc(wchar_t * , const char * , size_t); | |
void qsort(void *__base, size_t __nel, size_t __width, | |
int (* _Nonnull __compar)(const void *, const void *)); | |
int rand(void) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); | |
void srand(unsigned) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); | |
double strtod(const char *, char **) __asm("_" "strtod" ); | |
float strtof(const char *, char **) __asm("_" "strtof" ); | |
long strtol(const char *__str, char **__endptr, int __base); | |
long double | |
strtold(const char *, char **); | |
long long | |
strtoll(const char *__str, char **__endptr, int __base); | |
unsigned long | |
strtoul(const char *__str, char **__endptr, int __base); | |
unsigned long long | |
strtoull(const char *__str, char **__endptr, int __base); | |
__attribute__((__availability__(swift, unavailable, message="Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)"))) | |
__attribute__((availability(macos,introduced=10.0))) __attribute__((availability(ios,unavailable))) | |
__attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))) | |
int system(const char *) __asm("_" "system" ); | |
size_t wcstombs(char * , const wchar_t * , size_t); | |
int wctomb(char *, wchar_t); | |
void _Exit(int) __attribute__((__noreturn__)); | |
long a64l(const char *); | |
double drand48(void); | |
char *ecvt(double, int, int *, int *); | |
double erand48(unsigned short[3]); | |
char *fcvt(double, int, int *, int *); | |
char *gcvt(double, int, char *); | |
int getsubopt(char **, char * const *, char **); | |
int grantpt(int); | |
char *initstate(unsigned, char *, size_t); | |
long jrand48(unsigned short[3]) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); | |
char *l64a(long); | |
void lcong48(unsigned short[7]); | |
long lrand48(void) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); | |
char *mktemp(char *); | |
int mkstemp(char *); | |
long mrand48(void) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); | |
long nrand48(unsigned short[3]) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); | |
int posix_openpt(int); | |
char *ptsname(int); | |
int ptsname_r(int fildes, char *buffer, size_t buflen) __attribute__((availability(macos,introduced=10.13.4))) __attribute__((availability(ios,introduced=11.3))) __attribute__((availability(tvos,introduced=11.3))) __attribute__((availability(watchos,introduced=4.3))); | |
int putenv(char *) __asm("_" "putenv" ); | |
long random(void) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); | |
int rand_r(unsigned *) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); | |
char *realpath(const char * , char * ) __asm("_" "realpath" "$DARWIN_EXTSN"); | |
unsigned short | |
*seed48(unsigned short[3]); | |
int setenv(const char * __name, const char * __value, int __overwrite) __asm("_" "setenv" ); | |
void setkey(const char *) __asm("_" "setkey" ); | |
char *setstate(const char *); | |
void srand48(long); | |
void srandom(unsigned); | |
int unlockpt(int); | |
int unsetenv(const char *) __asm("_" "unsetenv" ); | |
typedef __darwin_dev_t dev_t; | |
typedef __darwin_mode_t mode_t; | |
uint32_t arc4random(void); | |
void arc4random_addrandom(unsigned char * , int ) | |
__attribute__((availability(macosx,introduced=10.0))) __attribute__((availability(macosx,deprecated=10.12,message="use arc4random_stir"))) | |
__attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=10.0,message="use arc4random_stir"))) | |
__attribute__((availability(tvos,introduced=2.0))) __attribute__((availability(tvos,deprecated=10.0,message="use arc4random_stir"))) | |
__attribute__((availability(watchos,introduced=1.0))) __attribute__((availability(watchos,deprecated=3.0,message="use arc4random_stir"))); | |
void arc4random_buf(void * __buf, size_t __nbytes) __attribute__((availability(macosx,introduced=10.7))); | |
void arc4random_stir(void); | |
uint32_t | |
arc4random_uniform(uint32_t __upper_bound) __attribute__((availability(macosx,introduced=10.7))); | |
int atexit_b(void (^ _Nonnull)(void)) __attribute__((availability(macosx,introduced=10.6))); | |
void *bsearch_b(const void *__key, const void *__base, size_t __nel, | |
size_t __width, int (^ _Nonnull __compar)(const void *, const void *) __attribute__((__noescape__))) | |
__attribute__((availability(macosx,introduced=10.6))); | |
char *cgetcap(char *, const char *, int); | |
int cgetclose(void); | |
int cgetent(char **, char **, const char *); | |
int cgetfirst(char **, char **); | |
int cgetmatch(const char *, const char *); | |
int cgetnext(char **, char **); | |
int cgetnum(char *, const char *, long *); | |
int cgetset(const char *); | |
int cgetstr(char *, const char *, char **); | |
int cgetustr(char *, const char *, char **); | |
int daemon(int, int) __asm("_" "daemon" "$1050") __attribute__((availability(macosx,introduced=10.0,deprecated=10.5,message="Use posix_spawn APIs instead."))) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); | |
char *devname(dev_t, mode_t); | |
char *devname_r(dev_t, mode_t, char *buf, int len); | |
char *getbsize(int *, long *); | |
int getloadavg(double [], int); | |
const char | |
*getprogname(void); | |
void setprogname(const char *); | |
int heapsort(void *__base, size_t __nel, size_t __width, | |
int (* _Nonnull __compar)(const void *, const void *)); | |
int heapsort_b(void *__base, size_t __nel, size_t __width, | |
int (^ _Nonnull __compar)(const void *, const void *) __attribute__((__noescape__))) | |
__attribute__((availability(macosx,introduced=10.6))); | |
int mergesort(void *__base, size_t __nel, size_t __width, | |
int (* _Nonnull __compar)(const void *, const void *)); | |
int mergesort_b(void *__base, size_t __nel, size_t __width, | |
int (^ _Nonnull __compar)(const void *, const void *) __attribute__((__noescape__))) | |
__attribute__((availability(macosx,introduced=10.6))); | |
void psort(void *__base, size_t __nel, size_t __width, | |
int (* _Nonnull __compar)(const void *, const void *)) | |
__attribute__((availability(macosx,introduced=10.6))); | |
void psort_b(void *__base, size_t __nel, size_t __width, | |
int (^ _Nonnull __compar)(const void *, const void *) __attribute__((__noescape__))) | |
__attribute__((availability(macosx,introduced=10.6))); | |
void psort_r(void *__base, size_t __nel, size_t __width, void *, | |
int (* _Nonnull __compar)(void *, const void *, const void *)) | |
__attribute__((availability(macosx,introduced=10.6))); | |
void qsort_b(void *__base, size_t __nel, size_t __width, | |
int (^ _Nonnull __compar)(const void *, const void *) __attribute__((__noescape__))) | |
__attribute__((availability(macosx,introduced=10.6))); | |
void qsort_r(void *__base, size_t __nel, size_t __width, void *, | |
int (* _Nonnull __compar)(void *, const void *, const void *)); | |
int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table, | |
unsigned __endbyte); | |
int rpmatch(const char *) | |
__attribute__((availability(macos,introduced=10.15))) __attribute__((availability(ios,introduced=13.0))) __attribute__((availability(tvos,introduced=13.0))) __attribute__((availability(watchos,introduced=6.0))); | |
int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table, | |
unsigned __endbyte); | |
void sranddev(void); | |
void srandomdev(void); | |
void *reallocf(void *__ptr, size_t __size) __attribute__((alloc_size(2))); | |
long long | |
strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp) | |
__attribute__((availability(macos,introduced=11.0))) __attribute__((availability(ios,introduced=14.0))) __attribute__((availability(tvos,introduced=14.0))) __attribute__((availability(watchos,introduced=7.0))); | |
long long | |
strtoq(const char *__str, char **__endptr, int __base); | |
unsigned long long | |
strtouq(const char *__str, char **__endptr, int __base); | |
extern char *suboptarg; | |
} | |
extern "C++" { | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) long abs(long __x) noexcept { | |
return __builtin_labs(__x); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) long long abs(long long __x) noexcept { | |
return __builtin_llabs(__x); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) float abs(float __lcpp_x) noexcept { | |
return __builtin_fabsf(__lcpp_x); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) double abs(double __lcpp_x) noexcept { | |
return __builtin_fabs(__lcpp_x); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) long double | |
abs(long double __lcpp_x) noexcept { | |
return __builtin_fabsl(__lcpp_x); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ldiv_t div(long __x, long __y) noexcept { | |
return ::ldiv(__x, __y); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) lldiv_t div(long long __x, | |
long long __y) noexcept { | |
return ::lldiv(__x, __y); | |
} | |
} | |
namespace std { inline namespace __1 { | |
using ::size_t; | |
using ::div_t __attribute__((using_if_exists)); | |
using ::ldiv_t __attribute__((using_if_exists)); | |
using ::lldiv_t __attribute__((using_if_exists)); | |
using ::atof __attribute__((using_if_exists)); | |
using ::atoi __attribute__((using_if_exists)); | |
using ::atol __attribute__((using_if_exists)); | |
using ::atoll __attribute__((using_if_exists)); | |
using ::strtod __attribute__((using_if_exists)); | |
using ::strtof __attribute__((using_if_exists)); | |
using ::strtold __attribute__((using_if_exists)); | |
using ::strtol __attribute__((using_if_exists)); | |
using ::strtoll __attribute__((using_if_exists)); | |
using ::strtoul __attribute__((using_if_exists)); | |
using ::strtoull __attribute__((using_if_exists)); | |
using ::rand __attribute__((using_if_exists)); | |
using ::srand __attribute__((using_if_exists)); | |
using ::calloc __attribute__((using_if_exists)); | |
using ::free __attribute__((using_if_exists)); | |
using ::malloc __attribute__((using_if_exists)); | |
using ::realloc __attribute__((using_if_exists)); | |
using ::abort __attribute__((using_if_exists)); | |
using ::atexit __attribute__((using_if_exists)); | |
using ::exit __attribute__((using_if_exists)); | |
using ::_Exit __attribute__((using_if_exists)); | |
using ::getenv __attribute__((using_if_exists)); | |
using ::system __attribute__((using_if_exists)); | |
using ::bsearch __attribute__((using_if_exists)); | |
using ::qsort __attribute__((using_if_exists)); | |
using ::abs __attribute__((using_if_exists)); | |
using ::labs __attribute__((using_if_exists)); | |
using ::llabs __attribute__((using_if_exists)); | |
using ::div __attribute__((using_if_exists)); | |
using ::ldiv __attribute__((using_if_exists)); | |
using ::lldiv __attribute__((using_if_exists)); | |
using ::mblen __attribute__((using_if_exists)); | |
using ::mbtowc __attribute__((using_if_exists)); | |
using ::wctomb __attribute__((using_if_exists)); | |
using ::mbstowcs __attribute__((using_if_exists)); | |
using ::wcstombs __attribute__((using_if_exists)); | |
} } | |
namespace std | |
{ | |
class __attribute__ ((__visibility__("default"))) exception | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) exception() noexcept {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) exception(const exception&) noexcept = default; | |
virtual ~exception() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) bad_exception | |
: public exception | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) bad_exception() noexcept {} | |
virtual ~bad_exception() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
typedef void (*unexpected_handler)(); | |
__attribute__ ((__visibility__("default"))) unexpected_handler set_unexpected(unexpected_handler) noexcept; | |
__attribute__ ((__visibility__("default"))) unexpected_handler get_unexpected() noexcept; | |
[[noreturn]] __attribute__ ((__visibility__("default"))) void unexpected(); | |
typedef void (*terminate_handler)(); | |
__attribute__ ((__visibility__("default"))) terminate_handler set_terminate(terminate_handler) noexcept; | |
__attribute__ ((__visibility__("default"))) terminate_handler get_terminate() noexcept; | |
[[noreturn]] __attribute__ ((__visibility__("default"))) void terminate() noexcept; | |
__attribute__ ((__visibility__("default"))) bool uncaught_exception() noexcept; | |
__attribute__ ((__visibility__("default"))) __attribute__((availability(macosx,strict,introduced=10.12))) __attribute__((availability(ios,strict,introduced=10.0))) __attribute__((availability(tvos,strict,introduced=10.0))) __attribute__((availability(watchos,strict,introduced=3.0))) int uncaught_exceptions() noexcept; | |
class __attribute__ ((__visibility__("default"))) exception_ptr; | |
__attribute__ ((__visibility__("default"))) exception_ptr current_exception() noexcept; | |
[[noreturn]] __attribute__ ((__visibility__("default"))) void rethrow_exception(exception_ptr); | |
class __attribute__ ((__visibility__("default"))) exception_ptr | |
{ | |
void* __ptr_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) exception_ptr() noexcept : __ptr_() {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) exception_ptr(nullptr_t) noexcept : __ptr_() {} | |
exception_ptr(const exception_ptr&) noexcept; | |
exception_ptr& operator=(const exception_ptr&) noexcept; | |
~exception_ptr() noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit operator bool() const noexcept | |
{return __ptr_ != nullptr;} | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(const exception_ptr& __x, const exception_ptr& __y) noexcept | |
{return __x.__ptr_ == __y.__ptr_;} | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(const exception_ptr& __x, const exception_ptr& __y) noexcept | |
{return !(__x == __y);} | |
friend __attribute__ ((__visibility__("default"))) exception_ptr current_exception() noexcept; | |
friend __attribute__ ((__visibility__("default"))) void rethrow_exception(exception_ptr); | |
}; | |
template<class _Ep> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) exception_ptr | |
make_exception_ptr(_Ep __e) noexcept | |
{ | |
((void)__e); | |
std::__1::abort(); | |
} | |
class __attribute__ ((__visibility__("default"))) nested_exception | |
{ | |
exception_ptr __ptr_; | |
public: | |
nested_exception() noexcept; | |
virtual ~nested_exception() noexcept; | |
[[noreturn]] void rethrow_nested() const; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) exception_ptr nested_ptr() const noexcept {return __ptr_;} | |
}; | |
template <class _Tp> | |
struct __nested | |
: public _Tp, | |
public nested_exception | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit __nested(const _Tp& __t) : _Tp(__t) {} | |
}; | |
template <class _Tp> | |
[[noreturn]] | |
void | |
throw_with_nested(_Tp&& __t) | |
{ | |
((void)__t); | |
} | |
template <class _From, class _To> | |
struct __can_dynamic_cast : public integral_constant<bool,(is_polymorphic<_From>::value && (!is_base_of<_To, _From>::value || is_convertible<const _From*, const _To*>::value))> {}; | |
template <class _Ep> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
rethrow_if_nested(const _Ep& __e, | |
typename enable_if< __can_dynamic_cast<_Ep, nested_exception>::value>::type* = 0) | |
{ | |
const nested_exception* __nep = dynamic_cast<const nested_exception*>(std::__1::addressof(__e)); | |
if (__nep) | |
__nep->rethrow_nested(); | |
} | |
template <class _Ep> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
rethrow_if_nested(const _Ep&, | |
typename enable_if<!__can_dynamic_cast<_Ep, nested_exception>::value>::type* = 0) | |
{ | |
} | |
} | |
namespace std { inline namespace __1 { | |
using::int8_t; | |
using::int16_t; | |
using::int32_t; | |
using::int64_t; | |
using::uint8_t; | |
using::uint16_t; | |
using::uint32_t; | |
using::uint64_t; | |
using::int_least8_t; | |
using::int_least16_t; | |
using::int_least32_t; | |
using::int_least64_t; | |
using::uint_least8_t; | |
using::uint_least16_t; | |
using::uint_least32_t; | |
using::uint_least64_t; | |
using::int_fast8_t; | |
using::int_fast16_t; | |
using::int_fast32_t; | |
using::int_fast64_t; | |
using::uint_fast8_t; | |
using::uint_fast16_t; | |
using::uint_fast32_t; | |
using::uint_fast64_t; | |
using::intptr_t; | |
using::uintptr_t; | |
using::intmax_t; | |
using::uintmax_t; | |
} } | |
namespace std | |
{ | |
struct __type_info_implementations { | |
struct __string_impl_base { | |
typedef const char* __type_name_t; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
constexpr static const char* __type_name_to_string(__type_name_t __v) noexcept { | |
return __v; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
constexpr static __type_name_t __string_to_type_name(const char* __v) noexcept { | |
return __v; | |
} | |
}; | |
struct __unique_impl : __string_impl_base { | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static size_t __hash(__type_name_t __v) noexcept { | |
return reinterpret_cast<size_t>(__v); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static bool __eq(__type_name_t __lhs, __type_name_t __rhs) noexcept { | |
return __lhs == __rhs; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static bool __lt(__type_name_t __lhs, __type_name_t __rhs) noexcept { | |
return __lhs < __rhs; | |
} | |
}; | |
struct __non_unique_impl : __string_impl_base { | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static size_t __hash(__type_name_t __ptr) noexcept { | |
size_t __hash = 5381; | |
while (unsigned char __c = static_cast<unsigned char>(*__ptr++)) | |
__hash = (__hash * 33) ^ __c; | |
return __hash; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static bool __eq(__type_name_t __lhs, __type_name_t __rhs) noexcept { | |
return __lhs == __rhs || __builtin_strcmp(__lhs, __rhs) == 0; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static bool __lt(__type_name_t __lhs, __type_name_t __rhs) noexcept { | |
return __builtin_strcmp(__lhs, __rhs) < 0; | |
} | |
}; | |
struct __non_unique_arm_rtti_bit_impl { | |
typedef uintptr_t __type_name_t; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static const char* __type_name_to_string(__type_name_t __v) noexcept { | |
return reinterpret_cast<const char*>(__v & | |
~__non_unique_rtti_bit::value); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static __type_name_t __string_to_type_name(const char* __v) noexcept { | |
return reinterpret_cast<__type_name_t>(__v); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static size_t __hash(__type_name_t __v) noexcept { | |
if (__is_type_name_unique(__v)) | |
return reinterpret_cast<size_t>(__v); | |
return __non_unique_impl::__hash(__type_name_to_string(__v)); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static bool __eq(__type_name_t __lhs, __type_name_t __rhs) noexcept { | |
if (__lhs == __rhs) | |
return true; | |
if (__is_type_name_unique(__lhs, __rhs)) | |
return false; | |
return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) == 0; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__always_inline__)) | |
static bool __lt(__type_name_t __lhs, __type_name_t __rhs) noexcept { | |
if (__is_type_name_unique(__lhs, __rhs)) | |
return __lhs < __rhs; | |
return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) < 0; | |
} | |
private: | |
typedef integral_constant<__type_name_t, | |
(1ULL << ((8 * sizeof(__type_name_t)) - 1))> __non_unique_rtti_bit; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static bool __is_type_name_unique(__type_name_t __lhs) noexcept { | |
return !(__lhs & __non_unique_rtti_bit::value); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static bool __is_type_name_unique(__type_name_t __lhs, __type_name_t __rhs) noexcept { | |
return !((__lhs & __rhs) & __non_unique_rtti_bit::value); | |
} | |
}; | |
typedef | |
__unique_impl | |
__impl; | |
}; | |
class __attribute__ ((__visibility__("default"))) type_info | |
{ | |
type_info& operator=(const type_info&); | |
type_info(const type_info&); | |
protected: | |
typedef __type_info_implementations::__impl __impl; | |
__impl::__type_name_t __type_name; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit type_info(const char* __n) | |
: __type_name(__impl::__string_to_type_name(__n)) {} | |
public: | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
virtual ~type_info(); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const char* name() const noexcept | |
{ | |
return __impl::__type_name_to_string(__type_name); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool before(const type_info& __arg) const noexcept | |
{ | |
return __impl::__lt(__type_name, __arg.__type_name); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t hash_code() const noexcept | |
{ | |
return __impl::__hash(__type_name); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(const type_info& __arg) const noexcept | |
{ | |
return __impl::__eq(__type_name, __arg.__type_name); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(const type_info& __arg) const noexcept | |
{ return !operator==(__arg); } | |
}; | |
class __attribute__ ((__visibility__("default"))) bad_cast | |
: public exception | |
{ | |
public: | |
bad_cast() noexcept; | |
bad_cast(const bad_cast&) noexcept = default; | |
virtual ~bad_cast() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) bad_typeid | |
: public exception | |
{ | |
public: | |
bad_typeid() noexcept; | |
virtual ~bad_typeid() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
} | |
namespace std { inline namespace __1 { | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_bad_cast() | |
{ | |
std::__1::abort(); | |
} | |
} } | |
namespace std | |
{ | |
struct __attribute__ ((__visibility__("default"))) nothrow_t { explicit nothrow_t() = default; }; | |
extern __attribute__ ((__visibility__("default"))) const nothrow_t nothrow; | |
class __attribute__ ((__visibility__("default"))) bad_alloc | |
: public exception | |
{ | |
public: | |
bad_alloc() noexcept; | |
virtual ~bad_alloc() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) bad_array_new_length | |
: public bad_alloc | |
{ | |
public: | |
bad_array_new_length() noexcept; | |
virtual ~bad_array_new_length() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
typedef void (*new_handler)(); | |
__attribute__ ((__visibility__("default"))) new_handler set_new_handler(new_handler) noexcept; | |
__attribute__ ((__visibility__("default"))) new_handler get_new_handler() noexcept; | |
[[noreturn]] __attribute__ ((__visibility__("default"))) void __throw_bad_alloc(); | |
enum class __attribute__ ((__type_visibility__("default"))) align_val_t : size_t { }; | |
} | |
__attribute__ ((__visibility__("default"))) void* operator new(std::size_t __sz) ; | |
__attribute__ ((__visibility__("default"))) void* operator new(std::size_t __sz, const std::nothrow_t&) noexcept __attribute__((__malloc__)); | |
__attribute__ ((__visibility__("default"))) void operator delete(void* __p) noexcept; | |
__attribute__ ((__visibility__("default"))) void operator delete(void* __p, const std::nothrow_t&) noexcept; | |
__attribute__ ((__visibility__("default"))) __attribute__((availability(macosx,strict,introduced=10.12))) __attribute__((availability(ios,strict,introduced=10.0))) __attribute__((availability(tvos,strict,introduced=10.0))) __attribute__((availability(watchos,strict,introduced=3.0))) void operator delete(void* __p, std::size_t __sz) noexcept; | |
__attribute__ ((__visibility__("default"))) void* operator new[](std::size_t __sz) ; | |
__attribute__ ((__visibility__("default"))) void* operator new[](std::size_t __sz, const std::nothrow_t&) noexcept __attribute__((__malloc__)); | |
__attribute__ ((__visibility__("default"))) void operator delete[](void* __p) noexcept; | |
__attribute__ ((__visibility__("default"))) void operator delete[](void* __p, const std::nothrow_t&) noexcept; | |
__attribute__ ((__visibility__("default"))) __attribute__((availability(macosx,strict,introduced=10.12))) __attribute__((availability(ios,strict,introduced=10.0))) __attribute__((availability(tvos,strict,introduced=10.0))) __attribute__((availability(watchos,strict,introduced=3.0))) void operator delete[](void* __p, std::size_t __sz) noexcept; | |
__attribute__ ((__visibility__("default"))) void* operator new(std::size_t __sz, std::align_val_t) ; | |
__attribute__ ((__visibility__("default"))) void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) noexcept __attribute__((__malloc__)); | |
__attribute__ ((__visibility__("default"))) void operator delete(void* __p, std::align_val_t) noexcept; | |
__attribute__ ((__visibility__("default"))) void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) noexcept; | |
__attribute__ ((__visibility__("default"))) __attribute__((availability(macosx,strict,introduced=10.12))) __attribute__((availability(ios,strict,introduced=10.0))) __attribute__((availability(tvos,strict,introduced=10.0))) __attribute__((availability(watchos,strict,introduced=3.0))) void operator delete(void* __p, std::size_t __sz, std::align_val_t) noexcept; | |
__attribute__ ((__visibility__("default"))) void* operator new[](std::size_t __sz, std::align_val_t) ; | |
__attribute__ ((__visibility__("default"))) void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) noexcept __attribute__((__malloc__)); | |
__attribute__ ((__visibility__("default"))) void operator delete[](void* __p, std::align_val_t) noexcept; | |
__attribute__ ((__visibility__("default"))) void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) noexcept; | |
__attribute__ ((__visibility__("default"))) __attribute__((availability(macosx,strict,introduced=10.12))) __attribute__((availability(ios,strict,introduced=10.0))) __attribute__((availability(tvos,strict,introduced=10.0))) __attribute__((availability(watchos,strict,introduced=3.0))) void operator delete[](void* __p, std::size_t __sz, std::align_val_t) noexcept; | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void* operator new (std::size_t, void* __p) noexcept {return __p;} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void* operator new[](std::size_t, void* __p) noexcept {return __p;} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void operator delete (void*, void*) noexcept {} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void operator delete[](void*, void*) noexcept {} | |
namespace std { inline namespace __1 { | |
constexpr inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) bool __is_overaligned_for_new(size_t __align) noexcept { | |
return __align > 16UL; | |
} | |
template <class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void* __libcpp_operator_new(_Args ...__args) { | |
return __builtin_operator_new(__args...); | |
} | |
template <class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __libcpp_operator_delete(_Args ...__args) { | |
__builtin_operator_delete(__args...); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void *__libcpp_allocate(size_t __size, size_t __align) { | |
(void)__align; | |
return __libcpp_operator_new(__size); | |
} | |
template <class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __do_deallocate_handle_size(void *__ptr, size_t __size, _Args ...__args) { | |
(void)__size; | |
return __libcpp_operator_delete(__ptr, __args...); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) { | |
(void)__align; | |
return __do_deallocate_handle_size(__ptr, __size); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __libcpp_deallocate_unsized(void* __ptr, size_t __align) { | |
(void)__align; | |
return __libcpp_operator_delete(__ptr); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) { | |
void* __result = nullptr; | |
::posix_memalign(&__result, __alignment, __size); | |
return __result; | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __libcpp_aligned_free(void* __ptr) { | |
::free(__ptr); | |
} | |
template <class _Tp> | |
inline | |
constexpr _Tp* __launder(_Tp* __p) noexcept | |
{ | |
static_assert (!(is_function<_Tp>::value), "can't launder functions" ); | |
static_assert (!(is_same<void, typename remove_cv<_Tp>::type>::value), "can't launder cv-void" ); | |
return __builtin_launder(__p); | |
} | |
} } | |
namespace std { inline namespace __1 { | |
template <class _Tp> struct __attribute__ ((__type_visibility__("default"))) tuple_size; | |
template <class _Tp, class...> | |
using __enable_if_tuple_size_imp = _Tp; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_size<__enable_if_tuple_size_imp< | |
const _Tp, | |
typename enable_if<!is_volatile<_Tp>::value>::type, | |
integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> | |
: public integral_constant<size_t, tuple_size<_Tp>::value> {}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_size<__enable_if_tuple_size_imp< | |
volatile _Tp, | |
typename enable_if<!is_const<_Tp>::value>::type, | |
integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> | |
: public integral_constant<size_t, tuple_size<_Tp>::value> {}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_size<__enable_if_tuple_size_imp< | |
const volatile _Tp, | |
integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> | |
: public integral_constant<size_t, tuple_size<_Tp>::value> {}; | |
template <size_t _Ip, class _Tp> struct __attribute__ ((__type_visibility__("default"))) tuple_element; | |
template <size_t _Ip, class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_element<_Ip, const _Tp> | |
{ | |
typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type; | |
}; | |
template <size_t _Ip, class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_element<_Ip, volatile _Tp> | |
{ | |
typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type; | |
}; | |
template <size_t _Ip, class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_element<_Ip, const volatile _Tp> | |
{ | |
typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type; | |
}; | |
template <class _Tp> struct __tuple_like : false_type {}; | |
template <class _Tp> struct __tuple_like<const _Tp> : public __tuple_like<_Tp> {}; | |
template <class _Tp> struct __tuple_like<volatile _Tp> : public __tuple_like<_Tp> {}; | |
template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_like<_Tp> {}; | |
template <size_t...> struct __tuple_indices {}; | |
template <class _IdxType, _IdxType... _Values> | |
struct __integer_sequence { | |
template <template <class _OIdxType, _OIdxType...> class _ToIndexSeq, class _ToIndexType> | |
using __convert = _ToIndexSeq<_ToIndexType, _Values...>; | |
template <size_t _Sp> | |
using __to_tuple_indices = __tuple_indices<(_Values + _Sp)...>; | |
}; | |
template <size_t _Ep, size_t _Sp> | |
using __make_indices_imp = | |
typename __make_integer_seq<__integer_sequence, size_t, _Ep - _Sp>::template | |
__to_tuple_indices<_Sp>; | |
template <size_t _Ep, size_t _Sp = 0> | |
struct __make_tuple_indices | |
{ | |
static_assert(_Sp <= _Ep, "__make_tuple_indices input error"); | |
typedef __make_indices_imp<_Ep, _Sp> type; | |
}; | |
template <class ..._Tp> class __attribute__ ((__type_visibility__("default"))) tuple; | |
template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {}; | |
template <class ..._Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_size<tuple<_Tp...> > | |
: public integral_constant<size_t, sizeof...(_Tp)> | |
{ | |
}; | |
template <size_t _Ip, class ..._Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename tuple_element<_Ip, tuple<_Tp...> >::type& | |
get(tuple<_Tp...>&) noexcept; | |
template <size_t _Ip, class ..._Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const typename tuple_element<_Ip, tuple<_Tp...> >::type& | |
get(const tuple<_Tp...>&) noexcept; | |
template <size_t _Ip, class ..._Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename tuple_element<_Ip, tuple<_Tp...> >::type&& | |
get(tuple<_Tp...>&&) noexcept; | |
template <size_t _Ip, class ..._Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const typename tuple_element<_Ip, tuple<_Tp...> >::type&& | |
get(const tuple<_Tp...>&&) noexcept; | |
template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {}; | |
template <size_t _Ip, class _T1, class _T2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename tuple_element<_Ip, pair<_T1, _T2> >::type& | |
get(pair<_T1, _T2>&) noexcept; | |
template <size_t _Ip, class _T1, class _T2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const typename tuple_element<_Ip, pair<_T1, _T2> >::type& | |
get(const pair<_T1, _T2>&) noexcept; | |
template <size_t _Ip, class _T1, class _T2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename tuple_element<_Ip, pair<_T1, _T2> >::type&& | |
get(pair<_T1, _T2>&&) noexcept; | |
template <size_t _Ip, class _T1, class _T2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&& | |
get(const pair<_T1, _T2>&&) noexcept; | |
template <class _Tp, size_t _Size> struct __attribute__ ((__type_visibility__("default"))) array; | |
template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {}; | |
template <size_t _Ip, class _Tp, size_t _Size> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp& | |
get(array<_Tp, _Size>&) noexcept; | |
template <size_t _Ip, class _Tp, size_t _Size> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _Tp& | |
get(const array<_Tp, _Size>&) noexcept; | |
template <size_t _Ip, class _Tp, size_t _Size> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp&& | |
get(array<_Tp, _Size>&&) noexcept; | |
template <size_t _Ip, class _Tp, size_t _Size> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _Tp&& | |
get(const array<_Tp, _Size>&&) noexcept; | |
template <class ..._Tp> struct __tuple_types {}; | |
template <size_t _Ip, class ..._Types> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_element<_Ip, __tuple_types<_Types...>> | |
{ | |
static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range"); | |
typedef __type_pack_element<_Ip, _Types...> type; | |
}; | |
template <class ..._Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_size<__tuple_types<_Tp...> > | |
: public integral_constant<size_t, sizeof...(_Tp)> | |
{ | |
}; | |
template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...> > : true_type {}; | |
template <bool _ApplyLV, bool _ApplyConst, bool _ApplyVolatile> | |
struct __apply_cv_mf; | |
template <> | |
struct __apply_cv_mf<false, false, false> { | |
template <class _Tp> using __apply = _Tp; | |
}; | |
template <> | |
struct __apply_cv_mf<false, true, false> { | |
template <class _Tp> using __apply = const _Tp; | |
}; | |
template <> | |
struct __apply_cv_mf<false, false, true> { | |
template <class _Tp> using __apply = volatile _Tp; | |
}; | |
template <> | |
struct __apply_cv_mf<false, true, true> { | |
template <class _Tp> using __apply = const volatile _Tp; | |
}; | |
template <> | |
struct __apply_cv_mf<true, false, false> { | |
template <class _Tp> using __apply = _Tp&; | |
}; | |
template <> | |
struct __apply_cv_mf<true, true, false> { | |
template <class _Tp> using __apply = const _Tp&; | |
}; | |
template <> | |
struct __apply_cv_mf<true, false, true> { | |
template <class _Tp> using __apply = volatile _Tp&; | |
}; | |
template <> | |
struct __apply_cv_mf<true, true, true> { | |
template <class _Tp> using __apply = const volatile _Tp&; | |
}; | |
template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type> | |
using __apply_cv_t = __apply_cv_mf< | |
is_lvalue_reference<_Tp>::value, | |
is_const<_RawTp>::value, | |
is_volatile<_RawTp>::value>; | |
template <class _TupleTypes, class _TupleIndices> | |
struct __make_tuple_types_flat; | |
template <template <class...> class _Tuple, class ..._Types, size_t ..._Idx> | |
struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> { | |
template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>> | |
using __apply_quals = __tuple_types< | |
typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>... | |
>; | |
}; | |
template <class _Vt, size_t _Np, size_t ..._Idx> | |
struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> { | |
template <size_t> | |
using __value_type = _Vt; | |
template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>> | |
using __apply_quals = __tuple_types< | |
typename _ApplyFn::template __apply<__value_type<_Idx>>... | |
>; | |
}; | |
template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value, | |
size_t _Sp = 0, | |
bool _SameSize = (_Ep == tuple_size<typename remove_reference<_Tp>::type>::value)> | |
struct __make_tuple_types | |
{ | |
static_assert(_Sp <= _Ep, "__make_tuple_types input error"); | |
using _RawTp = typename remove_cv<typename remove_reference<_Tp>::type>::type; | |
using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>; | |
using type = typename _Maker::template __apply_quals<_Tp>; | |
}; | |
template <class ..._Types, size_t _Ep> | |
struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> { | |
typedef __tuple_types<_Types...> type; | |
}; | |
template <class ..._Types, size_t _Ep> | |
struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> { | |
typedef __tuple_types<_Types...> type; | |
}; | |
template <bool ..._Preds> | |
struct __all_dummy; | |
template <bool ..._Pred> | |
using __all = _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>>; | |
struct __tuple_sfinae_base { | |
template <template <class, class...> class _Trait, | |
class ..._LArgs, class ..._RArgs> | |
static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>) | |
-> __all<typename enable_if<_Trait<_LArgs, _RArgs>::value, bool>::type{true}...>; | |
template <template <class...> class> | |
static auto __do_test(...) -> false_type; | |
template <class _FromArgs, class _ToArgs> | |
using __constructible = decltype(__do_test<is_constructible>(_ToArgs{}, _FromArgs{})); | |
template <class _FromArgs, class _ToArgs> | |
using __convertible = decltype(__do_test<is_convertible>(_FromArgs{}, _ToArgs{})); | |
template <class _FromArgs, class _ToArgs> | |
using __assignable = decltype(__do_test<is_assignable>(_ToArgs{}, _FromArgs{})); | |
}; | |
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, | |
bool = __tuple_like<_Up>::value> | |
struct __tuple_convertible | |
: public false_type {}; | |
template <class _Tp, class _Up> | |
struct __tuple_convertible<_Tp, _Up, true, true> | |
: public __tuple_sfinae_base::__convertible< | |
typename __make_tuple_types<_Tp>::type | |
, typename __make_tuple_types<_Up>::type | |
> | |
{}; | |
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, | |
bool = __tuple_like<_Up>::value> | |
struct __tuple_constructible | |
: public false_type {}; | |
template <class _Tp, class _Up> | |
struct __tuple_constructible<_Tp, _Up, true, true> | |
: public __tuple_sfinae_base::__constructible< | |
typename __make_tuple_types<_Tp>::type | |
, typename __make_tuple_types<_Up>::type | |
> | |
{}; | |
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, | |
bool = __tuple_like<_Up>::value> | |
struct __tuple_assignable | |
: public false_type {}; | |
template <class _Tp, class _Up> | |
struct __tuple_assignable<_Tp, _Up, true, true> | |
: public __tuple_sfinae_base::__assignable< | |
typename __make_tuple_types<_Tp>::type | |
, typename __make_tuple_types<_Up&>::type | |
> | |
{}; | |
template <size_t _Ip, class ..._Tp> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_element<_Ip, tuple<_Tp...> > | |
{ | |
typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; | |
}; | |
template <size_t _Ip, class ..._Tp> | |
using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; | |
template <bool _IsTuple, class _SizeTrait, size_t _Expected> | |
struct __tuple_like_with_size_imp : false_type {}; | |
template <class _SizeTrait, size_t _Expected> | |
struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected> | |
: integral_constant<bool, _SizeTrait::value == _Expected> {}; | |
template <class _Tuple, size_t _ExpectedSize, | |
class _RawTuple = typename __uncvref<_Tuple>::type> | |
using __tuple_like_with_size = __tuple_like_with_size_imp< | |
__tuple_like<_RawTuple>::value, | |
tuple_size<_RawTuple>, _ExpectedSize | |
>; | |
struct __attribute__ ((__visibility__("default"))) __check_tuple_constructor_fail { | |
static constexpr bool __enable_explicit_default() { return false; } | |
static constexpr bool __enable_implicit_default() { return false; } | |
template <class ...> | |
static constexpr bool __enable_explicit() { return false; } | |
template <class ...> | |
static constexpr bool __enable_implicit() { return false; } | |
template <class ...> | |
static constexpr bool __enable_assign() { return false; } | |
}; | |
} } | |
namespace std | |
{ | |
template<class _Ep> | |
class __attribute__ ((__type_visibility__("default"))) initializer_list | |
{ | |
const _Ep* __begin_; | |
size_t __size_; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
initializer_list(const _Ep* __b, size_t __s) noexcept | |
: __begin_(__b), | |
__size_(__s) | |
{} | |
public: | |
typedef _Ep value_type; | |
typedef const _Ep& reference; | |
typedef const _Ep& const_reference; | |
typedef size_t size_type; | |
typedef const _Ep* iterator; | |
typedef const _Ep* const_iterator; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
initializer_list() noexcept : __begin_(nullptr), __size_(0) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
size_t size() const noexcept {return __size_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
const _Ep* begin() const noexcept {return __begin_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
const _Ep* end() const noexcept {return __begin_ + __size_;} | |
}; | |
template<class _Ep> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
const _Ep* | |
begin(initializer_list<_Ep> __il) noexcept | |
{ | |
return __il.begin(); | |
} | |
template<class _Ep> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
const _Ep* | |
end(initializer_list<_Ep> __il) noexcept | |
{ | |
return __il.end(); | |
} | |
} | |
extern "C" { | |
void *memchr(const void *__s, int __c, size_t __n); | |
int memcmp(const void *__s1, const void *__s2, size_t __n); | |
void *memcpy(void *__dst, const void *__src, size_t __n); | |
void *memmove(void *__dst, const void *__src, size_t __len); | |
void *memset(void *__b, int __c, size_t __len); | |
char *strcat(char *__s1, const char *__s2); | |
char *strchr(const char *__s, int __c); | |
int strcmp(const char *__s1, const char *__s2); | |
int strcoll(const char *__s1, const char *__s2); | |
char *strcpy(char *__dst, const char *__src); | |
size_t strcspn(const char *__s, const char *__charset); | |
char *strerror(int __errnum) __asm("_" "strerror" ); | |
size_t strlen(const char *__s); | |
char *strncat(char *__s1, const char *__s2, size_t __n); | |
int strncmp(const char *__s1, const char *__s2, size_t __n); | |
char *strncpy(char *__dst, const char *__src, size_t __n); | |
char *strpbrk(const char *__s, const char *__charset); | |
char *strrchr(const char *__s, int __c); | |
size_t strspn(const char *__s, const char *__charset); | |
char *strstr(const char *__big, const char *__little); | |
char *strtok(char *__str, const char *__sep); | |
size_t strxfrm(char *__s1, const char *__s2, size_t __n); | |
} | |
extern "C" { | |
char *strtok_r(char *__str, const char *__sep, char **__lasts); | |
} | |
extern "C" { | |
int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen); | |
char *strdup(const char *__s1); | |
void *memccpy(void *__dst, const void *__src, int __c, size_t __n); | |
} | |
extern "C" { | |
char *stpcpy(char *__dst, const char *__src); | |
char *stpncpy(char *__dst, const char *__src, size_t __n) __attribute__((availability(macosx,introduced=10.7))); | |
char *strndup(const char *__s1, size_t __n) __attribute__((availability(macosx,introduced=10.7))); | |
size_t strnlen(const char *__s1, size_t __n) __attribute__((availability(macosx,introduced=10.7))); | |
char *strsignal(int __sig); | |
} | |
extern "C" { | |
void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __attribute__((availability(macosx,introduced=10.7))); | |
void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __attribute__((availability(macosx,introduced=10.5))); | |
void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __attribute__((availability(macosx,introduced=10.5))); | |
void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __attribute__((availability(macosx,introduced=10.5))); | |
char *strcasestr(const char *__big, const char *__little); | |
char *strnstr(const char *__big, const char *__little, size_t __len); | |
size_t strlcat(char *__dst, const char *__source, size_t __size); | |
size_t strlcpy(char *__dst, const char *__source, size_t __size); | |
void strmode(int __mode, char *__bp); | |
char *strsep(char **__stringp, const char *__delim); | |
void swab(const void * , void * , ssize_t); | |
__attribute__((availability(macosx,introduced=10.12.1))) __attribute__((availability(ios,introduced=10.1))) | |
__attribute__((availability(tvos,introduced=10.0.1))) __attribute__((availability(watchos,introduced=3.1))) | |
int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len); | |
__attribute__((availability(macosx,introduced=11.0))) __attribute__((availability(ios,introduced=14.0))) | |
__attribute__((availability(tvos,introduced=14.0))) __attribute__((availability(watchos,introduced=7.0))) | |
int strsignal_r(int __sig, char *__strsignalbuf, size_t __buflen); | |
} | |
extern "C" { | |
int bcmp(const void *, const void *, size_t) ; | |
void bcopy(const void *, void *, size_t) ; | |
void bzero(void *, size_t) ; | |
char *index(const char *, int) ; | |
char *rindex(const char *, int) ; | |
int ffs(int); | |
int strcasecmp(const char *, const char *); | |
int strncasecmp(const char *, const char *, size_t); | |
} | |
extern "C" { | |
int ffsl(long) __attribute__((availability(macosx,introduced=10.5))); | |
int ffsll(long long) __attribute__((availability(macosx,introduced=10.9))); | |
int fls(int) __attribute__((availability(macosx,introduced=10.5))); | |
int flsl(long) __attribute__((availability(macosx,introduced=10.5))); | |
int flsll(long long) __attribute__((availability(macosx,introduced=10.9))); | |
} | |
extern "C++" { | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const char* strpbrk(const char* __s1, const char* __s2) {return __libcpp_strpbrk(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
char* strpbrk( char* __s1, const char* __s2) {return __libcpp_strpbrk(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const char* strrchr(const char* __s, int __c) {return __libcpp_strrchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
char* strrchr( char* __s, int __c) {return __libcpp_strrchr(__s, __c);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const void* memchr(const void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
void* memchr( void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
const char* strstr(const char* __s1, const char* __s2) {return __libcpp_strstr(__s1, __s2);} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__ ((__enable_if__(true, ""))) | |
char* strstr( char* __s1, const char* __s2) {return __libcpp_strstr(__s1, __s2);} | |
} | |
namespace std { inline namespace __1 { | |
using ::size_t; | |
using ::memcpy __attribute__((using_if_exists)); | |
using ::memmove __attribute__((using_if_exists)); | |
using ::strcpy __attribute__((using_if_exists)); | |
using ::strncpy __attribute__((using_if_exists)); | |
using ::strcat __attribute__((using_if_exists)); | |
using ::strncat __attribute__((using_if_exists)); | |
using ::memcmp __attribute__((using_if_exists)); | |
using ::strcmp __attribute__((using_if_exists)); | |
using ::strncmp __attribute__((using_if_exists)); | |
using ::strcoll __attribute__((using_if_exists)); | |
using ::strxfrm __attribute__((using_if_exists)); | |
using ::memchr __attribute__((using_if_exists)); | |
using ::strchr __attribute__((using_if_exists)); | |
using ::strcspn __attribute__((using_if_exists)); | |
using ::strpbrk __attribute__((using_if_exists)); | |
using ::strrchr __attribute__((using_if_exists)); | |
using ::strspn __attribute__((using_if_exists)); | |
using ::strstr __attribute__((using_if_exists)); | |
using ::strtok __attribute__((using_if_exists)); | |
using ::memset __attribute__((using_if_exists)); | |
using ::strerror __attribute__((using_if_exists)); | |
using ::strlen __attribute__((using_if_exists)); | |
} } | |
namespace std { inline namespace __1 { | |
namespace rel_ops | |
{ | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const _Tp& __x, const _Tp& __y) | |
{ | |
return !(__x == __y); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator> (const _Tp& __x, const _Tp& __y) | |
{ | |
return __y < __x; | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(const _Tp& __x, const _Tp& __y) | |
{ | |
return !(__y < __x); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(const _Tp& __x, const _Tp& __y) | |
{ | |
return !(__x < __y); | |
} | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename conditional | |
< | |
!is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value, | |
const _Tp&, | |
_Tp&& | |
>::type | |
move_if_noexcept(_Tp& __x) noexcept | |
{ | |
return std::__1::move(__x); | |
} | |
struct __attribute__ ((__type_visibility__("default"))) piecewise_construct_t { explicit piecewise_construct_t() = default; }; | |
constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); | |
template <class _T1, class _T2> | |
struct __attribute__ ((__type_visibility__("default"))) pair | |
{ | |
typedef _T1 first_type; | |
typedef _T2 second_type; | |
_T1 first; | |
_T2 second; | |
pair(pair const&) = default; | |
pair(pair&&) = default; | |
template <bool _Val> | |
using _EnableB = typename enable_if<_Val, bool>::type; | |
struct _CheckArgs { | |
template <int&...> | |
static constexpr bool __enable_explicit_default() { | |
return is_default_constructible<_T1>::value | |
&& is_default_constructible<_T2>::value | |
&& !__enable_implicit_default<>(); | |
} | |
template <int&...> | |
static constexpr bool __enable_implicit_default() { | |
return __is_implicitly_default_constructible<_T1>::value | |
&& __is_implicitly_default_constructible<_T2>::value; | |
} | |
template <class _U1, class _U2> | |
static constexpr bool __enable_explicit() { | |
return is_constructible<first_type, _U1>::value | |
&& is_constructible<second_type, _U2>::value | |
&& (!is_convertible<_U1, first_type>::value | |
|| !is_convertible<_U2, second_type>::value); | |
} | |
template <class _U1, class _U2> | |
static constexpr bool __enable_implicit() { | |
return is_constructible<first_type, _U1>::value | |
&& is_constructible<second_type, _U2>::value | |
&& is_convertible<_U1, first_type>::value | |
&& is_convertible<_U2, second_type>::value; | |
} | |
}; | |
template <bool _MaybeEnable> | |
using _CheckArgsDep = typename conditional< | |
_MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type; | |
struct _CheckTupleLikeConstructor { | |
template <class _Tuple> | |
static constexpr bool __enable_implicit() { | |
return __tuple_convertible<_Tuple, pair>::value; | |
} | |
template <class _Tuple> | |
static constexpr bool __enable_explicit() { | |
return __tuple_constructible<_Tuple, pair>::value | |
&& !__tuple_convertible<_Tuple, pair>::value; | |
} | |
template <class _Tuple> | |
static constexpr bool __enable_assign() { | |
return __tuple_assignable<_Tuple, pair>::value; | |
} | |
}; | |
template <class _Tuple> | |
using _CheckTLC = typename conditional< | |
__tuple_like_with_size<_Tuple, 2>::value | |
&& !is_same<typename decay<_Tuple>::type, pair>::value, | |
_CheckTupleLikeConstructor, | |
__check_tuple_constructor_fail | |
>::type; | |
template<bool _Dummy = true, _EnableB< | |
_CheckArgsDep<_Dummy>::__enable_explicit_default() | |
> = false> | |
explicit LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair() noexcept(is_nothrow_default_constructible<first_type>::value && is_nothrow_default_constructible<second_type>::value) | |
: first(), second() {} | |
template<bool _Dummy = true, _EnableB< | |
_CheckArgsDep<_Dummy>::__enable_implicit_default() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair() noexcept(is_nothrow_default_constructible<first_type>::value && is_nothrow_default_constructible<second_type>::value) | |
: first(), second() {} | |
template <bool _Dummy = true, _EnableB< | |
_CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit pair(_T1 const& __t1, _T2 const& __t2) | |
noexcept(is_nothrow_copy_constructible<first_type>::value && is_nothrow_copy_constructible<second_type>::value) | |
: first(__t1), second(__t2) {} | |
template<bool _Dummy = true, _EnableB< | |
_CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair(_T1 const& __t1, _T2 const& __t2) | |
noexcept(is_nothrow_copy_constructible<first_type>::value && is_nothrow_copy_constructible<second_type>::value) | |
: first(__t1), second(__t2) {} | |
template<class _U1, class _U2, _EnableB< | |
_CheckArgs::template __enable_explicit<_U1, _U2>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit pair(_U1&& __u1, _U2&& __u2) | |
noexcept((is_nothrow_constructible<first_type, _U1>::value && is_nothrow_constructible<second_type, _U2>::value)) | |
: first(std::__1::forward<_U1>(__u1)), second(std::__1::forward<_U2>(__u2)) {} | |
template<class _U1, class _U2, _EnableB< | |
_CheckArgs::template __enable_implicit<_U1, _U2>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair(_U1&& __u1, _U2&& __u2) | |
noexcept((is_nothrow_constructible<first_type, _U1>::value && is_nothrow_constructible<second_type, _U2>::value)) | |
: first(std::__1::forward<_U1>(__u1)), second(std::__1::forward<_U2>(__u2)) {} | |
template<class _U1, class _U2, _EnableB< | |
_CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit pair(pair<_U1, _U2> const& __p) | |
noexcept((is_nothrow_constructible<first_type, _U1 const&>::value && is_nothrow_constructible<second_type, _U2 const&>::value)) | |
: first(__p.first), second(__p.second) {} | |
template<class _U1, class _U2, _EnableB< | |
_CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair(pair<_U1, _U2> const& __p) | |
noexcept((is_nothrow_constructible<first_type, _U1 const&>::value && is_nothrow_constructible<second_type, _U2 const&>::value)) | |
: first(__p.first), second(__p.second) {} | |
template<class _U1, class _U2, _EnableB< | |
_CheckArgs::template __enable_explicit<_U1, _U2>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit pair(pair<_U1, _U2>&&__p) | |
noexcept((is_nothrow_constructible<first_type, _U1&&>::value && is_nothrow_constructible<second_type, _U2&&>::value)) | |
: first(std::__1::forward<_U1>(__p.first)), second(std::__1::forward<_U2>(__p.second)) {} | |
template<class _U1, class _U2, _EnableB< | |
_CheckArgs::template __enable_implicit<_U1, _U2>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair(pair<_U1, _U2>&& __p) | |
noexcept((is_nothrow_constructible<first_type, _U1&&>::value && is_nothrow_constructible<second_type, _U2&&>::value)) | |
: first(std::__1::forward<_U1>(__p.first)), second(std::__1::forward<_U2>(__p.second)) {} | |
template<class _Tuple, _EnableB< | |
_CheckTLC<_Tuple>::template __enable_explicit<_Tuple>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit pair(_Tuple&& __p) | |
: first(std::__1::get<0>(std::__1::forward<_Tuple>(__p))), | |
second(std::__1::get<1>(std::__1::forward<_Tuple>(__p))) {} | |
template<class _Tuple, _EnableB< | |
_CheckTLC<_Tuple>::template __enable_implicit<_Tuple>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair(_Tuple&& __p) | |
: first(std::__1::get<0>(std::__1::forward<_Tuple>(__p))), | |
second(std::__1::get<1>(std::__1::forward<_Tuple>(__p))) {} | |
template <class... _Args1, class... _Args2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair(piecewise_construct_t __pc, | |
tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) | |
noexcept((is_nothrow_constructible<first_type, _Args1...>::value && is_nothrow_constructible<second_type, _Args2...>::value)) | |
: pair(__pc, __first_args, __second_args, | |
typename __make_tuple_indices<sizeof...(_Args1)>::type(), | |
typename __make_tuple_indices<sizeof...(_Args2) >::type()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair& operator=(typename conditional< | |
is_copy_assignable<first_type>::value && | |
is_copy_assignable<second_type>::value, | |
pair, __nat>::type const& __p) | |
noexcept(is_nothrow_copy_assignable<first_type>::value && is_nothrow_copy_assignable<second_type>::value) | |
{ | |
first = __p.first; | |
second = __p.second; | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair& operator=(typename conditional< | |
is_move_assignable<first_type>::value && | |
is_move_assignable<second_type>::value, | |
pair, __nat>::type&& __p) | |
noexcept(is_nothrow_move_assignable<first_type>::value && is_nothrow_move_assignable<second_type>::value) | |
{ | |
first = std::__1::forward<first_type>(__p.first); | |
second = std::__1::forward<second_type>(__p.second); | |
return *this; | |
} | |
template <class _Tuple, _EnableB< | |
_CheckTLC<_Tuple>::template __enable_assign<_Tuple>() | |
> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair& operator=(_Tuple&& __p) { | |
first = std::__1::get<0>(std::__1::forward<_Tuple>(__p)); | |
second = std::__1::get<1>(std::__1::forward<_Tuple>(__p)); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
swap(pair& __p) noexcept(__is_nothrow_swappable<first_type>::value && __is_nothrow_swappable<second_type>::value) | |
{ | |
using std::__1::swap; | |
swap(first, __p.first); | |
swap(second, __p.second); | |
} | |
private: | |
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair(piecewise_construct_t, | |
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args, | |
__tuple_indices<_I1...>, __tuple_indices<_I2...>); | |
}; | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator==(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) | |
{ | |
return __x.first == __y.first && __x.second == __y.second; | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) | |
{ | |
return !(__x == __y); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) | |
{ | |
return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) | |
{ | |
return __y < __x; | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) | |
{ | |
return !(__x < __y); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) | |
{ | |
return !(__y < __x); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
__is_swappable<_T1>::value && | |
__is_swappable<_T2>::value, | |
void | |
>::type | |
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | |
noexcept((__is_nothrow_swappable<_T1>::value && __is_nothrow_swappable<_T2>::value)) | |
{ | |
__x.swap(__y); | |
} | |
template <class _Tp> | |
struct __unwrap_reference { typedef _Tp type; }; | |
template <class _Tp> | |
struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _Tp& type; }; | |
template <class _Tp> | |
struct __unwrap_ref_decay | |
: __unwrap_reference<typename decay<_Tp>::type> | |
{ }; | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type> | |
make_pair(_T1&& __t1, _T2&& __t2) | |
{ | |
return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type> | |
(std::__1::forward<_T1>(__t1), std::__1::forward<_T2>(__t2)); | |
} | |
template <class _T1, class _T2> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_size<pair<_T1, _T2> > | |
: public integral_constant<size_t, 2> {}; | |
template <size_t _Ip, class _T1, class _T2> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_element<_Ip, pair<_T1, _T2> > | |
{ | |
static_assert(_Ip < 2, "Index out of bounds in std::tuple_element<std::pair<T1, T2>>"); | |
}; | |
template <class _T1, class _T2> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_element<0, pair<_T1, _T2> > | |
{ | |
typedef _T1 type; | |
}; | |
template <class _T1, class _T2> | |
struct __attribute__ ((__type_visibility__("default"))) tuple_element<1, pair<_T1, _T2> > | |
{ | |
typedef _T2 type; | |
}; | |
template <size_t _Ip> struct __get_pair; | |
template <> | |
struct __get_pair<0> | |
{ | |
template <class _T1, class _T2> | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_T1& | |
get(pair<_T1, _T2>& __p) noexcept {return __p.first;} | |
template <class _T1, class _T2> | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _T1& | |
get(const pair<_T1, _T2>& __p) noexcept {return __p.first;} | |
template <class _T1, class _T2> | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_T1&& | |
get(pair<_T1, _T2>&& __p) noexcept {return std::__1::forward<_T1>(__p.first);} | |
template <class _T1, class _T2> | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _T1&& | |
get(const pair<_T1, _T2>&& __p) noexcept {return std::__1::forward<const _T1>(__p.first);} | |
}; | |
template <> | |
struct __get_pair<1> | |
{ | |
template <class _T1, class _T2> | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_T2& | |
get(pair<_T1, _T2>& __p) noexcept {return __p.second;} | |
template <class _T1, class _T2> | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _T2& | |
get(const pair<_T1, _T2>& __p) noexcept {return __p.second;} | |
template <class _T1, class _T2> | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_T2&& | |
get(pair<_T1, _T2>&& __p) noexcept {return std::__1::forward<_T2>(__p.second);} | |
template <class _T1, class _T2> | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _T2&& | |
get(const pair<_T1, _T2>&& __p) noexcept {return std::__1::forward<const _T2>(__p.second);} | |
}; | |
template <size_t _Ip, class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename tuple_element<_Ip, pair<_T1, _T2> >::type& | |
get(pair<_T1, _T2>& __p) noexcept | |
{ | |
return __get_pair<_Ip>::get(__p); | |
} | |
template <size_t _Ip, class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const typename tuple_element<_Ip, pair<_T1, _T2> >::type& | |
get(const pair<_T1, _T2>& __p) noexcept | |
{ | |
return __get_pair<_Ip>::get(__p); | |
} | |
template <size_t _Ip, class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename tuple_element<_Ip, pair<_T1, _T2> >::type&& | |
get(pair<_T1, _T2>&& __p) noexcept | |
{ | |
return __get_pair<_Ip>::get(std::__1::move(__p)); | |
} | |
template <size_t _Ip, class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&& | |
get(const pair<_T1, _T2>&& __p) noexcept | |
{ | |
return __get_pair<_Ip>::get(std::__1::move(__p)); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 & get(pair<_T1, _T2>& __p) noexcept | |
{ | |
return __get_pair<0>::get(__p); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 const & get(pair<_T1, _T2> const& __p) noexcept | |
{ | |
return __get_pair<0>::get(__p); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 && get(pair<_T1, _T2>&& __p) noexcept | |
{ | |
return __get_pair<0>::get(std::__1::move(__p)); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 const && get(pair<_T1, _T2> const&& __p) noexcept | |
{ | |
return __get_pair<0>::get(std::__1::move(__p)); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 & get(pair<_T2, _T1>& __p) noexcept | |
{ | |
return __get_pair<1>::get(__p); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 const & get(pair<_T2, _T1> const& __p) noexcept | |
{ | |
return __get_pair<1>::get(__p); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 && get(pair<_T2, _T1>&& __p) noexcept | |
{ | |
return __get_pair<1>::get(std::__1::move(__p)); | |
} | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 const && get(pair<_T2, _T1> const&& __p) noexcept | |
{ | |
return __get_pair<1>::get(std::__1::move(__p)); | |
} | |
template<class _Tp, _Tp... _Ip> | |
struct __attribute__ ((__type_visibility__("default"))) integer_sequence | |
{ | |
typedef _Tp value_type; | |
static_assert( is_integral<_Tp>::value, | |
"std::integer_sequence can only be instantiated with an integral type" ); | |
static | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
size_t | |
size() noexcept { return sizeof...(_Ip); } | |
}; | |
template<size_t... _Ip> | |
using index_sequence = integer_sequence<size_t, _Ip...>; | |
template <class _Tp, _Tp _Ep> | |
using __make_integer_sequence = __make_integer_seq<integer_sequence, _Tp, _Ep>; | |
template<class _Tp, _Tp _Np> | |
using make_integer_sequence = __make_integer_sequence<_Tp, _Np>; | |
template<size_t _Np> | |
using make_index_sequence = make_integer_sequence<size_t, _Np>; | |
template<class... _Tp> | |
using index_sequence_for = make_index_sequence<sizeof...(_Tp)>; | |
template<class _T1, class _T2 = _T1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_T1 exchange(_T1& __obj, _T2 && __new_value) | |
{ | |
_T1 __old_value = std::__1::move(__obj); | |
__obj = std::__1::forward<_T2>(__new_value); | |
return __old_value; | |
} | |
template <class _Arg, class _Result> | |
struct __attribute__ ((__type_visibility__("default"))) unary_function | |
{ | |
typedef _Arg argument_type; | |
typedef _Result result_type; | |
}; | |
template <class _Size> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Size | |
__loadword(const void* __p) | |
{ | |
_Size __r; | |
std::__1::memcpy(&__r, __p, sizeof(__r)); | |
return __r; | |
} | |
template <class _Size, size_t = sizeof(_Size)*8> | |
struct __murmur2_or_cityhash; | |
template <class _Size> | |
struct __murmur2_or_cityhash<_Size, 32> | |
{ | |
inline _Size operator()(const void* __key, _Size __len) | |
__attribute__((__no_sanitize__("unsigned-integer-overflow"))); | |
}; | |
template <class _Size> | |
_Size | |
__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len) | |
{ | |
const _Size __m = 0x5bd1e995; | |
const _Size __r = 24; | |
_Size __h = __len; | |
const unsigned char* __data = static_cast<const unsigned char*>(__key); | |
for (; __len >= 4; __data += 4, __len -= 4) | |
{ | |
_Size __k = __loadword<_Size>(__data); | |
__k *= __m; | |
__k ^= __k >> __r; | |
__k *= __m; | |
__h *= __m; | |
__h ^= __k; | |
} | |
switch (__len) | |
{ | |
case 3: | |
__h ^= __data[2] << 16; | |
[[clang::fallthrough]]; | |
case 2: | |
__h ^= __data[1] << 8; | |
[[clang::fallthrough]]; | |
case 1: | |
__h ^= __data[0]; | |
__h *= __m; | |
} | |
__h ^= __h >> 13; | |
__h *= __m; | |
__h ^= __h >> 15; | |
return __h; | |
} | |
template <class _Size> | |
struct __murmur2_or_cityhash<_Size, 64> | |
{ | |
inline _Size operator()(const void* __key, _Size __len) __attribute__((__no_sanitize__("unsigned-integer-overflow"))); | |
private: | |
static const _Size __k0 = 0xc3a5c85c97cb3127ULL; | |
static const _Size __k1 = 0xb492b66fbe98f273ULL; | |
static const _Size __k2 = 0x9ae16a3b2f90404fULL; | |
static const _Size __k3 = 0xc949d7c7509e6557ULL; | |
static _Size __rotate(_Size __val, int __shift) { | |
return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift))); | |
} | |
static _Size __rotate_by_at_least_1(_Size __val, int __shift) { | |
return (__val >> __shift) | (__val << (64 - __shift)); | |
} | |
static _Size __shift_mix(_Size __val) { | |
return __val ^ (__val >> 47); | |
} | |
static _Size __hash_len_16(_Size __u, _Size __v) | |
__attribute__((__no_sanitize__("unsigned-integer-overflow"))) | |
{ | |
const _Size __mul = 0x9ddfea08eb382d69ULL; | |
_Size __a = (__u ^ __v) * __mul; | |
__a ^= (__a >> 47); | |
_Size __b = (__v ^ __a) * __mul; | |
__b ^= (__b >> 47); | |
__b *= __mul; | |
return __b; | |
} | |
static _Size __hash_len_0_to_16(const char* __s, _Size __len) | |
__attribute__((__no_sanitize__("unsigned-integer-overflow"))) | |
{ | |
if (__len > 8) { | |
const _Size __a = __loadword<_Size>(__s); | |
const _Size __b = __loadword<_Size>(__s + __len - 8); | |
return __hash_len_16(__a, __rotate_by_at_least_1(__b + __len, __len)) ^ __b; | |
} | |
if (__len >= 4) { | |
const uint32_t __a = __loadword<uint32_t>(__s); | |
const uint32_t __b = __loadword<uint32_t>(__s + __len - 4); | |
return __hash_len_16(__len + (__a << 3), __b); | |
} | |
if (__len > 0) { | |
const unsigned char __a = __s[0]; | |
const unsigned char __b = __s[__len >> 1]; | |
const unsigned char __c = __s[__len - 1]; | |
const uint32_t __y = static_cast<uint32_t>(__a) + | |
(static_cast<uint32_t>(__b) << 8); | |
const uint32_t __z = __len + (static_cast<uint32_t>(__c) << 2); | |
return __shift_mix(__y * __k2 ^ __z * __k3) * __k2; | |
} | |
return __k2; | |
} | |
static _Size __hash_len_17_to_32(const char *__s, _Size __len) | |
__attribute__((__no_sanitize__("unsigned-integer-overflow"))) | |
{ | |
const _Size __a = __loadword<_Size>(__s) * __k1; | |
const _Size __b = __loadword<_Size>(__s + 8); | |
const _Size __c = __loadword<_Size>(__s + __len - 8) * __k2; | |
const _Size __d = __loadword<_Size>(__s + __len - 16) * __k0; | |
return __hash_len_16(__rotate(__a - __b, 43) + __rotate(__c, 30) + __d, | |
__a + __rotate(__b ^ __k3, 20) - __c + __len); | |
} | |
static pair<_Size, _Size> __weak_hash_len_32_with_seeds( | |
_Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b) | |
__attribute__((__no_sanitize__("unsigned-integer-overflow"))) | |
{ | |
__a += __w; | |
__b = __rotate(__b + __a + __z, 21); | |
const _Size __c = __a; | |
__a += __x; | |
__a += __y; | |
__b += __rotate(__a, 44); | |
return pair<_Size, _Size>(__a + __z, __b + __c); | |
} | |
static pair<_Size, _Size> __weak_hash_len_32_with_seeds( | |
const char* __s, _Size __a, _Size __b) | |
__attribute__((__no_sanitize__("unsigned-integer-overflow"))) | |
{ | |
return __weak_hash_len_32_with_seeds(__loadword<_Size>(__s), | |
__loadword<_Size>(__s + 8), | |
__loadword<_Size>(__s + 16), | |
__loadword<_Size>(__s + 24), | |
__a, | |
__b); | |
} | |
static _Size __hash_len_33_to_64(const char *__s, size_t __len) | |
__attribute__((__no_sanitize__("unsigned-integer-overflow"))) | |
{ | |
_Size __z = __loadword<_Size>(__s + 24); | |
_Size __a = __loadword<_Size>(__s) + | |
(__len + __loadword<_Size>(__s + __len - 16)) * __k0; | |
_Size __b = __rotate(__a + __z, 52); | |
_Size __c = __rotate(__a, 37); | |
__a += __loadword<_Size>(__s + 8); | |
__c += __rotate(__a, 7); | |
__a += __loadword<_Size>(__s + 16); | |
_Size __vf = __a + __z; | |
_Size __vs = __b + __rotate(__a, 31) + __c; | |
__a = __loadword<_Size>(__s + 16) + __loadword<_Size>(__s + __len - 32); | |
__z += __loadword<_Size>(__s + __len - 8); | |
__b = __rotate(__a + __z, 52); | |
__c = __rotate(__a, 37); | |
__a += __loadword<_Size>(__s + __len - 24); | |
__c += __rotate(__a, 7); | |
__a += __loadword<_Size>(__s + __len - 16); | |
_Size __wf = __a + __z; | |
_Size __ws = __b + __rotate(__a, 31) + __c; | |
_Size __r = __shift_mix((__vf + __ws) * __k2 + (__wf + __vs) * __k0); | |
return __shift_mix(__r * __k0 + __vs) * __k2; | |
} | |
}; | |
template <class _Size> | |
_Size | |
__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len) | |
{ | |
const char* __s = static_cast<const char*>(__key); | |
if (__len <= 32) { | |
if (__len <= 16) { | |
return __hash_len_0_to_16(__s, __len); | |
} else { | |
return __hash_len_17_to_32(__s, __len); | |
} | |
} else if (__len <= 64) { | |
return __hash_len_33_to_64(__s, __len); | |
} | |
_Size __x = __loadword<_Size>(__s + __len - 40); | |
_Size __y = __loadword<_Size>(__s + __len - 16) + | |
__loadword<_Size>(__s + __len - 56); | |
_Size __z = __hash_len_16(__loadword<_Size>(__s + __len - 48) + __len, | |
__loadword<_Size>(__s + __len - 24)); | |
pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z); | |
pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x); | |
__x = __x * __k1 + __loadword<_Size>(__s); | |
__len = (__len - 1) & ~static_cast<_Size>(63); | |
do { | |
__x = __rotate(__x + __y + __v.first + __loadword<_Size>(__s + 8), 37) * __k1; | |
__y = __rotate(__y + __v.second + __loadword<_Size>(__s + 48), 42) * __k1; | |
__x ^= __w.second; | |
__y += __v.first + __loadword<_Size>(__s + 40); | |
__z = __rotate(__z + __w.first, 33) * __k1; | |
__v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first); | |
__w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second, | |
__y + __loadword<_Size>(__s + 16)); | |
std::__1::swap(__z, __x); | |
__s += 64; | |
__len -= 64; | |
} while (__len != 0); | |
return __hash_len_16( | |
__hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z, | |
__hash_len_16(__v.second, __w.second) + __x); | |
} | |
template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)> | |
struct __scalar_hash; | |
template <class _Tp> | |
struct __scalar_hash<_Tp, 0> | |
: public unary_function<_Tp, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(_Tp __v) const noexcept | |
{ | |
union | |
{ | |
_Tp __t; | |
size_t __a; | |
} __u; | |
__u.__a = 0; | |
__u.__t = __v; | |
return __u.__a; | |
} | |
}; | |
template <class _Tp> | |
struct __scalar_hash<_Tp, 1> | |
: public unary_function<_Tp, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(_Tp __v) const noexcept | |
{ | |
union | |
{ | |
_Tp __t; | |
size_t __a; | |
} __u; | |
__u.__t = __v; | |
return __u.__a; | |
} | |
}; | |
template <class _Tp> | |
struct __scalar_hash<_Tp, 2> | |
: public unary_function<_Tp, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(_Tp __v) const noexcept | |
{ | |
union | |
{ | |
_Tp __t; | |
struct | |
{ | |
size_t __a; | |
size_t __b; | |
} __s; | |
} __u; | |
__u.__t = __v; | |
return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u)); | |
} | |
}; | |
template <class _Tp> | |
struct __scalar_hash<_Tp, 3> | |
: public unary_function<_Tp, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(_Tp __v) const noexcept | |
{ | |
union | |
{ | |
_Tp __t; | |
struct | |
{ | |
size_t __a; | |
size_t __b; | |
size_t __c; | |
} __s; | |
} __u; | |
__u.__t = __v; | |
return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u)); | |
} | |
}; | |
template <class _Tp> | |
struct __scalar_hash<_Tp, 4> | |
: public unary_function<_Tp, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(_Tp __v) const noexcept | |
{ | |
union | |
{ | |
_Tp __t; | |
struct | |
{ | |
size_t __a; | |
size_t __b; | |
size_t __c; | |
size_t __d; | |
} __s; | |
} __u; | |
__u.__t = __v; | |
return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u)); | |
} | |
}; | |
struct _PairT { | |
size_t first; | |
size_t second; | |
}; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
inline size_t __hash_combine(size_t __lhs, size_t __rhs) noexcept { | |
typedef __scalar_hash<_PairT> _HashT; | |
const _PairT __p = {__lhs, __rhs}; | |
return _HashT()(__p); | |
} | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) hash<_Tp*> | |
: public unary_function<_Tp*, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(_Tp* __v) const noexcept | |
{ | |
union | |
{ | |
_Tp* __t; | |
size_t __a; | |
} __u; | |
__u.__t = __v; | |
return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u)); | |
} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<bool> | |
: public unary_function<bool, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(bool __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<char> | |
: public unary_function<char, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(char __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<signed char> | |
: public unary_function<signed char, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(signed char __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<unsigned char> | |
: public unary_function<unsigned char, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(unsigned char __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<char16_t> | |
: public unary_function<char16_t, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(char16_t __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<char32_t> | |
: public unary_function<char32_t, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(char32_t __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<wchar_t> | |
: public unary_function<wchar_t, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(wchar_t __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<short> | |
: public unary_function<short, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(short __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<unsigned short> | |
: public unary_function<unsigned short, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(unsigned short __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<int> | |
: public unary_function<int, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(int __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<unsigned int> | |
: public unary_function<unsigned int, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(unsigned int __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<long> | |
: public unary_function<long, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(long __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<unsigned long> | |
: public unary_function<unsigned long, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(unsigned long __v) const noexcept {return static_cast<size_t>(__v);} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<long long> | |
: public __scalar_hash<long long> | |
{ | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<unsigned long long> | |
: public __scalar_hash<unsigned long long> | |
{ | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<__int128_t> | |
: public __scalar_hash<__int128_t> | |
{ | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<__uint128_t> | |
: public __scalar_hash<__uint128_t> | |
{ | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<float> | |
: public __scalar_hash<float> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(float __v) const noexcept | |
{ | |
if (__v == 0.0f) | |
return 0; | |
return __scalar_hash<float>::operator()(__v); | |
} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<double> | |
: public __scalar_hash<double> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(double __v) const noexcept | |
{ | |
if (__v == 0.0) | |
return 0; | |
return __scalar_hash<double>::operator()(__v); | |
} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) hash<long double> | |
: public __scalar_hash<long double> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(long double __v) const noexcept | |
{ | |
if (__v == 0.0L) | |
return 0; | |
union | |
{ | |
long double __t; | |
struct | |
{ | |
size_t __a; | |
size_t __b; | |
} __s; | |
} __u; | |
__u.__s.__a = 0; | |
__u.__s.__b = 0; | |
__u.__t = __v; | |
return __u.__s.__a ^ __u.__s.__b; | |
} | |
}; | |
template <class _Tp, bool = is_enum<_Tp>::value> | |
struct __attribute__ ((__type_visibility__("default"))) __enum_hash | |
: public unary_function<_Tp, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(_Tp __v) const noexcept | |
{ | |
typedef typename underlying_type<_Tp>::type type; | |
return hash<type>{}(static_cast<type>(__v)); | |
} | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) __enum_hash<_Tp, false> { | |
__enum_hash() = delete; | |
__enum_hash(__enum_hash const&) = delete; | |
__enum_hash& operator=(__enum_hash const&) = delete; | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) hash : public __enum_hash<_Tp> | |
{ | |
}; | |
template <class _Key, class _Hash> | |
using __check_hash_requirements = integral_constant<bool, | |
is_copy_constructible<_Hash>::value && | |
is_move_constructible<_Hash>::value && | |
__invokable_r<size_t, _Hash, _Key const&>::value | |
>; | |
template <class _Key, class _Hash = hash<_Key> > | |
using __has_enabled_hash = integral_constant<bool, | |
__check_hash_requirements<_Key, _Hash>::value && | |
is_default_constructible<_Hash>::value | |
>; | |
template <class _Type, class ...> | |
using __enable_hash_helper = _Type; | |
} } | |
namespace std { inline namespace __1 { | |
enum float_round_style | |
{ | |
round_indeterminate = -1, | |
round_toward_zero = 0, | |
round_to_nearest = 1, | |
round_toward_infinity = 2, | |
round_toward_neg_infinity = 3 | |
}; | |
enum float_denorm_style | |
{ | |
denorm_indeterminate = -1, | |
denorm_absent = 0, | |
denorm_present = 1 | |
}; | |
template <class _Tp, bool = is_arithmetic<_Tp>::value> | |
class __libcpp_numeric_limits | |
{ | |
protected: | |
typedef _Tp type; | |
static constexpr const bool is_specialized = false; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return type();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return type();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return type();} | |
static constexpr const int digits = 0; | |
static constexpr const int digits10 = 0; | |
static constexpr const int max_digits10 = 0; | |
static constexpr const bool is_signed = false; | |
static constexpr const bool is_integer = false; | |
static constexpr const bool is_exact = false; | |
static constexpr const int radix = 0; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return type();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return type();} | |
static constexpr const int min_exponent = 0; | |
static constexpr const int min_exponent10 = 0; | |
static constexpr const int max_exponent = 0; | |
static constexpr const int max_exponent10 = 0; | |
static constexpr const bool has_infinity = false; | |
static constexpr const bool has_quiet_NaN = false; | |
static constexpr const bool has_signaling_NaN = false; | |
static constexpr const float_denorm_style has_denorm = denorm_absent; | |
static constexpr const bool has_denorm_loss = false; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return type();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return type();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return type();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return type();} | |
static constexpr const bool is_iec559 = false; | |
static constexpr const bool is_bounded = false; | |
static constexpr const bool is_modulo = false; | |
static constexpr const bool traps = false; | |
static constexpr const bool tinyness_before = false; | |
static constexpr const float_round_style round_style = round_toward_zero; | |
}; | |
template <class _Tp, int __digits, bool _IsSigned> | |
struct __libcpp_compute_min | |
{ | |
static constexpr const _Tp value = _Tp(_Tp(1) << __digits); | |
}; | |
template <class _Tp, int __digits> | |
struct __libcpp_compute_min<_Tp, __digits, false> | |
{ | |
static constexpr const _Tp value = _Tp(0); | |
}; | |
template <class _Tp> | |
class __libcpp_numeric_limits<_Tp, true> | |
{ | |
protected: | |
typedef _Tp type; | |
static constexpr const bool is_specialized = true; | |
static constexpr const bool is_signed = type(-1) < type(0); | |
static constexpr const int digits = static_cast<int>(sizeof(type) * 8 - is_signed); | |
static constexpr const int digits10 = digits * 3 / 10; | |
static constexpr const int max_digits10 = 0; | |
static constexpr const type __min = __libcpp_compute_min<type, digits, is_signed>::value; | |
static constexpr const type __max = is_signed ? type(type(~0) ^ __min) : type(~0); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return __min;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return __max;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return min();} | |
static constexpr const bool is_integer = true; | |
static constexpr const bool is_exact = true; | |
static constexpr const int radix = 2; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return type(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return type(0);} | |
static constexpr const int min_exponent = 0; | |
static constexpr const int min_exponent10 = 0; | |
static constexpr const int max_exponent = 0; | |
static constexpr const int max_exponent10 = 0; | |
static constexpr const bool has_infinity = false; | |
static constexpr const bool has_quiet_NaN = false; | |
static constexpr const bool has_signaling_NaN = false; | |
static constexpr const float_denorm_style has_denorm = denorm_absent; | |
static constexpr const bool has_denorm_loss = false; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return type(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return type(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return type(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return type(0);} | |
static constexpr const bool is_iec559 = false; | |
static constexpr const bool is_bounded = true; | |
static constexpr const bool is_modulo = !std::__1::is_signed<_Tp>::value; | |
static constexpr const bool traps = true; | |
static constexpr const bool tinyness_before = false; | |
static constexpr const float_round_style round_style = round_toward_zero; | |
}; | |
template <> | |
class __libcpp_numeric_limits<bool, true> | |
{ | |
protected: | |
typedef bool type; | |
static constexpr const bool is_specialized = true; | |
static constexpr const bool is_signed = false; | |
static constexpr const int digits = 1; | |
static constexpr const int digits10 = 0; | |
static constexpr const int max_digits10 = 0; | |
static constexpr const type __min = false; | |
static constexpr const type __max = true; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return __min;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return __max;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return min();} | |
static constexpr const bool is_integer = true; | |
static constexpr const bool is_exact = true; | |
static constexpr const int radix = 2; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return type(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return type(0);} | |
static constexpr const int min_exponent = 0; | |
static constexpr const int min_exponent10 = 0; | |
static constexpr const int max_exponent = 0; | |
static constexpr const int max_exponent10 = 0; | |
static constexpr const bool has_infinity = false; | |
static constexpr const bool has_quiet_NaN = false; | |
static constexpr const bool has_signaling_NaN = false; | |
static constexpr const float_denorm_style has_denorm = denorm_absent; | |
static constexpr const bool has_denorm_loss = false; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return type(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return type(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return type(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return type(0);} | |
static constexpr const bool is_iec559 = false; | |
static constexpr const bool is_bounded = true; | |
static constexpr const bool is_modulo = false; | |
static constexpr const bool traps = false; | |
static constexpr const bool tinyness_before = false; | |
static constexpr const float_round_style round_style = round_toward_zero; | |
}; | |
template <> | |
class __libcpp_numeric_limits<float, true> | |
{ | |
protected: | |
typedef float type; | |
static constexpr const bool is_specialized = true; | |
static constexpr const bool is_signed = true; | |
static constexpr const int digits = 24; | |
static constexpr const int digits10 = 6; | |
static constexpr const int max_digits10 = 2+(digits * 30103l)/100000l; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return 1.17549435e-38F;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return 3.40282347e+38F;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return -max();} | |
static constexpr const bool is_integer = false; | |
static constexpr const bool is_exact = false; | |
static constexpr const int radix = 2; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return 1.19209290e-7F;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return 0.5F;} | |
static constexpr const int min_exponent = (-125); | |
static constexpr const int min_exponent10 = (-37); | |
static constexpr const int max_exponent = 128; | |
static constexpr const int max_exponent10 = 38; | |
static constexpr const bool has_infinity = true; | |
static constexpr const bool has_quiet_NaN = true; | |
static constexpr const bool has_signaling_NaN = true; | |
static constexpr const float_denorm_style has_denorm = denorm_present; | |
static constexpr const bool has_denorm_loss = false; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return __builtin_huge_valf();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return __builtin_nanf("");} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return __builtin_nansf("");} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return 1.40129846e-45F;} | |
static constexpr const bool is_iec559 = true; | |
static constexpr const bool is_bounded = true; | |
static constexpr const bool is_modulo = false; | |
static constexpr const bool traps = false; | |
static constexpr const bool tinyness_before = false; | |
static constexpr const float_round_style round_style = round_to_nearest; | |
}; | |
template <> | |
class __libcpp_numeric_limits<double, true> | |
{ | |
protected: | |
typedef double type; | |
static constexpr const bool is_specialized = true; | |
static constexpr const bool is_signed = true; | |
static constexpr const int digits = 53; | |
static constexpr const int digits10 = 15; | |
static constexpr const int max_digits10 = 2+(digits * 30103l)/100000l; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return 2.2250738585072014e-308;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return 1.7976931348623157e+308;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return -max();} | |
static constexpr const bool is_integer = false; | |
static constexpr const bool is_exact = false; | |
static constexpr const int radix = 2; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return 2.2204460492503131e-16;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return 0.5;} | |
static constexpr const int min_exponent = (-1021); | |
static constexpr const int min_exponent10 = (-307); | |
static constexpr const int max_exponent = 1024; | |
static constexpr const int max_exponent10 = 308; | |
static constexpr const bool has_infinity = true; | |
static constexpr const bool has_quiet_NaN = true; | |
static constexpr const bool has_signaling_NaN = true; | |
static constexpr const float_denorm_style has_denorm = denorm_present; | |
static constexpr const bool has_denorm_loss = false; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return __builtin_huge_val();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return __builtin_nan("");} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return __builtin_nans("");} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return 4.9406564584124654e-324;} | |
static constexpr const bool is_iec559 = true; | |
static constexpr const bool is_bounded = true; | |
static constexpr const bool is_modulo = false; | |
static constexpr const bool traps = false; | |
static constexpr const bool tinyness_before = false; | |
static constexpr const float_round_style round_style = round_to_nearest; | |
}; | |
template <> | |
class __libcpp_numeric_limits<long double, true> | |
{ | |
protected: | |
typedef long double type; | |
static constexpr const bool is_specialized = true; | |
static constexpr const bool is_signed = true; | |
static constexpr const int digits = 64; | |
static constexpr const int digits10 = 18; | |
static constexpr const int max_digits10 = 2+(digits * 30103l)/100000l; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return 3.36210314311209350626e-4932L;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return 1.18973149535723176502e+4932L;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return -max();} | |
static constexpr const bool is_integer = false; | |
static constexpr const bool is_exact = false; | |
static constexpr const int radix = 2; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return 1.08420217248550443401e-19L;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return 0.5L;} | |
static constexpr const int min_exponent = (-16381); | |
static constexpr const int min_exponent10 = (-4931); | |
static constexpr const int max_exponent = 16384; | |
static constexpr const int max_exponent10 = 4932; | |
static constexpr const bool has_infinity = true; | |
static constexpr const bool has_quiet_NaN = true; | |
static constexpr const bool has_signaling_NaN = true; | |
static constexpr const float_denorm_style has_denorm = denorm_present; | |
static constexpr const bool has_denorm_loss = false; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return __builtin_huge_vall();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return __builtin_nanl("");} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return __builtin_nansl("");} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return 3.64519953188247460253e-4951L;} | |
static constexpr const bool is_iec559 = true; | |
static constexpr const bool is_bounded = true; | |
static constexpr const bool is_modulo = false; | |
static constexpr const bool traps = false; | |
static constexpr const bool tinyness_before = false; | |
static constexpr const float_round_style round_style = round_to_nearest; | |
}; | |
template <class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) numeric_limits | |
: private __libcpp_numeric_limits<typename remove_cv<_Tp>::type> | |
{ | |
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base; | |
typedef typename __base::type type; | |
public: | |
static constexpr const bool is_specialized = __base::is_specialized; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return __base::min();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return __base::max();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return __base::lowest();} | |
static constexpr const int digits = __base::digits; | |
static constexpr const int digits10 = __base::digits10; | |
static constexpr const int max_digits10 = __base::max_digits10; | |
static constexpr const bool is_signed = __base::is_signed; | |
static constexpr const bool is_integer = __base::is_integer; | |
static constexpr const bool is_exact = __base::is_exact; | |
static constexpr const int radix = __base::radix; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return __base::epsilon();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return __base::round_error();} | |
static constexpr const int min_exponent = __base::min_exponent; | |
static constexpr const int min_exponent10 = __base::min_exponent10; | |
static constexpr const int max_exponent = __base::max_exponent; | |
static constexpr const int max_exponent10 = __base::max_exponent10; | |
static constexpr const bool has_infinity = __base::has_infinity; | |
static constexpr const bool has_quiet_NaN = __base::has_quiet_NaN; | |
static constexpr const bool has_signaling_NaN = __base::has_signaling_NaN; | |
static constexpr const float_denorm_style has_denorm = __base::has_denorm; | |
static constexpr const bool has_denorm_loss = __base::has_denorm_loss; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return __base::infinity();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return __base::quiet_NaN();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return __base::signaling_NaN();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return __base::denorm_min();} | |
static constexpr const bool is_iec559 = __base::is_iec559; | |
static constexpr const bool is_bounded = __base::is_bounded; | |
static constexpr const bool is_modulo = __base::is_modulo; | |
static constexpr const bool traps = __base::traps; | |
static constexpr const bool tinyness_before = __base::tinyness_before; | |
static constexpr const float_round_style round_style = __base::round_style; | |
}; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::is_specialized; | |
template <class _Tp> | |
constexpr const int numeric_limits<_Tp>::digits; | |
template <class _Tp> | |
constexpr const int numeric_limits<_Tp>::digits10; | |
template <class _Tp> | |
constexpr const int numeric_limits<_Tp>::max_digits10; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::is_signed; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::is_integer; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::is_exact; | |
template <class _Tp> | |
constexpr const int numeric_limits<_Tp>::radix; | |
template <class _Tp> | |
constexpr const int numeric_limits<_Tp>::min_exponent; | |
template <class _Tp> | |
constexpr const int numeric_limits<_Tp>::min_exponent10; | |
template <class _Tp> | |
constexpr const int numeric_limits<_Tp>::max_exponent; | |
template <class _Tp> | |
constexpr const int numeric_limits<_Tp>::max_exponent10; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::has_infinity; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::has_quiet_NaN; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::has_signaling_NaN; | |
template <class _Tp> | |
constexpr const float_denorm_style numeric_limits<_Tp>::has_denorm; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::has_denorm_loss; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::is_iec559; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::is_bounded; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::is_modulo; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::traps; | |
template <class _Tp> | |
constexpr const bool numeric_limits<_Tp>::tinyness_before; | |
template <class _Tp> | |
constexpr const float_round_style numeric_limits<_Tp>::round_style; | |
template <class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) numeric_limits<const _Tp> | |
: private numeric_limits<_Tp> | |
{ | |
typedef numeric_limits<_Tp> __base; | |
typedef _Tp type; | |
public: | |
static constexpr const bool is_specialized = __base::is_specialized; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return __base::min();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return __base::max();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return __base::lowest();} | |
static constexpr const int digits = __base::digits; | |
static constexpr const int digits10 = __base::digits10; | |
static constexpr const int max_digits10 = __base::max_digits10; | |
static constexpr const bool is_signed = __base::is_signed; | |
static constexpr const bool is_integer = __base::is_integer; | |
static constexpr const bool is_exact = __base::is_exact; | |
static constexpr const int radix = __base::radix; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return __base::epsilon();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return __base::round_error();} | |
static constexpr const int min_exponent = __base::min_exponent; | |
static constexpr const int min_exponent10 = __base::min_exponent10; | |
static constexpr const int max_exponent = __base::max_exponent; | |
static constexpr const int max_exponent10 = __base::max_exponent10; | |
static constexpr const bool has_infinity = __base::has_infinity; | |
static constexpr const bool has_quiet_NaN = __base::has_quiet_NaN; | |
static constexpr const bool has_signaling_NaN = __base::has_signaling_NaN; | |
static constexpr const float_denorm_style has_denorm = __base::has_denorm; | |
static constexpr const bool has_denorm_loss = __base::has_denorm_loss; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return __base::infinity();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return __base::quiet_NaN();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return __base::signaling_NaN();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return __base::denorm_min();} | |
static constexpr const bool is_iec559 = __base::is_iec559; | |
static constexpr const bool is_bounded = __base::is_bounded; | |
static constexpr const bool is_modulo = __base::is_modulo; | |
static constexpr const bool traps = __base::traps; | |
static constexpr const bool tinyness_before = __base::tinyness_before; | |
static constexpr const float_round_style round_style = __base::round_style; | |
}; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::is_specialized; | |
template <class _Tp> | |
constexpr const int numeric_limits<const _Tp>::digits; | |
template <class _Tp> | |
constexpr const int numeric_limits<const _Tp>::digits10; | |
template <class _Tp> | |
constexpr const int numeric_limits<const _Tp>::max_digits10; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::is_signed; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::is_integer; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::is_exact; | |
template <class _Tp> | |
constexpr const int numeric_limits<const _Tp>::radix; | |
template <class _Tp> | |
constexpr const int numeric_limits<const _Tp>::min_exponent; | |
template <class _Tp> | |
constexpr const int numeric_limits<const _Tp>::min_exponent10; | |
template <class _Tp> | |
constexpr const int numeric_limits<const _Tp>::max_exponent; | |
template <class _Tp> | |
constexpr const int numeric_limits<const _Tp>::max_exponent10; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::has_infinity; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::has_quiet_NaN; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::has_signaling_NaN; | |
template <class _Tp> | |
constexpr const float_denorm_style numeric_limits<const _Tp>::has_denorm; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::has_denorm_loss; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::is_iec559; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::is_bounded; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::is_modulo; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::traps; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const _Tp>::tinyness_before; | |
template <class _Tp> | |
constexpr const float_round_style numeric_limits<const _Tp>::round_style; | |
template <class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) numeric_limits<volatile _Tp> | |
: private numeric_limits<_Tp> | |
{ | |
typedef numeric_limits<_Tp> __base; | |
typedef _Tp type; | |
public: | |
static constexpr const bool is_specialized = __base::is_specialized; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return __base::min();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return __base::max();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return __base::lowest();} | |
static constexpr const int digits = __base::digits; | |
static constexpr const int digits10 = __base::digits10; | |
static constexpr const int max_digits10 = __base::max_digits10; | |
static constexpr const bool is_signed = __base::is_signed; | |
static constexpr const bool is_integer = __base::is_integer; | |
static constexpr const bool is_exact = __base::is_exact; | |
static constexpr const int radix = __base::radix; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return __base::epsilon();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return __base::round_error();} | |
static constexpr const int min_exponent = __base::min_exponent; | |
static constexpr const int min_exponent10 = __base::min_exponent10; | |
static constexpr const int max_exponent = __base::max_exponent; | |
static constexpr const int max_exponent10 = __base::max_exponent10; | |
static constexpr const bool has_infinity = __base::has_infinity; | |
static constexpr const bool has_quiet_NaN = __base::has_quiet_NaN; | |
static constexpr const bool has_signaling_NaN = __base::has_signaling_NaN; | |
static constexpr const float_denorm_style has_denorm = __base::has_denorm; | |
static constexpr const bool has_denorm_loss = __base::has_denorm_loss; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return __base::infinity();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return __base::quiet_NaN();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return __base::signaling_NaN();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return __base::denorm_min();} | |
static constexpr const bool is_iec559 = __base::is_iec559; | |
static constexpr const bool is_bounded = __base::is_bounded; | |
static constexpr const bool is_modulo = __base::is_modulo; | |
static constexpr const bool traps = __base::traps; | |
static constexpr const bool tinyness_before = __base::tinyness_before; | |
static constexpr const float_round_style round_style = __base::round_style; | |
}; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::is_specialized; | |
template <class _Tp> | |
constexpr const int numeric_limits<volatile _Tp>::digits; | |
template <class _Tp> | |
constexpr const int numeric_limits<volatile _Tp>::digits10; | |
template <class _Tp> | |
constexpr const int numeric_limits<volatile _Tp>::max_digits10; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::is_signed; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::is_integer; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::is_exact; | |
template <class _Tp> | |
constexpr const int numeric_limits<volatile _Tp>::radix; | |
template <class _Tp> | |
constexpr const int numeric_limits<volatile _Tp>::min_exponent; | |
template <class _Tp> | |
constexpr const int numeric_limits<volatile _Tp>::min_exponent10; | |
template <class _Tp> | |
constexpr const int numeric_limits<volatile _Tp>::max_exponent; | |
template <class _Tp> | |
constexpr const int numeric_limits<volatile _Tp>::max_exponent10; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::has_infinity; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::has_quiet_NaN; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::has_signaling_NaN; | |
template <class _Tp> | |
constexpr const float_denorm_style numeric_limits<volatile _Tp>::has_denorm; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::has_denorm_loss; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::is_iec559; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::is_bounded; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::is_modulo; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::traps; | |
template <class _Tp> | |
constexpr const bool numeric_limits<volatile _Tp>::tinyness_before; | |
template <class _Tp> | |
constexpr const float_round_style numeric_limits<volatile _Tp>::round_style; | |
template <class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) numeric_limits<const volatile _Tp> | |
: private numeric_limits<_Tp> | |
{ | |
typedef numeric_limits<_Tp> __base; | |
typedef _Tp type; | |
public: | |
static constexpr const bool is_specialized = __base::is_specialized; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type min() noexcept {return __base::min();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type max() noexcept {return __base::max();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type lowest() noexcept {return __base::lowest();} | |
static constexpr const int digits = __base::digits; | |
static constexpr const int digits10 = __base::digits10; | |
static constexpr const int max_digits10 = __base::max_digits10; | |
static constexpr const bool is_signed = __base::is_signed; | |
static constexpr const bool is_integer = __base::is_integer; | |
static constexpr const bool is_exact = __base::is_exact; | |
static constexpr const int radix = __base::radix; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type epsilon() noexcept {return __base::epsilon();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type round_error() noexcept {return __base::round_error();} | |
static constexpr const int min_exponent = __base::min_exponent; | |
static constexpr const int min_exponent10 = __base::min_exponent10; | |
static constexpr const int max_exponent = __base::max_exponent; | |
static constexpr const int max_exponent10 = __base::max_exponent10; | |
static constexpr const bool has_infinity = __base::has_infinity; | |
static constexpr const bool has_quiet_NaN = __base::has_quiet_NaN; | |
static constexpr const bool has_signaling_NaN = __base::has_signaling_NaN; | |
static constexpr const float_denorm_style has_denorm = __base::has_denorm; | |
static constexpr const bool has_denorm_loss = __base::has_denorm_loss; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type infinity() noexcept {return __base::infinity();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type quiet_NaN() noexcept {return __base::quiet_NaN();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type signaling_NaN() noexcept {return __base::signaling_NaN();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr type denorm_min() noexcept {return __base::denorm_min();} | |
static constexpr const bool is_iec559 = __base::is_iec559; | |
static constexpr const bool is_bounded = __base::is_bounded; | |
static constexpr const bool is_modulo = __base::is_modulo; | |
static constexpr const bool traps = __base::traps; | |
static constexpr const bool tinyness_before = __base::tinyness_before; | |
static constexpr const float_round_style round_style = __base::round_style; | |
}; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::is_specialized; | |
template <class _Tp> | |
constexpr const int numeric_limits<const volatile _Tp>::digits; | |
template <class _Tp> | |
constexpr const int numeric_limits<const volatile _Tp>::digits10; | |
template <class _Tp> | |
constexpr const int numeric_limits<const volatile _Tp>::max_digits10; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::is_signed; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::is_integer; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::is_exact; | |
template <class _Tp> | |
constexpr const int numeric_limits<const volatile _Tp>::radix; | |
template <class _Tp> | |
constexpr const int numeric_limits<const volatile _Tp>::min_exponent; | |
template <class _Tp> | |
constexpr const int numeric_limits<const volatile _Tp>::min_exponent10; | |
template <class _Tp> | |
constexpr const int numeric_limits<const volatile _Tp>::max_exponent; | |
template <class _Tp> | |
constexpr const int numeric_limits<const volatile _Tp>::max_exponent10; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::has_infinity; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::has_quiet_NaN; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::has_signaling_NaN; | |
template <class _Tp> | |
constexpr const float_denorm_style numeric_limits<const volatile _Tp>::has_denorm; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::has_denorm_loss; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::is_iec559; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::is_bounded; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::is_modulo; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::traps; | |
template <class _Tp> | |
constexpr const bool numeric_limits<const volatile _Tp>::tinyness_before; | |
template <class _Tp> | |
constexpr const float_round_style numeric_limits<const volatile _Tp>::round_style; | |
} } | |
namespace std { inline namespace __1 { | |
template <class _Arg1, class _Arg2, class _Result> | |
struct __attribute__ ((__type_visibility__("default"))) binary_function | |
{ | |
typedef _Arg1 first_argument_type; | |
typedef _Arg2 second_argument_type; | |
typedef _Result result_type; | |
}; | |
template <class _Tp> | |
struct __has_result_type | |
{ | |
private: | |
struct __two {char __lx; char __lxx;}; | |
template <class _Up> static __two __test(...); | |
template <class _Up> static char __test(typename _Up::result_type* = 0); | |
public: | |
static const bool value = sizeof(__test<_Tp>(0)) == 1; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) less : binary_function<_Tp, _Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x < __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) less<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) < std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) < std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) < std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp> | |
struct __derives_from_unary_function | |
{ | |
private: | |
struct __two {char __lx; char __lxx;}; | |
static __two __test(...); | |
template <class _Ap, class _Rp> | |
static unary_function<_Ap, _Rp> | |
__test(const volatile unary_function<_Ap, _Rp>*); | |
public: | |
static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; | |
typedef decltype(__test((_Tp*)0)) type; | |
}; | |
template <class _Tp> | |
struct __derives_from_binary_function | |
{ | |
private: | |
struct __two {char __lx; char __lxx;}; | |
static __two __test(...); | |
template <class _A1, class _A2, class _Rp> | |
static binary_function<_A1, _A2, _Rp> | |
__test(const volatile binary_function<_A1, _A2, _Rp>*); | |
public: | |
static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; | |
typedef decltype(__test((_Tp*)0)) type; | |
}; | |
template <class _Tp, bool = __derives_from_unary_function<_Tp>::value> | |
struct __maybe_derive_from_unary_function | |
: public __derives_from_unary_function<_Tp>::type | |
{ | |
}; | |
template <class _Tp> | |
struct __maybe_derive_from_unary_function<_Tp, false> | |
{ | |
}; | |
template <class _Tp, bool = __derives_from_binary_function<_Tp>::value> | |
struct __maybe_derive_from_binary_function | |
: public __derives_from_binary_function<_Tp>::type | |
{ | |
}; | |
template <class _Tp> | |
struct __maybe_derive_from_binary_function<_Tp, false> | |
{ | |
}; | |
template <class _Tp, bool = __has_result_type<_Tp>::value> | |
struct __weak_result_type_imp | |
: public __maybe_derive_from_unary_function<_Tp>, | |
public __maybe_derive_from_binary_function<_Tp> | |
{ | |
typedef typename _Tp::result_type result_type; | |
}; | |
template <class _Tp> | |
struct __weak_result_type_imp<_Tp, false> | |
: public __maybe_derive_from_unary_function<_Tp>, | |
public __maybe_derive_from_binary_function<_Tp> | |
{ | |
}; | |
template <class _Tp> | |
struct __weak_result_type | |
: public __weak_result_type_imp<_Tp> | |
{ | |
}; | |
template <class _Rp> | |
struct __weak_result_type<_Rp ()> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp> | |
struct __weak_result_type<_Rp (&)()> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp> | |
struct __weak_result_type<_Rp (*)()> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp, class _A1> | |
struct __weak_result_type<_Rp (_A1)> | |
: public unary_function<_A1, _Rp> | |
{ | |
}; | |
template <class _Rp, class _A1> | |
struct __weak_result_type<_Rp (&)(_A1)> | |
: public unary_function<_A1, _Rp> | |
{ | |
}; | |
template <class _Rp, class _A1> | |
struct __weak_result_type<_Rp (*)(_A1)> | |
: public unary_function<_A1, _Rp> | |
{ | |
}; | |
template <class _Rp, class _Cp> | |
struct __weak_result_type<_Rp (_Cp::*)()> | |
: public unary_function<_Cp*, _Rp> | |
{ | |
}; | |
template <class _Rp, class _Cp> | |
struct __weak_result_type<_Rp (_Cp::*)() const> | |
: public unary_function<const _Cp*, _Rp> | |
{ | |
}; | |
template <class _Rp, class _Cp> | |
struct __weak_result_type<_Rp (_Cp::*)() volatile> | |
: public unary_function<volatile _Cp*, _Rp> | |
{ | |
}; | |
template <class _Rp, class _Cp> | |
struct __weak_result_type<_Rp (_Cp::*)() const volatile> | |
: public unary_function<const volatile _Cp*, _Rp> | |
{ | |
}; | |
template <class _Rp, class _A1, class _A2> | |
struct __weak_result_type<_Rp (_A1, _A2)> | |
: public binary_function<_A1, _A2, _Rp> | |
{ | |
}; | |
template <class _Rp, class _A1, class _A2> | |
struct __weak_result_type<_Rp (*)(_A1, _A2)> | |
: public binary_function<_A1, _A2, _Rp> | |
{ | |
}; | |
template <class _Rp, class _A1, class _A2> | |
struct __weak_result_type<_Rp (&)(_A1, _A2)> | |
: public binary_function<_A1, _A2, _Rp> | |
{ | |
}; | |
template <class _Rp, class _Cp, class _A1> | |
struct __weak_result_type<_Rp (_Cp::*)(_A1)> | |
: public binary_function<_Cp*, _A1, _Rp> | |
{ | |
}; | |
template <class _Rp, class _Cp, class _A1> | |
struct __weak_result_type<_Rp (_Cp::*)(_A1) const> | |
: public binary_function<const _Cp*, _A1, _Rp> | |
{ | |
}; | |
template <class _Rp, class _Cp, class _A1> | |
struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile> | |
: public binary_function<volatile _Cp*, _A1, _Rp> | |
{ | |
}; | |
template <class _Rp, class _Cp, class _A1> | |
struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> | |
: public binary_function<const volatile _Cp*, _A1, _Rp> | |
{ | |
}; | |
template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> | |
struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> | |
struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> | |
struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> | |
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> | |
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> | |
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> | |
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> | |
{ | |
typedef _Rp result_type; | |
}; | |
template <class _Tp, class ..._Args> | |
struct __invoke_return | |
{ | |
typedef decltype(std::__1::__invoke(declval<_Tp>(), declval<_Args>()...)) type; | |
}; | |
template <class _Ret, bool = is_void<_Ret>::value> | |
struct __invoke_void_return_wrapper | |
{ | |
template <class ..._Args> | |
static _Ret __call(_Args&&... __args) { | |
return std::__1::__invoke(std::__1::forward<_Args>(__args)...); | |
} | |
}; | |
template <class _Ret> | |
struct __invoke_void_return_wrapper<_Ret, true> | |
{ | |
template <class ..._Args> | |
static void __call(_Args&&... __args) { | |
std::__1::__invoke(std::__1::forward<_Args>(__args)...); | |
} | |
}; | |
template <class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) reference_wrapper | |
: public __weak_result_type<_Tp> | |
{ | |
public: | |
typedef _Tp type; | |
private: | |
type* __f_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference_wrapper(type& __f) noexcept | |
: __f_(std::__1::addressof(__f)) {} | |
private: reference_wrapper(type&&); public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator type&() const noexcept {return *__f_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
type& get() const noexcept {return *__f_;} | |
template <class... _ArgTypes> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename __invoke_of<type&, _ArgTypes...>::type | |
operator() (_ArgTypes&&... __args) const { | |
return std::__1::__invoke(get(), std::__1::forward<_ArgTypes>(__args)...); | |
} | |
}; | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference_wrapper<_Tp> | |
ref(_Tp& __t) noexcept | |
{ | |
return reference_wrapper<_Tp>(__t); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference_wrapper<_Tp> | |
ref(reference_wrapper<_Tp> __t) noexcept | |
{ | |
return std::__1::ref(__t.get()); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference_wrapper<const _Tp> | |
cref(const _Tp& __t) noexcept | |
{ | |
return reference_wrapper<const _Tp>(__t); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference_wrapper<const _Tp> | |
cref(reference_wrapper<_Tp> __t) noexcept | |
{ | |
return std::__1::cref(__t.get()); | |
} | |
template <class _Tp> void ref(const _Tp&&) = delete; | |
template <class _Tp> void cref(const _Tp&&) = delete; | |
template <class _Tp, class, class = void> | |
struct __is_transparent : false_type {}; | |
template <class _Tp, class _Up> | |
struct __is_transparent<_Tp, _Up, | |
typename __void_t<typename _Tp::is_transparent>::type> | |
: true_type {}; | |
struct __attribute__ ((__type_visibility__("default"))) allocator_arg_t { explicit allocator_arg_t() = default; }; | |
constexpr allocator_arg_t allocator_arg = allocator_arg_t(); | |
template <class _Tp> | |
struct __has_allocator_type | |
{ | |
private: | |
struct __two {char __lx; char __lxx;}; | |
template <class _Up> static __two __test(...); | |
template <class _Up> static char __test(typename _Up::allocator_type* = 0); | |
public: | |
static const bool value = sizeof(__test<_Tp>(0)) == 1; | |
}; | |
template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value> | |
struct __uses_allocator | |
: public integral_constant<bool, | |
is_convertible<_Alloc, typename _Tp::allocator_type>::value> | |
{ | |
}; | |
template <class _Tp, class _Alloc> | |
struct __uses_allocator<_Tp, _Alloc, false> | |
: public false_type | |
{ | |
}; | |
template <class _Tp, class _Alloc> | |
struct __attribute__ ((__type_visibility__("default"))) uses_allocator | |
: public __uses_allocator<_Tp, _Alloc> | |
{ | |
}; | |
template <class _Tp, class _Alloc, class ..._Args> | |
struct __uses_alloc_ctor_imp | |
{ | |
typedef typename __uncvref<_Alloc>::type _RawAlloc; | |
static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value; | |
static const bool __ic = | |
is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; | |
static const int value = __ua ? 2 - __ic : 0; | |
}; | |
template <class _Tp, class _Alloc, class ..._Args> | |
struct __uses_alloc_ctor | |
: integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value> | |
{}; | |
template <class _Tp, class _Allocator, class... _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args ) | |
{ | |
new (__storage) _Tp (std::__1::forward<_Args>(__args)...); | |
} | |
template <class _Tp, class _Allocator, class... _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) | |
{ | |
new (__storage) _Tp (allocator_arg, __a, std::__1::forward<_Args>(__args)...); | |
} | |
template <class _Tp, class _Allocator, class... _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) | |
{ | |
new (__storage) _Tp (std::__1::forward<_Args>(__args)..., __a); | |
} | |
} } | |
namespace std { inline namespace __1 { | |
template <class _Iter> | |
struct __attribute__ ((__type_visibility__("default"))) iterator_traits; | |
struct __attribute__ ((__type_visibility__("default"))) input_iterator_tag {}; | |
struct __attribute__ ((__type_visibility__("default"))) output_iterator_tag {}; | |
struct __attribute__ ((__type_visibility__("default"))) forward_iterator_tag : public input_iterator_tag {}; | |
struct __attribute__ ((__type_visibility__("default"))) bidirectional_iterator_tag : public forward_iterator_tag {}; | |
struct __attribute__ ((__type_visibility__("default"))) random_access_iterator_tag : public bidirectional_iterator_tag {}; | |
template <class _Iter> | |
struct __iter_traits_cache { | |
using type = _If< | |
__is_primary_template<iterator_traits<_Iter> >::value, | |
_Iter, | |
iterator_traits<_Iter> | |
>; | |
}; | |
template <class _Iter> | |
using _ITER_TRAITS = typename __iter_traits_cache<_Iter>::type; | |
struct __iter_concept_concept_test { | |
template <class _Iter> | |
using _Apply = typename _ITER_TRAITS<_Iter>::iterator_concept; | |
}; | |
struct __iter_concept_category_test { | |
template <class _Iter> | |
using _Apply = typename _ITER_TRAITS<_Iter>::iterator_category; | |
}; | |
struct __iter_concept_random_fallback { | |
template <class _Iter> | |
using _Apply = _EnableIf< | |
__is_primary_template<iterator_traits<_Iter> >::value, | |
random_access_iterator_tag | |
>; | |
}; | |
template <class _Iter, class _Tester> struct __test_iter_concept | |
: _IsValidExpansion<_Tester::template _Apply, _Iter>, | |
_Tester | |
{ | |
}; | |
template <class _Iter> | |
struct __iter_concept_cache { | |
using type = _Or< | |
__test_iter_concept<_Iter, __iter_concept_concept_test>, | |
__test_iter_concept<_Iter, __iter_concept_category_test>, | |
__test_iter_concept<_Iter, __iter_concept_random_fallback> | |
>; | |
}; | |
template <class _Iter> | |
using _ITER_CONCEPT = typename __iter_concept_cache<_Iter>::type::template _Apply<_Iter>; | |
template <class _Tp> | |
struct __has_iterator_typedefs | |
{ | |
private: | |
struct __two {char __lx; char __lxx;}; | |
template <class _Up> static __two __test(...); | |
template <class _Up> static char __test(typename __void_t<typename _Up::iterator_category>::type* = 0, | |
typename __void_t<typename _Up::difference_type>::type* = 0, | |
typename __void_t<typename _Up::value_type>::type* = 0, | |
typename __void_t<typename _Up::reference>::type* = 0, | |
typename __void_t<typename _Up::pointer>::type* = 0); | |
public: | |
static const bool value = sizeof(__test<_Tp>(0,0,0,0,0)) == 1; | |
}; | |
template <class _Tp> | |
struct __has_iterator_category | |
{ | |
private: | |
struct __two {char __lx; char __lxx;}; | |
template <class _Up> static __two __test(...); | |
template <class _Up> static char __test(typename _Up::iterator_category* = nullptr); | |
public: | |
static const bool value = sizeof(__test<_Tp>(nullptr)) == 1; | |
}; | |
template <class _Iter, bool> struct __iterator_traits_impl {}; | |
template <class _Iter> | |
struct __iterator_traits_impl<_Iter, true> | |
{ | |
typedef typename _Iter::difference_type difference_type; | |
typedef typename _Iter::value_type value_type; | |
typedef typename _Iter::pointer pointer; | |
typedef typename _Iter::reference reference; | |
typedef typename _Iter::iterator_category iterator_category; | |
}; | |
template <class _Iter, bool> struct __iterator_traits {}; | |
template <class _Iter> | |
struct __iterator_traits<_Iter, true> | |
: __iterator_traits_impl | |
< | |
_Iter, | |
is_convertible<typename _Iter::iterator_category, input_iterator_tag>::value || | |
is_convertible<typename _Iter::iterator_category, output_iterator_tag>::value | |
> | |
{}; | |
template <class _Iter> | |
struct __attribute__ ((__type_visibility__("default"))) iterator_traits | |
: __iterator_traits<_Iter, __has_iterator_typedefs<_Iter>::value> { | |
using __primary_template = iterator_traits; | |
}; | |
template<class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) iterator_traits<_Tp*> | |
{ | |
typedef ptrdiff_t difference_type; | |
typedef typename remove_cv<_Tp>::type value_type; | |
typedef _Tp* pointer; | |
typedef _Tp& reference; | |
typedef random_access_iterator_tag iterator_category; | |
}; | |
template <class _Tp, class _Up, bool = __has_iterator_category<iterator_traits<_Tp> >::value> | |
struct __has_iterator_category_convertible_to | |
: public integral_constant<bool, is_convertible<typename iterator_traits<_Tp>::iterator_category, _Up>::value> | |
{}; | |
template <class _Tp, class _Up> | |
struct __has_iterator_category_convertible_to<_Tp, _Up, false> : public false_type {}; | |
template <class _Tp> | |
struct __is_cpp17_input_iterator : public __has_iterator_category_convertible_to<_Tp, input_iterator_tag> {}; | |
template <class _Tp> | |
struct __is_cpp17_forward_iterator : public __has_iterator_category_convertible_to<_Tp, forward_iterator_tag> {}; | |
template <class _Tp> | |
struct __is_cpp17_bidirectional_iterator : public __has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag> {}; | |
template <class _Tp> | |
struct __is_cpp17_random_access_iterator : public __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag> {}; | |
template <class _Tp> | |
struct __is_cpp17_contiguous_iterator : public false_type {}; | |
template <class _Tp> | |
struct __is_exactly_cpp17_input_iterator | |
: public integral_constant<bool, | |
__has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value && | |
!__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {}; | |
template<class _Category, class _Tp, class _Distance = ptrdiff_t, | |
class _Pointer = _Tp*, class _Reference = _Tp&> | |
struct __attribute__ ((__type_visibility__("default"))) iterator | |
{ | |
typedef _Tp value_type; | |
typedef _Distance difference_type; | |
typedef _Pointer pointer; | |
typedef _Reference reference; | |
typedef _Category iterator_category; | |
}; | |
template <class _InputIter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __advance(_InputIter& __i, | |
typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag) | |
{ | |
for (; __n > 0; --__n) | |
++__i; | |
} | |
template <class _BiDirIter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __advance(_BiDirIter& __i, | |
typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag) | |
{ | |
if (__n >= 0) | |
for (; __n > 0; --__n) | |
++__i; | |
else | |
for (; __n < 0; ++__n) | |
--__i; | |
} | |
template <class _RandIter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __advance(_RandIter& __i, | |
typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag) | |
{ | |
__i += __n; | |
} | |
template <class _InputIter, class _Distance> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void advance(_InputIter& __i, _Distance __orig_n) | |
{ | |
((void)0); | |
typedef decltype(std::__1::__convert_to_integral(__orig_n)) _IntegralSize; | |
_IntegralSize __n = __orig_n; | |
std::__1::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category()); | |
} | |
template <class _InputIter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename iterator_traits<_InputIter>::difference_type | |
__distance(_InputIter __first, _InputIter __last, input_iterator_tag) | |
{ | |
typename iterator_traits<_InputIter>::difference_type __r(0); | |
for (; __first != __last; ++__first) | |
++__r; | |
return __r; | |
} | |
template <class _RandIter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename iterator_traits<_RandIter>::difference_type | |
__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag) | |
{ | |
return __last - __first; | |
} | |
template <class _InputIter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename iterator_traits<_InputIter>::difference_type | |
distance(_InputIter __first, _InputIter __last) | |
{ | |
return std::__1::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category()); | |
} | |
template <class _InputIter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
__is_cpp17_input_iterator<_InputIter>::value, | |
_InputIter | |
>::type | |
next(_InputIter __x, | |
typename iterator_traits<_InputIter>::difference_type __n = 1) | |
{ | |
((void)0); | |
std::__1::advance(__x, __n); | |
return __x; | |
} | |
template <class _InputIter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
__is_cpp17_input_iterator<_InputIter>::value, | |
_InputIter | |
>::type | |
prev(_InputIter __x, | |
typename iterator_traits<_InputIter>::difference_type __n = 1) | |
{ | |
((void)0); | |
std::__1::advance(__x, -__n); | |
return __x; | |
} | |
template <class _Tp, class = void> | |
struct __is_stashing_iterator : false_type {}; | |
template <class _Tp> | |
struct __is_stashing_iterator<_Tp, typename __void_t<typename _Tp::__stashing_iterator_tag>::type> | |
: true_type {}; | |
template <class _Iter> | |
class __attribute__ ((__type_visibility__("default"))) reverse_iterator | |
: public iterator<typename iterator_traits<_Iter>::iterator_category, | |
typename iterator_traits<_Iter>::value_type, | |
typename iterator_traits<_Iter>::difference_type, | |
typename iterator_traits<_Iter>::pointer, | |
typename iterator_traits<_Iter>::reference> | |
{ | |
private: | |
_Iter __t; | |
static_assert(!__is_stashing_iterator<_Iter>::value, | |
"The specified iterator type cannot be used with reverse_iterator; " | |
"Using stashing iterators with reverse_iterator causes undefined behavior"); | |
protected: | |
_Iter current; | |
public: | |
typedef _Iter iterator_type; | |
typedef typename iterator_traits<_Iter>::difference_type difference_type; | |
typedef typename iterator_traits<_Iter>::reference reference; | |
typedef typename iterator_traits<_Iter>::pointer pointer; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator() : __t(), current() {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator(const reverse_iterator<_Up>& __u) : __t(__u.base()), current(__u.base()) {} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator& operator=(const reverse_iterator<_Up>& __u) | |
{ __t = current = __u.base(); return *this; } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Iter base() const {return current;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference operator*() const {_Iter __tmp = current; return *--__tmp;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer operator->() const {return std::__1::addressof(operator*());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator& operator++() {--current; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator operator++(int) {reverse_iterator __tmp(*this); --current; return __tmp;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator& operator--() {++current; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator operator--(int) {reverse_iterator __tmp(*this); ++current; return __tmp;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator operator+ (difference_type __n) const {return reverse_iterator(current - __n);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator& operator+=(difference_type __n) {current -= __n; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator operator- (difference_type __n) const {return reverse_iterator(current + __n);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference operator[](difference_type __n) const {return *(*this + __n);} | |
}; | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) | |
{ | |
return __x.base() == __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) | |
{ | |
return __x.base() > __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) | |
{ | |
return __x.base() != __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) | |
{ | |
return __x.base() < __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) | |
{ | |
return __x.base() <= __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) | |
{ | |
return __x.base() >= __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) | |
-> decltype(__y.base() - __x.base()) | |
{ | |
return __y.base() - __x.base(); | |
} | |
template <class _Iter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator<_Iter> | |
operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x) | |
{ | |
return reverse_iterator<_Iter>(__x.base() - __n); | |
} | |
template <class _Iter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator<_Iter> make_reverse_iterator(_Iter __i) | |
{ | |
return reverse_iterator<_Iter>(__i); | |
} | |
template <class _Container> | |
class __attribute__ ((__type_visibility__("default"))) back_insert_iterator | |
: public iterator<output_iterator_tag, | |
void, | |
void, | |
void, | |
void> | |
{ | |
protected: | |
_Container* container; | |
public: | |
typedef _Container container_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit back_insert_iterator(_Container& __x) : container(std::__1::addressof(__x)) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) back_insert_iterator& operator=(const typename _Container::value_type& __value_) | |
{container->push_back(__value_); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) back_insert_iterator& operator=(typename _Container::value_type&& __value_) | |
{container->push_back(std::__1::move(__value_)); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) back_insert_iterator& operator*() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) back_insert_iterator& operator++() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) back_insert_iterator operator++(int) {return *this;} | |
}; | |
template <class _Container> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
back_insert_iterator<_Container> | |
back_inserter(_Container& __x) | |
{ | |
return back_insert_iterator<_Container>(__x); | |
} | |
template <class _Container> | |
class __attribute__ ((__type_visibility__("default"))) front_insert_iterator | |
: public iterator<output_iterator_tag, | |
void, | |
void, | |
void, | |
void> | |
{ | |
protected: | |
_Container* container; | |
public: | |
typedef _Container container_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit front_insert_iterator(_Container& __x) : container(std::__1::addressof(__x)) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) front_insert_iterator& operator=(const typename _Container::value_type& __value_) | |
{container->push_front(__value_); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) front_insert_iterator& operator=(typename _Container::value_type&& __value_) | |
{container->push_front(std::__1::move(__value_)); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) front_insert_iterator& operator*() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) front_insert_iterator& operator++() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) front_insert_iterator operator++(int) {return *this;} | |
}; | |
template <class _Container> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
front_insert_iterator<_Container> | |
front_inserter(_Container& __x) | |
{ | |
return front_insert_iterator<_Container>(__x); | |
} | |
template <class _Container> | |
class __attribute__ ((__type_visibility__("default"))) insert_iterator | |
: public iterator<output_iterator_tag, | |
void, | |
void, | |
void, | |
void> | |
{ | |
protected: | |
_Container* container; | |
typename _Container::iterator iter; | |
public: | |
typedef _Container container_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) insert_iterator(_Container& __x, typename _Container::iterator __i) | |
: container(std::__1::addressof(__x)), iter(__i) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) insert_iterator& operator=(const typename _Container::value_type& __value_) | |
{iter = container->insert(iter, __value_); ++iter; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) insert_iterator& operator=(typename _Container::value_type&& __value_) | |
{iter = container->insert(iter, std::__1::move(__value_)); ++iter; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) insert_iterator& operator*() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) insert_iterator& operator++() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) insert_iterator& operator++(int) {return *this;} | |
}; | |
template <class _Container> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
insert_iterator<_Container> | |
inserter(_Container& __x, typename _Container::iterator __i) | |
{ | |
return insert_iterator<_Container>(__x, __i); | |
} | |
template <class _Tp, class _CharT = char, | |
class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t> | |
class __attribute__ ((__type_visibility__("default"))) istream_iterator | |
: public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&> | |
{ | |
public: | |
typedef _CharT char_type; | |
typedef _Traits traits_type; | |
typedef basic_istream<_CharT,_Traits> istream_type; | |
private: | |
istream_type* __in_stream_; | |
_Tp __value_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr istream_iterator() : __in_stream_(nullptr), __value_() {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) istream_iterator(istream_type& __s) : __in_stream_(std::__1::addressof(__s)) | |
{ | |
if (!(*__in_stream_ >> __value_)) | |
__in_stream_ = nullptr; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) const _Tp& operator*() const {return __value_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) const _Tp* operator->() const {return std::__1::addressof((operator*()));} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) istream_iterator& operator++() | |
{ | |
if (!(*__in_stream_ >> __value_)) | |
__in_stream_ = nullptr; | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) istream_iterator operator++(int) | |
{istream_iterator __t(*this); ++(*this); return __t;} | |
template <class _Up, class _CharU, class _TraitsU, class _DistanceU> | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x, | |
const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y); | |
template <class _Up, class _CharU, class _TraitsU, class _DistanceU> | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x, | |
const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y); | |
}; | |
template <class _Tp, class _CharT, class _Traits, class _Distance> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x, | |
const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y) | |
{ | |
return __x.__in_stream_ == __y.__in_stream_; | |
} | |
template <class _Tp, class _CharT, class _Traits, class _Distance> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x, | |
const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y) | |
{ | |
return !(__x == __y); | |
} | |
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) ostream_iterator | |
: public iterator<output_iterator_tag, void, void, void, void> | |
{ | |
public: | |
typedef output_iterator_tag iterator_category; | |
typedef void value_type; | |
typedef void difference_type; | |
typedef void pointer; | |
typedef void reference; | |
typedef _CharT char_type; | |
typedef _Traits traits_type; | |
typedef basic_ostream<_CharT, _Traits> ostream_type; | |
private: | |
ostream_type* __out_stream_; | |
const char_type* __delim_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostream_iterator(ostream_type& __s) noexcept | |
: __out_stream_(std::__1::addressof(__s)), __delim_(nullptr) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostream_iterator(ostream_type& __s, const _CharT* __delimiter) noexcept | |
: __out_stream_(std::__1::addressof(__s)), __delim_(__delimiter) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostream_iterator& operator=(const _Tp& __value_) | |
{ | |
*__out_stream_ << __value_; | |
if (__delim_) | |
*__out_stream_ << __delim_; | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostream_iterator& operator*() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostream_iterator& operator++() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostream_iterator& operator++(int) {return *this;} | |
}; | |
template<class _CharT, class _Traits> | |
class __attribute__ ((__type_visibility__("default"))) istreambuf_iterator | |
: public iterator<input_iterator_tag, _CharT, | |
typename _Traits::off_type, _CharT*, | |
_CharT> | |
{ | |
public: | |
typedef _CharT char_type; | |
typedef _Traits traits_type; | |
typedef typename _Traits::int_type int_type; | |
typedef basic_streambuf<_CharT,_Traits> streambuf_type; | |
typedef basic_istream<_CharT,_Traits> istream_type; | |
private: | |
mutable streambuf_type* __sbuf_; | |
class __proxy | |
{ | |
char_type __keep_; | |
streambuf_type* __sbuf_; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __proxy(char_type __c, streambuf_type* __s) | |
: __keep_(__c), __sbuf_(__s) {} | |
friend class istreambuf_iterator; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) char_type operator*() const {return __keep_;} | |
}; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __test_for_eof() const | |
{ | |
if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof())) | |
__sbuf_ = nullptr; | |
return __sbuf_ == nullptr; | |
} | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr istreambuf_iterator() noexcept : __sbuf_(nullptr) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) istreambuf_iterator(istream_type& __s) noexcept | |
: __sbuf_(__s.rdbuf()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) istreambuf_iterator(streambuf_type* __s) noexcept | |
: __sbuf_(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) istreambuf_iterator(const __proxy& __p) noexcept | |
: __sbuf_(__p.__sbuf_) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) char_type operator*() const | |
{return static_cast<char_type>(__sbuf_->sgetc());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) istreambuf_iterator& operator++() | |
{ | |
__sbuf_->sbumpc(); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __proxy operator++(int) | |
{ | |
return __proxy(__sbuf_->sbumpc(), __sbuf_); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) bool equal(const istreambuf_iterator& __b) const | |
{return __test_for_eof() == __b.__test_for_eof();} | |
}; | |
template <class _CharT, class _Traits> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(const istreambuf_iterator<_CharT,_Traits>& __a, | |
const istreambuf_iterator<_CharT,_Traits>& __b) | |
{return __a.equal(__b);} | |
template <class _CharT, class _Traits> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a, | |
const istreambuf_iterator<_CharT,_Traits>& __b) | |
{return !__a.equal(__b);} | |
template <class _CharT, class _Traits> | |
class __attribute__ ((__type_visibility__("default"))) ostreambuf_iterator | |
: public iterator<output_iterator_tag, void, void, void, void> | |
{ | |
public: | |
typedef output_iterator_tag iterator_category; | |
typedef void value_type; | |
typedef void difference_type; | |
typedef void pointer; | |
typedef void reference; | |
typedef _CharT char_type; | |
typedef _Traits traits_type; | |
typedef basic_streambuf<_CharT, _Traits> streambuf_type; | |
typedef basic_ostream<_CharT, _Traits> ostream_type; | |
private: | |
streambuf_type* __sbuf_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostreambuf_iterator(ostream_type& __s) noexcept | |
: __sbuf_(__s.rdbuf()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostreambuf_iterator(streambuf_type* __s) noexcept | |
: __sbuf_(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostreambuf_iterator& operator=(_CharT __c) | |
{ | |
if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof())) | |
__sbuf_ = nullptr; | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostreambuf_iterator& operator*() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostreambuf_iterator& operator++() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ostreambuf_iterator& operator++(int) {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) bool failed() const noexcept {return __sbuf_ == nullptr;} | |
template <class _Ch, class _Tr> | |
friend | |
LDIONNE_HIDDEN | |
ostreambuf_iterator<_Ch, _Tr> | |
__pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s, | |
const _Ch* __ob, const _Ch* __op, const _Ch* __oe, | |
ios_base& __iob, _Ch __fl); | |
}; | |
template <class _Iter> | |
class __attribute__ ((__type_visibility__("default"))) move_iterator | |
{ | |
private: | |
_Iter __i; | |
public: | |
typedef _Iter iterator_type; | |
typedef typename iterator_traits<iterator_type>::iterator_category iterator_category; | |
typedef typename iterator_traits<iterator_type>::value_type value_type; | |
typedef typename iterator_traits<iterator_type>::difference_type difference_type; | |
typedef iterator_type pointer; | |
typedef typename iterator_traits<iterator_type>::reference __reference; | |
typedef typename conditional< | |
is_reference<__reference>::value, | |
typename remove_reference<__reference>::type&&, | |
__reference | |
>::type reference; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator() : __i() {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit move_iterator(_Iter __x) : __i(__x) {} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Iter base() const {return __i;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference operator*() const { return static_cast<reference>(*__i); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer operator->() const { return __i;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator& operator++() {++__i; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator operator++(int) {move_iterator __tmp(*this); ++__i; return __tmp;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator& operator--() {--__i; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator operator--(int) {move_iterator __tmp(*this); --__i; return __tmp;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator operator+ (difference_type __n) const {return move_iterator(__i + __n);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator& operator+=(difference_type __n) {__i += __n; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator operator- (difference_type __n) const {return move_iterator(__i - __n);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator& operator-=(difference_type __n) {__i -= __n; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reference operator[](difference_type __n) const { return static_cast<reference>(__i[__n]); } | |
}; | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) | |
{ | |
return __x.base() == __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) | |
{ | |
return __x.base() < __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) | |
{ | |
return __x.base() != __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) | |
{ | |
return __x.base() > __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) | |
{ | |
return __x.base() >= __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) | |
{ | |
return __x.base() <= __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) | |
-> decltype(__x.base() - __y.base()) | |
{ | |
return __x.base() - __y.base(); | |
} | |
template <class _Iter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator<_Iter> | |
operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x) | |
{ | |
return move_iterator<_Iter>(__x.base() + __n); | |
} | |
template <class _Iter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
move_iterator<_Iter> | |
make_move_iterator(_Iter __i) | |
{ | |
return move_iterator<_Iter>(__i); | |
} | |
template <class _Iter> class __wrap_iter; | |
template <class _Iter1, class _Iter2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
auto | |
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
-> decltype(__x.base() - __y.base()); | |
template <class _Iter> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__wrap_iter<_Iter> | |
operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) noexcept; | |
template <class _Ip, class _Op> _Op LDIONNE_HIDDEN __attribute__ ((internal_linkage)) copy(_Ip, _Ip, _Op); | |
template <class _B1, class _B2> _B2 LDIONNE_HIDDEN __attribute__ ((internal_linkage)) copy_backward(_B1, _B1, _B2); | |
template <class _Ip, class _Op> _Op LDIONNE_HIDDEN __attribute__ ((internal_linkage)) move(_Ip, _Ip, _Op); | |
template <class _B1, class _B2> _B2 LDIONNE_HIDDEN __attribute__ ((internal_linkage)) move_backward(_B1, _B1, _B2); | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename enable_if | |
< | |
is_trivially_copy_assignable<_Tp>::value, | |
_Tp* | |
>::type | |
__unwrap_iter(__wrap_iter<_Tp*>); | |
template <class _Iter> | |
class __wrap_iter | |
{ | |
public: | |
typedef _Iter iterator_type; | |
typedef typename iterator_traits<iterator_type>::iterator_category iterator_category; | |
typedef typename iterator_traits<iterator_type>::value_type value_type; | |
typedef typename iterator_traits<iterator_type>::difference_type difference_type; | |
typedef typename iterator_traits<iterator_type>::pointer pointer; | |
typedef typename iterator_traits<iterator_type>::reference reference; | |
private: | |
iterator_type __i; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter() noexcept | |
: __i{} | |
{ | |
} | |
template <class _Up> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__wrap_iter(const __wrap_iter<_Up>& __u, | |
typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) noexcept | |
: __i(__u.base()) | |
{ | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr reference operator*() const noexcept | |
{ | |
return *__i; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr pointer operator->() const noexcept | |
{ | |
return (pointer)std::__1::addressof(*__i); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter& operator++() noexcept | |
{ | |
++__i; | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter operator++(int) noexcept | |
{__wrap_iter __tmp(*this); ++(*this); return __tmp;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter& operator--() noexcept | |
{ | |
--__i; | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter operator--(int) noexcept | |
{__wrap_iter __tmp(*this); --(*this); return __tmp;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter operator+ (difference_type __n) const noexcept | |
{__wrap_iter __w(*this); __w += __n; return __w;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter& operator+=(difference_type __n) noexcept | |
{ | |
__i += __n; | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter operator- (difference_type __n) const noexcept | |
{return *this + (-__n);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter& operator-=(difference_type __n) noexcept | |
{*this += -__n; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr reference operator[](difference_type __n) const noexcept | |
{ | |
return __i[__n]; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr iterator_type base() const noexcept {return __i;} | |
private: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __wrap_iter(iterator_type __x) noexcept : __i(__x) {} | |
template <class _Up> friend class __wrap_iter; | |
template <class _CharT, class _Traits, class _Alloc> friend class basic_string; | |
template <class _Tp, class _Alloc> friend class __attribute__ ((__type_visibility__("default"))) vector; | |
template <class _Tp, size_t> friend class __attribute__ ((__type_visibility__("default"))) span; | |
template <class _Iter1, class _Iter2> | |
constexpr friend | |
bool | |
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
constexpr friend | |
bool | |
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
constexpr friend | |
bool | |
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
constexpr friend | |
bool | |
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
constexpr friend | |
bool | |
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
constexpr friend | |
bool | |
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) noexcept; | |
template <class _Iter1, class _Iter2> | |
constexpr friend | |
auto | |
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
-> decltype(__x.base() - __y.base()); | |
template <class _Iter1> | |
constexpr friend | |
__wrap_iter<_Iter1> | |
operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) noexcept; | |
template <class _Ip, class _Op> friend _Op copy(_Ip, _Ip, _Op); | |
template <class _B1, class _B2> friend _B2 copy_backward(_B1, _B1, _B2); | |
template <class _Ip, class _Op> friend _Op move(_Ip, _Ip, _Op); | |
template <class _B1, class _B2> friend _B2 move_backward(_B1, _B1, _B2); | |
template <class _Tp> | |
constexpr friend | |
typename enable_if | |
< | |
is_trivially_copy_assignable<_Tp>::value, | |
_Tp* | |
>::type | |
__unwrap_iter(__wrap_iter<_Tp*>); | |
}; | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
{ | |
return __x.base() == __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
{ | |
return __x.base() < __y.base(); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
{ | |
return !(__x == __y); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
{ | |
return __y < __x; | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
{ | |
return !(__x < __y); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
{ | |
return !(__y < __x); | |
} | |
template <class _Iter1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept | |
{ | |
return !(__x == __y); | |
} | |
template <class _Iter1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept | |
{ | |
return __y < __x; | |
} | |
template <class _Iter1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept | |
{ | |
return !(__x < __y); | |
} | |
template <class _Iter1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept | |
{ | |
return !(__y < __x); | |
} | |
template <class _Iter1, class _Iter2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
auto | |
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept | |
-> decltype(__x.base() - __y.base()) | |
{ | |
return __x.base() - __y.base(); | |
} | |
template <class _Iter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__wrap_iter<_Iter> | |
operator+(typename __wrap_iter<_Iter>::difference_type __n, | |
__wrap_iter<_Iter> __x) noexcept | |
{ | |
__x += __n; | |
return __x; | |
} | |
template <class _Iter> | |
struct __libcpp_is_trivial_iterator | |
: public integral_constant<bool,(is_pointer<_Iter>::value)> {}; | |
template <class _Iter> | |
struct __libcpp_is_trivial_iterator<move_iterator<_Iter> > | |
: public integral_constant<bool,(__libcpp_is_trivial_iterator<_Iter>::value)> {}; | |
template <class _Iter> | |
struct __libcpp_is_trivial_iterator<reverse_iterator<_Iter> > | |
: public integral_constant<bool,(__libcpp_is_trivial_iterator<_Iter>::value)> {}; | |
template <class _Iter> | |
struct __libcpp_is_trivial_iterator<__wrap_iter<_Iter> > | |
: public integral_constant<bool,(__libcpp_is_trivial_iterator<_Iter>::value)> {}; | |
template <class _Tp, size_t _Np> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp* | |
begin(_Tp (&__array)[_Np]) | |
{ | |
return __array; | |
} | |
template <class _Tp, size_t _Np> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp* | |
end(_Tp (&__array)[_Np]) | |
{ | |
return __array + _Np; | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
begin(_Cp& __c) -> decltype(__c.begin()) | |
{ | |
return __c.begin(); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
begin(const _Cp& __c) -> decltype(__c.begin()) | |
{ | |
return __c.begin(); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
end(_Cp& __c) -> decltype(__c.end()) | |
{ | |
return __c.end(); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto | |
end(const _Cp& __c) -> decltype(__c.end()) | |
{ | |
return __c.end(); | |
} | |
template <class _Tp, size_t _Np> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np]) | |
{ | |
return reverse_iterator<_Tp*>(__array + _Np); | |
} | |
template <class _Tp, size_t _Np> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np]) | |
{ | |
return reverse_iterator<_Tp*>(__array); | |
} | |
template <class _Ep> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il) | |
{ | |
return reverse_iterator<const _Ep*>(__il.end()); | |
} | |
template <class _Ep> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il) | |
{ | |
return reverse_iterator<const _Ep*>(__il.begin()); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
auto cbegin(const _Cp& __c) -> decltype(std::__1::begin(__c)) | |
{ | |
return std::__1::begin(__c); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
auto cend(const _Cp& __c) -> decltype(std::__1::end(__c)) | |
{ | |
return std::__1::end(__c); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto rbegin(_Cp& __c) -> decltype(__c.rbegin()) | |
{ | |
return __c.rbegin(); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto rbegin(const _Cp& __c) -> decltype(__c.rbegin()) | |
{ | |
return __c.rbegin(); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto rend(_Cp& __c) -> decltype(__c.rend()) | |
{ | |
return __c.rend(); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto rend(const _Cp& __c) -> decltype(__c.rend()) | |
{ | |
return __c.rend(); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto crbegin(const _Cp& __c) -> decltype(std::__1::rbegin(__c)) | |
{ | |
return std::__1::rbegin(__c); | |
} | |
template <class _Cp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto crend(const _Cp& __c) -> decltype(std::__1::rend(__c)) | |
{ | |
return std::__1::rend(__c); | |
} | |
} } | |
namespace std { inline namespace __1 { | |
template <size_t _Ip, class _Hp, | |
bool=is_empty<_Hp>::value && !__libcpp_is_final<_Hp>::value | |
> | |
class __tuple_leaf; | |
template <size_t _Ip, class _Hp, bool _Ep> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y) | |
noexcept(__is_nothrow_swappable<_Hp>::value) | |
{ | |
swap(__x.get(), __y.get()); | |
} | |
template <size_t _Ip, class _Hp, bool> | |
class __tuple_leaf | |
{ | |
_Hp __value_; | |
template <class _Tp> | |
static constexpr bool __can_bind_reference() { | |
return !__reference_binds_to_temporary(_Hp, _Tp); | |
} | |
__tuple_leaf& operator=(const __tuple_leaf&); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __tuple_leaf() | |
noexcept(is_nothrow_default_constructible<_Hp>::value) : __value_() | |
{static_assert(!is_reference<_Hp>::value, | |
"Attempted to default construct a reference element in a tuple");} | |
template <class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_leaf(integral_constant<int, 0>, const _Alloc&) | |
: __value_() | |
{static_assert(!is_reference<_Hp>::value, | |
"Attempted to default construct a reference element in a tuple");} | |
template <class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_leaf(integral_constant<int, 1>, const _Alloc& __a) | |
: __value_(allocator_arg_t(), __a) | |
{static_assert(!is_reference<_Hp>::value, | |
"Attempted to default construct a reference element in a tuple");} | |
template <class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_leaf(integral_constant<int, 2>, const _Alloc& __a) | |
: __value_(__a) | |
{static_assert(!is_reference<_Hp>::value, | |
"Attempted to default construct a reference element in a tuple");} | |
template <class _Tp, | |
class = _EnableIf< | |
_And< | |
_IsNotSame<__uncvref_t<_Tp>, __tuple_leaf>, | |
is_constructible<_Hp, _Tp> | |
>::value | |
> | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit __tuple_leaf(_Tp&& __t) noexcept((is_nothrow_constructible<_Hp, _Tp>::value)) | |
: __value_(std::__1::forward<_Tp>(__t)) | |
{static_assert(__can_bind_reference<_Tp&&>(), | |
"Attempted construction of reference element binds to a temporary whose lifetime has ended");} | |
template <class _Tp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t) | |
: __value_(std::__1::forward<_Tp>(__t)) | |
{static_assert(__can_bind_reference<_Tp&&>(), | |
"Attempted construction of reference element binds to a temporary whose lifetime has ended");} | |
template <class _Tp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t) | |
: __value_(allocator_arg_t(), __a, std::__1::forward<_Tp>(__t)) | |
{static_assert(!is_reference<_Hp>::value, | |
"Attempted to uses-allocator construct a reference element in a tuple");} | |
template <class _Tp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t) | |
: __value_(std::__1::forward<_Tp>(__t), __a) | |
{static_assert(!is_reference<_Hp>::value, | |
"Attempted to uses-allocator construct a reference element in a tuple");} | |
__tuple_leaf(const __tuple_leaf& __t) = default; | |
__tuple_leaf(__tuple_leaf&& __t) = default; | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_leaf& | |
operator=(_Tp&& __t) noexcept((is_nothrow_assignable<_Hp&, _Tp>::value)) | |
{ | |
__value_ = std::__1::forward<_Tp>(__t); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int swap(__tuple_leaf& __t) noexcept(__is_nothrow_swappable<__tuple_leaf>::value) | |
{ | |
std::__1::swap(*this, __t); | |
return 0; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr _Hp& get() noexcept {return __value_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr const _Hp& get() const noexcept {return __value_;} | |
}; | |
template <size_t _Ip, class _Hp> | |
class __tuple_leaf<_Ip, _Hp, true> | |
: private _Hp | |
{ | |
__tuple_leaf& operator=(const __tuple_leaf&); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __tuple_leaf() | |
noexcept(is_nothrow_default_constructible<_Hp>::value) {} | |
template <class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_leaf(integral_constant<int, 0>, const _Alloc&) {} | |
template <class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_leaf(integral_constant<int, 1>, const _Alloc& __a) | |
: _Hp(allocator_arg_t(), __a) {} | |
template <class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_leaf(integral_constant<int, 2>, const _Alloc& __a) | |
: _Hp(__a) {} | |
template <class _Tp, | |
class = _EnableIf< | |
_And< | |
_IsNotSame<__uncvref_t<_Tp>, __tuple_leaf>, | |
is_constructible<_Hp, _Tp> | |
>::value | |
> | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit __tuple_leaf(_Tp&& __t) noexcept((is_nothrow_constructible<_Hp, _Tp>::value)) | |
: _Hp(std::__1::forward<_Tp>(__t)) {} | |
template <class _Tp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t) | |
: _Hp(std::__1::forward<_Tp>(__t)) {} | |
template <class _Tp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t) | |
: _Hp(allocator_arg_t(), __a, std::__1::forward<_Tp>(__t)) {} | |
template <class _Tp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t) | |
: _Hp(std::__1::forward<_Tp>(__t), __a) {} | |
__tuple_leaf(__tuple_leaf const &) = default; | |
__tuple_leaf(__tuple_leaf &&) = default; | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_leaf& | |
operator=(_Tp&& __t) noexcept((is_nothrow_assignable<_Hp&, _Tp>::value)) | |
{ | |
_Hp::operator=(std::__1::forward<_Tp>(__t)); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int | |
swap(__tuple_leaf& __t) noexcept(__is_nothrow_swappable<__tuple_leaf>::value) | |
{ | |
std::__1::swap(*this, __t); | |
return 0; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr _Hp& get() noexcept {return static_cast<_Hp&>(*this);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr const _Hp& get() const noexcept {return static_cast<const _Hp&>(*this);} | |
}; | |
template <class ..._Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __swallow(_Tp&&...) noexcept {} | |
template <class _Tp> | |
struct __all_default_constructible; | |
template <class ..._Tp> | |
struct __all_default_constructible<__tuple_types<_Tp...>> | |
: __all<is_default_constructible<_Tp>::value...> | |
{ }; | |
template<class _Indx, class ..._Tp> struct __tuple_impl; | |
template<size_t ..._Indx, class ..._Tp> | |
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...> | |
: public __tuple_leaf<_Indx, _Tp>... | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr __tuple_impl() | |
noexcept(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {} | |
template <size_t ..._Uf, class ..._Tf, | |
size_t ..._Ul, class ..._Tl, class ..._Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit | |
__tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>, | |
__tuple_indices<_Ul...>, __tuple_types<_Tl...>, | |
_Up&&... __u) | |
noexcept((__all<is_nothrow_constructible<_Tf, _Up>::value...>::value && __all<is_nothrow_default_constructible<_Tl>::value...>::value)) : | |
__tuple_leaf<_Uf, _Tf>(std::__1::forward<_Up>(__u))..., | |
__tuple_leaf<_Ul, _Tl>()... | |
{} | |
template <class _Alloc, size_t ..._Uf, class ..._Tf, | |
size_t ..._Ul, class ..._Tl, class ..._Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit | |
__tuple_impl(allocator_arg_t, const _Alloc& __a, | |
__tuple_indices<_Uf...>, __tuple_types<_Tf...>, | |
__tuple_indices<_Ul...>, __tuple_types<_Tl...>, | |
_Up&&... __u) : | |
__tuple_leaf<_Uf, _Tf>(__uses_alloc_ctor<_Tf, _Alloc, _Up>(), __a, | |
std::__1::forward<_Up>(__u))..., | |
__tuple_leaf<_Ul, _Tl>(__uses_alloc_ctor<_Tl, _Alloc>(), __a)... | |
{} | |
template <class _Tuple, | |
class = typename enable_if | |
< | |
__tuple_constructible<_Tuple, tuple<_Tp...> >::value | |
>::type | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__tuple_impl(_Tuple&& __t) noexcept((__all<is_nothrow_constructible<_Tp, typename tuple_element<_Indx, typename __make_tuple_types<_Tuple>::type>::type>::value...>::value)) | |
: __tuple_leaf<_Indx, _Tp>(std::__1::forward<typename tuple_element<_Indx, | |
typename __make_tuple_types<_Tuple>::type>::type>(std::__1::get<_Indx>(__t)))... | |
{} | |
template <class _Alloc, class _Tuple, | |
class = typename enable_if | |
< | |
__tuple_constructible<_Tuple, tuple<_Tp...> >::value | |
>::type | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t) | |
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, typename tuple_element<_Indx, | |
typename __make_tuple_types<_Tuple>::type>::type>(), __a, | |
std::__1::forward<typename tuple_element<_Indx, | |
typename __make_tuple_types<_Tuple>::type>::type>(std::__1::get<_Indx>(__t)))... | |
{} | |
template <class _Tuple> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
__tuple_assignable<_Tuple, tuple<_Tp...> >::value, | |
__tuple_impl& | |
>::type | |
operator=(_Tuple&& __t) noexcept((__all<is_nothrow_assignable<_Tp&, typename tuple_element<_Indx, typename __make_tuple_types<_Tuple>::type>::type>::value...>::value)) | |
{ | |
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(std::__1::forward<typename tuple_element<_Indx, | |
typename __make_tuple_types<_Tuple>::type>::type>(std::__1::get<_Indx>(__t)))...); | |
return *this; | |
} | |
__tuple_impl(const __tuple_impl&) = default; | |
__tuple_impl(__tuple_impl&&) = default; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_impl& | |
operator=(const __tuple_impl& __t) noexcept((__all<is_nothrow_copy_assignable<_Tp>::value...>::value)) | |
{ | |
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(static_cast<const __tuple_leaf<_Indx, _Tp>&>(__t).get())...); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__tuple_impl& | |
operator=(__tuple_impl&& __t) noexcept((__all<is_nothrow_move_assignable<_Tp>::value...>::value)) | |
{ | |
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(std::__1::forward<_Tp>(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t).get()))...); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(__tuple_impl& __t) | |
noexcept(__all<__is_nothrow_swappable<_Tp>::value...>::value) | |
{ | |
__swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...); | |
} | |
}; | |
template <class ..._Tp> | |
class __attribute__ ((__type_visibility__("default"))) tuple | |
{ | |
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> _BaseT; | |
_BaseT __base_; | |
static constexpr bool _EnableImplicitReducedArityExtension = false; | |
template <class ..._Args> | |
struct _PackExpandsToThisTuple : false_type {}; | |
template <class _Arg> | |
struct _PackExpandsToThisTuple<_Arg> | |
: is_same<typename __uncvref<_Arg>::type, tuple> {}; | |
template <bool _MaybeEnable, class _Dummy = void> | |
struct _CheckArgsConstructor : __check_tuple_constructor_fail {}; | |
template <class _Dummy> | |
struct _CheckArgsConstructor<true, _Dummy> | |
{ | |
template <int&...> | |
static constexpr bool __enable_implicit_default() { | |
return __all<__is_implicitly_default_constructible<_Tp>::value... >::value; | |
} | |
template <int&...> | |
static constexpr bool __enable_explicit_default() { | |
return | |
__all<is_default_constructible<_Tp>::value...>::value && | |
!__enable_implicit_default< >(); | |
} | |
template <class ..._Args> | |
static constexpr bool __enable_explicit() { | |
return | |
__tuple_constructible< | |
tuple<_Args...>, | |
typename __make_tuple_types<tuple, | |
sizeof...(_Args) < sizeof...(_Tp) ? | |
sizeof...(_Args) : | |
sizeof...(_Tp)>::type | |
>::value && | |
!__tuple_convertible< | |
tuple<_Args...>, | |
typename __make_tuple_types<tuple, | |
sizeof...(_Args) < sizeof...(_Tp) ? | |
sizeof...(_Args) : | |
sizeof...(_Tp)>::type | |
>::value && | |
__all_default_constructible< | |
typename __make_tuple_types<tuple, sizeof...(_Tp), | |
sizeof...(_Args) < sizeof...(_Tp) ? | |
sizeof...(_Args) : | |
sizeof...(_Tp)>::type | |
>::value; | |
} | |
template <class ..._Args> | |
static constexpr bool __enable_implicit() { | |
return | |
__tuple_constructible< | |
tuple<_Args...>, | |
typename __make_tuple_types<tuple, | |
sizeof...(_Args) < sizeof...(_Tp) ? | |
sizeof...(_Args) : | |
sizeof...(_Tp)>::type | |
>::value && | |
__tuple_convertible< | |
tuple<_Args...>, | |
typename __make_tuple_types<tuple, | |
sizeof...(_Args) < sizeof...(_Tp) ? | |
sizeof...(_Args) : | |
sizeof...(_Tp)>::type | |
>::value && | |
__all_default_constructible< | |
typename __make_tuple_types<tuple, sizeof...(_Tp), | |
sizeof...(_Args) < sizeof...(_Tp) ? | |
sizeof...(_Args) : | |
sizeof...(_Tp)>::type | |
>::value; | |
} | |
}; | |
template <bool _MaybeEnable, | |
bool = sizeof...(_Tp) == 1, | |
class _Dummy = void> | |
struct _CheckTupleLikeConstructor : __check_tuple_constructor_fail {}; | |
template <class _Dummy> | |
struct _CheckTupleLikeConstructor<true, false, _Dummy> | |
{ | |
template <class _Tuple> | |
static constexpr bool __enable_implicit() { | |
return __tuple_constructible<_Tuple, tuple>::value | |
&& __tuple_convertible<_Tuple, tuple>::value; | |
} | |
template <class _Tuple> | |
static constexpr bool __enable_explicit() { | |
return __tuple_constructible<_Tuple, tuple>::value | |
&& !__tuple_convertible<_Tuple, tuple>::value; | |
} | |
}; | |
template <class _Dummy> | |
struct _CheckTupleLikeConstructor<true, true, _Dummy> | |
{ | |
template <class _Tuple> | |
using _PreferTupleLikeConstructor = _Or< | |
_IsSame<__uncvref_t<_Tuple>, tuple>, | |
_Lazy<_And, | |
_Not<is_constructible<_Tp..., _Tuple>>, | |
_Not<is_convertible<_Tuple, _Tp...>> | |
> | |
>; | |
template <class _Tuple> | |
static constexpr bool __enable_implicit() { | |
return _And< | |
__tuple_constructible<_Tuple, tuple>, | |
__tuple_convertible<_Tuple, tuple>, | |
_PreferTupleLikeConstructor<_Tuple> | |
>::value; | |
} | |
template <class _Tuple> | |
static constexpr bool __enable_explicit() { | |
return _And< | |
__tuple_constructible<_Tuple, tuple>, | |
_PreferTupleLikeConstructor<_Tuple>, | |
_Not<__tuple_convertible<_Tuple, tuple>> | |
>::value; | |
} | |
}; | |
template <class _Tuple, bool _DisableIfLValue> | |
using _EnableImplicitTupleLikeConstructor = _EnableIf< | |
_CheckTupleLikeConstructor< | |
__tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value | |
&& !_PackExpandsToThisTuple<_Tuple>::value | |
&& (!is_lvalue_reference<_Tuple>::value || !_DisableIfLValue) | |
>::template __enable_implicit<_Tuple>(), | |
bool | |
>; | |
template <class _Tuple, bool _DisableIfLValue> | |
using _EnableExplicitTupleLikeConstructor = _EnableIf< | |
_CheckTupleLikeConstructor< | |
__tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value | |
&& !_PackExpandsToThisTuple<_Tuple>::value | |
&& (!is_lvalue_reference<_Tuple>::value || !_DisableIfLValue) | |
>::template __enable_explicit<_Tuple>(), | |
bool | |
>; | |
template <size_t _Jp, class ..._Up> friend constexpr | |
typename tuple_element<_Jp, tuple<_Up...> >::type& get(tuple<_Up...>&) noexcept; | |
template <size_t _Jp, class ..._Up> friend constexpr | |
const typename tuple_element<_Jp, tuple<_Up...> >::type& get(const tuple<_Up...>&) noexcept; | |
template <size_t _Jp, class ..._Up> friend constexpr | |
typename tuple_element<_Jp, tuple<_Up...> >::type&& get(tuple<_Up...>&&) noexcept; | |
template <size_t _Jp, class ..._Up> friend constexpr | |
const typename tuple_element<_Jp, tuple<_Up...> >::type&& get(const tuple<_Up...>&&) noexcept; | |
public: | |
template <bool _Dummy = true, _EnableIf< | |
_CheckArgsConstructor<_Dummy>::__enable_implicit_default() | |
, void*> = nullptr> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple() | |
noexcept(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {} | |
template <bool _Dummy = true, _EnableIf< | |
_CheckArgsConstructor<_Dummy>::__enable_explicit_default() | |
, void*> = nullptr> | |
explicit LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple() | |
noexcept(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {} | |
tuple(tuple const&) = default; | |
tuple(tuple&&) = default; | |
template <class _AllocArgT, class _Alloc, _EnableIf< | |
_CheckArgsConstructor<_IsSame<allocator_arg_t, _AllocArgT>::value >::__enable_implicit_default() | |
, void*> = nullptr | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(_AllocArgT, _Alloc const& __a) | |
: __base_(allocator_arg_t(), __a, | |
__tuple_indices<>(), __tuple_types<>(), | |
typename __make_tuple_indices<sizeof...(_Tp), 0>::type(), | |
__tuple_types<_Tp...>()) {} | |
template <class _AllocArgT, class _Alloc, _EnableIf< | |
_CheckArgsConstructor<_IsSame<allocator_arg_t, _AllocArgT>::value>::__enable_explicit_default() | |
, void*> = nullptr | |
> | |
explicit LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(_AllocArgT, _Alloc const& __a) | |
: __base_(allocator_arg_t(), __a, | |
__tuple_indices<>(), __tuple_types<>(), | |
typename __make_tuple_indices<sizeof...(_Tp), 0>::type(), | |
__tuple_types<_Tp...>()) {} | |
template <bool _Dummy = true, | |
typename enable_if | |
< | |
_CheckArgsConstructor< | |
_Dummy | |
>::template __enable_implicit<_Tp const&...>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple(const _Tp& ... __t) noexcept((__all<is_nothrow_copy_constructible<_Tp>::value...>::value)) | |
: __base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(), | |
typename __make_tuple_indices<0>::type(), | |
typename __make_tuple_types<tuple, 0>::type(), | |
__t... | |
) {} | |
template <bool _Dummy = true, | |
typename enable_if | |
< | |
_CheckArgsConstructor< | |
_Dummy | |
>::template __enable_explicit<_Tp const&...>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit tuple(const _Tp& ... __t) noexcept((__all<is_nothrow_copy_constructible<_Tp>::value...>::value)) | |
: __base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(), | |
typename __make_tuple_indices<0>::type(), | |
typename __make_tuple_types<tuple, 0>::type(), | |
__t... | |
) {} | |
template <class _Alloc, bool _Dummy = true, | |
typename enable_if | |
< | |
_CheckArgsConstructor< | |
_Dummy | |
>::template __enable_implicit<_Tp const&...>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t) | |
: __base_(allocator_arg_t(), __a, | |
typename __make_tuple_indices<sizeof...(_Tp)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(), | |
typename __make_tuple_indices<0>::type(), | |
typename __make_tuple_types<tuple, 0>::type(), | |
__t... | |
) {} | |
template <class _Alloc, bool _Dummy = true, | |
typename enable_if | |
< | |
_CheckArgsConstructor< | |
_Dummy | |
>::template __enable_explicit<_Tp const&...>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit | |
tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t) | |
: __base_(allocator_arg_t(), __a, | |
typename __make_tuple_indices<sizeof...(_Tp)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(), | |
typename __make_tuple_indices<0>::type(), | |
typename __make_tuple_types<tuple, 0>::type(), | |
__t... | |
) {} | |
template <class ..._Up, | |
bool _PackIsTuple = _PackExpandsToThisTuple<_Up...>::value, | |
typename enable_if | |
< | |
_CheckArgsConstructor< | |
sizeof...(_Up) == sizeof...(_Tp) | |
&& !_PackIsTuple | |
>::template __enable_implicit<_Up...>() || | |
_CheckArgsConstructor< | |
_EnableImplicitReducedArityExtension | |
&& sizeof...(_Up) < sizeof...(_Tp) | |
&& !_PackIsTuple | |
>::template __enable_implicit<_Up...>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple(_Up&&... __u) | |
noexcept(( is_nothrow_constructible<_BaseT, typename __make_tuple_indices<sizeof...(_Up)>::type, typename __make_tuple_types<tuple, sizeof...(_Up)>::type, typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type, typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type, _Up... >::value )) | |
: __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(), | |
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(), | |
std::__1::forward<_Up>(__u)...) {} | |
template <class ..._Up, | |
typename enable_if | |
< | |
_CheckArgsConstructor< | |
sizeof...(_Up) <= sizeof...(_Tp) | |
&& !_PackExpandsToThisTuple<_Up...>::value | |
>::template __enable_explicit<_Up...>() || | |
_CheckArgsConstructor< | |
!_EnableImplicitReducedArityExtension | |
&& sizeof...(_Up) < sizeof...(_Tp) | |
&& !_PackExpandsToThisTuple<_Up...>::value | |
>::template __enable_implicit<_Up...>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit | |
tuple(_Up&&... __u) | |
noexcept(( is_nothrow_constructible<_BaseT, typename __make_tuple_indices<sizeof...(_Up)>::type, typename __make_tuple_types<tuple, sizeof...(_Up)>::type, typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type, typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type, _Up... >::value )) | |
: __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(), | |
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(), | |
std::__1::forward<_Up>(__u)...) {} | |
template <class _Alloc, class ..._Up, | |
typename enable_if | |
< | |
_CheckArgsConstructor< | |
sizeof...(_Up) == sizeof...(_Tp) && | |
!_PackExpandsToThisTuple<_Up...>::value | |
>::template __enable_implicit<_Up...>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u) | |
: __base_(allocator_arg_t(), __a, | |
typename __make_tuple_indices<sizeof...(_Up)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(), | |
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(), | |
std::__1::forward<_Up>(__u)...) {} | |
template <class _Alloc, class ..._Up, | |
typename enable_if | |
< | |
_CheckArgsConstructor< | |
sizeof...(_Up) == sizeof...(_Tp) && | |
!_PackExpandsToThisTuple<_Up...>::value | |
>::template __enable_explicit<_Up...>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit | |
tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u) | |
: __base_(allocator_arg_t(), __a, | |
typename __make_tuple_indices<sizeof...(_Up)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(), | |
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(), | |
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(), | |
std::__1::forward<_Up>(__u)...) {} | |
template <class _Tuple, _EnableImplicitTupleLikeConstructor<_Tuple, true> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple(_Tuple&& __t) noexcept((is_nothrow_constructible<_BaseT, _Tuple>::value)) | |
: __base_(std::__1::forward<_Tuple>(__t)) {} | |
template <class _Tuple, _EnableImplicitTupleLikeConstructor<const _Tuple&, false> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple(const _Tuple& __t) noexcept((is_nothrow_constructible<_BaseT, const _Tuple&>::value)) | |
: __base_(__t) {} | |
template <class _Tuple, _EnableExplicitTupleLikeConstructor<_Tuple, true> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit | |
tuple(_Tuple&& __t) noexcept((is_nothrow_constructible<_BaseT, _Tuple>::value)) | |
: __base_(std::__1::forward<_Tuple>(__t)) {} | |
template <class _Tuple, _EnableExplicitTupleLikeConstructor<const _Tuple&, false> = false> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit | |
tuple(const _Tuple& __t) noexcept((is_nothrow_constructible<_BaseT, const _Tuple&>::value)) | |
: __base_(__t) {} | |
template <class _Alloc, class _Tuple, | |
typename enable_if | |
< | |
_CheckTupleLikeConstructor< | |
__tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value | |
>::template __enable_implicit<_Tuple>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t) | |
: __base_(allocator_arg_t(), __a, std::__1::forward<_Tuple>(__t)) {} | |
template <class _Alloc, class _Tuple, | |
typename enable_if | |
< | |
_CheckTupleLikeConstructor< | |
__tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value | |
>::template __enable_explicit<_Tuple>(), | |
bool | |
>::type = false | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit | |
tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t) | |
: __base_(allocator_arg_t(), __a, std::__1::forward<_Tuple>(__t)) {} | |
using _CanCopyAssign = __all<is_copy_assignable<_Tp>::value...>; | |
using _CanMoveAssign = __all<is_move_assignable<_Tp>::value...>; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple& operator=(typename conditional<_CanCopyAssign::value, tuple, __nat>::type const& __t) | |
noexcept((__all<is_nothrow_copy_assignable<_Tp>::value...>::value)) | |
{ | |
__base_.operator=(__t.__base_); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple& operator=(typename conditional<_CanMoveAssign::value, tuple, __nat>::type&& __t) | |
noexcept((__all<is_nothrow_move_assignable<_Tp>::value...>::value)) | |
{ | |
__base_.operator=(static_cast<_BaseT&&>(__t.__base_)); | |
return *this; | |
} | |
template <class _Tuple, | |
class = typename enable_if | |
< | |
__tuple_assignable<_Tuple, tuple>::value | |
>::type | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple& | |
operator=(_Tuple&& __t) noexcept((is_nothrow_assignable<_BaseT&, _Tuple>::value)) | |
{ | |
__base_.operator=(std::__1::forward<_Tuple>(__t)); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(tuple& __t) noexcept(__all<__is_nothrow_swappable<_Tp>::value...>::value) | |
{__base_.swap(__t.__base_);} | |
}; | |
template <> | |
class __attribute__ ((__type_visibility__("default"))) tuple<> | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr tuple() noexcept = default; | |
template <class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(allocator_arg_t, const _Alloc&) noexcept {} | |
template <class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(allocator_arg_t, const _Alloc&, const tuple&) noexcept {} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(array<_Up, 0>) noexcept {} | |
template <class _Alloc, class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) noexcept {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(tuple&) noexcept {} | |
}; | |
template <class ..._Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
__all<__is_swappable<_Tp>::value...>::value, | |
void | |
>::type | |
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u) | |
noexcept(__all<__is_nothrow_swappable<_Tp>::value...>::value) | |
{__t.swap(__u);} | |
template <size_t _Ip, class ..._Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename tuple_element<_Ip, tuple<_Tp...> >::type& | |
get(tuple<_Tp...>& __t) noexcept | |
{ | |
typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
return static_cast<__tuple_leaf<_Ip, type>&>(__t.__base_).get(); | |
} | |
template <size_t _Ip, class ..._Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const typename tuple_element<_Ip, tuple<_Tp...> >::type& | |
get(const tuple<_Tp...>& __t) noexcept | |
{ | |
typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
return static_cast<const __tuple_leaf<_Ip, type>&>(__t.__base_).get(); | |
} | |
template <size_t _Ip, class ..._Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename tuple_element<_Ip, tuple<_Tp...> >::type&& | |
get(tuple<_Tp...>&& __t) noexcept | |
{ | |
typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
return static_cast<type&&>( | |
static_cast<__tuple_leaf<_Ip, type>&&>(__t.__base_).get()); | |
} | |
template <size_t _Ip, class ..._Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const typename tuple_element<_Ip, tuple<_Tp...> >::type&& | |
get(const tuple<_Tp...>&& __t) noexcept | |
{ | |
typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
return static_cast<const type&&>( | |
static_cast<const __tuple_leaf<_Ip, type>&&>(__t.__base_).get()); | |
} | |
namespace __find_detail { | |
static constexpr size_t __not_found = -1; | |
static constexpr size_t __ambiguous = __not_found - 1; | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr size_t __find_idx_return(size_t __curr_i, size_t __res, bool __matches) { | |
return !__matches ? __res : | |
(__res == __not_found ? __curr_i : __ambiguous); | |
} | |
template <size_t _Nx> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr size_t __find_idx(size_t __i, const bool (&__matches)[_Nx]) { | |
return __i == _Nx ? __not_found : | |
__find_idx_return(__i, __find_idx(__i + 1, __matches), __matches[__i]); | |
} | |
template <class _T1, class ..._Args> | |
struct __find_exactly_one_checked { | |
static constexpr bool __matches[sizeof...(_Args)] = {is_same<_T1, _Args>::value...}; | |
static constexpr size_t value = __find_detail::__find_idx(0, __matches); | |
static_assert(value != __not_found, "type not found in type list" ); | |
static_assert(value != __ambiguous, "type occurs more than once in type list"); | |
}; | |
template <class _T1> | |
struct __find_exactly_one_checked<_T1> { | |
static_assert(!is_same<_T1, _T1>::value, "type not in empty type list"); | |
}; | |
} | |
template <typename _T1, typename... _Args> | |
struct __find_exactly_one_t | |
: public __find_detail::__find_exactly_one_checked<_T1, _Args...> { | |
}; | |
template <class _T1, class... _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1& get(tuple<_Args...>& __tup) noexcept | |
{ | |
return std::__1::get<__find_exactly_one_t<_T1, _Args...>::value>(__tup); | |
} | |
template <class _T1, class... _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 const& get(tuple<_Args...> const& __tup) noexcept | |
{ | |
return std::__1::get<__find_exactly_one_t<_T1, _Args...>::value>(__tup); | |
} | |
template <class _T1, class... _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1&& get(tuple<_Args...>&& __tup) noexcept | |
{ | |
return std::__1::get<__find_exactly_one_t<_T1, _Args...>::value>(std::__1::move(__tup)); | |
} | |
template <class _T1, class... _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _T1 const&& get(tuple<_Args...> const&& __tup) noexcept | |
{ | |
return std::__1::get<__find_exactly_one_t<_T1, _Args...>::value>(std::__1::move(__tup)); | |
} | |
template <class ..._Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple<_Tp&...> | |
tie(_Tp&... __t) noexcept | |
{ | |
return tuple<_Tp&...>(__t...); | |
} | |
template <class _Up> | |
struct __ignore_t | |
{ | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const __ignore_t& operator=(_Tp&&) const {return *this;} | |
}; | |
namespace { | |
constexpr __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); | |
} | |
template <class... _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple<typename __unwrap_ref_decay<_Tp>::type...> | |
make_tuple(_Tp&&... __t) | |
{ | |
return tuple<typename __unwrap_ref_decay<_Tp>::type...>(std::__1::forward<_Tp>(__t)...); | |
} | |
template <class... _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple<_Tp&&...> | |
forward_as_tuple(_Tp&&... __t) noexcept | |
{ | |
return tuple<_Tp&&...>(std::__1::forward<_Tp>(__t)...); | |
} | |
template <size_t _Ip> | |
struct __tuple_equal | |
{ | |
template <class _Tp, class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _Tp& __x, const _Up& __y) | |
{ | |
return __tuple_equal<_Ip - 1>()(__x, __y) && std::__1::get<_Ip-1>(__x) == std::__1::get<_Ip-1>(__y); | |
} | |
}; | |
template <> | |
struct __tuple_equal<0> | |
{ | |
template <class _Tp, class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _Tp&, const _Up&) | |
{ | |
return true; | |
} | |
}; | |
template <class ..._Tp, class ..._Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) | |
{ | |
static_assert (sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes"); | |
return __tuple_equal<sizeof...(_Tp)>()(__x, __y); | |
} | |
template <class ..._Tp, class ..._Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator!=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) | |
{ | |
return !(__x == __y); | |
} | |
template <size_t _Ip> | |
struct __tuple_less | |
{ | |
template <class _Tp, class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _Tp& __x, const _Up& __y) | |
{ | |
const size_t __idx = tuple_size<_Tp>::value - _Ip; | |
if (std::__1::get<__idx>(__x) < std::__1::get<__idx>(__y)) | |
return true; | |
if (std::__1::get<__idx>(__y) < std::__1::get<__idx>(__x)) | |
return false; | |
return __tuple_less<_Ip-1>()(__x, __y); | |
} | |
}; | |
template <> | |
struct __tuple_less<0> | |
{ | |
template <class _Tp, class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _Tp&, const _Up&) | |
{ | |
return false; | |
} | |
}; | |
template <class ..._Tp, class ..._Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) | |
{ | |
static_assert (sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes"); | |
return __tuple_less<sizeof...(_Tp)>()(__x, __y); | |
} | |
template <class ..._Tp, class ..._Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) | |
{ | |
return __y < __x; | |
} | |
template <class ..._Tp, class ..._Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) | |
{ | |
return !(__x < __y); | |
} | |
template <class ..._Tp, class ..._Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) | |
{ | |
return !(__y < __x); | |
} | |
template <class _Tp, class _Up> struct __tuple_cat_type; | |
template <class ..._Ttypes, class ..._Utypes> | |
struct __tuple_cat_type<tuple<_Ttypes...>, __tuple_types<_Utypes...> > | |
{ | |
typedef tuple<_Ttypes..., _Utypes...> type; | |
}; | |
template <class _ResultTuple, bool _Is_Tuple0TupleLike, class ..._Tuples> | |
struct __tuple_cat_return_1 | |
{ | |
}; | |
template <class ..._Types, class _Tuple0> | |
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0> | |
{ | |
typedef typename __tuple_cat_type<tuple<_Types...>, | |
typename __make_tuple_types<typename __uncvref<_Tuple0>::type>::type>::type | |
type; | |
}; | |
template <class ..._Types, class _Tuple0, class _Tuple1, class ..._Tuples> | |
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0, _Tuple1, _Tuples...> | |
: public __tuple_cat_return_1< | |
typename __tuple_cat_type< | |
tuple<_Types...>, | |
typename __make_tuple_types<typename __uncvref<_Tuple0>::type>::type | |
>::type, | |
__tuple_like<typename remove_reference<_Tuple1>::type>::value, | |
_Tuple1, _Tuples...> | |
{ | |
}; | |
template <class ..._Tuples> struct __tuple_cat_return; | |
template <class _Tuple0, class ..._Tuples> | |
struct __tuple_cat_return<_Tuple0, _Tuples...> | |
: public __tuple_cat_return_1<tuple<>, | |
__tuple_like<typename remove_reference<_Tuple0>::type>::value, _Tuple0, | |
_Tuples...> | |
{ | |
}; | |
template <> | |
struct __tuple_cat_return<> | |
{ | |
typedef tuple<> type; | |
}; | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
tuple<> | |
tuple_cat() | |
{ | |
return tuple<>(); | |
} | |
template <class _Rp, class _Indices, class _Tuple0, class ..._Tuples> | |
struct __tuple_cat_return_ref_imp; | |
template <class ..._Types, size_t ..._I0, class _Tuple0> | |
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0> | |
{ | |
typedef typename remove_reference<_Tuple0>::type _T0; | |
typedef tuple<_Types..., typename __apply_cv<_Tuple0, | |
typename tuple_element<_I0, _T0>::type>::type&&...> type; | |
}; | |
template <class ..._Types, size_t ..._I0, class _Tuple0, class _Tuple1, class ..._Tuples> | |
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, | |
_Tuple0, _Tuple1, _Tuples...> | |
: public __tuple_cat_return_ref_imp< | |
tuple<_Types..., typename __apply_cv<_Tuple0, | |
typename tuple_element<_I0, | |
typename remove_reference<_Tuple0>::type>::type>::type&&...>, | |
typename __make_tuple_indices<tuple_size<typename | |
remove_reference<_Tuple1>::type>::value>::type, | |
_Tuple1, _Tuples...> | |
{ | |
}; | |
template <class _Tuple0, class ..._Tuples> | |
struct __tuple_cat_return_ref | |
: public __tuple_cat_return_ref_imp<tuple<>, | |
typename __make_tuple_indices< | |
tuple_size<typename remove_reference<_Tuple0>::type>::value | |
>::type, _Tuple0, _Tuples...> | |
{ | |
}; | |
template <class _Types, class _I0, class _J0> | |
struct __tuple_cat; | |
template <class ..._Types, size_t ..._I0, size_t ..._J0> | |
struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J0...> > | |
{ | |
template <class _Tuple0> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type | |
operator()(tuple<_Types...> __t, _Tuple0&& __t0) | |
{ | |
return std::__1::forward_as_tuple( | |
std::__1::forward<_Types>(std::__1::get<_I0>(__t))..., | |
std::__1::get<_J0>(std::__1::forward<_Tuple0>(__t0))...); | |
} | |
template <class _Tuple0, class _Tuple1, class ..._Tuples> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&, _Tuple1&&, _Tuples&&...>::type | |
operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&& ...__tpls) | |
{ | |
typedef typename remove_reference<_Tuple0>::type _T0; | |
typedef typename remove_reference<_Tuple1>::type _T1; | |
return __tuple_cat< | |
tuple<_Types..., | |
typename __apply_cv<_Tuple0, typename tuple_element< | |
_J0, _T0>::type>::type&&...>, | |
typename __make_tuple_indices<sizeof...(_Types) + | |
tuple_size<_T0>::value>::type, | |
typename __make_tuple_indices<tuple_size<_T1>::value>::type>()( | |
std::__1::forward_as_tuple( | |
std::__1::forward<_Types>(std::__1::get<_I0>(__t))..., | |
std::__1::get<_J0>(std::__1::forward<_Tuple0>(__t0))...), | |
std::__1::forward<_Tuple1>(__t1), std::__1::forward<_Tuples>(__tpls)...); | |
} | |
}; | |
template <class _Tuple0, class... _Tuples> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename __tuple_cat_return<_Tuple0, _Tuples...>::type | |
tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls) | |
{ | |
typedef typename remove_reference<_Tuple0>::type _T0; | |
return __tuple_cat<tuple<>, __tuple_indices<>, | |
typename __make_tuple_indices<tuple_size<_T0>::value>::type>() | |
(tuple<>(), std::__1::forward<_Tuple0>(__t0), | |
std::__1::forward<_Tuples>(__tpls)...); | |
} | |
template <class ..._Tp, class _Alloc> | |
struct __attribute__ ((__type_visibility__("default"))) uses_allocator<tuple<_Tp...>, _Alloc> | |
: true_type {}; | |
template <class _T1, class _T2> | |
template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair<_T1, _T2>::pair(piecewise_construct_t, | |
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args, | |
__tuple_indices<_I1...>, __tuple_indices<_I2...>) | |
: first(std::__1::forward<_Args1>(std::__1::get<_I1>( __first_args))...), | |
second(std::__1::forward<_Args2>(std::__1::get<_I2>(__second_args))...) | |
{ | |
} | |
} } | |
namespace std { inline namespace __1 { | |
class LDIONNE_HIDDEN __libcpp_refstring | |
{ | |
const char* __imp_; | |
bool __uses_refcount() const; | |
public: | |
explicit __libcpp_refstring(const char* __msg); | |
__libcpp_refstring(const __libcpp_refstring& __s) noexcept; | |
__libcpp_refstring& operator=(const __libcpp_refstring& __s) noexcept; | |
~__libcpp_refstring(); | |
const char* c_str() const noexcept {return __imp_;} | |
}; | |
} } | |
namespace std | |
{ | |
class __attribute__ ((__visibility__("default"))) logic_error | |
: public exception | |
{ | |
private: | |
std::__1::__libcpp_refstring __imp_; | |
public: | |
explicit logic_error(const string&); | |
explicit logic_error(const char*); | |
logic_error(const logic_error&) noexcept; | |
logic_error& operator=(const logic_error&) noexcept; | |
virtual ~logic_error() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) runtime_error | |
: public exception | |
{ | |
private: | |
std::__1::__libcpp_refstring __imp_; | |
public: | |
explicit runtime_error(const string&); | |
explicit runtime_error(const char*); | |
runtime_error(const runtime_error&) noexcept; | |
runtime_error& operator=(const runtime_error&) noexcept; | |
virtual ~runtime_error() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) domain_error | |
: public logic_error | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit domain_error(const string& __s) : logic_error(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit domain_error(const char* __s) : logic_error(__s) {} | |
domain_error(const domain_error&) noexcept = default; | |
virtual ~domain_error() noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) invalid_argument | |
: public logic_error | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit invalid_argument(const string& __s) : logic_error(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit invalid_argument(const char* __s) : logic_error(__s) {} | |
invalid_argument(const invalid_argument&) noexcept = default; | |
virtual ~invalid_argument() noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) length_error | |
: public logic_error | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit length_error(const string& __s) : logic_error(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit length_error(const char* __s) : logic_error(__s) {} | |
length_error(const length_error&) noexcept = default; | |
virtual ~length_error() noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) out_of_range | |
: public logic_error | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit out_of_range(const string& __s) : logic_error(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit out_of_range(const char* __s) : logic_error(__s) {} | |
out_of_range(const out_of_range&) noexcept = default; | |
virtual ~out_of_range() noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) range_error | |
: public runtime_error | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit range_error(const string& __s) : runtime_error(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit range_error(const char* __s) : runtime_error(__s) {} | |
range_error(const range_error&) noexcept = default; | |
virtual ~range_error() noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) overflow_error | |
: public runtime_error | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit overflow_error(const string& __s) : runtime_error(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit overflow_error(const char* __s) : runtime_error(__s) {} | |
overflow_error(const overflow_error&) noexcept = default; | |
virtual ~overflow_error() noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) underflow_error | |
: public runtime_error | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit underflow_error(const string& __s) : runtime_error(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit underflow_error(const char* __s) : runtime_error(__s) {} | |
underflow_error(const underflow_error&) noexcept = default; | |
virtual ~underflow_error() noexcept; | |
}; | |
} | |
namespace std { inline namespace __1 { | |
[[noreturn]] __attribute__ ((__visibility__("default"))) void __throw_runtime_error(const char*); | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_logic_error(const char*__msg) | |
{ | |
((void)__msg); | |
std::__1::abort(); | |
} | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_domain_error(const char*__msg) | |
{ | |
((void)__msg); | |
std::__1::abort(); | |
} | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_invalid_argument(const char*__msg) | |
{ | |
((void)__msg); | |
std::__1::abort(); | |
} | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_length_error(const char*__msg) | |
{ | |
((void)__msg); | |
std::__1::abort(); | |
} | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_out_of_range(const char*__msg) | |
{ | |
((void)__msg); | |
std::__1::abort(); | |
} | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_range_error(const char*__msg) | |
{ | |
((void)__msg); | |
std::__1::abort(); | |
} | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_overflow_error(const char*__msg) | |
{ | |
((void)__msg); | |
std::__1::abort(); | |
} | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_underflow_error(const char*__msg) | |
{ | |
((void)__msg); | |
std::__1::abort(); | |
} | |
} } | |
namespace std { inline namespace __1 { | |
template <class _Tp, class = void> | |
struct __has_element_type : false_type {}; | |
template <class _Tp> | |
struct __has_element_type<_Tp, | |
typename __void_t<typename _Tp::element_type>::type> : true_type {}; | |
template <class _Ptr, bool = __has_element_type<_Ptr>::value> | |
struct __pointer_traits_element_type; | |
template <class _Ptr> | |
struct __pointer_traits_element_type<_Ptr, true> | |
{ | |
typedef typename _Ptr::element_type type; | |
}; | |
template <template <class, class...> class _Sp, class _Tp, class ..._Args> | |
struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true> | |
{ | |
typedef typename _Sp<_Tp, _Args...>::element_type type; | |
}; | |
template <template <class, class...> class _Sp, class _Tp, class ..._Args> | |
struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false> | |
{ | |
typedef _Tp type; | |
}; | |
template <class _Tp, class = void> | |
struct __has_difference_type : false_type {}; | |
template <class _Tp> | |
struct __has_difference_type<_Tp, | |
typename __void_t<typename _Tp::difference_type>::type> : true_type {}; | |
template <class _Ptr, bool = __has_difference_type<_Ptr>::value> | |
struct __pointer_traits_difference_type | |
{ | |
typedef ptrdiff_t type; | |
}; | |
template <class _Ptr> | |
struct __pointer_traits_difference_type<_Ptr, true> | |
{ | |
typedef typename _Ptr::difference_type type; | |
}; | |
template <class _Tp, class _Up> | |
struct __has_rebind | |
{ | |
private: | |
struct __two {char __lx; char __lxx;}; | |
template <class _Xp> static __two __test(...); | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated" | |
template <class _Xp> static char __test(typename _Xp::template rebind<_Up>* = 0); | |
#pragma GCC diagnostic pop | |
public: | |
static const bool value = sizeof(__test<_Tp>(0)) == 1; | |
}; | |
template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value> | |
struct __pointer_traits_rebind | |
{ | |
typedef typename _Tp::template rebind<_Up> type; | |
}; | |
template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up> | |
struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true> | |
{ | |
typedef typename _Sp<_Tp, _Args...>::template rebind<_Up> type; | |
}; | |
template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up> | |
struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false> | |
{ | |
typedef _Sp<_Up, _Args...> type; | |
}; | |
template <class _Ptr> | |
struct __attribute__ ((__type_visibility__("default"))) pointer_traits | |
{ | |
typedef _Ptr pointer; | |
typedef typename __pointer_traits_element_type<pointer>::type element_type; | |
typedef typename __pointer_traits_difference_type<pointer>::type difference_type; | |
template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type; | |
private: | |
struct __nat {}; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static pointer pointer_to(typename conditional<is_void<element_type>::value, | |
__nat, element_type>::type& __r) | |
{return pointer::pointer_to(__r);} | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) pointer_traits<_Tp*> | |
{ | |
typedef _Tp* pointer; | |
typedef _Tp element_type; | |
typedef ptrdiff_t difference_type; | |
template <class _Up> using rebind = _Up*; | |
private: | |
struct __nat {}; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static pointer pointer_to(typename conditional<is_void<element_type>::value, | |
__nat, element_type>::type& __r) noexcept | |
{return std::__1::addressof(__r);} | |
}; | |
template <class _From, class _To> | |
struct __rebind_pointer { | |
typedef typename pointer_traits<_From>::template rebind<_To> type; | |
}; | |
} } | |
namespace std { inline namespace __1 { | |
template <class _Tp, class = void> struct __has_pointer : false_type { }; template <class _Tp> struct __has_pointer<_Tp, typename __void_t<typename _Tp:: pointer >::type> : true_type { }; | |
template <class _Tp, class _Alloc, | |
class _RawAlloc = typename remove_reference<_Alloc>::type, | |
bool = __has_pointer<_RawAlloc>::value> | |
struct __pointer { | |
using type = typename _RawAlloc::pointer; | |
}; | |
template <class _Tp, class _Alloc, class _RawAlloc> | |
struct __pointer<_Tp, _Alloc, _RawAlloc, false> { | |
using type = _Tp*; | |
}; | |
template <class _Tp, class = void> struct __has_const_pointer : false_type { }; template <class _Tp> struct __has_const_pointer<_Tp, typename __void_t<typename _Tp:: const_pointer >::type> : true_type { }; | |
template <class _Tp, class _Ptr, class _Alloc, | |
bool = __has_const_pointer<_Alloc>::value> | |
struct __const_pointer { | |
using type = typename _Alloc::const_pointer; | |
}; | |
template <class _Tp, class _Ptr, class _Alloc> | |
struct __const_pointer<_Tp, _Ptr, _Alloc, false> { | |
using type = typename pointer_traits<_Ptr>::template rebind<const _Tp>; | |
}; | |
template <class _Tp, class = void> struct __has_void_pointer : false_type { }; template <class _Tp> struct __has_void_pointer<_Tp, typename __void_t<typename _Tp:: void_pointer >::type> : true_type { }; | |
template <class _Ptr, class _Alloc, | |
bool = __has_void_pointer<_Alloc>::value> | |
struct __void_pointer { | |
using type = typename _Alloc::void_pointer; | |
}; | |
template <class _Ptr, class _Alloc> | |
struct __void_pointer<_Ptr, _Alloc, false> { | |
using type = typename pointer_traits<_Ptr>::template rebind<void>; | |
}; | |
template <class _Tp, class = void> struct __has_const_void_pointer : false_type { }; template <class _Tp> struct __has_const_void_pointer<_Tp, typename __void_t<typename _Tp:: const_void_pointer >::type> : true_type { }; | |
template <class _Ptr, class _Alloc, | |
bool = __has_const_void_pointer<_Alloc>::value> | |
struct __const_void_pointer { | |
using type = typename _Alloc::const_void_pointer; | |
}; | |
template <class _Ptr, class _Alloc> | |
struct __const_void_pointer<_Ptr, _Alloc, false> { | |
using type = typename pointer_traits<_Ptr>::template rebind<const void>; | |
}; | |
template <class _Tp, class = void> struct __has_size_type : false_type { }; template <class _Tp> struct __has_size_type<_Tp, typename __void_t<typename _Tp:: size_type >::type> : true_type { }; | |
template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value> | |
struct __size_type : make_unsigned<_DiffType> { }; | |
template <class _Alloc, class _DiffType> | |
struct __size_type<_Alloc, _DiffType, true> { | |
using type = typename _Alloc::size_type; | |
}; | |
template <class _Tp, class = void> struct __has_alloc_traits_difference_type : false_type { }; template <class _Tp> struct __has_alloc_traits_difference_type<_Tp, typename __void_t<typename _Tp:: difference_type >::type> : true_type { }; | |
template <class _Alloc, class _Ptr, bool = __has_alloc_traits_difference_type<_Alloc>::value> | |
struct __alloc_traits_difference_type { | |
using type = typename pointer_traits<_Ptr>::difference_type; | |
}; | |
template <class _Alloc, class _Ptr> | |
struct __alloc_traits_difference_type<_Alloc, _Ptr, true> { | |
using type = typename _Alloc::difference_type; | |
}; | |
template <class _Tp, class = void> struct __has_propagate_on_container_copy_assignment : false_type { }; template <class _Tp> struct __has_propagate_on_container_copy_assignment<_Tp, typename __void_t<typename _Tp:: propagate_on_container_copy_assignment >::type> : true_type { }; | |
template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value> | |
struct __propagate_on_container_copy_assignment : false_type { }; | |
template <class _Alloc> | |
struct __propagate_on_container_copy_assignment<_Alloc, true> { | |
using type = typename _Alloc::propagate_on_container_copy_assignment; | |
}; | |
template <class _Tp, class = void> struct __has_propagate_on_container_move_assignment : false_type { }; template <class _Tp> struct __has_propagate_on_container_move_assignment<_Tp, typename __void_t<typename _Tp:: propagate_on_container_move_assignment >::type> : true_type { }; | |
template <class _Alloc, bool = __has_propagate_on_container_move_assignment<_Alloc>::value> | |
struct __propagate_on_container_move_assignment : false_type { }; | |
template <class _Alloc> | |
struct __propagate_on_container_move_assignment<_Alloc, true> { | |
using type = typename _Alloc::propagate_on_container_move_assignment; | |
}; | |
template <class _Tp, class = void> struct __has_propagate_on_container_swap : false_type { }; template <class _Tp> struct __has_propagate_on_container_swap<_Tp, typename __void_t<typename _Tp:: propagate_on_container_swap >::type> : true_type { }; | |
template <class _Alloc, bool = __has_propagate_on_container_swap<_Alloc>::value> | |
struct __propagate_on_container_swap : false_type { }; | |
template <class _Alloc> | |
struct __propagate_on_container_swap<_Alloc, true> { | |
using type = typename _Alloc::propagate_on_container_swap; | |
}; | |
template <class _Tp, class = void> struct __has_is_always_equal : false_type { }; template <class _Tp> struct __has_is_always_equal<_Tp, typename __void_t<typename _Tp:: is_always_equal >::type> : true_type { }; | |
template <class _Alloc, bool = __has_is_always_equal<_Alloc>::value> | |
struct __is_always_equal : is_empty<_Alloc> { }; | |
template <class _Alloc> | |
struct __is_always_equal<_Alloc, true> { | |
using type = typename _Alloc::is_always_equal; | |
}; | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated" | |
template <class _Tp, class _Up, class = void> | |
struct __has_rebind_other : false_type { }; | |
template <class _Tp, class _Up> | |
struct __has_rebind_other<_Tp, _Up, typename __void_t< | |
typename _Tp::template rebind<_Up>::other | |
>::type> : true_type { }; | |
template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value> | |
struct __allocator_traits_rebind { | |
using type = typename _Tp::template rebind<_Up>::other; | |
}; | |
template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up> | |
struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true> { | |
using type = typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other; | |
}; | |
template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up> | |
struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false> { | |
using type = _Alloc<_Up, _Args...>; | |
}; | |
#pragma GCC diagnostic pop | |
template<class _Alloc, class _Tp> | |
using __allocator_traits_rebind_t = typename __allocator_traits_rebind<_Alloc, _Tp>::type; | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated" | |
template <class _Alloc, class _SizeType, class _ConstVoidPtr, class = void> | |
struct __has_allocate_hint : false_type { }; | |
template <class _Alloc, class _SizeType, class _ConstVoidPtr> | |
struct __has_allocate_hint<_Alloc, _SizeType, _ConstVoidPtr, decltype( | |
(void)declval<_Alloc>().allocate(declval<_SizeType>(), declval<_ConstVoidPtr>()) | |
)> : true_type { }; | |
template <class, class _Alloc, class ..._Args> | |
struct __has_construct_impl : false_type { }; | |
template <class _Alloc, class ..._Args> | |
struct __has_construct_impl<decltype( | |
(void)declval<_Alloc>().construct(declval<_Args>()...) | |
), _Alloc, _Args...> : true_type { }; | |
template <class _Alloc, class ..._Args> | |
struct __has_construct : __has_construct_impl<void, _Alloc, _Args...> { }; | |
template <class _Alloc, class _Pointer, class = void> | |
struct __has_destroy : false_type { }; | |
template <class _Alloc, class _Pointer> | |
struct __has_destroy<_Alloc, _Pointer, decltype( | |
(void)declval<_Alloc>().destroy(declval<_Pointer>()) | |
)> : true_type { }; | |
template <class _Alloc, class = void> | |
struct __has_max_size : false_type { }; | |
template <class _Alloc> | |
struct __has_max_size<_Alloc, decltype( | |
(void)declval<_Alloc&>().max_size() | |
)> : true_type { }; | |
template <class _Alloc, class = void> | |
struct __has_select_on_container_copy_construction : false_type { }; | |
template <class _Alloc> | |
struct __has_select_on_container_copy_construction<_Alloc, decltype( | |
(void)declval<_Alloc>().select_on_container_copy_construction() | |
)> : true_type { }; | |
#pragma GCC diagnostic pop | |
template <class _Alloc> | |
struct __attribute__ ((__type_visibility__("default"))) allocator_traits | |
{ | |
using allocator_type = _Alloc; | |
using value_type = typename allocator_type::value_type; | |
using pointer = typename __pointer<value_type, allocator_type>::type; | |
using const_pointer = typename __const_pointer<value_type, pointer, allocator_type>::type; | |
using void_pointer = typename __void_pointer<pointer, allocator_type>::type; | |
using const_void_pointer = typename __const_void_pointer<pointer, allocator_type>::type; | |
using difference_type = typename __alloc_traits_difference_type<allocator_type, pointer>::type; | |
using size_type = typename __size_type<allocator_type, difference_type>::type; | |
using propagate_on_container_copy_assignment = typename __propagate_on_container_copy_assignment<allocator_type>::type; | |
using propagate_on_container_move_assignment = typename __propagate_on_container_move_assignment<allocator_type>::type; | |
using propagate_on_container_swap = typename __propagate_on_container_swap<allocator_type>::type; | |
using is_always_equal = typename __is_always_equal<allocator_type>::type; | |
template <class _Tp> | |
using rebind_alloc = __allocator_traits_rebind_t<allocator_type, _Tp>; | |
template <class _Tp> | |
using rebind_traits = allocator_traits<rebind_alloc<_Tp> >; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static pointer allocate(allocator_type& __a, size_type __n) { | |
return __a.allocate(__n); | |
} | |
template <class _Ap = _Alloc, class = | |
_EnableIf<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) { | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated" | |
return __a.allocate(__n, __hint); | |
#pragma GCC diagnostic pop | |
} | |
template <class _Ap = _Alloc, class = void, class = | |
_EnableIf<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer) { | |
return __a.allocate(__n); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static void deallocate(allocator_type& __a, pointer __p, size_type __n) noexcept { | |
__a.deallocate(__p, __n); | |
} | |
template <class _Tp, class... _Args, class = | |
_EnableIf<__has_construct<allocator_type, _Tp*, _Args...>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args) { | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated" | |
__a.construct(__p, std::__1::forward<_Args>(__args)...); | |
#pragma GCC diagnostic pop | |
} | |
template <class _Tp, class... _Args, class = void, class = | |
_EnableIf<!__has_construct<allocator_type, _Tp*, _Args...>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static void construct(allocator_type&, _Tp* __p, _Args&&... __args) { | |
::new ((void*)__p) _Tp(std::__1::forward<_Args>(__args)...); | |
} | |
template <class _Tp, class = | |
_EnableIf<__has_destroy<allocator_type, _Tp*>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static void destroy(allocator_type& __a, _Tp* __p) { | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated" | |
__a.destroy(__p); | |
#pragma GCC diagnostic pop | |
} | |
template <class _Tp, class = void, class = | |
_EnableIf<!__has_destroy<allocator_type, _Tp*>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static void destroy(allocator_type&, _Tp* __p) { | |
__p->~_Tp(); | |
} | |
template <class _Ap = _Alloc, class = | |
_EnableIf<__has_max_size<const _Ap>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static size_type max_size(const allocator_type& __a) noexcept { | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated" | |
return __a.max_size(); | |
#pragma GCC diagnostic pop | |
} | |
template <class _Ap = _Alloc, class = void, class = | |
_EnableIf<!__has_max_size<const _Ap>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static size_type max_size(const allocator_type&) noexcept { | |
return numeric_limits<size_type>::max() / sizeof(value_type); | |
} | |
template <class _Ap = _Alloc, class = | |
_EnableIf<__has_select_on_container_copy_construction<const _Ap>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static allocator_type select_on_container_copy_construction(const allocator_type& __a) { | |
return __a.select_on_container_copy_construction(); | |
} | |
template <class _Ap = _Alloc, class = void, class = | |
_EnableIf<!__has_select_on_container_copy_construction<const _Ap>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static allocator_type select_on_container_copy_construction(const allocator_type& __a) { | |
return __a; | |
} | |
}; | |
template <class _Traits, class _Tp> | |
struct __rebind_alloc_helper { | |
using type = typename _Traits::template rebind_alloc<_Tp>; | |
}; | |
template <class _Tp> | |
struct __is_default_allocator : false_type { }; | |
template <class _Tp> | |
struct __is_default_allocator<std::__1::allocator<_Tp> > : true_type { }; | |
template <class _Alloc, class = void> | |
struct __is_cpp17_move_insertable | |
: is_move_constructible<typename _Alloc::value_type> | |
{ }; | |
template <class _Alloc> | |
struct __is_cpp17_move_insertable<_Alloc, _EnableIf< | |
!__is_default_allocator<_Alloc>::value && | |
__has_construct<_Alloc, typename _Alloc::value_type*, typename _Alloc::value_type&&>::value | |
> > : true_type { }; | |
template <class _Alloc, class = void> | |
struct __is_cpp17_copy_insertable | |
: integral_constant<bool, | |
is_copy_constructible<typename _Alloc::value_type>::value && | |
__is_cpp17_move_insertable<_Alloc>::value | |
> | |
{ }; | |
template <class _Alloc> | |
struct __is_cpp17_copy_insertable<_Alloc, _EnableIf< | |
!__is_default_allocator<_Alloc>::value && | |
__has_construct<_Alloc, typename _Alloc::value_type*, const typename _Alloc::value_type&>::value | |
> > | |
: __is_cpp17_move_insertable<_Alloc> | |
{ }; | |
} } | |
namespace std { inline namespace __1 { | |
template<class _Alloc> | |
struct __allocation_guard { | |
using _Pointer = typename allocator_traits<_Alloc>::pointer; | |
using _Size = typename allocator_traits<_Alloc>::size_type; | |
template<class _AllocT> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __allocation_guard(_AllocT __alloc, _Size __n) | |
: __alloc_(std::__1::move(__alloc)) | |
, __n_(__n) | |
, __ptr_(allocator_traits<_Alloc>::allocate(__alloc_, __n_)) | |
{ } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
~__allocation_guard() noexcept { | |
if (__ptr_ != nullptr) { | |
allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __n_); | |
} | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Pointer __release_ptr() noexcept { | |
_Pointer __tmp = __ptr_; | |
__ptr_ = nullptr; | |
return __tmp; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Pointer __get() const noexcept { | |
return __ptr_; | |
} | |
private: | |
_Alloc __alloc_; | |
_Size __n_; | |
_Pointer __ptr_; | |
}; | |
} } | |
namespace std { inline namespace __1 { | |
using ::clock_t __attribute__((using_if_exists)); | |
using ::size_t; | |
using ::time_t __attribute__((using_if_exists)); | |
using ::tm __attribute__((using_if_exists)); | |
using ::clock __attribute__((using_if_exists)); | |
using ::difftime __attribute__((using_if_exists)); | |
using ::mktime __attribute__((using_if_exists)); | |
using ::time __attribute__((using_if_exists)); | |
using ::asctime __attribute__((using_if_exists)); | |
using ::ctime __attribute__((using_if_exists)); | |
using ::gmtime __attribute__((using_if_exists)); | |
using ::localtime __attribute__((using_if_exists)); | |
using ::strftime __attribute__((using_if_exists)); | |
} } | |
namespace std { inline namespace __1 { | |
template <intmax_t _Xp, intmax_t _Yp> | |
struct __static_gcd | |
{ | |
static const intmax_t value = __static_gcd<_Yp, _Xp % _Yp>::value; | |
}; | |
template <intmax_t _Xp> | |
struct __static_gcd<_Xp, 0> | |
{ | |
static const intmax_t value = _Xp; | |
}; | |
template <> | |
struct __static_gcd<0, 0> | |
{ | |
static const intmax_t value = 1; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp> | |
struct __static_lcm | |
{ | |
static const intmax_t value = _Xp / __static_gcd<_Xp, _Yp>::value * _Yp; | |
}; | |
template <intmax_t _Xp> | |
struct __static_abs | |
{ | |
static const intmax_t value = _Xp < 0 ? -_Xp : _Xp; | |
}; | |
template <intmax_t _Xp> | |
struct __static_sign | |
{ | |
static const intmax_t value = _Xp == 0 ? 0 : (_Xp < 0 ? -1 : 1); | |
}; | |
template <intmax_t _Xp, intmax_t _Yp, intmax_t = __static_sign<_Yp>::value> | |
class __ll_add; | |
template <intmax_t _Xp, intmax_t _Yp> | |
class __ll_add<_Xp, _Yp, 1> | |
{ | |
static const intmax_t min = (1LL << (sizeof(intmax_t) * 8 - 1)) + 1; | |
static const intmax_t max = -min; | |
static_assert(_Xp <= max - _Yp, "overflow in __ll_add"); | |
public: | |
static const intmax_t value = _Xp + _Yp; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp> | |
class __ll_add<_Xp, _Yp, 0> | |
{ | |
public: | |
static const intmax_t value = _Xp; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp> | |
class __ll_add<_Xp, _Yp, -1> | |
{ | |
static const intmax_t min = (1LL << (sizeof(intmax_t) * 8 - 1)) + 1; | |
static const intmax_t max = -min; | |
static_assert(min - _Yp <= _Xp, "overflow in __ll_add"); | |
public: | |
static const intmax_t value = _Xp + _Yp; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp, intmax_t = __static_sign<_Yp>::value> | |
class __ll_sub; | |
template <intmax_t _Xp, intmax_t _Yp> | |
class __ll_sub<_Xp, _Yp, 1> | |
{ | |
static const intmax_t min = (1LL << (sizeof(intmax_t) * 8 - 1)) + 1; | |
static const intmax_t max = -min; | |
static_assert(min + _Yp <= _Xp, "overflow in __ll_sub"); | |
public: | |
static const intmax_t value = _Xp - _Yp; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp> | |
class __ll_sub<_Xp, _Yp, 0> | |
{ | |
public: | |
static const intmax_t value = _Xp; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp> | |
class __ll_sub<_Xp, _Yp, -1> | |
{ | |
static const intmax_t min = (1LL << (sizeof(intmax_t) * 8 - 1)) + 1; | |
static const intmax_t max = -min; | |
static_assert(_Xp <= max + _Yp, "overflow in __ll_sub"); | |
public: | |
static const intmax_t value = _Xp - _Yp; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp> | |
class __ll_mul | |
{ | |
static const intmax_t nan = (1LL << (sizeof(intmax_t) * 8 - 1)); | |
static const intmax_t min = nan + 1; | |
static const intmax_t max = -min; | |
static const intmax_t __a_x = __static_abs<_Xp>::value; | |
static const intmax_t __a_y = __static_abs<_Yp>::value; | |
static_assert(_Xp != nan && _Yp != nan && __a_x <= max / __a_y, "overflow in __ll_mul"); | |
public: | |
static const intmax_t value = _Xp * _Yp; | |
}; | |
template <intmax_t _Yp> | |
class __ll_mul<0, _Yp> | |
{ | |
public: | |
static const intmax_t value = 0; | |
}; | |
template <intmax_t _Xp> | |
class __ll_mul<_Xp, 0> | |
{ | |
public: | |
static const intmax_t value = 0; | |
}; | |
template <> | |
class __ll_mul<0, 0> | |
{ | |
public: | |
static const intmax_t value = 0; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp> | |
class __ll_div | |
{ | |
static const intmax_t nan = (1LL << (sizeof(intmax_t) * 8 - 1)); | |
static const intmax_t min = nan + 1; | |
static const intmax_t max = -min; | |
static_assert(_Xp != nan && _Yp != nan && _Yp != 0, "overflow in __ll_div"); | |
public: | |
static const intmax_t value = _Xp / _Yp; | |
}; | |
template <intmax_t _Num, intmax_t _Den = 1> | |
class __attribute__ ((__type_visibility__("default"))) ratio | |
{ | |
static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range"); | |
static_assert(_Den != 0, "ratio divide by 0"); | |
static_assert(__static_abs<_Den>::value > 0, "ratio denominator is out of range"); | |
static constexpr const intmax_t __na = __static_abs<_Num>::value; | |
static constexpr const intmax_t __da = __static_abs<_Den>::value; | |
static constexpr const intmax_t __s = __static_sign<_Num>::value * __static_sign<_Den>::value; | |
static constexpr const intmax_t __gcd = __static_gcd<__na, __da>::value; | |
public: | |
static constexpr const intmax_t num = __s * __na / __gcd; | |
static constexpr const intmax_t den = __da / __gcd; | |
typedef ratio<num, den> type; | |
}; | |
template <intmax_t _Num, intmax_t _Den> | |
constexpr const intmax_t ratio<_Num, _Den>::num; | |
template <intmax_t _Num, intmax_t _Den> | |
constexpr const intmax_t ratio<_Num, _Den>::den; | |
template <class _Tp> struct __is_ratio : false_type {}; | |
template <intmax_t _Num, intmax_t _Den> struct __is_ratio<ratio<_Num, _Den> > : true_type {}; | |
typedef ratio<1LL, 1000000000000000000LL> atto; | |
typedef ratio<1LL, 1000000000000000LL> femto; | |
typedef ratio<1LL, 1000000000000LL> pico; | |
typedef ratio<1LL, 1000000000LL> nano; | |
typedef ratio<1LL, 1000000LL> micro; | |
typedef ratio<1LL, 1000LL> milli; | |
typedef ratio<1LL, 100LL> centi; | |
typedef ratio<1LL, 10LL> deci; | |
typedef ratio< 10LL, 1LL> deca; | |
typedef ratio< 100LL, 1LL> hecto; | |
typedef ratio< 1000LL, 1LL> kilo; | |
typedef ratio< 1000000LL, 1LL> mega; | |
typedef ratio< 1000000000LL, 1LL> giga; | |
typedef ratio< 1000000000000LL, 1LL> tera; | |
typedef ratio< 1000000000000000LL, 1LL> peta; | |
typedef ratio<1000000000000000000LL, 1LL> exa; | |
template <class _R1, class _R2> | |
struct __ratio_multiply | |
{ | |
private: | |
static const intmax_t __gcd_n1_d2 = __static_gcd<_R1::num, _R2::den>::value; | |
static const intmax_t __gcd_d1_n2 = __static_gcd<_R1::den, _R2::num>::value; | |
public: | |
typedef typename ratio | |
< | |
__ll_mul<_R1::num / __gcd_n1_d2, _R2::num / __gcd_d1_n2>::value, | |
__ll_mul<_R2::den / __gcd_n1_d2, _R1::den / __gcd_d1_n2>::value | |
>::type type; | |
}; | |
template <class _R1, class _R2> using ratio_multiply | |
= typename __ratio_multiply<_R1, _R2>::type; | |
template <class _R1, class _R2> | |
struct __ratio_divide | |
{ | |
private: | |
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value; | |
static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value; | |
public: | |
typedef typename ratio | |
< | |
__ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value, | |
__ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value | |
>::type type; | |
}; | |
template <class _R1, class _R2> using ratio_divide | |
= typename __ratio_divide<_R1, _R2>::type; | |
template <class _R1, class _R2> | |
struct __ratio_add | |
{ | |
private: | |
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value; | |
static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value; | |
public: | |
typedef typename ratio_multiply | |
< | |
ratio<__gcd_n1_n2, _R1::den / __gcd_d1_d2>, | |
ratio | |
< | |
__ll_add | |
< | |
__ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value, | |
__ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value | |
>::value, | |
_R2::den | |
> | |
>::type type; | |
}; | |
template <class _R1, class _R2> using ratio_add | |
= typename __ratio_add<_R1, _R2>::type; | |
template <class _R1, class _R2> | |
struct __ratio_subtract | |
{ | |
private: | |
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value; | |
static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value; | |
public: | |
typedef typename ratio_multiply | |
< | |
ratio<__gcd_n1_n2, _R1::den / __gcd_d1_d2>, | |
ratio | |
< | |
__ll_sub | |
< | |
__ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value, | |
__ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value | |
>::value, | |
_R2::den | |
> | |
>::type type; | |
}; | |
template <class _R1, class _R2> using ratio_subtract | |
= typename __ratio_subtract<_R1, _R2>::type; | |
template <class _R1, class _R2> | |
struct __attribute__ ((__type_visibility__("default"))) ratio_equal | |
: public integral_constant<bool,((_R1::num == _R2::num && _R1::den == _R2::den))> {}; | |
template <class _R1, class _R2> | |
struct __attribute__ ((__type_visibility__("default"))) ratio_not_equal | |
: public integral_constant<bool,((!ratio_equal<_R1, _R2>::value))> {}; | |
template <class _R1, class _R2, bool _Odd = false, | |
intmax_t _Q1 = _R1::num / _R1::den, intmax_t _M1 = _R1::num % _R1::den, | |
intmax_t _Q2 = _R2::num / _R2::den, intmax_t _M2 = _R2::num % _R2::den> | |
struct __ratio_less1 | |
{ | |
static const bool value = _Odd ? _Q2 < _Q1 : _Q1 < _Q2; | |
}; | |
template <class _R1, class _R2, bool _Odd, intmax_t _Qp> | |
struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, 0> | |
{ | |
static const bool value = false; | |
}; | |
template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M2> | |
struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, _M2> | |
{ | |
static const bool value = !_Odd; | |
}; | |
template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1> | |
struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, 0> | |
{ | |
static const bool value = _Odd; | |
}; | |
template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1, | |
intmax_t _M2> | |
struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, _M2> | |
{ | |
static const bool value = __ratio_less1<ratio<_R1::den, _M1>, | |
ratio<_R2::den, _M2>, !_Odd>::value; | |
}; | |
template <class _R1, class _R2, intmax_t _S1 = __static_sign<_R1::num>::value, | |
intmax_t _S2 = __static_sign<_R2::num>::value> | |
struct __ratio_less | |
{ | |
static const bool value = _S1 < _S2; | |
}; | |
template <class _R1, class _R2> | |
struct __ratio_less<_R1, _R2, 1LL, 1LL> | |
{ | |
static const bool value = __ratio_less1<_R1, _R2>::value; | |
}; | |
template <class _R1, class _R2> | |
struct __ratio_less<_R1, _R2, -1LL, -1LL> | |
{ | |
static const bool value = __ratio_less1<ratio<-_R2::num, _R2::den>, ratio<-_R1::num, _R1::den> >::value; | |
}; | |
template <class _R1, class _R2> | |
struct __attribute__ ((__type_visibility__("default"))) ratio_less | |
: public integral_constant<bool,((__ratio_less<_R1, _R2>::value))> {}; | |
template <class _R1, class _R2> | |
struct __attribute__ ((__type_visibility__("default"))) ratio_less_equal | |
: public integral_constant<bool,((!ratio_less<_R2, _R1>::value))> {}; | |
template <class _R1, class _R2> | |
struct __attribute__ ((__type_visibility__("default"))) ratio_greater | |
: public integral_constant<bool,((ratio_less<_R2, _R1>::value))> {}; | |
template <class _R1, class _R2> | |
struct __attribute__ ((__type_visibility__("default"))) ratio_greater_equal | |
: public integral_constant<bool,((!ratio_less<_R1, _R2>::value))> {}; | |
template <class _R1, class _R2> | |
struct __ratio_gcd | |
{ | |
typedef ratio<__static_gcd<_R1::num, _R2::num>::value, | |
__static_lcm<_R1::den, _R2::den>::value> type; | |
}; | |
} } | |
namespace std { inline namespace __1 { namespace __fs { namespace filesystem { | |
struct _FilesystemClock; | |
} } } } | |
namespace std { inline namespace __1 { | |
namespace chrono | |
{ | |
template <class _Rep, class _Period = ratio<1> > class __attribute__ ((__type_visibility__("default"))) duration; | |
template <class _Tp> | |
struct __is_duration : false_type {}; | |
template <class _Rep, class _Period> | |
struct __is_duration<duration<_Rep, _Period> > : true_type {}; | |
template <class _Rep, class _Period> | |
struct __is_duration<const duration<_Rep, _Period> > : true_type {}; | |
template <class _Rep, class _Period> | |
struct __is_duration<volatile duration<_Rep, _Period> > : true_type {}; | |
template <class _Rep, class _Period> | |
struct __is_duration<const volatile duration<_Rep, _Period> > : true_type {}; | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
struct __attribute__ ((__type_visibility__("default"))) common_type<chrono::duration<_Rep1, _Period1>, | |
chrono::duration<_Rep2, _Period2> > | |
{ | |
typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type, | |
typename __ratio_gcd<_Period1, _Period2>::type> type; | |
}; | |
namespace chrono { | |
template <class _FromDuration, class _ToDuration, | |
class _Period = typename ratio_divide<typename _FromDuration::period, typename _ToDuration::period>::type, | |
bool = _Period::num == 1, | |
bool = _Period::den == 1> | |
struct __duration_cast; | |
template <class _FromDuration, class _ToDuration, class _Period> | |
struct __duration_cast<_FromDuration, _ToDuration, _Period, true, true> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_ToDuration operator()(const _FromDuration& __fd) const | |
{ | |
return _ToDuration(static_cast<typename _ToDuration::rep>(__fd.count())); | |
} | |
}; | |
template <class _FromDuration, class _ToDuration, class _Period> | |
struct __duration_cast<_FromDuration, _ToDuration, _Period, true, false> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_ToDuration operator()(const _FromDuration& __fd) const | |
{ | |
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct; | |
return _ToDuration(static_cast<typename _ToDuration::rep>( | |
static_cast<_Ct>(__fd.count()) / static_cast<_Ct>(_Period::den))); | |
} | |
}; | |
template <class _FromDuration, class _ToDuration, class _Period> | |
struct __duration_cast<_FromDuration, _ToDuration, _Period, false, true> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_ToDuration operator()(const _FromDuration& __fd) const | |
{ | |
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct; | |
return _ToDuration(static_cast<typename _ToDuration::rep>( | |
static_cast<_Ct>(__fd.count()) * static_cast<_Ct>(_Period::num))); | |
} | |
}; | |
template <class _FromDuration, class _ToDuration, class _Period> | |
struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_ToDuration operator()(const _FromDuration& __fd) const | |
{ | |
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct; | |
return _ToDuration(static_cast<typename _ToDuration::rep>( | |
static_cast<_Ct>(__fd.count()) * static_cast<_Ct>(_Period::num) | |
/ static_cast<_Ct>(_Period::den))); | |
} | |
}; | |
template <class _ToDuration, class _Rep, class _Period> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename enable_if | |
< | |
__is_duration<_ToDuration>::value, | |
_ToDuration | |
>::type | |
duration_cast(const duration<_Rep, _Period>& __fd) | |
{ | |
return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd); | |
} | |
template <class _Rep> | |
struct __attribute__ ((__type_visibility__("default"))) treat_as_floating_point : is_floating_point<_Rep> {}; | |
template <class _Rep> | |
struct __attribute__ ((__type_visibility__("default"))) duration_values | |
{ | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr _Rep zero() noexcept {return _Rep(0);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr _Rep max() noexcept {return numeric_limits<_Rep>::max();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr _Rep min() noexcept {return numeric_limits<_Rep>::lowest();} | |
}; | |
template <class _Rep, class _Period> | |
class __attribute__ ((__type_visibility__("default"))) duration | |
{ | |
static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration"); | |
static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ratio"); | |
static_assert(_Period::num > 0, "duration period must be positive"); | |
template <class _R1, class _R2> | |
struct __no_overflow | |
{ | |
private: | |
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value; | |
static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value; | |
static const intmax_t __n1 = _R1::num / __gcd_n1_n2; | |
static const intmax_t __d1 = _R1::den / __gcd_d1_d2; | |
static const intmax_t __n2 = _R2::num / __gcd_n1_n2; | |
static const intmax_t __d2 = _R2::den / __gcd_d1_d2; | |
static const intmax_t max = -((intmax_t(1) << (sizeof(intmax_t) * 8 - 1)) + 1); | |
template <intmax_t _Xp, intmax_t _Yp, bool __overflow> | |
struct __mul | |
{ | |
static const intmax_t value = _Xp * _Yp; | |
}; | |
template <intmax_t _Xp, intmax_t _Yp> | |
struct __mul<_Xp, _Yp, true> | |
{ | |
static const intmax_t value = 1; | |
}; | |
public: | |
static const bool value = (__n1 <= max / __d2) && (__n2 <= max / __d1); | |
typedef ratio<__mul<__n1, __d2, !value>::value, | |
__mul<__n2, __d1, !value>::value> type; | |
}; | |
public: | |
typedef _Rep rep; | |
typedef typename _Period::type period; | |
private: | |
rep __rep_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
duration() = default; | |
template <class _Rep2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
explicit duration(const _Rep2& __r, | |
typename enable_if | |
< | |
is_convertible<_Rep2, rep>::value && | |
(treat_as_floating_point<rep>::value || | |
!treat_as_floating_point<_Rep2>::value) | |
>::type* = nullptr) | |
: __rep_(__r) {} | |
template <class _Rep2, class _Period2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
duration(const duration<_Rep2, _Period2>& __d, | |
typename enable_if | |
< | |
__no_overflow<_Period2, period>::value && ( | |
treat_as_floating_point<rep>::value || | |
(__no_overflow<_Period2, period>::type::den == 1 && | |
!treat_as_floating_point<_Rep2>::value)) | |
>::type* = nullptr) | |
: __rep_(std::__1::chrono::duration_cast<duration>(__d).count()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr rep count() const {return __rep_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr typename common_type<duration>::type operator+() const {return typename common_type<duration>::type(*this);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr typename common_type<duration>::type operator-() const {return typename common_type<duration>::type(-__rep_);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration& operator++() {++__rep_; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration operator++(int) {return duration(__rep_++);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration& operator--() {--__rep_; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration operator--(int) {return duration(__rep_--);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration& operator+=(const duration& __d) {__rep_ += __d.count(); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration& operator-=(const duration& __d) {__rep_ -= __d.count(); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration& operator*=(const rep& rhs) {__rep_ *= rhs; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration& operator/=(const rep& rhs) {__rep_ /= rhs; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration& operator%=(const rep& rhs) {__rep_ %= rhs; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) duration& operator%=(const duration& rhs) {__rep_ %= rhs.count(); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr duration zero() noexcept {return duration(duration_values<rep>::zero());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr duration min() noexcept {return duration(duration_values<rep>::min());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr duration max() noexcept {return duration(duration_values<rep>::max());} | |
}; | |
typedef duration<long long, nano> nanoseconds; | |
typedef duration<long long, micro> microseconds; | |
typedef duration<long long, milli> milliseconds; | |
typedef duration<long long > seconds; | |
typedef duration< long, ratio< 60> > minutes; | |
typedef duration< long, ratio<3600> > hours; | |
template <class _LhsDuration, class _RhsDuration> | |
struct __duration_eq | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const | |
{ | |
typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct; | |
return _Ct(__lhs).count() == _Ct(__rhs).count(); | |
} | |
}; | |
template <class _LhsDuration> | |
struct __duration_eq<_LhsDuration, _LhsDuration> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const | |
{return __lhs.count() == __rhs.count();} | |
}; | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
bool | |
operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
return __duration_eq<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs); | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
bool | |
operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
return !(__lhs == __rhs); | |
} | |
template <class _LhsDuration, class _RhsDuration> | |
struct __duration_lt | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const | |
{ | |
typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct; | |
return _Ct(__lhs).count() < _Ct(__rhs).count(); | |
} | |
}; | |
template <class _LhsDuration> | |
struct __duration_lt<_LhsDuration, _LhsDuration> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const | |
{return __lhs.count() < __rhs.count();} | |
}; | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
bool | |
operator< (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
return __duration_lt<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs); | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
bool | |
operator> (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
return __rhs < __lhs; | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
bool | |
operator<=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
return !(__rhs < __lhs); | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
bool | |
operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
return !(__lhs < __rhs); | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type | |
operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd; | |
return _Cd(_Cd(__lhs).count() + _Cd(__rhs).count()); | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type | |
operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd; | |
return _Cd(_Cd(__lhs).count() - _Cd(__rhs).count()); | |
} | |
template <class _Rep1, class _Period, class _Rep2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename enable_if | |
< | |
is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, | |
duration<typename common_type<_Rep1, _Rep2>::type, _Period> | |
>::type | |
operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s) | |
{ | |
typedef typename common_type<_Rep1, _Rep2>::type _Cr; | |
typedef duration<_Cr, _Period> _Cd; | |
return _Cd(_Cd(__d).count() * static_cast<_Cr>(__s)); | |
} | |
template <class _Rep1, class _Period, class _Rep2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename enable_if | |
< | |
is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value, | |
duration<typename common_type<_Rep1, _Rep2>::type, _Period> | |
>::type | |
operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d) | |
{ | |
return __d * __s; | |
} | |
template <class _Rep1, class _Period, class _Rep2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename enable_if | |
< | |
!__is_duration<_Rep2>::value && | |
is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, | |
duration<typename common_type<_Rep1, _Rep2>::type, _Period> | |
>::type | |
operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s) | |
{ | |
typedef typename common_type<_Rep1, _Rep2>::type _Cr; | |
typedef duration<_Cr, _Period> _Cd; | |
return _Cd(_Cd(__d).count() / static_cast<_Cr>(__s)); | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename common_type<_Rep1, _Rep2>::type | |
operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Ct; | |
return _Ct(__lhs).count() / _Ct(__rhs).count(); | |
} | |
template <class _Rep1, class _Period, class _Rep2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename enable_if | |
< | |
!__is_duration<_Rep2>::value && | |
is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, | |
duration<typename common_type<_Rep1, _Rep2>::type, _Period> | |
>::type | |
operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s) | |
{ | |
typedef typename common_type<_Rep1, _Rep2>::type _Cr; | |
typedef duration<_Cr, _Period> _Cd; | |
return _Cd(_Cd(__d).count() % static_cast<_Cr>(__s)); | |
} | |
template <class _Rep1, class _Period1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type | |
operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
typedef typename common_type<_Rep1, _Rep2>::type _Cr; | |
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd; | |
return _Cd(static_cast<_Cr>(_Cd(__lhs).count()) % static_cast<_Cr>(_Cd(__rhs).count())); | |
} | |
template <class _Clock, class _Duration = typename _Clock::duration> | |
class __attribute__ ((__type_visibility__("default"))) time_point | |
{ | |
static_assert(__is_duration<_Duration>::value, | |
"Second template parameter of time_point must be a std::chrono::duration"); | |
public: | |
typedef _Clock clock; | |
typedef _Duration duration; | |
typedef typename duration::rep rep; | |
typedef typename duration::period period; | |
private: | |
duration __d_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr time_point() : __d_(duration::zero()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr explicit time_point(const duration& __d) : __d_(__d) {} | |
template <class _Duration2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
time_point(const time_point<clock, _Duration2>& t, | |
typename enable_if | |
< | |
is_convertible<_Duration2, duration>::value | |
>::type* = nullptr) | |
: __d_(t.time_since_epoch()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr duration time_since_epoch() const {return __d_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) time_point& operator+=(const duration& __d) {__d_ += __d; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr time_point min() noexcept {return time_point(duration::min());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static constexpr time_point max() noexcept {return time_point(duration::max());} | |
}; | |
} | |
template <class _Clock, class _Duration1, class _Duration2> | |
struct __attribute__ ((__type_visibility__("default"))) common_type<chrono::time_point<_Clock, _Duration1>, | |
chrono::time_point<_Clock, _Duration2> > | |
{ | |
typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type; | |
}; | |
namespace chrono { | |
template <class _ToDuration, class _Clock, class _Duration> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
time_point<_Clock, _ToDuration> | |
time_point_cast(const time_point<_Clock, _Duration>& __t) | |
{ | |
return time_point<_Clock, _ToDuration>(std::__1::chrono::duration_cast<_ToDuration>(__t.time_since_epoch())); | |
} | |
template <class _Clock, class _Duration1, class _Duration2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator==(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) | |
{ | |
return __lhs.time_since_epoch() == __rhs.time_since_epoch(); | |
} | |
template <class _Clock, class _Duration1, class _Duration2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator!=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) | |
{ | |
return !(__lhs == __rhs); | |
} | |
template <class _Clock, class _Duration1, class _Duration2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) | |
{ | |
return __lhs.time_since_epoch() < __rhs.time_since_epoch(); | |
} | |
template <class _Clock, class _Duration1, class _Duration2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) | |
{ | |
return __rhs < __lhs; | |
} | |
template <class _Clock, class _Duration1, class _Duration2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator<=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) | |
{ | |
return !(__rhs < __lhs); | |
} | |
template <class _Clock, class _Duration1, class _Duration2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool | |
operator>=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) | |
{ | |
return !(__lhs < __rhs); | |
} | |
template <class _Clock, class _Duration1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> | |
operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Tr; | |
return _Tr (__lhs.time_since_epoch() + __rhs); | |
} | |
template <class _Rep1, class _Period1, class _Clock, class _Duration2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type> | |
operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) | |
{ | |
return __rhs + __lhs; | |
} | |
template <class _Clock, class _Duration1, class _Rep2, class _Period2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> | |
operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) | |
{ | |
typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Ret; | |
return _Ret(__lhs.time_since_epoch() -__rhs); | |
} | |
template <class _Clock, class _Duration1, class _Duration2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename common_type<_Duration1, _Duration2>::type | |
operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) | |
{ | |
return __lhs.time_since_epoch() - __rhs.time_since_epoch(); | |
} | |
class __attribute__ ((__visibility__("default"))) system_clock | |
{ | |
public: | |
typedef microseconds duration; | |
typedef duration::rep rep; | |
typedef duration::period period; | |
typedef chrono::time_point<system_clock> time_point; | |
static constexpr const bool is_steady = false; | |
static time_point now() noexcept; | |
static time_t to_time_t (const time_point& __t) noexcept; | |
static time_point from_time_t(time_t __t) noexcept; | |
}; | |
class __attribute__ ((__visibility__("default"))) steady_clock | |
{ | |
public: | |
typedef nanoseconds duration; | |
typedef duration::rep rep; | |
typedef duration::period period; | |
typedef chrono::time_point<steady_clock, duration> time_point; | |
static constexpr const bool is_steady = true; | |
static time_point now() noexcept; | |
}; | |
typedef steady_clock high_resolution_clock; | |
} | |
inline namespace literals | |
{ | |
inline namespace chrono_literals | |
{ | |
}} | |
namespace chrono { | |
using namespace literals::chrono_literals; | |
} | |
} } | |
namespace std { inline namespace __1 { namespace __fs { namespace filesystem { | |
struct _FilesystemClock { | |
typedef __int128_t rep; | |
typedef nano period; | |
typedef chrono::duration<rep, period> duration; | |
typedef chrono::time_point<_FilesystemClock> time_point; | |
__attribute__((__visibility__("default"))) | |
static constexpr const bool is_steady = false; | |
__attribute__((availability(macosx,strict,introduced=10.15))) __attribute__((availability(ios,strict,introduced=13.0))) __attribute__((availability(tvos,strict,introduced=13.0))) __attribute__((availability(watchos,strict,introduced=6.0))) __attribute__ ((__visibility__("default"))) static time_point now() noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static time_t to_time_t(const time_point& __t) noexcept { | |
typedef chrono::duration<rep> __secs; | |
return time_t( | |
chrono::duration_cast<__secs>(__t.time_since_epoch()).count()); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static time_point from_time_t(time_t __t) noexcept { | |
typedef chrono::duration<rep> __secs; | |
return time_point(__secs(__t)); | |
} | |
}; | |
} } } } | |
extern "C" { | |
extern int * __error(void); | |
} | |
#pragma clang assume_nonnull begin | |
#pragma clang assume_nonnull end | |
extern "C" { | |
struct sched_param { int sched_priority; char __opaque[4]; }; | |
extern int sched_yield(void); | |
extern int sched_get_priority_min(int); | |
extern int sched_get_priority_max(int); | |
} | |
typedef __darwin_pthread_cond_t pthread_cond_t; | |
typedef __darwin_pthread_condattr_t pthread_condattr_t; | |
typedef __darwin_pthread_key_t pthread_key_t; | |
typedef __darwin_pthread_mutex_t pthread_mutex_t; | |
typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t; | |
typedef __darwin_pthread_once_t pthread_once_t; | |
typedef __darwin_pthread_rwlock_t pthread_rwlock_t; | |
typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t; | |
typedef __darwin_pthread_t pthread_t; | |
typedef enum : unsigned int { QOS_CLASS_USER_INTERACTIVE __attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) = 0x21, QOS_CLASS_USER_INITIATED __attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) = 0x19, QOS_CLASS_DEFAULT __attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) = 0x15, QOS_CLASS_UTILITY __attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) = 0x11, QOS_CLASS_BACKGROUND __attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) = 0x09, QOS_CLASS_UNSPECIFIED __attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) = 0x00, } qos_class_t; | |
extern "C" { | |
__attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) | |
qos_class_t | |
qos_class_self(void); | |
__attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) | |
qos_class_t | |
qos_class_main(void); | |
} | |
#pragma clang assume_nonnull begin | |
extern "C" { | |
__attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) | |
int | |
pthread_attr_set_qos_class_np(pthread_attr_t *__attr, | |
qos_class_t __qos_class, int __relative_priority); | |
__attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) | |
int | |
pthread_attr_get_qos_class_np(pthread_attr_t * __attr, | |
qos_class_t * _Nullable __qos_class, | |
int * _Nullable __relative_priority); | |
__attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) | |
int | |
pthread_set_qos_class_self_np(qos_class_t __qos_class, | |
int __relative_priority); | |
__attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) | |
int | |
pthread_get_qos_class_np(pthread_t __pthread, | |
qos_class_t * _Nullable __qos_class, | |
int * _Nullable __relative_priority); | |
typedef struct pthread_override_s* pthread_override_t; | |
__attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) | |
pthread_override_t | |
pthread_override_qos_class_start_np(pthread_t __pthread, | |
qos_class_t __qos_class, int __relative_priority); | |
__attribute__((availability(macos,introduced=10.10))) __attribute__((availability(ios,introduced=8.0))) | |
int | |
pthread_override_qos_class_end_np(pthread_override_t __override); | |
} | |
#pragma clang assume_nonnull end | |
typedef __darwin_mach_port_t mach_port_t; | |
#pragma clang assume_nonnull begin | |
extern "C" { | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_atfork(void (* _Nullable)(void), void (* _Nullable)(void), | |
void (* _Nullable)(void)); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_destroy(pthread_attr_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getdetachstate(const pthread_attr_t *, int *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getguardsize(const pthread_attr_t * , size_t * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getinheritsched(const pthread_attr_t * , int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getschedparam(const pthread_attr_t * , | |
struct sched_param * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getschedpolicy(const pthread_attr_t * , int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getscope(const pthread_attr_t * , int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getstack(const pthread_attr_t * , | |
void * _Nullable * _Nonnull , size_t * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getstackaddr(const pthread_attr_t * , | |
void * _Nullable * _Nonnull ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_getstacksize(const pthread_attr_t * , size_t * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_init(pthread_attr_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setdetachstate(pthread_attr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setguardsize(pthread_attr_t *, size_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setinheritsched(pthread_attr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setschedparam(pthread_attr_t * , | |
const struct sched_param * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setschedpolicy(pthread_attr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setscope(pthread_attr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setstack(pthread_attr_t *, void *, size_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setstackaddr(pthread_attr_t *, void *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_attr_setstacksize(pthread_attr_t *, size_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cancel(pthread_t) __asm("_" "pthread_cancel" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cond_broadcast(pthread_cond_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cond_destroy(pthread_cond_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cond_init( | |
pthread_cond_t * , | |
const pthread_condattr_t * _Nullable ) | |
__asm("_" "pthread_cond_init" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cond_signal(pthread_cond_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cond_timedwait( | |
pthread_cond_t * , pthread_mutex_t * , | |
const struct timespec * _Nullable ) | |
__asm("_" "pthread_cond_timedwait" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cond_wait(pthread_cond_t * , | |
pthread_mutex_t * ) __asm("_" "pthread_cond_wait" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_condattr_destroy(pthread_condattr_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_condattr_init(pthread_condattr_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_condattr_getpshared(const pthread_condattr_t * , | |
int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_condattr_setpshared(pthread_condattr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_create(pthread_t _Nullable * _Nonnull , | |
const pthread_attr_t * _Nullable , | |
void * _Nullable (* _Nonnull)(void * _Nullable), | |
void * _Nullable ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_detach(pthread_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_equal(pthread_t _Nullable, pthread_t _Nullable); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
void pthread_exit(void * _Nullable) __attribute__((__noreturn__)); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_getconcurrency(void); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_getschedparam(pthread_t , int * _Nullable , | |
struct sched_param * _Nullable ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
void* _Nullable pthread_getspecific(pthread_key_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_join(pthread_t , void * _Nullable * _Nullable) | |
__asm("_" "pthread_join" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_key_create(pthread_key_t *, void (* _Nullable)(void *)); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_key_delete(pthread_key_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutex_destroy(pthread_mutex_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutex_getprioceiling(const pthread_mutex_t * , | |
int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutex_init(pthread_mutex_t * , | |
const pthread_mutexattr_t * _Nullable ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutex_lock(pthread_mutex_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutex_setprioceiling(pthread_mutex_t * , int, | |
int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutex_trylock(pthread_mutex_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutex_unlock(pthread_mutex_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_destroy(pthread_mutexattr_t *) __asm("_" "pthread_mutexattr_destroy" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * , | |
int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * , | |
int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_getpshared(const pthread_mutexattr_t * , | |
int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_gettype(const pthread_mutexattr_t * , | |
int * ); | |
__attribute__((availability(macos,introduced=10.13.4))) __attribute__((availability(ios,introduced=11.3))) __attribute__((availability(watchos,introduced=4.3))) __attribute__((availability(tvos,introduced=11.3))) | |
int pthread_mutexattr_getpolicy_np(const pthread_mutexattr_t * , | |
int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_init(pthread_mutexattr_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_mutexattr_settype(pthread_mutexattr_t *, int); | |
__attribute__((availability(macos,introduced=10.7))) __attribute__((availability(ios,introduced=5.0))) | |
int pthread_mutexattr_setpolicy_np(pthread_mutexattr_t *, int); | |
__attribute__((availability(swift,unavailable,message="Use lazily initialized globals instead"))) | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_once(pthread_once_t *, void (* _Nonnull)(void)); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlock_destroy(pthread_rwlock_t * ) __asm("_" "pthread_rwlock_destroy" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlock_init(pthread_rwlock_t * , | |
const pthread_rwlockattr_t * _Nullable ) | |
__asm("_" "pthread_rwlock_init" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlock_rdlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_rdlock" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlock_tryrdlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_tryrdlock" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlock_trywrlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_trywrlock" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlock_wrlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_wrlock" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlock_unlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_unlock" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * , | |
int * ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlockattr_init(pthread_rwlockattr_t *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
pthread_t pthread_self(void); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_setcancelstate(int , int * _Nullable) | |
__asm("_" "pthread_setcancelstate" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_setcanceltype(int , int * _Nullable) | |
__asm("_" "pthread_setcanceltype" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_setconcurrency(int); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_setschedparam(pthread_t, int, const struct sched_param *); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_setspecific(pthread_key_t , const void * _Nullable); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
void pthread_testcancel(void) __asm("_" "pthread_testcancel" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_is_threaded_np(void); | |
__attribute__((availability(macos,introduced=10.6))) __attribute__((availability(ios,introduced=3.2))) | |
int pthread_threadid_np(pthread_t _Nullable,__uint64_t* _Nullable); | |
__attribute__((availability(macos,introduced=10.6))) __attribute__((availability(ios,introduced=3.2))) | |
int pthread_getname_np(pthread_t,char*,size_t); | |
__attribute__((availability(macos,introduced=10.6))) __attribute__((availability(ios,introduced=3.2))) | |
int pthread_setname_np(const char*); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_main_np(void); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
mach_port_t pthread_mach_thread_np(pthread_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
size_t pthread_get_stacksize_np(pthread_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
void* pthread_get_stackaddr_np(pthread_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cond_signal_thread_np(pthread_cond_t *, pthread_t _Nullable); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_cond_timedwait_relative_np(pthread_cond_t *, pthread_mutex_t *, | |
const struct timespec * _Nullable); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_create_suspended_np( | |
pthread_t _Nullable * _Nonnull, const pthread_attr_t * _Nullable, | |
void * _Nullable (* _Nonnull)(void * _Nullable), void * _Nullable); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_kill(pthread_t, int); | |
__attribute__((availability(macos,introduced=10.5))) __attribute__((availability(ios,introduced=2.0))) | |
_Nullable pthread_t pthread_from_mach_thread_np(mach_port_t); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
int pthread_sigmask(int, const sigset_t * _Nullable, sigset_t * _Nullable) | |
__asm("_" "pthread_sigmask" ); | |
__attribute__((availability(macos,introduced=10.4))) __attribute__((availability(ios,introduced=2.0))) | |
void pthread_yield_np(void); | |
__attribute__((availability(macos,introduced=11.0))) | |
__attribute__((availability(ios,unavailable))) __attribute__((availability(tvos,unavailable))) __attribute__((availability(watchos,unavailable))) __attribute__((availability(driverkit,unavailable))) | |
void pthread_jit_write_protect_np(int enabled); | |
__attribute__((availability(macos,introduced=11.0))) | |
__attribute__((availability(ios,unavailable))) __attribute__((availability(tvos,unavailable))) __attribute__((availability(watchos,unavailable))) __attribute__((availability(driverkit,unavailable))) | |
int pthread_jit_write_protect_supported_np(void); | |
typedef int (*pthread_jit_write_callback_t)(void * _Nullable ctx); | |
__attribute__((availability(macos,introduced=11.4))) | |
__attribute__((availability(ios,unavailable))) __attribute__((availability(tvos,unavailable))) __attribute__((availability(watchos,unavailable))) __attribute__((availability(driverkit,unavailable))) | |
__attribute__((availability(swift,unavailable,message="This interface cannot be safely used from Swift"))) | |
int pthread_jit_write_with_callback_np( | |
pthread_jit_write_callback_t _Nonnull callback, void * _Nullable ctx); | |
__attribute__((availability(macos,introduced=12.1))) | |
__attribute__((availability(ios,unavailable))) __attribute__((availability(tvos,unavailable))) __attribute__((availability(watchos,unavailable))) __attribute__((availability(driverkit,unavailable))) | |
void pthread_jit_write_freeze_callbacks_np(void); | |
__attribute__((availability(macos,introduced=11.0))) __attribute__((availability(ios,introduced=14.2))) __attribute__((availability(tvos,introduced=14.2))) __attribute__((availability(watchos,introduced=7.1))) | |
int | |
pthread_cpu_number_np(size_t *cpu_number_out); | |
} | |
#pragma clang assume_nonnull end | |
typedef ::timespec __libcpp_timespec_t; | |
namespace std { inline namespace __1 { | |
typedef pthread_mutex_t __libcpp_mutex_t; | |
typedef pthread_mutex_t __libcpp_recursive_mutex_t; | |
typedef pthread_cond_t __libcpp_condvar_t; | |
typedef pthread_once_t __libcpp_exec_once_flag; | |
typedef pthread_t __libcpp_thread_id; | |
typedef pthread_t __libcpp_thread_t; | |
typedef pthread_key_t __libcpp_tls_key; | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_mutex_lock(__libcpp_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_mutex_unlock(__libcpp_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_mutex_destroy(__libcpp_mutex_t *__m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_condvar_signal(__libcpp_condvar_t* __cv); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, | |
__libcpp_timespec_t *__ts); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_execute_once(__libcpp_exec_once_flag *flag, | |
void (*init_routine)()); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __libcpp_thread_isnull(const __libcpp_thread_t *__t); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), | |
void *__arg); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__libcpp_thread_id __libcpp_thread_get_current_id(); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_thread_join(__libcpp_thread_t *__t); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_thread_detach(__libcpp_thread_t *__t); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __libcpp_thread_yield(); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_tls_create(__libcpp_tls_key* __key, | |
void(* __at_exit)(void*)); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void *__libcpp_tls_get(__libcpp_tls_key __key); | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int __libcpp_tls_set(__libcpp_tls_key __key, void *__p); | |
struct __libcpp_timed_backoff_policy { | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(chrono::nanoseconds __elapsed) const | |
{ | |
if(__elapsed > chrono::milliseconds(128)) | |
__libcpp_thread_sleep_for(chrono::milliseconds(8)); | |
else if(__elapsed > chrono::microseconds(64)) | |
__libcpp_thread_sleep_for(__elapsed / 2); | |
else if(__elapsed > chrono::microseconds(4)) | |
__libcpp_thread_yield(); | |
else | |
{} | |
return false; | |
} | |
}; | |
static constexpr const int __libcpp_polling_count = 64; | |
template<class _Fn, class _BFn> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __libcpp_thread_poll_with_backoff( | |
_Fn && __f, _BFn && __bf, chrono::nanoseconds __max_elapsed = chrono::nanoseconds::zero()) | |
{ | |
auto const __start = chrono::high_resolution_clock::now(); | |
for(int __count = 0;;) { | |
if(__f()) | |
return true; | |
if(__count < __libcpp_polling_count) { | |
__count += 1; | |
continue; | |
} | |
chrono::nanoseconds const __elapsed = chrono::high_resolution_clock::now() - __start; | |
if(__max_elapsed != chrono::nanoseconds::zero() && __max_elapsed < __elapsed) | |
return false; | |
if(__bf(__elapsed)) | |
return false; | |
} | |
} | |
namespace __thread_detail { | |
inline __libcpp_timespec_t __convert_to_timespec(const chrono::nanoseconds& __ns) | |
{ | |
using namespace chrono; | |
seconds __s = duration_cast<seconds>(__ns); | |
__libcpp_timespec_t __ts; | |
typedef decltype(__ts.tv_sec) __ts_sec; | |
const __ts_sec __ts_sec_max = numeric_limits<__ts_sec>::max(); | |
if (__s.count() < __ts_sec_max) | |
{ | |
__ts.tv_sec = static_cast<__ts_sec>(__s.count()); | |
__ts.tv_nsec = static_cast<decltype(__ts.tv_nsec)>((__ns - __s).count()); | |
} | |
else | |
{ | |
__ts.tv_sec = __ts_sec_max; | |
__ts.tv_nsec = 999999999; | |
} | |
return __ts; | |
} | |
} | |
int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m) | |
{ | |
pthread_mutexattr_t attr; | |
int __ec = pthread_mutexattr_init(&attr); | |
if (__ec) | |
return __ec; | |
__ec = pthread_mutexattr_settype(&attr, 2); | |
if (__ec) { | |
pthread_mutexattr_destroy(&attr); | |
return __ec; | |
} | |
__ec = pthread_mutex_init(__m, &attr); | |
if (__ec) { | |
pthread_mutexattr_destroy(&attr); | |
return __ec; | |
} | |
__ec = pthread_mutexattr_destroy(&attr); | |
if (__ec) { | |
pthread_mutex_destroy(__m); | |
return __ec; | |
} | |
return 0; | |
} | |
int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m) | |
{ | |
return pthread_mutex_lock(__m); | |
} | |
bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m) | |
{ | |
return pthread_mutex_trylock(__m) == 0; | |
} | |
int __libcpp_recursive_mutex_unlock(__libcpp_mutex_t *__m) | |
{ | |
return pthread_mutex_unlock(__m); | |
} | |
int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m) | |
{ | |
return pthread_mutex_destroy(__m); | |
} | |
int __libcpp_mutex_lock(__libcpp_mutex_t *__m) | |
{ | |
return pthread_mutex_lock(__m); | |
} | |
bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m) | |
{ | |
return pthread_mutex_trylock(__m) == 0; | |
} | |
int __libcpp_mutex_unlock(__libcpp_mutex_t *__m) | |
{ | |
return pthread_mutex_unlock(__m); | |
} | |
int __libcpp_mutex_destroy(__libcpp_mutex_t *__m) | |
{ | |
return pthread_mutex_destroy(__m); | |
} | |
int __libcpp_condvar_signal(__libcpp_condvar_t *__cv) | |
{ | |
return pthread_cond_signal(__cv); | |
} | |
int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv) | |
{ | |
return pthread_cond_broadcast(__cv); | |
} | |
int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m) | |
{ | |
return pthread_cond_wait(__cv, __m); | |
} | |
int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, | |
__libcpp_timespec_t *__ts) | |
{ | |
return pthread_cond_timedwait(__cv, __m, __ts); | |
} | |
int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv) | |
{ | |
return pthread_cond_destroy(__cv); | |
} | |
int __libcpp_execute_once(__libcpp_exec_once_flag *flag, | |
void (*init_routine)()) { | |
return pthread_once(flag, init_routine); | |
} | |
bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2) | |
{ | |
return t1 == t2; | |
} | |
bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2) | |
{ | |
return t1 < t2; | |
} | |
bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) { | |
return *__t == __libcpp_thread_t(); | |
} | |
int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), | |
void *__arg) | |
{ | |
return pthread_create(__t, nullptr, __func, __arg); | |
} | |
__libcpp_thread_id __libcpp_thread_get_current_id() | |
{ | |
const __libcpp_thread_t thread = pthread_self(); | |
return __libcpp_thread_get_id(&thread); | |
} | |
__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t) | |
{ | |
return *__t; | |
} | |
int __libcpp_thread_join(__libcpp_thread_t *__t) | |
{ | |
return pthread_join(*__t, nullptr); | |
} | |
int __libcpp_thread_detach(__libcpp_thread_t *__t) | |
{ | |
return pthread_detach(*__t); | |
} | |
void __libcpp_thread_yield() | |
{ | |
sched_yield(); | |
} | |
void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns) | |
{ | |
__libcpp_timespec_t __ts = __thread_detail::__convert_to_timespec(__ns); | |
while (nanosleep(&__ts, &__ts) == -1 && (*__error()) == 4); | |
} | |
int __libcpp_tls_create(__libcpp_tls_key *__key, void (*__at_exit)(void *)) | |
{ | |
return pthread_key_create(__key, __at_exit); | |
} | |
void *__libcpp_tls_get(__libcpp_tls_key __key) | |
{ | |
return pthread_getspecific(__key); | |
} | |
int __libcpp_tls_set(__libcpp_tls_key __key, void *__p) | |
{ | |
return pthread_setspecific(__key, __p); | |
} | |
class __attribute__ ((__visibility__("default"))) thread; | |
class __attribute__ ((__visibility__("default"))) __thread_id; | |
namespace this_thread | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __thread_id get_id() noexcept; | |
} | |
template<> struct hash<__thread_id>; | |
class __attribute__ ((__type_visibility__("default"))) __thread_id | |
{ | |
__libcpp_thread_id __id_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__thread_id() noexcept : __id_(0) {} | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(__thread_id __x, __thread_id __y) noexcept | |
{ | |
if (__x.__id_ == 0) return __y.__id_ == 0; | |
if (__y.__id_ == 0) return false; | |
return __libcpp_thread_id_equal(__x.__id_, __y.__id_); | |
} | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(__thread_id __x, __thread_id __y) noexcept | |
{return !(__x == __y);} | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator< (__thread_id __x, __thread_id __y) noexcept | |
{ | |
if (__x.__id_ == 0) return __y.__id_ != 0; | |
if (__y.__id_ == 0) return false; | |
return __libcpp_thread_id_less(__x.__id_, __y.__id_); | |
} | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator<=(__thread_id __x, __thread_id __y) noexcept | |
{return !(__y < __x);} | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator> (__thread_id __x, __thread_id __y) noexcept | |
{return __y < __x ;} | |
friend LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator>=(__thread_id __x, __thread_id __y) noexcept | |
{return !(__x < __y);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __reset() { __id_ = 0; } | |
template<class _CharT, class _Traits> | |
friend | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_ostream<_CharT, _Traits>& | |
operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id); | |
private: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__thread_id(__libcpp_thread_id __id) : __id_(__id) {} | |
friend __thread_id this_thread::get_id() noexcept; | |
friend class __attribute__ ((__visibility__("default"))) thread; | |
friend struct __attribute__ ((__type_visibility__("default"))) hash<__thread_id>; | |
}; | |
namespace this_thread | |
{ | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__thread_id | |
get_id() noexcept | |
{ | |
return __libcpp_thread_get_current_id(); | |
} | |
} | |
} } | |
namespace std { inline namespace __1 { | |
enum __legacy_memory_order { | |
__mo_relaxed, | |
__mo_consume, | |
__mo_acquire, | |
__mo_release, | |
__mo_acq_rel, | |
__mo_seq_cst | |
}; | |
typedef underlying_type<__legacy_memory_order>::type __memory_order_underlying_t; | |
typedef enum memory_order { | |
memory_order_relaxed = __mo_relaxed, | |
memory_order_consume = __mo_consume, | |
memory_order_acquire = __mo_acquire, | |
memory_order_release = __mo_release, | |
memory_order_acq_rel = __mo_acq_rel, | |
memory_order_seq_cst = __mo_seq_cst, | |
} memory_order; | |
template <typename _Tp> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) { | |
return std::__1::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0; | |
} | |
static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value), | |
"unexpected underlying type for std::memory_order"); | |
template <typename _Tp> | |
struct __cxx_atomic_base_impl { | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__cxx_atomic_base_impl() noexcept = default; | |
constexpr explicit __cxx_atomic_base_impl(_Tp value) noexcept | |
: __a_value(value) {} | |
__extension__ _Atomic(_Tp) __a_value; | |
}; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) inline | |
void __cxx_atomic_thread_fence(memory_order __order) noexcept { | |
__c11_atomic_thread_fence(static_cast<__memory_order_underlying_t>(__order)); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) inline | |
void __cxx_atomic_signal_fence(memory_order __order) noexcept { | |
__c11_atomic_signal_fence(static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val) noexcept { | |
__c11_atomic_init(&__a->__a_value, __val); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val) noexcept { | |
__c11_atomic_init(&__a->__a_value, __val); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val, memory_order __order) noexcept { | |
__c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_order __order) noexcept { | |
__c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) noexcept { | |
using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*; | |
return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) noexcept { | |
using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*; | |
return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __value, memory_order __order) noexcept { | |
return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> * __a, _Tp __value, memory_order __order) noexcept { | |
return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) noexcept { | |
return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) noexcept { | |
return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) noexcept { | |
return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) noexcept { | |
return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) noexcept { | |
return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) noexcept { | |
return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) noexcept { | |
return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) noexcept { | |
return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) noexcept { | |
return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) noexcept { | |
return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) noexcept { | |
return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) noexcept { | |
return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) noexcept { | |
return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) noexcept { | |
return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) noexcept { | |
return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) noexcept { | |
return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) noexcept { | |
return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) noexcept { | |
return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp kill_dependency(_Tp __y) noexcept | |
{ | |
return __y; | |
} | |
template <typename _Tp, | |
typename _Base = __cxx_atomic_base_impl<_Tp> > | |
struct __cxx_atomic_impl : public _Base { | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __cxx_atomic_impl() noexcept = default; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr explicit __cxx_atomic_impl(_Tp value) noexcept | |
: _Base(value) {} | |
}; | |
using __cxx_contention_t = int64_t; | |
using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>; | |
__attribute__((unavailable)) __attribute__((__visibility__("default"))) void __cxx_atomic_notify_one(void const volatile*); | |
__attribute__((unavailable)) __attribute__((__visibility__("default"))) void __cxx_atomic_notify_all(void const volatile*); | |
__attribute__((unavailable)) __attribute__((__visibility__("default"))) __cxx_contention_t __libcpp_atomic_monitor(void const volatile*); | |
__attribute__((unavailable)) __attribute__((__visibility__("default"))) void __libcpp_atomic_wait(void const volatile*, __cxx_contention_t); | |
__attribute__((unavailable)) __attribute__((__visibility__("default"))) void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*); | |
__attribute__((unavailable)) __attribute__((__visibility__("default"))) void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*); | |
__attribute__((unavailable)) __attribute__((__visibility__("default"))) __cxx_contention_t __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*); | |
__attribute__((unavailable)) __attribute__((__visibility__("default"))) void __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t); | |
template <class _Atp, class _Fn> | |
struct __libcpp_atomic_wait_backoff_impl { | |
_Atp* __a; | |
_Fn __test_fn; | |
__attribute__((unavailable)) | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) bool operator()(chrono::nanoseconds __elapsed) const | |
{ | |
if(__elapsed > chrono::microseconds(64)) | |
{ | |
auto const __monitor = __libcpp_atomic_monitor(__a); | |
if(__test_fn()) | |
return true; | |
__libcpp_atomic_wait(__a, __monitor); | |
} | |
else if(__elapsed > chrono::microseconds(4)) | |
__libcpp_thread_yield(); | |
else | |
{} | |
return false; | |
} | |
}; | |
template <class _Atp, class _Fn> | |
__attribute__((unavailable)) | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) bool __cxx_atomic_wait(_Atp* __a, _Fn && __test_fn) | |
{ | |
__libcpp_atomic_wait_backoff_impl<_Atp, typename decay<_Fn>::type> __backoff_fn = {__a, __test_fn}; | |
return __libcpp_thread_poll_with_backoff(__test_fn, __backoff_fn); | |
} | |
template <class _Atp, class _Tp> | |
struct __cxx_atomic_wait_test_fn_impl { | |
_Atp* __a; | |
_Tp __val; | |
memory_order __order; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) bool operator()() const | |
{ | |
return !__cxx_nonatomic_compare_equal(__cxx_atomic_load(__a, __order), __val); | |
} | |
}; | |
template <class _Atp, class _Tp> | |
__attribute__((unavailable)) | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, memory_order __order) | |
{ | |
__cxx_atomic_wait_test_fn_impl<_Atp, _Tp> __test_fn = {__a, __val, __order}; | |
return __cxx_atomic_wait(__a, __test_fn); | |
} | |
template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value> | |
struct __atomic_base | |
{ | |
mutable __cxx_atomic_impl<_Tp> __a_; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool is_lock_free() const volatile noexcept | |
{return __c11_atomic_is_lock_free(sizeof(_Tp));} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool is_lock_free() const noexcept | |
{return static_cast<__atomic_base const volatile*>(this)->is_lock_free();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile noexcept | |
__attribute__((diagnose_if(__m == memory_order_consume || __m == memory_order_acquire || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{__cxx_atomic_store(&__a_, __d, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void store(_Tp __d, memory_order __m = memory_order_seq_cst) noexcept | |
__attribute__((diagnose_if(__m == memory_order_consume || __m == memory_order_acquire || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{__cxx_atomic_store(&__a_, __d, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp load(memory_order __m = memory_order_seq_cst) const volatile noexcept | |
__attribute__((diagnose_if(__m == memory_order_release || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{return __cxx_atomic_load(&__a_, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp load(memory_order __m = memory_order_seq_cst) const noexcept | |
__attribute__((diagnose_if(__m == memory_order_release || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{return __cxx_atomic_load(&__a_, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator _Tp() const volatile noexcept {return load();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator _Tp() const noexcept {return load();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_exchange(&__a_, __d, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_exchange(&__a_, __d, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool compare_exchange_weak(_Tp& __e, _Tp __d, | |
memory_order __s, memory_order __f) volatile noexcept | |
__attribute__((diagnose_if(__f == memory_order_release || __f == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool compare_exchange_weak(_Tp& __e, _Tp __d, | |
memory_order __s, memory_order __f) noexcept | |
__attribute__((diagnose_if(__f == memory_order_release || __f == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool compare_exchange_strong(_Tp& __e, _Tp __d, | |
memory_order __s, memory_order __f) volatile noexcept | |
__attribute__((diagnose_if(__f == memory_order_release || __f == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool compare_exchange_strong(_Tp& __e, _Tp __d, | |
memory_order __s, memory_order __f) noexcept | |
__attribute__((diagnose_if(__f == memory_order_release || __f == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool compare_exchange_weak(_Tp& __e, _Tp __d, | |
memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool compare_exchange_weak(_Tp& __e, _Tp __d, | |
memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool compare_exchange_strong(_Tp& __e, _Tp __d, | |
memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool compare_exchange_strong(_Tp& __e, _Tp __d, | |
memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const volatile noexcept | |
{__cxx_atomic_wait(&__a_, __v, __m);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const noexcept | |
{__cxx_atomic_wait(&__a_, __v, __m);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void notify_one() volatile noexcept | |
{__cxx_atomic_notify_one(&__a_);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void notify_one() noexcept | |
{__cxx_atomic_notify_one(&__a_);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void notify_all() volatile noexcept | |
{__cxx_atomic_notify_all(&__a_);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void notify_all() noexcept | |
{__cxx_atomic_notify_all(&__a_);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__atomic_base() noexcept = default; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__atomic_base(_Tp __d) noexcept : __a_(__d) {} | |
__atomic_base(const __atomic_base&) = delete; | |
__atomic_base& operator=(const __atomic_base&) = delete; | |
__atomic_base& operator=(const __atomic_base&) volatile = delete; | |
}; | |
template <class _Tp> | |
struct __atomic_base<_Tp, true> | |
: public __atomic_base<_Tp, false> | |
{ | |
typedef __atomic_base<_Tp, false> __base; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__atomic_base() noexcept = default; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr __atomic_base(_Tp __d) noexcept : __base(__d) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_fetch_and(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_fetch_and(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_fetch_or(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_fetch_or(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_fetch_xor(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_fetch_xor(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator++(int) volatile noexcept {return fetch_add(_Tp(1));} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator++(int) noexcept {return fetch_add(_Tp(1));} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator--(int) volatile noexcept {return fetch_sub(_Tp(1));} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator--(int) noexcept {return fetch_sub(_Tp(1));} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator++() volatile noexcept {return fetch_add(_Tp(1)) + _Tp(1);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator++() noexcept {return fetch_add(_Tp(1)) + _Tp(1);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator--() volatile noexcept {return fetch_sub(_Tp(1)) - _Tp(1);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator--() noexcept {return fetch_sub(_Tp(1)) - _Tp(1);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator+=(_Tp __op) volatile noexcept {return fetch_add(__op) + __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator+=(_Tp __op) noexcept {return fetch_add(__op) + __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator-=(_Tp __op) volatile noexcept {return fetch_sub(__op) - __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator-=(_Tp __op) noexcept {return fetch_sub(__op) - __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator&=(_Tp __op) volatile noexcept {return fetch_and(__op) & __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator&=(_Tp __op) noexcept {return fetch_and(__op) & __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator|=(_Tp __op) volatile noexcept {return fetch_or(__op) | __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator|=(_Tp __op) noexcept {return fetch_or(__op) | __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator^=(_Tp __op) volatile noexcept {return fetch_xor(__op) ^ __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator^=(_Tp __op) noexcept {return fetch_xor(__op) ^ __op;} | |
}; | |
template <class _Tp> | |
struct atomic | |
: public __atomic_base<_Tp> | |
{ | |
typedef __atomic_base<_Tp> __base; | |
typedef _Tp value_type; | |
typedef value_type difference_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
atomic() noexcept = default; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr atomic(_Tp __d) noexcept : __base(__d) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator=(_Tp __d) volatile noexcept | |
{__base::store(__d); return __d;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator=(_Tp __d) noexcept | |
{__base::store(__d); return __d;} | |
}; | |
template <class _Tp> | |
struct atomic<_Tp*> | |
: public __atomic_base<_Tp*> | |
{ | |
typedef __atomic_base<_Tp*> __base; | |
typedef _Tp* value_type; | |
typedef ptrdiff_t difference_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
atomic() noexcept = default; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr atomic(_Tp* __d) noexcept : __base(__d) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator=(_Tp* __d) volatile noexcept | |
{__base::store(__d); return __d;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator=(_Tp* __d) noexcept | |
{__base::store(__d); return __d;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) | |
volatile noexcept | |
{return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) | |
volatile noexcept | |
{return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator++(int) volatile noexcept {return fetch_add(1);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator++(int) noexcept {return fetch_add(1);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator--(int) volatile noexcept {return fetch_sub(1);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator--(int) noexcept {return fetch_sub(1);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator++() volatile noexcept {return fetch_add(1) + 1;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator++() noexcept {return fetch_add(1) + 1;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator--() volatile noexcept {return fetch_sub(1) - 1;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator--() noexcept {return fetch_sub(1) - 1;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator+=(ptrdiff_t __op) volatile noexcept {return fetch_add(__op) + __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator+=(ptrdiff_t __op) noexcept {return fetch_add(__op) + __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator-=(ptrdiff_t __op) volatile noexcept {return fetch_sub(__op) - __op;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* operator-=(ptrdiff_t __op) noexcept {return fetch_sub(__op) - __op;} | |
}; | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_is_lock_free(const volatile atomic<_Tp>* __o) noexcept | |
{ | |
return __o->is_lock_free(); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_is_lock_free(const atomic<_Tp>* __o) noexcept | |
{ | |
return __o->is_lock_free(); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
__cxx_atomic_init(&__o->__a_, __d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
__cxx_atomic_init(&__o->__a_, __d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
__o->store(__d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
__o->store(__d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) noexcept | |
__attribute__((diagnose_if(__m == memory_order_consume || __m == memory_order_acquire || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
__o->store(__d, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) noexcept | |
__attribute__((diagnose_if(__m == memory_order_consume || __m == memory_order_acquire || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
__o->store(__d, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp | |
atomic_load(const volatile atomic<_Tp>* __o) noexcept | |
{ | |
return __o->load(); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp | |
atomic_load(const atomic<_Tp>* __o) noexcept | |
{ | |
return __o->load(); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp | |
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) noexcept | |
__attribute__((diagnose_if(__m == memory_order_release || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
return __o->load(__m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp | |
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) noexcept | |
__attribute__((diagnose_if(__m == memory_order_release || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
return __o->load(__m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp | |
atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
return __o->exchange(__d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp | |
atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
return __o->exchange(__d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp | |
atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) noexcept | |
{ | |
return __o->exchange(__d, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp | |
atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) noexcept | |
{ | |
return __o->exchange(__d, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
return __o->compare_exchange_weak(*__e, __d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
return __o->compare_exchange_weak(*__e, __d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
return __o->compare_exchange_strong(*__e, __d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) noexcept | |
{ | |
return __o->compare_exchange_strong(*__e, __d); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, | |
typename atomic<_Tp>::value_type __d, | |
memory_order __s, memory_order __f) noexcept | |
__attribute__((diagnose_if(__f == memory_order_release || __f == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
return __o->compare_exchange_weak(*__e, __d, __s, __f); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d, | |
memory_order __s, memory_order __f) noexcept | |
__attribute__((diagnose_if(__f == memory_order_release || __f == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
return __o->compare_exchange_weak(*__e, __d, __s, __f); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o, | |
typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d, | |
memory_order __s, memory_order __f) noexcept | |
__attribute__((diagnose_if(__f == memory_order_release || __f == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
return __o->compare_exchange_strong(*__e, __d, __s, __f); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, | |
typename atomic<_Tp>::value_type __d, | |
memory_order __s, memory_order __f) noexcept | |
__attribute__((diagnose_if(__f == memory_order_release || __f == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
return __o->compare_exchange_strong(*__e, __d, __s, __f); | |
} | |
template <class _Tp> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void atomic_wait(const volatile atomic<_Tp>* __o, | |
typename atomic<_Tp>::value_type __v) noexcept | |
{ | |
return __o->wait(__v); | |
} | |
template <class _Tp> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void atomic_wait(const atomic<_Tp>* __o, | |
typename atomic<_Tp>::value_type __v) noexcept | |
{ | |
return __o->wait(__v); | |
} | |
template <class _Tp> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void atomic_wait_explicit(const volatile atomic<_Tp>* __o, | |
typename atomic<_Tp>::value_type __v, | |
memory_order __m) noexcept | |
__attribute__((diagnose_if(__m == memory_order_release || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
return __o->wait(__v, __m); | |
} | |
template <class _Tp> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void atomic_wait_explicit(const atomic<_Tp>* __o, | |
typename atomic<_Tp>::value_type __v, | |
memory_order __m) noexcept | |
__attribute__((diagnose_if(__m == memory_order_release || __m == memory_order_acq_rel, "memory order argument to atomic operation is invalid", "warning"))) | |
{ | |
return __o->wait(__v, __m); | |
} | |
template <class _Tp> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void atomic_notify_one(volatile atomic<_Tp>* __o) noexcept | |
{ | |
__o->notify_one(); | |
} | |
template <class _Tp> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void atomic_notify_one(atomic<_Tp>* __o) noexcept | |
{ | |
__o->notify_one(); | |
} | |
template <class _Tp> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void atomic_notify_all(volatile atomic<_Tp>* __o) noexcept | |
{ | |
__o->notify_all(); | |
} | |
template <class _Tp> | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void atomic_notify_all(atomic<_Tp>* __o) noexcept | |
{ | |
__o->notify_all(); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value, | |
_Tp | |
>::type | |
atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) noexcept | |
{ | |
return __o->fetch_add(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value, | |
_Tp | |
>::type | |
atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) noexcept | |
{ | |
return __o->fetch_add(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
atomic_fetch_add(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) noexcept | |
{ | |
return __o->fetch_add(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
atomic_fetch_add(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) noexcept | |
{ | |
return __o->fetch_add(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value, | |
_Tp | |
>::type | |
atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_add(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value, | |
_Tp | |
>::type | |
atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_add(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_add(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
atomic_fetch_add_explicit(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_add(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value, | |
_Tp | |
>::type | |
atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) noexcept | |
{ | |
return __o->fetch_sub(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value, | |
_Tp | |
>::type | |
atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) noexcept | |
{ | |
return __o->fetch_sub(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
atomic_fetch_sub(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) noexcept | |
{ | |
return __o->fetch_sub(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
atomic_fetch_sub(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) noexcept | |
{ | |
return __o->fetch_sub(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value, | |
_Tp | |
>::type | |
atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_sub(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value, | |
_Tp | |
>::type | |
atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_sub(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_sub(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
atomic_fetch_sub_explicit(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_sub(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) noexcept | |
{ | |
return __o->fetch_and(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) noexcept | |
{ | |
return __o->fetch_and(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_and(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_and(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) noexcept | |
{ | |
return __o->fetch_or(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) noexcept | |
{ | |
return __o->fetch_or(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_or(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_or(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) noexcept | |
{ | |
return __o->fetch_xor(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) noexcept | |
{ | |
return __o->fetch_xor(__op); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_xor(__op, __m); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_integral<_Tp>::value && !is_same<_Tp, bool>::value, | |
_Tp | |
>::type | |
atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) noexcept | |
{ | |
return __o->fetch_xor(__op, __m); | |
} | |
typedef struct atomic_flag | |
{ | |
__cxx_atomic_impl<bool> __a_; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool test(memory_order __m = memory_order_seq_cst) const volatile noexcept | |
{return bool(true) == __cxx_atomic_load(&__a_, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool test(memory_order __m = memory_order_seq_cst) const noexcept | |
{return bool(true) == __cxx_atomic_load(&__a_, __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept | |
{return __cxx_atomic_exchange(&__a_, bool(true), __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool test_and_set(memory_order __m = memory_order_seq_cst) noexcept | |
{return __cxx_atomic_exchange(&__a_, bool(true), __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void clear(memory_order __m = memory_order_seq_cst) volatile noexcept | |
{__cxx_atomic_store(&__a_, bool(false), __m);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void clear(memory_order __m = memory_order_seq_cst) noexcept | |
{__cxx_atomic_store(&__a_, bool(false), __m);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile noexcept | |
{__cxx_atomic_wait(&__a_, bool(__v), __m);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void wait(bool __v, memory_order __m = memory_order_seq_cst) const noexcept | |
{__cxx_atomic_wait(&__a_, bool(__v), __m);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void notify_one() volatile noexcept | |
{__cxx_atomic_notify_one(&__a_);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void notify_one() noexcept | |
{__cxx_atomic_notify_one(&__a_);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void notify_all() volatile noexcept | |
{__cxx_atomic_notify_all(&__a_);} | |
__attribute__((unavailable)) LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void notify_all() noexcept | |
{__cxx_atomic_notify_all(&__a_);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
atomic_flag() noexcept = default; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
atomic_flag(bool __b) noexcept : __a_(__b) {} | |
atomic_flag(const atomic_flag&) = delete; | |
atomic_flag& operator=(const atomic_flag&) = delete; | |
atomic_flag& operator=(const atomic_flag&) volatile = delete; | |
} atomic_flag; | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_flag_test(const volatile atomic_flag* __o) noexcept | |
{ | |
return __o->test(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_flag_test(const atomic_flag* __o) noexcept | |
{ | |
return __o->test(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_flag_test_explicit(const volatile atomic_flag* __o, memory_order __m) noexcept | |
{ | |
return __o->test(__m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_flag_test_explicit(const atomic_flag* __o, memory_order __m) noexcept | |
{ | |
return __o->test(__m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_flag_test_and_set(volatile atomic_flag* __o) noexcept | |
{ | |
return __o->test_and_set(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_flag_test_and_set(atomic_flag* __o) noexcept | |
{ | |
return __o->test_and_set(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) noexcept | |
{ | |
return __o->test_and_set(__m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) noexcept | |
{ | |
return __o->test_and_set(__m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_flag_clear(volatile atomic_flag* __o) noexcept | |
{ | |
__o->clear(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_flag_clear(atomic_flag* __o) noexcept | |
{ | |
__o->clear(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) noexcept | |
{ | |
__o->clear(__m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) noexcept | |
{ | |
__o->clear(__m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__((unavailable)) | |
void | |
atomic_flag_wait(const volatile atomic_flag* __o, bool __v) noexcept | |
{ | |
__o->wait(__v); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__((unavailable)) | |
void | |
atomic_flag_wait(const atomic_flag* __o, bool __v) noexcept | |
{ | |
__o->wait(__v); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__((unavailable)) | |
void | |
atomic_flag_wait_explicit(const volatile atomic_flag* __o, | |
bool __v, memory_order __m) noexcept | |
{ | |
__o->wait(__v, __m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__((unavailable)) | |
void | |
atomic_flag_wait_explicit(const atomic_flag* __o, | |
bool __v, memory_order __m) noexcept | |
{ | |
__o->wait(__v, __m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__((unavailable)) | |
void | |
atomic_flag_notify_one(volatile atomic_flag* __o) noexcept | |
{ | |
__o->notify_one(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__((unavailable)) | |
void | |
atomic_flag_notify_one(atomic_flag* __o) noexcept | |
{ | |
__o->notify_one(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__((unavailable)) | |
void | |
atomic_flag_notify_all(volatile atomic_flag* __o) noexcept | |
{ | |
__o->notify_all(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __attribute__((unavailable)) | |
void | |
atomic_flag_notify_all(atomic_flag* __o) noexcept | |
{ | |
__o->notify_all(); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_thread_fence(memory_order __m) noexcept | |
{ | |
__cxx_atomic_thread_fence(__m); | |
} | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
atomic_signal_fence(memory_order __m) noexcept | |
{ | |
__cxx_atomic_signal_fence(__m); | |
} | |
typedef atomic<bool> atomic_bool; | |
typedef atomic<char> atomic_char; | |
typedef atomic<signed char> atomic_schar; | |
typedef atomic<unsigned char> atomic_uchar; | |
typedef atomic<short> atomic_short; | |
typedef atomic<unsigned short> atomic_ushort; | |
typedef atomic<int> atomic_int; | |
typedef atomic<unsigned int> atomic_uint; | |
typedef atomic<long> atomic_long; | |
typedef atomic<unsigned long> atomic_ulong; | |
typedef atomic<long long> atomic_llong; | |
typedef atomic<unsigned long long> atomic_ullong; | |
typedef atomic<char16_t> atomic_char16_t; | |
typedef atomic<char32_t> atomic_char32_t; | |
typedef atomic<wchar_t> atomic_wchar_t; | |
typedef atomic<int_least8_t> atomic_int_least8_t; | |
typedef atomic<uint_least8_t> atomic_uint_least8_t; | |
typedef atomic<int_least16_t> atomic_int_least16_t; | |
typedef atomic<uint_least16_t> atomic_uint_least16_t; | |
typedef atomic<int_least32_t> atomic_int_least32_t; | |
typedef atomic<uint_least32_t> atomic_uint_least32_t; | |
typedef atomic<int_least64_t> atomic_int_least64_t; | |
typedef atomic<uint_least64_t> atomic_uint_least64_t; | |
typedef atomic<int_fast8_t> atomic_int_fast8_t; | |
typedef atomic<uint_fast8_t> atomic_uint_fast8_t; | |
typedef atomic<int_fast16_t> atomic_int_fast16_t; | |
typedef atomic<uint_fast16_t> atomic_uint_fast16_t; | |
typedef atomic<int_fast32_t> atomic_int_fast32_t; | |
typedef atomic<uint_fast32_t> atomic_uint_fast32_t; | |
typedef atomic<int_fast64_t> atomic_int_fast64_t; | |
typedef atomic<uint_fast64_t> atomic_uint_fast64_t; | |
typedef atomic< int8_t> atomic_int8_t; | |
typedef atomic<uint8_t> atomic_uint8_t; | |
typedef atomic< int16_t> atomic_int16_t; | |
typedef atomic<uint16_t> atomic_uint16_t; | |
typedef atomic< int32_t> atomic_int32_t; | |
typedef atomic<uint32_t> atomic_uint32_t; | |
typedef atomic< int64_t> atomic_int64_t; | |
typedef atomic<uint64_t> atomic_uint64_t; | |
typedef atomic<intptr_t> atomic_intptr_t; | |
typedef atomic<uintptr_t> atomic_uintptr_t; | |
typedef atomic<size_t> atomic_size_t; | |
typedef atomic<ptrdiff_t> atomic_ptrdiff_t; | |
typedef atomic<intmax_t> atomic_intmax_t; | |
typedef atomic<uintmax_t> atomic_uintmax_t; | |
typedef conditional<false, __cxx_contention_t, long long>::type __libcpp_signed_lock_free; | |
typedef conditional<false, __cxx_contention_t, unsigned long long>::type __libcpp_unsigned_lock_free; | |
typedef atomic<__libcpp_signed_lock_free> atomic_signed_lock_free; | |
typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free; | |
} } | |
namespace std { inline namespace __1 { | |
template <class _ValueType> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ValueType __libcpp_relaxed_load(_ValueType const* __value) { | |
return __atomic_load_n(__value, 0); | |
} | |
template <class _ValueType> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ValueType __libcpp_acquire_load(_ValueType const* __value) { | |
return __atomic_load_n(__value, 2); | |
} | |
template <bool _UsePointerTraits> struct __to_address_helper; | |
template <> struct __to_address_helper<true> { | |
template <class _Pointer> | |
using __return_type = decltype(pointer_traits<_Pointer>::to_address(std::__1::declval<const _Pointer&>())); | |
template <class _Pointer> | |
constexpr | |
static __return_type<_Pointer> | |
__do_it(const _Pointer &__p) noexcept { return pointer_traits<_Pointer>::to_address(__p); } | |
}; | |
template <class _Pointer, bool _Dummy = true> | |
using __choose_to_address = __to_address_helper<_IsValidExpansion<__to_address_helper<_Dummy>::template __return_type, _Pointer>::value>; | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp* | |
__to_address(_Tp* __p) noexcept | |
{ | |
static_assert(!is_function<_Tp>::value, "_Tp is a function type"); | |
return __p; | |
} | |
template <class _Pointer> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename __choose_to_address<_Pointer>::template __return_type<_Pointer> | |
__to_address(const _Pointer& __p) noexcept { | |
return __choose_to_address<_Pointer>::__do_it(__p); | |
} | |
template <> struct __to_address_helper<false> { | |
template <class _Pointer> | |
using __return_type = typename pointer_traits<_Pointer>::element_type*; | |
template <class _Pointer> | |
constexpr | |
static __return_type<_Pointer> | |
__do_it(const _Pointer &__p) noexcept { return std::__1::__to_address(__p.operator->()); } | |
}; | |
template <class _Tp> class allocator; | |
template <> | |
class __attribute__ ((__type_visibility__("default"))) allocator<void> | |
{ | |
public: | |
typedef void* pointer; | |
typedef const void* const_pointer; | |
typedef void value_type; | |
template <class _Up> struct rebind {typedef allocator<_Up> other;}; | |
}; | |
template <> | |
class __attribute__ ((__type_visibility__("default"))) allocator<const void> | |
{ | |
public: | |
typedef const void* pointer; | |
typedef const void* const_pointer; | |
typedef const void value_type; | |
template <class _Up> struct rebind {typedef allocator<_Up> other;}; | |
}; | |
template <bool _Cond, class _Unique> | |
struct __non_trivial_if { }; | |
template <class _Unique> | |
struct __non_trivial_if<true, _Unique> { | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr __non_trivial_if() noexcept { } | |
}; | |
template <class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) allocator | |
: private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> > | |
{ | |
public: | |
typedef size_t size_type; | |
typedef ptrdiff_t difference_type; | |
typedef _Tp value_type; | |
typedef true_type propagate_on_container_move_assignment; | |
typedef true_type is_always_equal; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
allocator() noexcept = default; | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
allocator(const allocator<_Up>&) noexcept { } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* allocate(size_t __n) { | |
if (__n > allocator_traits<allocator>::max_size(*this)) | |
__throw_length_error("allocator<T>::allocate(size_t n)" | |
" 'n' exceeds maximum supported size"); | |
if (__libcpp_is_constant_evaluated()) { | |
return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); | |
} else { | |
return static_cast<_Tp*>(std::__1::__libcpp_allocate(__n * sizeof(_Tp), alignof(_Tp))); | |
} | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void deallocate(_Tp* __p, size_t __n) noexcept { | |
if (__libcpp_is_constant_evaluated()) { | |
::operator delete(__p); | |
} else { | |
std::__1::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), alignof(_Tp)); | |
} | |
} | |
typedef _Tp* pointer; | |
typedef const _Tp* const_pointer; | |
typedef _Tp& reference; | |
typedef const _Tp& const_reference; | |
template <class _Up> | |
struct rebind { | |
typedef allocator<_Up> other; | |
}; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer address(reference __x) const noexcept { | |
return std::__1::addressof(__x); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_pointer address(const_reference __x) const noexcept { | |
return std::__1::addressof(__x); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* allocate(size_t __n, const void*) { | |
return allocate(__n); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) size_type max_size() const noexcept { | |
return size_type(~0) / sizeof(_Tp); | |
} | |
template <class _Up, class... _Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void construct(_Up* __p, _Args&&... __args) { | |
::new ((void*)__p) _Up(std::__1::forward<_Args>(__args)...); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void destroy(pointer __p) { | |
__p->~_Tp(); | |
} | |
}; | |
template <class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) allocator<const _Tp> | |
: private __non_trivial_if<!is_void<_Tp>::value, allocator<const _Tp> > | |
{ | |
public: | |
typedef size_t size_type; | |
typedef ptrdiff_t difference_type; | |
typedef const _Tp value_type; | |
typedef true_type propagate_on_container_move_assignment; | |
typedef true_type is_always_equal; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
allocator() noexcept = default; | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
allocator(const allocator<_Up>&) noexcept { } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const _Tp* allocate(size_t __n) { | |
if (__n > allocator_traits<allocator>::max_size(*this)) | |
__throw_length_error("allocator<const T>::allocate(size_t n)" | |
" 'n' exceeds maximum supported size"); | |
if (__libcpp_is_constant_evaluated()) { | |
return static_cast<const _Tp*>(::operator new(__n * sizeof(_Tp))); | |
} else { | |
return static_cast<const _Tp*>(std::__1::__libcpp_allocate(__n * sizeof(_Tp), alignof(_Tp))); | |
} | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void deallocate(const _Tp* __p, size_t __n) { | |
if (__libcpp_is_constant_evaluated()) { | |
::operator delete(const_cast<_Tp*>(__p)); | |
} else { | |
std::__1::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), alignof(_Tp)); | |
} | |
} | |
typedef const _Tp* pointer; | |
typedef const _Tp* const_pointer; | |
typedef const _Tp& reference; | |
typedef const _Tp& const_reference; | |
template <class _Up> | |
struct rebind { | |
typedef allocator<_Up> other; | |
}; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_pointer address(const_reference __x) const noexcept { | |
return std::__1::addressof(__x); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const _Tp* allocate(size_t __n, const void*) { | |
return allocate(__n); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) size_type max_size() const noexcept { | |
return size_type(~0) / sizeof(_Tp); | |
} | |
template <class _Up, class... _Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void construct(_Up* __p, _Args&&... __args) { | |
::new ((void*)__p) _Up(std::__1::forward<_Args>(__args)...); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void destroy(pointer __p) { | |
__p->~_Tp(); | |
} | |
}; | |
template <class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(const allocator<_Tp>&, const allocator<_Up>&) noexcept {return true;} | |
template <class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) noexcept {return false;} | |
template <class _Alloc, class _Ptr> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __construct_forward_with_exception_guarantees(_Alloc& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __begin2) { | |
static_assert(__is_cpp17_move_insertable<_Alloc>::value, | |
"The specified type does not meet the requirements of Cpp17MoveInsertable"); | |
typedef allocator_traits<_Alloc> _Traits; | |
for (; __begin1 != __end1; ++__begin1, (void)++__begin2) { | |
_Traits::construct(__a, std::__1::__to_address(__begin2), | |
std::__1::move(*__begin1) | |
); | |
} | |
} | |
template <class _Alloc, class _Tp, typename enable_if< | |
(__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Tp*, _Tp>::value) && | |
is_trivially_move_constructible<_Tp>::value | |
>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __construct_forward_with_exception_guarantees(_Alloc&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2) { | |
ptrdiff_t _Np = __end1 - __begin1; | |
if (_Np > 0) { | |
std::__1::memcpy(__begin2, __begin1, _Np * sizeof(_Tp)); | |
__begin2 += _Np; | |
} | |
} | |
template <class _Alloc, class _Iter, class _Ptr> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __construct_range_forward(_Alloc& __a, _Iter __begin1, _Iter __end1, _Ptr& __begin2) { | |
typedef allocator_traits<_Alloc> _Traits; | |
for (; __begin1 != __end1; ++__begin1, (void) ++__begin2) { | |
_Traits::construct(__a, std::__1::__to_address(__begin2), *__begin1); | |
} | |
} | |
template <class _Alloc, class _Source, class _Dest, | |
class _RawSource = typename remove_const<_Source>::type, | |
class _RawDest = typename remove_const<_Dest>::type, | |
class = | |
typename enable_if< | |
is_trivially_copy_constructible<_Dest>::value && | |
is_same<_RawSource, _RawDest>::value && | |
(__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Dest*, _Source&>::value) | |
>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __construct_range_forward(_Alloc&, _Source* __begin1, _Source* __end1, _Dest*& __begin2) { | |
ptrdiff_t _Np = __end1 - __begin1; | |
if (_Np > 0) { | |
std::__1::memcpy(const_cast<_RawDest*>(__begin2), __begin1, _Np * sizeof(_Dest)); | |
__begin2 += _Np; | |
} | |
} | |
template <class _Alloc, class _Ptr> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __construct_backward_with_exception_guarantees(_Alloc& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2) { | |
static_assert(__is_cpp17_move_insertable<_Alloc>::value, | |
"The specified type does not meet the requirements of Cpp17MoveInsertable"); | |
typedef allocator_traits<_Alloc> _Traits; | |
while (__end1 != __begin1) { | |
_Traits::construct(__a, std::__1::__to_address(__end2 - 1), | |
std::__1::move(*--__end1) | |
); | |
--__end2; | |
} | |
} | |
template <class _Alloc, class _Tp, class = typename enable_if< | |
(__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Tp*, _Tp>::value) && | |
is_trivially_move_constructible<_Tp>::value | |
>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __construct_backward_with_exception_guarantees(_Alloc&, _Tp* __begin1, _Tp* __end1, _Tp*& __end2) { | |
ptrdiff_t _Np = __end1 - __begin1; | |
__end2 -= _Np; | |
if (_Np > 0) | |
std::__1::memcpy(__end2, __begin1, _Np * sizeof(_Tp)); | |
} | |
template <class _OutputIterator, class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) raw_storage_iterator | |
: public iterator<output_iterator_tag, | |
_Tp, | |
ptrdiff_t, | |
_Tp*, | |
raw_storage_iterator<_OutputIterator, _Tp>&> | |
{ | |
private: | |
_OutputIterator __x_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) raw_storage_iterator& operator*() {return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) raw_storage_iterator& operator=(const _Tp& __element) | |
{::new ((void*)std::__1::addressof(*__x_)) _Tp(__element); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) raw_storage_iterator& operator=(_Tp&& __element) | |
{::new ((void*)std::__1::addressof(*__x_)) _Tp(std::__1::move(__element)); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) raw_storage_iterator& operator++() {++__x_; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) raw_storage_iterator operator++(int) | |
{raw_storage_iterator __t(*this); ++__x_; return __t;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _OutputIterator base() const { return __x_; } | |
}; | |
template <class _Tp> | |
__attribute__((__no_sanitize__("cfi"))) | |
pair<_Tp*, ptrdiff_t> | |
get_temporary_buffer(ptrdiff_t __n) noexcept | |
{ | |
pair<_Tp*, ptrdiff_t> __r(0, 0); | |
const ptrdiff_t __m = (~ptrdiff_t(0) ^ | |
ptrdiff_t(ptrdiff_t(1) << (sizeof(ptrdiff_t) * 8 - 1))) | |
/ sizeof(_Tp); | |
if (__n > __m) | |
__n = __m; | |
while (__n > 0) | |
{ | |
if (__is_overaligned_for_new(alignof(_Tp))) | |
{ | |
return __r; | |
} | |
__r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), nothrow)); | |
if (__r.first) | |
{ | |
__r.second = __n; | |
break; | |
} | |
__n /= 2; | |
} | |
return __r; | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void return_temporary_buffer(_Tp* __p) noexcept | |
{ | |
std::__1::__libcpp_deallocate_unsized((void*)__p, alignof(_Tp)); | |
} | |
template <class _Tp> | |
struct __attribute__ ((deprecated)) auto_ptr_ref | |
{ | |
_Tp* __ptr_; | |
}; | |
template<class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) auto_ptr | |
{ | |
private: | |
_Tp* __ptr_; | |
public: | |
typedef _Tp element_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit auto_ptr(_Tp* __p = 0) noexcept : __ptr_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) auto_ptr(auto_ptr& __p) noexcept : __ptr_(__p.release()) {} | |
template<class _Up> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) auto_ptr(auto_ptr<_Up>& __p) noexcept | |
: __ptr_(__p.release()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) auto_ptr& operator=(auto_ptr& __p) noexcept | |
{reset(__p.release()); return *this;} | |
template<class _Up> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) auto_ptr& operator=(auto_ptr<_Up>& __p) noexcept | |
{reset(__p.release()); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) auto_ptr& operator=(auto_ptr_ref<_Tp> __p) noexcept | |
{reset(__p.__ptr_); return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ~auto_ptr() noexcept {delete __ptr_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Tp& operator*() const noexcept | |
{return *__ptr_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Tp* operator->() const noexcept {return __ptr_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Tp* get() const noexcept {return __ptr_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Tp* release() noexcept | |
{ | |
_Tp* __t = __ptr_; | |
__ptr_ = nullptr; | |
return __t; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void reset(_Tp* __p = 0) noexcept | |
{ | |
if (__ptr_ != __p) | |
delete __ptr_; | |
__ptr_ = __p; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) auto_ptr(auto_ptr_ref<_Tp> __p) noexcept : __ptr_(__p.__ptr_) {} | |
template<class _Up> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) operator auto_ptr_ref<_Up>() noexcept | |
{auto_ptr_ref<_Up> __t; __t.__ptr_ = release(); return __t;} | |
template<class _Up> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) operator auto_ptr<_Up>() noexcept | |
{return auto_ptr<_Up>(release());} | |
}; | |
template <> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) auto_ptr<void> | |
{ | |
public: | |
typedef void element_type; | |
}; | |
struct __default_init_tag {}; | |
struct __value_init_tag {}; | |
template <class _Tp, int _Idx, | |
bool _CanBeEmptyBase = | |
is_empty<_Tp>::value && !__libcpp_is_final<_Tp>::value> | |
struct __compressed_pair_elem { | |
typedef _Tp _ParamT; | |
typedef _Tp& reference; | |
typedef const _Tp& const_reference; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__compressed_pair_elem(__default_init_tag) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__compressed_pair_elem(__value_init_tag) : __value_() {} | |
template <class _Up, class = typename enable_if< | |
!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value | |
>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr explicit | |
__compressed_pair_elem(_Up&& __u) | |
: __value_(std::__1::forward<_Up>(__u)) | |
{ | |
} | |
template <class... _Args, size_t... _Indexes> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args, | |
__tuple_indices<_Indexes...>) | |
: __value_(std::__1::forward<_Args>(std::__1::get<_Indexes>(__args))...) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) reference __get() noexcept { return __value_; } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reference __get() const noexcept { return __value_; } | |
private: | |
_Tp __value_; | |
}; | |
template <class _Tp, int _Idx> | |
struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp { | |
typedef _Tp _ParamT; | |
typedef _Tp& reference; | |
typedef const _Tp& const_reference; | |
typedef _Tp __value_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr __compressed_pair_elem() = default; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__compressed_pair_elem(__default_init_tag) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__compressed_pair_elem(__value_init_tag) : __value_type() {} | |
template <class _Up, class = typename enable_if< | |
!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value | |
>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr explicit | |
__compressed_pair_elem(_Up&& __u) | |
: __value_type(std::__1::forward<_Up>(__u)) | |
{} | |
template <class... _Args, size_t... _Indexes> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args, | |
__tuple_indices<_Indexes...>) | |
: __value_type(std::__1::forward<_Args>(std::__1::get<_Indexes>(__args))...) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) reference __get() noexcept { return *this; } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reference __get() const noexcept { return *this; } | |
}; | |
template <class _T1, class _T2> | |
class __compressed_pair : private __compressed_pair_elem<_T1, 0>, | |
private __compressed_pair_elem<_T2, 1> { | |
public: | |
static_assert((!is_same<_T1, _T2>::value), | |
"__compressed_pair cannot be instantiated when T1 and T2 are the same type; " | |
"The current implementation is NOT ABI-compatible with the previous " | |
"implementation for this configuration"); | |
typedef __compressed_pair_elem<_T1, 0> _Base1; | |
typedef __compressed_pair_elem<_T2, 1> _Base2; | |
template <bool _Dummy = true, | |
class = typename enable_if< | |
__dependent_type<is_default_constructible<_T1>, _Dummy>::value && | |
__dependent_type<is_default_constructible<_T2>, _Dummy>::value | |
>::type | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr __compressed_pair() : _Base1(__value_init_tag()), _Base2(__value_init_tag()) {} | |
template <class _U1, class _U2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
__compressed_pair(_U1&& __t1, _U2&& __t2) | |
: _Base1(std::__1::forward<_U1>(__t1)), _Base2(std::__1::forward<_U2>(__t2)) {} | |
template <class... _Args1, class... _Args2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, | |
tuple<_Args2...> __second_args) | |
: _Base1(__pc, std::__1::move(__first_args), | |
typename __make_tuple_indices<sizeof...(_Args1)>::type()), | |
_Base2(__pc, std::__1::move(__second_args), | |
typename __make_tuple_indices<sizeof...(_Args2)>::type()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename _Base1::reference first() noexcept { | |
return static_cast<_Base1&>(*this).__get(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename _Base1::const_reference first() const noexcept { | |
return static_cast<_Base1 const&>(*this).__get(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename _Base2::reference second() noexcept { | |
return static_cast<_Base2&>(*this).__get(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename _Base2::const_reference second() const noexcept { | |
return static_cast<_Base2 const&>(*this).__get(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
static _Base1* __get_first_base(__compressed_pair* __pair) noexcept { | |
return static_cast<_Base1*>(__pair); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
static _Base2* __get_second_base(__compressed_pair* __pair) noexcept { | |
return static_cast<_Base2*>(__pair); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(__compressed_pair& __x) | |
noexcept(__is_nothrow_swappable<_T1>::value && __is_nothrow_swappable<_T2>::value) | |
{ | |
using std::__1::swap; | |
swap(first(), __x.first()); | |
swap(second(), __x.second()); | |
} | |
}; | |
template <class _T1, class _T2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y) | |
noexcept(__is_nothrow_swappable<_T1>::value && __is_nothrow_swappable<_T2>::value) { | |
__x.swap(__y); | |
} | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) default_delete { | |
static_assert(!is_function<_Tp>::value, | |
"default_delete cannot be instantiated for function types"); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr default_delete() noexcept = default; | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
default_delete(const default_delete<_Up>&, | |
typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* = | |
0) noexcept {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void operator()(_Tp* __ptr) const noexcept { | |
static_assert(sizeof(_Tp) > 0, | |
"default_delete can not delete incomplete type"); | |
static_assert(!is_void<_Tp>::value, | |
"default_delete can not delete incomplete type"); | |
delete __ptr; | |
} | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) default_delete<_Tp[]> { | |
private: | |
template <class _Up> | |
struct _EnableIfConvertible | |
: enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value> {}; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr default_delete() noexcept = default; | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
default_delete(const default_delete<_Up[]>&, | |
typename _EnableIfConvertible<_Up>::type* = 0) noexcept {} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename _EnableIfConvertible<_Up>::type | |
operator()(_Up* __ptr) const noexcept { | |
static_assert(sizeof(_Tp) > 0, | |
"default_delete can not delete incomplete type"); | |
static_assert(!is_void<_Tp>::value, | |
"default_delete can not delete void type"); | |
delete[] __ptr; | |
} | |
}; | |
template <class _Deleter> | |
struct __unique_ptr_deleter_sfinae { | |
static_assert(!is_reference<_Deleter>::value, "incorrect specialization"); | |
typedef const _Deleter& __lval_ref_type; | |
typedef _Deleter&& __good_rval_ref_type; | |
typedef true_type __enable_rval_overload; | |
}; | |
template <class _Deleter> | |
struct __unique_ptr_deleter_sfinae<_Deleter const&> { | |
typedef const _Deleter& __lval_ref_type; | |
typedef const _Deleter&& __bad_rval_ref_type; | |
typedef false_type __enable_rval_overload; | |
}; | |
template <class _Deleter> | |
struct __unique_ptr_deleter_sfinae<_Deleter&> { | |
typedef _Deleter& __lval_ref_type; | |
typedef _Deleter&& __bad_rval_ref_type; | |
typedef false_type __enable_rval_overload; | |
}; | |
template <class _Tp, class _Dp = default_delete<_Tp> > | |
class __attribute__ ((__type_visibility__("default"))) unique_ptr { | |
public: | |
typedef _Tp element_type; | |
typedef _Dp deleter_type; | |
typedef typename __pointer<_Tp, deleter_type>::type pointer; | |
static_assert(!is_rvalue_reference<deleter_type>::value, | |
"the specified deleter type cannot be an rvalue reference"); | |
private: | |
__compressed_pair<pointer, deleter_type> __ptr_; | |
struct __nat { int __for_bool_; }; | |
typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE; | |
template <bool _Dummy> | |
using _LValRefType = | |
typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type; | |
template <bool _Dummy> | |
using _GoodRValRefType = | |
typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type; | |
template <bool _Dummy> | |
using _BadRValRefType = | |
typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type; | |
template <bool _Dummy, class _Deleter = typename __dependent_type< | |
__identity<deleter_type>, _Dummy>::type> | |
using _EnableIfDeleterDefaultConstructible = | |
typename enable_if<is_default_constructible<_Deleter>::value && | |
!is_pointer<_Deleter>::value>::type; | |
template <class _ArgType> | |
using _EnableIfDeleterConstructible = | |
typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type; | |
template <class _UPtr, class _Up> | |
using _EnableIfMoveConvertible = typename enable_if< | |
is_convertible<typename _UPtr::pointer, pointer>::value && | |
!is_array<_Up>::value | |
>::type; | |
template <class _UDel> | |
using _EnableIfDeleterConvertible = typename enable_if< | |
(is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) || | |
(!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value) | |
>::type; | |
template <class _UDel> | |
using _EnableIfDeleterAssignable = typename enable_if< | |
is_assignable<_Dp&, _UDel&&>::value | |
>::type; | |
public: | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr unique_ptr() noexcept : __ptr_(pointer(), __default_init_tag()) {} | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr unique_ptr(nullptr_t) noexcept : __ptr_(pointer(), __default_init_tag()) {} | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit unique_ptr(pointer __p) noexcept : __ptr_(__p, __default_init_tag()) {} | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(pointer __p, _LValRefType<_Dummy> __d) noexcept | |
: __ptr_(__p, __d) {} | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) noexcept | |
: __ptr_(__p, std::__1::move(__d)) { | |
static_assert(!is_reference<deleter_type>::value, | |
"rvalue deleter bound to reference"); | |
} | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> > > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(unique_ptr&& __u) noexcept | |
: __ptr_(__u.release(), std::__1::forward<deleter_type>(__u.get_deleter())) { | |
} | |
template <class _Up, class _Ep, | |
class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>, | |
class = _EnableIfDeleterConvertible<_Ep> | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept | |
: __ptr_(__u.release(), std::__1::forward<_Ep>(__u.get_deleter())) {} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(auto_ptr<_Up>&& __p, | |
typename enable_if<is_convertible<_Up*, _Tp*>::value && | |
is_same<_Dp, default_delete<_Tp> >::value, | |
__nat>::type = __nat()) noexcept | |
: __ptr_(__p.release(), __default_init_tag()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr& operator=(unique_ptr&& __u) noexcept { | |
reset(__u.release()); | |
__ptr_.second() = std::__1::forward<deleter_type>(__u.get_deleter()); | |
return *this; | |
} | |
template <class _Up, class _Ep, | |
class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>, | |
class = _EnableIfDeleterAssignable<_Ep> | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr& operator=(unique_ptr<_Up, _Ep>&& __u) noexcept { | |
reset(__u.release()); | |
__ptr_.second() = std::__1::forward<_Ep>(__u.get_deleter()); | |
return *this; | |
} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if<is_convertible<_Up*, _Tp*>::value && | |
is_same<_Dp, default_delete<_Tp> >::value, | |
unique_ptr&>::type | |
operator=(auto_ptr<_Up> __p) { | |
reset(__p.release()); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
~unique_ptr() { reset(); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr& operator=(nullptr_t) noexcept { | |
reset(); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename add_lvalue_reference<_Tp>::type | |
operator*() const { | |
return *__ptr_.first(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer operator->() const noexcept { | |
return __ptr_.first(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer get() const noexcept { | |
return __ptr_.first(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
deleter_type& get_deleter() noexcept { | |
return __ptr_.second(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const deleter_type& get_deleter() const noexcept { | |
return __ptr_.second(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit operator bool() const noexcept { | |
return __ptr_.first() != nullptr; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer release() noexcept { | |
pointer __t = __ptr_.first(); | |
__ptr_.first() = pointer(); | |
return __t; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void reset(pointer __p = pointer()) noexcept { | |
pointer __tmp = __ptr_.first(); | |
__ptr_.first() = __p; | |
if (__tmp) | |
__ptr_.second()(__tmp); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(unique_ptr& __u) noexcept { | |
__ptr_.swap(__u.__ptr_); | |
} | |
}; | |
template <class _Tp, class _Dp> | |
class __attribute__ ((__type_visibility__("default"))) unique_ptr<_Tp[], _Dp> { | |
public: | |
typedef _Tp element_type; | |
typedef _Dp deleter_type; | |
typedef typename __pointer<_Tp, deleter_type>::type pointer; | |
private: | |
__compressed_pair<pointer, deleter_type> __ptr_; | |
template <class _From> | |
struct _CheckArrayPointerConversion : is_same<_From, pointer> {}; | |
template <class _FromElem> | |
struct _CheckArrayPointerConversion<_FromElem*> | |
: integral_constant<bool, | |
is_same<_FromElem*, pointer>::value || | |
(is_same<pointer, element_type*>::value && | |
is_convertible<_FromElem(*)[], element_type(*)[]>::value) | |
> | |
{}; | |
typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE; | |
template <bool _Dummy> | |
using _LValRefType = | |
typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type; | |
template <bool _Dummy> | |
using _GoodRValRefType = | |
typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type; | |
template <bool _Dummy> | |
using _BadRValRefType = | |
typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type; | |
template <bool _Dummy, class _Deleter = typename __dependent_type< | |
__identity<deleter_type>, _Dummy>::type> | |
using _EnableIfDeleterDefaultConstructible = | |
typename enable_if<is_default_constructible<_Deleter>::value && | |
!is_pointer<_Deleter>::value>::type; | |
template <class _ArgType> | |
using _EnableIfDeleterConstructible = | |
typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type; | |
template <class _Pp> | |
using _EnableIfPointerConvertible = typename enable_if< | |
_CheckArrayPointerConversion<_Pp>::value | |
>::type; | |
template <class _UPtr, class _Up, | |
class _ElemT = typename _UPtr::element_type> | |
using _EnableIfMoveConvertible = typename enable_if< | |
is_array<_Up>::value && | |
is_same<pointer, element_type*>::value && | |
is_same<typename _UPtr::pointer, _ElemT*>::value && | |
is_convertible<_ElemT(*)[], element_type(*)[]>::value | |
>::type; | |
template <class _UDel> | |
using _EnableIfDeleterConvertible = typename enable_if< | |
(is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) || | |
(!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value) | |
>::type; | |
template <class _UDel> | |
using _EnableIfDeleterAssignable = typename enable_if< | |
is_assignable<_Dp&, _UDel&&>::value | |
>::type; | |
public: | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr unique_ptr() noexcept : __ptr_(pointer(), __default_init_tag()) {} | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr unique_ptr(nullptr_t) noexcept : __ptr_(pointer(), __default_init_tag()) {} | |
template <class _Pp, bool _Dummy = true, | |
class = _EnableIfDeleterDefaultConstructible<_Dummy>, | |
class = _EnableIfPointerConvertible<_Pp> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit unique_ptr(_Pp __p) noexcept | |
: __ptr_(__p, __default_init_tag()) {} | |
template <class _Pp, bool _Dummy = true, | |
class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> >, | |
class = _EnableIfPointerConvertible<_Pp> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) noexcept | |
: __ptr_(__p, __d) {} | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) noexcept | |
: __ptr_(nullptr, __d) {} | |
template <class _Pp, bool _Dummy = true, | |
class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> >, | |
class = _EnableIfPointerConvertible<_Pp> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) noexcept | |
: __ptr_(__p, std::__1::move(__d)) { | |
static_assert(!is_reference<deleter_type>::value, | |
"rvalue deleter bound to reference"); | |
} | |
template <bool _Dummy = true, | |
class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) noexcept | |
: __ptr_(nullptr, std::__1::move(__d)) { | |
static_assert(!is_reference<deleter_type>::value, | |
"rvalue deleter bound to reference"); | |
} | |
template <class _Pp, bool _Dummy = true, | |
class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> >, | |
class = _EnableIfPointerConvertible<_Pp> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(unique_ptr&& __u) noexcept | |
: __ptr_(__u.release(), std::__1::forward<deleter_type>(__u.get_deleter())) { | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr& operator=(unique_ptr&& __u) noexcept { | |
reset(__u.release()); | |
__ptr_.second() = std::__1::forward<deleter_type>(__u.get_deleter()); | |
return *this; | |
} | |
template <class _Up, class _Ep, | |
class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>, | |
class = _EnableIfDeleterConvertible<_Ep> | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept | |
: __ptr_(__u.release(), std::__1::forward<_Ep>(__u.get_deleter())) { | |
} | |
template <class _Up, class _Ep, | |
class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>, | |
class = _EnableIfDeleterAssignable<_Ep> | |
> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr& | |
operator=(unique_ptr<_Up, _Ep>&& __u) noexcept { | |
reset(__u.release()); | |
__ptr_.second() = std::__1::forward<_Ep>(__u.get_deleter()); | |
return *this; | |
} | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
~unique_ptr() { reset(); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unique_ptr& operator=(nullptr_t) noexcept { | |
reset(); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename add_lvalue_reference<_Tp>::type | |
operator[](size_t __i) const { | |
return __ptr_.first()[__i]; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer get() const noexcept { | |
return __ptr_.first(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
deleter_type& get_deleter() noexcept { | |
return __ptr_.second(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const deleter_type& get_deleter() const noexcept { | |
return __ptr_.second(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit operator bool() const noexcept { | |
return __ptr_.first() != nullptr; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer release() noexcept { | |
pointer __t = __ptr_.first(); | |
__ptr_.first() = pointer(); | |
return __t; | |
} | |
template <class _Pp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if< | |
_CheckArrayPointerConversion<_Pp>::value | |
>::type | |
reset(_Pp __p) noexcept { | |
pointer __tmp = __ptr_.first(); | |
__ptr_.first() = __p; | |
if (__tmp) | |
__ptr_.second()(__tmp); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void reset(nullptr_t = nullptr) noexcept { | |
pointer __tmp = __ptr_.first(); | |
__ptr_.first() = nullptr; | |
if (__tmp) | |
__ptr_.second()(__tmp); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(unique_ptr& __u) noexcept { | |
__ptr_.swap(__u.__ptr_); | |
} | |
}; | |
template <class _Tp, class _Dp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if< | |
__is_swappable<_Dp>::value, | |
void | |
>::type | |
swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) noexcept {__x.swap(__y);} | |
template <class _T1, class _D1, class _T2, class _D2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __x.get() == __y.get();} | |
template <class _T1, class _D1, class _T2, class _D2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x == __y);} | |
template <class _T1, class _D1, class _T2, class _D2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator< (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) | |
{ | |
typedef typename unique_ptr<_T1, _D1>::pointer _P1; | |
typedef typename unique_ptr<_T2, _D2>::pointer _P2; | |
typedef typename common_type<_P1, _P2>::type _Vp; | |
return less<_Vp>()(__x.get(), __y.get()); | |
} | |
template <class _T1, class _D1, class _T2, class _D2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator> (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __y < __x;} | |
template <class _T1, class _D1, class _T2, class _D2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__y < __x);} | |
template <class _T1, class _D1, class _T2, class _D2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x < __y);} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) noexcept | |
{ | |
return !__x; | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) noexcept | |
{ | |
return !__x; | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) noexcept | |
{ | |
return static_cast<bool>(__x); | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) noexcept | |
{ | |
return static_cast<bool>(__x); | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t) | |
{ | |
typedef typename unique_ptr<_T1, _D1>::pointer _P1; | |
return less<_P1>()(__x.get(), nullptr); | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<(nullptr_t, const unique_ptr<_T1, _D1>& __x) | |
{ | |
typedef typename unique_ptr<_T1, _D1>::pointer _P1; | |
return less<_P1>()(nullptr, __x.get()); | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>(const unique_ptr<_T1, _D1>& __x, nullptr_t) | |
{ | |
return nullptr < __x; | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>(nullptr_t, const unique_ptr<_T1, _D1>& __x) | |
{ | |
return __x < nullptr; | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(const unique_ptr<_T1, _D1>& __x, nullptr_t) | |
{ | |
return !(nullptr < __x); | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(nullptr_t, const unique_ptr<_T1, _D1>& __x) | |
{ | |
return !(__x < nullptr); | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(const unique_ptr<_T1, _D1>& __x, nullptr_t) | |
{ | |
return !(__x < nullptr); | |
} | |
template <class _T1, class _D1> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x) | |
{ | |
return !(nullptr < __x); | |
} | |
template<class _Tp> | |
struct __unique_if | |
{ | |
typedef unique_ptr<_Tp> __unique_single; | |
}; | |
template<class _Tp> | |
struct __unique_if<_Tp[]> | |
{ | |
typedef unique_ptr<_Tp[]> __unique_array_unknown_bound; | |
}; | |
template<class _Tp, size_t _Np> | |
struct __unique_if<_Tp[_Np]> | |
{ | |
typedef void __unique_array_known_bound; | |
}; | |
template<class _Tp, class... _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename __unique_if<_Tp>::__unique_single | |
make_unique(_Args&&... __args) | |
{ | |
return unique_ptr<_Tp>(new _Tp(std::__1::forward<_Args>(__args)...)); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename __unique_if<_Tp>::__unique_array_unknown_bound | |
make_unique(size_t __n) | |
{ | |
typedef typename remove_extent<_Tp>::type _Up; | |
return unique_ptr<_Tp>(new _Up[__n]()); | |
} | |
template<class _Tp, class... _Args> | |
typename __unique_if<_Tp>::__unique_array_known_bound | |
make_unique(_Args&&...) = delete; | |
template <class _Tp, class _Dp> | |
struct __attribute__ ((__type_visibility__("default"))) hash<__enable_hash_helper< | |
unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer> > | |
{ | |
typedef unique_ptr<_Tp, _Dp> argument_type; | |
typedef size_t result_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
result_type operator()(const argument_type& __ptr) const | |
{ | |
typedef typename argument_type::pointer pointer; | |
return hash<pointer>()(__ptr.get()); | |
} | |
}; | |
struct __destruct_n | |
{ | |
private: | |
size_t __size_; | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __process(_Tp* __p, false_type) noexcept | |
{for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __process(_Tp*, true_type) noexcept | |
{} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __incr(false_type) noexcept | |
{++__size_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __incr(true_type) noexcept | |
{} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __set(size_t __s, false_type) noexcept | |
{__size_ = __s;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __set(size_t, true_type) noexcept | |
{} | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit __destruct_n(size_t __s) noexcept | |
: __size_(__s) {} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __incr() noexcept | |
{__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __set(size_t __s, _Tp*) noexcept | |
{__set(__s, integral_constant<bool, is_trivially_destructible<_Tp>::value>());} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void operator()(_Tp* __p) noexcept | |
{__process(__p, integral_constant<bool, is_trivially_destructible<_Tp>::value>());} | |
}; | |
template <class _Alloc> | |
class __allocator_destructor | |
{ | |
typedef allocator_traits<_Alloc> __alloc_traits; | |
public: | |
typedef typename __alloc_traits::pointer pointer; | |
typedef typename __alloc_traits::size_type size_type; | |
private: | |
_Alloc& __alloc_; | |
size_type __s_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __allocator_destructor(_Alloc& __a, size_type __s) | |
noexcept | |
: __alloc_(__a), __s_(__s) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void operator()(pointer __p) noexcept | |
{__alloc_traits::deallocate(__alloc_, __p, __s_);} | |
}; | |
template <class _InputIterator, class _ForwardIterator> | |
_ForwardIterator | |
uninitialized_copy(_InputIterator __f, _InputIterator __l, _ForwardIterator __r) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type value_type; | |
for (; __f != __l; ++__f, (void) ++__r) | |
::new ((void*)std::__1::addressof(*__r)) value_type(*__f); | |
return __r; | |
} | |
template <class _InputIterator, class _Size, class _ForwardIterator> | |
_ForwardIterator | |
uninitialized_copy_n(_InputIterator __f, _Size __n, _ForwardIterator __r) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type value_type; | |
for (; __n > 0; ++__f, (void) ++__r, (void) --__n) | |
::new ((void*)std::__1::addressof(*__r)) value_type(*__f); | |
return __r; | |
} | |
template <class _ForwardIterator, class _Tp> | |
void | |
uninitialized_fill(_ForwardIterator __f, _ForwardIterator __l, const _Tp& __x) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type value_type; | |
for (; __f != __l; ++__f) | |
::new ((void*)std::__1::addressof(*__f)) value_type(__x); | |
} | |
template <class _ForwardIterator, class _Size, class _Tp> | |
_ForwardIterator | |
uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type value_type; | |
for (; __n > 0; ++__f, (void) --__n) | |
::new ((void*)std::__1::addressof(*__f)) value_type(__x); | |
return __f; | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Tp | |
__libcpp_atomic_refcount_increment(_Tp& __t) noexcept | |
{ | |
return __atomic_add_fetch(&__t, 1, 0); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Tp | |
__libcpp_atomic_refcount_decrement(_Tp& __t) noexcept | |
{ | |
return __atomic_add_fetch(&__t, -1, 4); | |
} | |
class __attribute__ ((__visibility__("default"))) bad_weak_ptr | |
: public std::exception | |
{ | |
public: | |
bad_weak_ptr() noexcept = default; | |
bad_weak_ptr(const bad_weak_ptr&) noexcept = default; | |
virtual ~bad_weak_ptr() noexcept; | |
virtual const char* what() const noexcept; | |
}; | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_bad_weak_ptr() | |
{ | |
std::__1::abort(); | |
} | |
template<class _Tp> class __attribute__ ((__type_visibility__("default"))) weak_ptr; | |
class __attribute__ ((__visibility__("default"))) __shared_count | |
{ | |
__shared_count(const __shared_count&); | |
__shared_count& operator=(const __shared_count&); | |
protected: | |
long __shared_owners_; | |
virtual ~__shared_count(); | |
private: | |
virtual void __on_zero_shared() noexcept = 0; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __shared_count(long __refs = 0) noexcept | |
: __shared_owners_(__refs) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __add_shared() noexcept { | |
__libcpp_atomic_refcount_increment(__shared_owners_); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __release_shared() noexcept { | |
if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1) { | |
__on_zero_shared(); | |
return true; | |
} | |
return false; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
long use_count() const noexcept { | |
return __libcpp_relaxed_load(&__shared_owners_) + 1; | |
} | |
}; | |
class __attribute__ ((__visibility__("default"))) __shared_weak_count | |
: private __shared_count | |
{ | |
long __shared_weak_owners_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __shared_weak_count(long __refs = 0) noexcept | |
: __shared_count(__refs), | |
__shared_weak_owners_(__refs) {} | |
protected: | |
virtual ~__shared_weak_count(); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __add_shared() noexcept { | |
__shared_count::__add_shared(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __add_weak() noexcept { | |
__libcpp_atomic_refcount_increment(__shared_weak_owners_); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __release_shared() noexcept { | |
if (__shared_count::__release_shared()) | |
__release_weak(); | |
} | |
void __release_weak() noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
long use_count() const noexcept {return __shared_count::use_count();} | |
__shared_weak_count* lock() noexcept; | |
virtual const void* __get_deleter(const type_info&) const noexcept; | |
private: | |
virtual void __on_zero_shared_weak() noexcept = 0; | |
}; | |
template <class _Tp, class _Dp, class _Alloc> | |
class __shared_ptr_pointer | |
: public __shared_weak_count | |
{ | |
__compressed_pair<__compressed_pair<_Tp, _Dp>, _Alloc> __data_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a) | |
: __data_(__compressed_pair<_Tp, _Dp>(__p, std::__1::move(__d)), std::__1::move(__a)) {} | |
private: | |
virtual void __on_zero_shared() noexcept; | |
virtual void __on_zero_shared_weak() noexcept; | |
}; | |
template <class _Tp, class _Dp, class _Alloc> | |
void | |
__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared() noexcept | |
{ | |
__data_.first().second()(__data_.first().first()); | |
__data_.first().second().~_Dp(); | |
} | |
template <class _Tp, class _Dp, class _Alloc> | |
void | |
__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() noexcept | |
{ | |
typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_pointer>::type _Al; | |
typedef allocator_traits<_Al> _ATraits; | |
typedef pointer_traits<typename _ATraits::pointer> _PTraits; | |
_Al __a(__data_.second()); | |
__data_.second().~_Alloc(); | |
__a.deallocate(_PTraits::pointer_to(*this), 1); | |
} | |
template <class _Tp, class _Alloc> | |
struct __shared_ptr_emplace | |
: __shared_weak_count | |
{ | |
template<class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __shared_ptr_emplace(_Alloc __a, _Args&& ...__args) | |
: __storage_(std::__1::move(__a)) | |
{ | |
::new ((void*)__get_elem()) _Tp(std::__1::forward<_Args>(__args)...); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Alloc* __get_alloc() noexcept { return __storage_.__get_alloc(); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* __get_elem() noexcept { return __storage_.__get_elem(); } | |
private: | |
virtual void __on_zero_shared() noexcept { | |
__get_elem()->~_Tp(); | |
} | |
virtual void __on_zero_shared_weak() noexcept { | |
using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type; | |
using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer; | |
_ControlBlockAlloc __tmp(*__get_alloc()); | |
__storage_.~_Storage(); | |
allocator_traits<_ControlBlockAlloc>::deallocate(__tmp, | |
pointer_traits<_ControlBlockPointer>::pointer_to(*this), 1); | |
} | |
using _CompressedPair = __compressed_pair<_Alloc, _Tp>; | |
struct alignas(_CompressedPair) _Storage { | |
char __blob_[sizeof(_CompressedPair)]; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit _Storage(_Alloc&& __a) { | |
::new ((void*)__get_alloc()) _Alloc(std::__1::move(__a)); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) ~_Storage() { | |
__get_alloc()->~_Alloc(); | |
} | |
_Alloc* __get_alloc() noexcept { | |
_CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_); | |
typename _CompressedPair::_Base1* __first = _CompressedPair::__get_first_base(__as_pair); | |
_Alloc *__alloc = reinterpret_cast<_Alloc*>(__first); | |
return __alloc; | |
} | |
__attribute__((__no_sanitize__("cfi"))) _Tp* __get_elem() noexcept { | |
_CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_); | |
typename _CompressedPair::_Base2* __second = _CompressedPair::__get_second_base(__as_pair); | |
_Tp *__elem = reinterpret_cast<_Tp*>(__second); | |
return __elem; | |
} | |
}; | |
static_assert(alignof(_Storage) == alignof(_CompressedPair), ""); | |
static_assert(sizeof(_Storage) == sizeof(_CompressedPair), ""); | |
_Storage __storage_; | |
}; | |
struct __shared_ptr_dummy_rebind_allocator_type; | |
template <> | |
class __attribute__ ((__type_visibility__("default"))) allocator<__shared_ptr_dummy_rebind_allocator_type> | |
{ | |
public: | |
template <class _Other> | |
struct rebind | |
{ | |
typedef allocator<_Other> other; | |
}; | |
}; | |
template<class _Tp> class __attribute__ ((__type_visibility__("default"))) enable_shared_from_this; | |
template<class _Tp, class _Up> | |
struct __compatible_with | |
: is_convertible<_Tp*, _Up*> {}; | |
template<class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) shared_ptr | |
{ | |
public: | |
typedef _Tp element_type; | |
private: | |
element_type* __ptr_; | |
__shared_weak_count* __cntrl_; | |
struct __nat {int __for_bool_;}; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr shared_ptr() noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr shared_ptr(nullptr_t) noexcept; | |
template<class _Yp> | |
explicit shared_ptr(_Yp* __p, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat()); | |
template<class _Yp, class _Dp> | |
shared_ptr(_Yp* __p, _Dp __d, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat()); | |
template<class _Yp, class _Dp, class _Alloc> | |
shared_ptr(_Yp* __p, _Dp __d, _Alloc __a, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat()); | |
template <class _Dp> shared_ptr(nullptr_t __p, _Dp __d); | |
template <class _Dp, class _Alloc> shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a); | |
template<class _Yp> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr(const shared_ptr& __r) noexcept; | |
template<class _Yp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr(const shared_ptr<_Yp>& __r, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat()) | |
noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr(shared_ptr&& __r) noexcept; | |
template<class _Yp> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) shared_ptr(shared_ptr<_Yp>&& __r, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat()) | |
noexcept; | |
template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r, | |
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type= __nat()); | |
template<class _Yp> | |
shared_ptr(auto_ptr<_Yp>&& __r, | |
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat()); | |
template <class _Yp, class _Dp> | |
shared_ptr(unique_ptr<_Yp, _Dp>&&, | |
typename enable_if | |
< | |
!is_lvalue_reference<_Dp>::value && | |
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value, | |
__nat | |
>::type = __nat()); | |
template <class _Yp, class _Dp> | |
shared_ptr(unique_ptr<_Yp, _Dp>&&, | |
typename enable_if | |
< | |
is_lvalue_reference<_Dp>::value && | |
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value, | |
__nat | |
>::type = __nat()); | |
~shared_ptr(); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr& operator=(const shared_ptr& __r) noexcept; | |
template<class _Yp> | |
typename enable_if | |
< | |
__compatible_with<_Yp, element_type>::value, | |
shared_ptr& | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator=(const shared_ptr<_Yp>& __r) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr& operator=(shared_ptr&& __r) noexcept; | |
template<class _Yp> | |
typename enable_if | |
< | |
__compatible_with<_Yp, element_type>::value, | |
shared_ptr& | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator=(shared_ptr<_Yp>&& __r); | |
template<class _Yp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
!is_array<_Yp>::value && | |
is_convertible<_Yp*, element_type*>::value, | |
shared_ptr | |
>::type& | |
operator=(auto_ptr<_Yp>&& __r); | |
template <class _Yp, class _Dp> | |
typename enable_if | |
< | |
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value, | |
shared_ptr& | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator=(unique_ptr<_Yp, _Dp>&& __r); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(shared_ptr& __r) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void reset() noexcept; | |
template<class _Yp> | |
typename enable_if | |
< | |
__compatible_with<_Yp, element_type>::value, | |
void | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reset(_Yp* __p); | |
template<class _Yp, class _Dp> | |
typename enable_if | |
< | |
__compatible_with<_Yp, element_type>::value, | |
void | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reset(_Yp* __p, _Dp __d); | |
template<class _Yp, class _Dp, class _Alloc> | |
typename enable_if | |
< | |
__compatible_with<_Yp, element_type>::value, | |
void | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reset(_Yp* __p, _Dp __d, _Alloc __a); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
element_type* get() const noexcept {return __ptr_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename add_lvalue_reference<element_type>::type operator*() const noexcept | |
{return *__ptr_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
element_type* operator->() const noexcept | |
{ | |
static_assert(!std::__1::is_array<_Tp>::value, | |
"std::shared_ptr<T>::operator-> is only valid when T is not an array type."); | |
return __ptr_; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
long use_count() const noexcept {return __cntrl_ ? __cntrl_->use_count() : 0;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool unique() const noexcept {return use_count() == 1;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit operator bool() const noexcept {return get() != nullptr;} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool owner_before(shared_ptr<_Up> const& __p) const noexcept | |
{return __cntrl_ < __p.__cntrl_;} | |
template <class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool owner_before(weak_ptr<_Up> const& __p) const noexcept | |
{return __cntrl_ < __p.__cntrl_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
__owner_equivalent(const shared_ptr& __p) const | |
{return __cntrl_ == __p.__cntrl_;} | |
template<class _Yp, class _CntrlBlk> | |
static shared_ptr<_Tp> | |
__create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl) noexcept | |
{ | |
shared_ptr<_Tp> __r; | |
__r.__ptr_ = __p; | |
__r.__cntrl_ = __cntrl; | |
__r.__enable_weak_this(__r.__ptr_, __r.__ptr_); | |
return __r; | |
} | |
private: | |
template <class _Yp, bool = is_function<_Yp>::value> | |
struct __shared_ptr_default_allocator | |
{ | |
typedef allocator<_Yp> type; | |
}; | |
template <class _Yp> | |
struct __shared_ptr_default_allocator<_Yp, true> | |
{ | |
typedef allocator<__shared_ptr_dummy_rebind_allocator_type> type; | |
}; | |
template <class _Yp, class _OrigPtr> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if<is_convertible<_OrigPtr*, | |
const enable_shared_from_this<_Yp>* | |
>::value, | |
void>::type | |
__enable_weak_this(const enable_shared_from_this<_Yp>* __e, | |
_OrigPtr* __ptr) noexcept | |
{ | |
typedef typename remove_cv<_Yp>::type _RawYp; | |
if (__e && __e->__weak_this_.expired()) | |
{ | |
__e->__weak_this_ = shared_ptr<_RawYp>(*this, | |
const_cast<_RawYp*>(static_cast<const _Yp*>(__ptr))); | |
} | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __enable_weak_this(...) noexcept {} | |
template <class, class _Yp> | |
struct __shared_ptr_default_delete | |
: default_delete<_Yp> {}; | |
template <class _Yp, class _Un, size_t _Sz> | |
struct __shared_ptr_default_delete<_Yp[_Sz], _Un> | |
: default_delete<_Yp[]> {}; | |
template <class _Yp, class _Un> | |
struct __shared_ptr_default_delete<_Yp[], _Un> | |
: default_delete<_Yp[]> {}; | |
template <class _Up> friend class __attribute__ ((__type_visibility__("default"))) shared_ptr; | |
template <class _Up> friend class __attribute__ ((__type_visibility__("default"))) weak_ptr; | |
}; | |
template<class _Tp> | |
inline | |
constexpr | |
shared_ptr<_Tp>::shared_ptr() noexcept | |
: __ptr_(nullptr), | |
__cntrl_(nullptr) | |
{ | |
} | |
template<class _Tp> | |
inline | |
constexpr | |
shared_ptr<_Tp>::shared_ptr(nullptr_t) noexcept | |
: __ptr_(nullptr), | |
__cntrl_(nullptr) | |
{ | |
} | |
template<class _Tp> | |
template<class _Yp> | |
shared_ptr<_Tp>::shared_ptr(_Yp* __p, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type) | |
: __ptr_(__p) | |
{ | |
unique_ptr<_Yp> __hold(__p); | |
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; | |
typedef __shared_ptr_pointer<_Yp*, __shared_ptr_default_delete<_Tp, _Yp>, _AllocT > _CntrlBlk; | |
__cntrl_ = new _CntrlBlk(__p, __shared_ptr_default_delete<_Tp, _Yp>(), _AllocT()); | |
__hold.release(); | |
__enable_weak_this(__p, __p); | |
} | |
template<class _Tp> | |
template<class _Yp, class _Dp> | |
shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type) | |
: __ptr_(__p) | |
{ | |
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; | |
typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk; | |
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT()); | |
__enable_weak_this(__p, __p); | |
} | |
template<class _Tp> | |
template<class _Dp> | |
shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d) | |
: __ptr_(nullptr) | |
{ | |
typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT; | |
typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT > _CntrlBlk; | |
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT()); | |
} | |
template<class _Tp> | |
template<class _Yp, class _Dp, class _Alloc> | |
shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type) | |
: __ptr_(__p) | |
{ | |
typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk; | |
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2; | |
typedef __allocator_destructor<_A2> _D2; | |
_A2 __a2(__a); | |
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1)); | |
::new ((void*)std::__1::addressof(*__hold2.get())) _CntrlBlk(__p, __d, __a); | |
__cntrl_ = std::__1::addressof(*__hold2.release()); | |
__enable_weak_this(__p, __p); | |
} | |
template<class _Tp> | |
template<class _Dp, class _Alloc> | |
shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a) | |
: __ptr_(nullptr) | |
{ | |
typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk; | |
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2; | |
typedef __allocator_destructor<_A2> _D2; | |
_A2 __a2(__a); | |
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1)); | |
::new ((void*)std::__1::addressof(*__hold2.get())) _CntrlBlk(__p, __d, __a); | |
__cntrl_ = std::__1::addressof(*__hold2.release()); | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) noexcept | |
: __ptr_(__p), | |
__cntrl_(__r.__cntrl_) | |
{ | |
if (__cntrl_) | |
__cntrl_->__add_shared(); | |
} | |
template<class _Tp> | |
inline | |
shared_ptr<_Tp>::shared_ptr(const shared_ptr& __r) noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
if (__cntrl_) | |
__cntrl_->__add_shared(); | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type) | |
noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
if (__cntrl_) | |
__cntrl_->__add_shared(); | |
} | |
template<class _Tp> | |
inline | |
shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
__r.__ptr_ = nullptr; | |
__r.__cntrl_ = nullptr; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r, | |
typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type) | |
noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
__r.__ptr_ = nullptr; | |
__r.__cntrl_ = nullptr; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r, | |
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type) | |
: __ptr_(__r.get()) | |
{ | |
typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk; | |
__cntrl_ = new _CntrlBlk(__r.get(), default_delete<_Yp>(), allocator<_Yp>()); | |
__enable_weak_this(__r.get(), __r.get()); | |
__r.release(); | |
} | |
template<class _Tp> | |
template <class _Yp, class _Dp> | |
shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r, | |
typename enable_if | |
< | |
!is_lvalue_reference<_Dp>::value && | |
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value, | |
__nat | |
>::type) | |
: __ptr_(__r.get()) | |
{ | |
if (__ptr_ == nullptr) | |
__cntrl_ = nullptr; | |
else | |
{ | |
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; | |
typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer, _Dp, _AllocT > _CntrlBlk; | |
__cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), _AllocT()); | |
__enable_weak_this(__r.get(), __r.get()); | |
} | |
__r.release(); | |
} | |
template<class _Tp> | |
template <class _Yp, class _Dp> | |
shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r, | |
typename enable_if | |
< | |
is_lvalue_reference<_Dp>::value && | |
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value, | |
__nat | |
>::type) | |
: __ptr_(__r.get()) | |
{ | |
if (__ptr_ == nullptr) | |
__cntrl_ = nullptr; | |
else | |
{ | |
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; | |
typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer, | |
reference_wrapper<typename remove_reference<_Dp>::type>, | |
_AllocT > _CntrlBlk; | |
__cntrl_ = new _CntrlBlk(__r.get(), std::__1::ref(__r.get_deleter()), _AllocT()); | |
__enable_weak_this(__r.get(), __r.get()); | |
} | |
__r.release(); | |
} | |
template<class _Tp> | |
shared_ptr<_Tp>::~shared_ptr() | |
{ | |
if (__cntrl_) | |
__cntrl_->__release_shared(); | |
} | |
template<class _Tp> | |
inline | |
shared_ptr<_Tp>& | |
shared_ptr<_Tp>::operator=(const shared_ptr& __r) noexcept | |
{ | |
shared_ptr(__r).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
typename enable_if | |
< | |
__compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value, | |
shared_ptr<_Tp>& | |
>::type | |
shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) noexcept | |
{ | |
shared_ptr(__r).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
inline | |
shared_ptr<_Tp>& | |
shared_ptr<_Tp>::operator=(shared_ptr&& __r) noexcept | |
{ | |
shared_ptr(std::__1::move(__r)).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
typename enable_if | |
< | |
__compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value, | |
shared_ptr<_Tp>& | |
>::type | |
shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r) | |
{ | |
shared_ptr(std::__1::move(__r)).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
typename enable_if | |
< | |
!is_array<_Yp>::value && | |
is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, | |
shared_ptr<_Tp> | |
>::type& | |
shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r) | |
{ | |
shared_ptr(std::__1::move(__r)).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
template <class _Yp, class _Dp> | |
inline | |
typename enable_if | |
< | |
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, | |
typename shared_ptr<_Tp>::element_type*>::value, | |
shared_ptr<_Tp>& | |
>::type | |
shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r) | |
{ | |
shared_ptr(std::__1::move(__r)).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
inline | |
void | |
shared_ptr<_Tp>::swap(shared_ptr& __r) noexcept | |
{ | |
std::__1::swap(__ptr_, __r.__ptr_); | |
std::__1::swap(__cntrl_, __r.__cntrl_); | |
} | |
template<class _Tp> | |
inline | |
void | |
shared_ptr<_Tp>::reset() noexcept | |
{ | |
shared_ptr().swap(*this); | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
typename enable_if | |
< | |
__compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value, | |
void | |
>::type | |
shared_ptr<_Tp>::reset(_Yp* __p) | |
{ | |
shared_ptr(__p).swap(*this); | |
} | |
template<class _Tp> | |
template<class _Yp, class _Dp> | |
inline | |
typename enable_if | |
< | |
__compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value, | |
void | |
>::type | |
shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d) | |
{ | |
shared_ptr(__p, __d).swap(*this); | |
} | |
template<class _Tp> | |
template<class _Yp, class _Dp, class _Alloc> | |
inline | |
typename enable_if | |
< | |
__compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value, | |
void | |
>::type | |
shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a) | |
{ | |
shared_ptr(__p, __d, __a).swap(*this); | |
} | |
template<class _Tp, class _Alloc, class ..._Args, class = _EnableIf<!is_array<_Tp>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&& ...__args) | |
{ | |
using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>; | |
using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type; | |
__allocation_guard<_ControlBlockAllocator> __guard(__a, 1); | |
::new ((void*)std::__1::addressof(*__guard.__get())) _ControlBlock(__a, std::__1::forward<_Args>(__args)...); | |
auto __control_block = __guard.__release_ptr(); | |
return shared_ptr<_Tp>::__create_with_control_block((*__control_block).__get_elem(), std::__1::addressof(*__control_block)); | |
} | |
template<class _Tp, class ..._Args, class = _EnableIf<!is_array<_Tp>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr<_Tp> make_shared(_Args&& ...__args) | |
{ | |
return std::__1::allocate_shared<_Tp>(allocator<_Tp>(), std::__1::forward<_Args>(__args)...); | |
} | |
template<class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) noexcept | |
{ | |
return __x.get() == __y.get(); | |
} | |
template<class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) noexcept | |
{ | |
return !(__x == __y); | |
} | |
template<class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) noexcept | |
{ | |
return less<>()(__x.get(), __y.get()); | |
} | |
template<class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) noexcept | |
{ | |
return __y < __x; | |
} | |
template<class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) noexcept | |
{ | |
return !(__y < __x); | |
} | |
template<class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) noexcept | |
{ | |
return !(__x < __y); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const shared_ptr<_Tp>& __x, nullptr_t) noexcept | |
{ | |
return !__x; | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(nullptr_t, const shared_ptr<_Tp>& __x) noexcept | |
{ | |
return !__x; | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const shared_ptr<_Tp>& __x, nullptr_t) noexcept | |
{ | |
return static_cast<bool>(__x); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(nullptr_t, const shared_ptr<_Tp>& __x) noexcept | |
{ | |
return static_cast<bool>(__x); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<(const shared_ptr<_Tp>& __x, nullptr_t) noexcept | |
{ | |
return less<_Tp*>()(__x.get(), nullptr); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<(nullptr_t, const shared_ptr<_Tp>& __x) noexcept | |
{ | |
return less<_Tp*>()(nullptr, __x.get()); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>(const shared_ptr<_Tp>& __x, nullptr_t) noexcept | |
{ | |
return nullptr < __x; | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>(nullptr_t, const shared_ptr<_Tp>& __x) noexcept | |
{ | |
return __x < nullptr; | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(const shared_ptr<_Tp>& __x, nullptr_t) noexcept | |
{ | |
return !(nullptr < __x); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator<=(nullptr_t, const shared_ptr<_Tp>& __x) noexcept | |
{ | |
return !(__x < nullptr); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(const shared_ptr<_Tp>& __x, nullptr_t) noexcept | |
{ | |
return !(__x < nullptr); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator>=(nullptr_t, const shared_ptr<_Tp>& __x) noexcept | |
{ | |
return !(nullptr < __x); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __y) noexcept | |
{ | |
__x.swap(__y); | |
} | |
template<class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr<_Tp> | |
static_pointer_cast(const shared_ptr<_Up>& __r) noexcept | |
{ | |
return shared_ptr<_Tp>(__r, | |
static_cast< | |
typename shared_ptr<_Tp>::element_type*>(__r.get())); | |
} | |
template<class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr<_Tp> | |
dynamic_pointer_cast(const shared_ptr<_Up>& __r) noexcept | |
{ | |
typedef typename shared_ptr<_Tp>::element_type _ET; | |
_ET* __p = dynamic_cast<_ET*>(__r.get()); | |
return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>(); | |
} | |
template<class _Tp, class _Up> | |
shared_ptr<_Tp> | |
const_pointer_cast(const shared_ptr<_Up>& __r) noexcept | |
{ | |
typedef typename shared_ptr<_Tp>::element_type _RTp; | |
return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get())); | |
} | |
template<class _Tp, class _Up> | |
shared_ptr<_Tp> | |
reinterpret_pointer_cast(const shared_ptr<_Up>& __r) noexcept | |
{ | |
return shared_ptr<_Tp>(__r, | |
reinterpret_cast< | |
typename shared_ptr<_Tp>::element_type*>(__r.get())); | |
} | |
template<class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) weak_ptr | |
{ | |
public: | |
typedef _Tp element_type; | |
private: | |
element_type* __ptr_; | |
__shared_weak_count* __cntrl_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr weak_ptr() noexcept; | |
template<class _Yp> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) weak_ptr(shared_ptr<_Yp> const& __r, | |
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0) | |
noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
weak_ptr(weak_ptr const& __r) noexcept; | |
template<class _Yp> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) weak_ptr(weak_ptr<_Yp> const& __r, | |
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0) | |
noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
weak_ptr(weak_ptr&& __r) noexcept; | |
template<class _Yp> LDIONNE_HIDDEN __attribute__ ((internal_linkage)) weak_ptr(weak_ptr<_Yp>&& __r, | |
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0) | |
noexcept; | |
~weak_ptr(); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
weak_ptr& operator=(weak_ptr const& __r) noexcept; | |
template<class _Yp> | |
typename enable_if | |
< | |
is_convertible<_Yp*, element_type*>::value, | |
weak_ptr& | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator=(weak_ptr<_Yp> const& __r) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
weak_ptr& operator=(weak_ptr&& __r) noexcept; | |
template<class _Yp> | |
typename enable_if | |
< | |
is_convertible<_Yp*, element_type*>::value, | |
weak_ptr& | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator=(weak_ptr<_Yp>&& __r) noexcept; | |
template<class _Yp> | |
typename enable_if | |
< | |
is_convertible<_Yp*, element_type*>::value, | |
weak_ptr& | |
>::type | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator=(shared_ptr<_Yp> const& __r) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(weak_ptr& __r) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void reset() noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
long use_count() const noexcept | |
{return __cntrl_ ? __cntrl_->use_count() : 0;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool expired() const noexcept | |
{return __cntrl_ == nullptr || __cntrl_->use_count() == 0;} | |
shared_ptr<_Tp> lock() const noexcept; | |
template<class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool owner_before(const shared_ptr<_Up>& __r) const noexcept | |
{return __cntrl_ < __r.__cntrl_;} | |
template<class _Up> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool owner_before(const weak_ptr<_Up>& __r) const noexcept | |
{return __cntrl_ < __r.__cntrl_;} | |
template <class _Up> friend class __attribute__ ((__type_visibility__("default"))) weak_ptr; | |
template <class _Up> friend class __attribute__ ((__type_visibility__("default"))) shared_ptr; | |
}; | |
template<class _Tp> | |
inline | |
constexpr | |
weak_ptr<_Tp>::weak_ptr() noexcept | |
: __ptr_(nullptr), | |
__cntrl_(nullptr) | |
{ | |
} | |
template<class _Tp> | |
inline | |
weak_ptr<_Tp>::weak_ptr(weak_ptr const& __r) noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
if (__cntrl_) | |
__cntrl_->__add_weak(); | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r, | |
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type) | |
noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
if (__cntrl_) | |
__cntrl_->__add_weak(); | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r, | |
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type) | |
noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
if (__cntrl_) | |
__cntrl_->__add_weak(); | |
} | |
template<class _Tp> | |
inline | |
weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
__r.__ptr_ = nullptr; | |
__r.__cntrl_ = nullptr; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r, | |
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type) | |
noexcept | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_) | |
{ | |
__r.__ptr_ = nullptr; | |
__r.__cntrl_ = nullptr; | |
} | |
template<class _Tp> | |
weak_ptr<_Tp>::~weak_ptr() | |
{ | |
if (__cntrl_) | |
__cntrl_->__release_weak(); | |
} | |
template<class _Tp> | |
inline | |
weak_ptr<_Tp>& | |
weak_ptr<_Tp>::operator=(weak_ptr const& __r) noexcept | |
{ | |
weak_ptr(__r).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
typename enable_if | |
< | |
is_convertible<_Yp*, _Tp*>::value, | |
weak_ptr<_Tp>& | |
>::type | |
weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) noexcept | |
{ | |
weak_ptr(__r).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
inline | |
weak_ptr<_Tp>& | |
weak_ptr<_Tp>::operator=(weak_ptr&& __r) noexcept | |
{ | |
weak_ptr(std::__1::move(__r)).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
typename enable_if | |
< | |
is_convertible<_Yp*, _Tp*>::value, | |
weak_ptr<_Tp>& | |
>::type | |
weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) noexcept | |
{ | |
weak_ptr(std::__1::move(__r)).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
template<class _Yp> | |
inline | |
typename enable_if | |
< | |
is_convertible<_Yp*, _Tp*>::value, | |
weak_ptr<_Tp>& | |
>::type | |
weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) noexcept | |
{ | |
weak_ptr(__r).swap(*this); | |
return *this; | |
} | |
template<class _Tp> | |
inline | |
void | |
weak_ptr<_Tp>::swap(weak_ptr& __r) noexcept | |
{ | |
std::__1::swap(__ptr_, __r.__ptr_); | |
std::__1::swap(__cntrl_, __r.__cntrl_); | |
} | |
template<class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
swap(weak_ptr<_Tp>& __x, weak_ptr<_Tp>& __y) noexcept | |
{ | |
__x.swap(__y); | |
} | |
template<class _Tp> | |
inline | |
void | |
weak_ptr<_Tp>::reset() noexcept | |
{ | |
weak_ptr().swap(*this); | |
} | |
template<class _Tp> | |
template<class _Yp> | |
shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r, | |
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type) | |
: __ptr_(__r.__ptr_), | |
__cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_) | |
{ | |
if (__cntrl_ == nullptr) | |
__throw_bad_weak_ptr(); | |
} | |
template<class _Tp> | |
shared_ptr<_Tp> | |
weak_ptr<_Tp>::lock() const noexcept | |
{ | |
shared_ptr<_Tp> __r; | |
__r.__cntrl_ = __cntrl_ ? __cntrl_->lock() : __cntrl_; | |
if (__r.__cntrl_) | |
__r.__ptr_ = __ptr_; | |
return __r; | |
} | |
template <class _Tp> struct owner_less; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) owner_less<shared_ptr<_Tp> > | |
: binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool> | |
{ | |
typedef bool result_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const noexcept | |
{return __x.owner_before(__y);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const noexcept | |
{return __x.owner_before(__y);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const noexcept | |
{return __x.owner_before(__y);} | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) owner_less<weak_ptr<_Tp> > | |
: binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool> | |
{ | |
typedef bool result_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const noexcept | |
{return __x.owner_before(__y);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const noexcept | |
{return __x.owner_before(__y);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const noexcept | |
{return __x.owner_before(__y);} | |
}; | |
template<class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) enable_shared_from_this | |
{ | |
mutable weak_ptr<_Tp> __weak_this_; | |
protected: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
enable_shared_from_this() noexcept {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
enable_shared_from_this(enable_shared_from_this const&) noexcept {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
enable_shared_from_this& operator=(enable_shared_from_this const&) noexcept | |
{return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
~enable_shared_from_this() {} | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr<_Tp> shared_from_this() | |
{return shared_ptr<_Tp>(__weak_this_);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
shared_ptr<_Tp const> shared_from_this() const | |
{return shared_ptr<const _Tp>(__weak_this_);} | |
template <class _Up> friend class shared_ptr; | |
}; | |
template <class _Tp> | |
struct __attribute__ ((__type_visibility__("default"))) hash<shared_ptr<_Tp> > | |
{ | |
typedef shared_ptr<_Tp> argument_type; | |
typedef size_t result_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
result_type operator()(const argument_type& __ptr) const noexcept | |
{ | |
return hash<typename shared_ptr<_Tp>::element_type*>()(__ptr.get()); | |
} | |
}; | |
template<class _CharT, class _Traits, class _Yp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_ostream<_CharT, _Traits>& | |
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p); | |
class __attribute__ ((__visibility__("default"))) __sp_mut | |
{ | |
void* __lx; | |
public: | |
void lock() noexcept; | |
void unlock() noexcept; | |
private: | |
constexpr __sp_mut(void*) noexcept; | |
__sp_mut(const __sp_mut&); | |
__sp_mut& operator=(const __sp_mut&); | |
friend __attribute__ ((__visibility__("default"))) __sp_mut& __get_sp_mut(const void*); | |
}; | |
__attribute__ ((__visibility__("default"))) __attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
__sp_mut& __get_sp_mut(const void*); | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
atomic_is_lock_free(const shared_ptr<_Tp>*) | |
{ | |
return false; | |
} | |
template <class _Tp> | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
shared_ptr<_Tp> | |
atomic_load(const shared_ptr<_Tp>* __p) | |
{ | |
__sp_mut& __m = __get_sp_mut(__p); | |
__m.lock(); | |
shared_ptr<_Tp> __q = *__p; | |
__m.unlock(); | |
return __q; | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
shared_ptr<_Tp> | |
atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order) | |
{ | |
return atomic_load(__p); | |
} | |
template <class _Tp> | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
void | |
atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r) | |
{ | |
__sp_mut& __m = __get_sp_mut(__p); | |
__m.lock(); | |
__p->swap(__r); | |
__m.unlock(); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
void | |
atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order) | |
{ | |
atomic_store(__p, __r); | |
} | |
template <class _Tp> | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
shared_ptr<_Tp> | |
atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r) | |
{ | |
__sp_mut& __m = __get_sp_mut(__p); | |
__m.lock(); | |
__p->swap(__r); | |
__m.unlock(); | |
return __r; | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
shared_ptr<_Tp> | |
atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order) | |
{ | |
return atomic_exchange(__p, __r); | |
} | |
template <class _Tp> | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
bool | |
atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w) | |
{ | |
shared_ptr<_Tp> __temp; | |
__sp_mut& __m = __get_sp_mut(__p); | |
__m.lock(); | |
if (__p->__owner_equivalent(*__v)) | |
{ | |
std::__1::swap(__temp, *__p); | |
*__p = __w; | |
__m.unlock(); | |
return true; | |
} | |
std::__1::swap(__temp, *__v); | |
*__v = *__p; | |
__m.unlock(); | |
return false; | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
bool | |
atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w) | |
{ | |
return atomic_compare_exchange_strong(__p, __v, __w); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
bool | |
atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, | |
shared_ptr<_Tp> __w, memory_order, memory_order) | |
{ | |
return atomic_compare_exchange_strong(__p, __v, __w); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__attribute__((availability(macosx,strict,introduced=10.9))) __attribute__((availability(ios,strict,introduced=7.0))) | |
bool | |
atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, | |
shared_ptr<_Tp> __w, memory_order, memory_order) | |
{ | |
return atomic_compare_exchange_weak(__p, __v, __w); | |
} | |
struct __attribute__ ((__visibility__("default"))) pointer_safety | |
{ | |
enum __lx | |
{ | |
relaxed, | |
preferred, | |
strict | |
}; | |
__lx __v_; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer_safety() : __v_() {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer_safety(__lx __v) : __v_(__v) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator int() const {return __v_;} | |
}; | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer_safety get_pointer_safety() noexcept { | |
return pointer_safety::relaxed; | |
} | |
__attribute__ ((__visibility__("default"))) void declare_reachable(void* __p); | |
__attribute__ ((__visibility__("default"))) void declare_no_pointers(char* __p, size_t __n); | |
__attribute__ ((__visibility__("default"))) void undeclare_no_pointers(char* __p, size_t __n); | |
__attribute__ ((__visibility__("default"))) void* __undeclare_reachable(void* __p); | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp* | |
undeclare_reachable(_Tp* __p) | |
{ | |
return static_cast<_Tp*>(__undeclare_reachable(__p)); | |
} | |
__attribute__ ((__visibility__("default"))) void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space); | |
template <typename _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type) | |
noexcept | |
{ | |
using std::__1::swap; | |
swap(__a1, __a2); | |
} | |
template <typename _Alloc> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __swap_allocator(_Alloc &, _Alloc &, false_type) noexcept {} | |
template <typename _Alloc> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __swap_allocator(_Alloc & __a1, _Alloc & __a2) | |
noexcept | |
{ | |
std::__1::__swap_allocator(__a1, __a2, | |
integral_constant<bool, std::__1::allocator_traits<_Alloc>::propagate_on_container_swap::value>()); | |
} | |
template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> > | |
struct __noexcept_move_assign_container : public integral_constant<bool, | |
_Traits::propagate_on_container_move_assignment::value | |
&& is_nothrow_move_assignable<_Alloc>::value | |
> {}; | |
template <class _Tp, class _Alloc> | |
struct __temp_value { | |
typedef allocator_traits<_Alloc> _Traits; | |
typename aligned_storage<sizeof(_Tp), alignof(_Tp)>::type __v; | |
_Alloc &__a; | |
_Tp *__addr() { return reinterpret_cast<_Tp *>(addressof(__v)); } | |
_Tp & get() { return *__addr(); } | |
template<class... _Args> | |
__attribute__((__no_sanitize__("cfi"))) | |
__temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) { | |
_Traits::construct(__a, reinterpret_cast<_Tp*>(addressof(__v)), | |
std::__1::forward<_Args>(__args)...); | |
} | |
~__temp_value() { _Traits::destroy(__a, __addr()); } | |
}; | |
template<typename _Alloc, typename = void, typename = void> | |
struct __is_allocator : false_type {}; | |
template<typename _Alloc> | |
struct __is_allocator<_Alloc, | |
typename __void_t<typename _Alloc::value_type>::type, | |
typename __void_t<decltype(std::__1::declval<_Alloc&>().allocate(size_t(0)))>::type | |
> | |
: true_type {}; | |
struct __builtin_new_allocator { | |
struct __builtin_new_deleter { | |
typedef void* pointer_type; | |
constexpr explicit __builtin_new_deleter(size_t __size, size_t __align) | |
: __size_(__size), __align_(__align) {} | |
void operator()(void* p) const noexcept { | |
std::__1::__libcpp_deallocate(p, __size_, __align_); | |
} | |
private: | |
size_t __size_; | |
size_t __align_; | |
}; | |
typedef unique_ptr<void, __builtin_new_deleter> __holder_t; | |
static __holder_t __allocate_bytes(size_t __s, size_t __align) { | |
return __holder_t(std::__1::__libcpp_allocate(__s, __align), | |
__builtin_new_deleter(__s, __align)); | |
} | |
static void __deallocate_bytes(void* __p, size_t __s, | |
size_t __align) noexcept { | |
std::__1::__libcpp_deallocate(__p, __s, __align); | |
} | |
template <class _Tp> | |
__attribute__((__nodebug__)) __attribute__ ((__always_inline__)) | |
static __holder_t __allocate_type(size_t __n) { | |
return __allocate_bytes(__n * sizeof(_Tp), alignof(_Tp)); | |
} | |
template <class _Tp> | |
__attribute__((__nodebug__)) __attribute__ ((__always_inline__)) | |
static void __deallocate_type(void* __p, size_t __n) noexcept { | |
__deallocate_bytes(__p, __n * sizeof(_Tp), alignof(_Tp)); | |
} | |
}; | |
} } | |
namespace std { inline namespace __1 { | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) plus : binary_function<_Tp, _Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x + __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) plus<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) + std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) + std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) + std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) minus : binary_function<_Tp, _Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x - __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) minus<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) - std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) - std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) - std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) multiplies : binary_function<_Tp, _Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x * __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) multiplies<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) * std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) * std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) * std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) divides : binary_function<_Tp, _Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x / __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) divides<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) / std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) / std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) / std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) modulus : binary_function<_Tp, _Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x % __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) modulus<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) % std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) % std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) % std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) negate : unary_function<_Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x) const | |
{return -__x;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) negate<void> | |
{ | |
template <class _Tp> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_Tp&& __x) const | |
noexcept(noexcept(- std::__1::forward<_Tp>(__x))) | |
-> decltype (- std::__1::forward<_Tp>(__x)) | |
{ return - std::__1::forward<_Tp>(__x); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) equal_to : binary_function<_Tp, _Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x == __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) equal_to<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) == std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) == std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) == std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) not_equal_to : binary_function<_Tp, _Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x != __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) not_equal_to<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) != std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) != std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) != std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) greater : binary_function<_Tp, _Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x > __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) greater<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) > std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) > std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) > std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) greater_equal : binary_function<_Tp, _Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x >= __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) greater_equal<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) >= std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) >= std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) >= std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) less_equal : binary_function<_Tp, _Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x <= __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) less_equal<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) <= std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) <= std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) <= std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) logical_and : binary_function<_Tp, _Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x && __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) logical_and<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) && std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) && std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) && std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) logical_or : binary_function<_Tp, _Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x || __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) logical_or<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) || std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) || std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) || std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) logical_not : unary_function<_Tp, bool> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _Tp& __x) const | |
{return !__x;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) logical_not<void> | |
{ | |
template <class _Tp> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_Tp&& __x) const | |
noexcept(noexcept(!std::__1::forward<_Tp>(__x))) | |
-> decltype (!std::__1::forward<_Tp>(__x)) | |
{ return !std::__1::forward<_Tp>(__x); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) bit_and : binary_function<_Tp, _Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x & __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) bit_and<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) & std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) & std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) & std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) bit_or : binary_function<_Tp, _Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x | __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) bit_or<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) | std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) | std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) | std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) bit_xor : binary_function<_Tp, _Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x, const _Tp& __y) const | |
{return __x ^ __y;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) bit_xor<void> | |
{ | |
template <class _T1, class _T2> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_T1&& __t, _T2&& __u) const | |
noexcept(noexcept(std::__1::forward<_T1>(__t) ^ std::__1::forward<_T2>(__u))) | |
-> decltype (std::__1::forward<_T1>(__t) ^ std::__1::forward<_T2>(__u)) | |
{ return std::__1::forward<_T1>(__t) ^ std::__1::forward<_T2>(__u); } | |
typedef void is_transparent; | |
}; | |
template <class _Tp = void> | |
struct __attribute__ ((__type_visibility__("default"))) bit_not : unary_function<_Tp, _Tp> | |
{ | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp operator()(const _Tp& __x) const | |
{return ~__x;} | |
}; | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) bit_not<void> | |
{ | |
template <class _Tp> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
auto operator()(_Tp&& __x) const | |
noexcept(noexcept(~std::__1::forward<_Tp>(__x))) | |
-> decltype (~std::__1::forward<_Tp>(__x)) | |
{ return ~std::__1::forward<_Tp>(__x); } | |
typedef void is_transparent; | |
}; | |
template <class _Predicate> | |
class __attribute__ ((__type_visibility__("default"))) unary_negate | |
: public unary_function<typename _Predicate::argument_type, bool> | |
{ | |
_Predicate __pred_; | |
public: | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit unary_negate(const _Predicate& __pred) | |
: __pred_(__pred) {} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const typename _Predicate::argument_type& __x) const | |
{return !__pred_(__x);} | |
}; | |
template <class _Predicate> | |
inline constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
unary_negate<_Predicate> | |
not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);} | |
template <class _Predicate> | |
class __attribute__ ((__type_visibility__("default"))) binary_negate | |
: public binary_function<typename _Predicate::first_argument_type, | |
typename _Predicate::second_argument_type, | |
bool> | |
{ | |
_Predicate __pred_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit constexpr | |
binary_negate(const _Predicate& __pred) : __pred_(__pred) {} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const typename _Predicate::first_argument_type& __x, | |
const typename _Predicate::second_argument_type& __y) const | |
{return !__pred_(__x, __y);} | |
}; | |
template <class _Predicate> | |
inline constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
binary_negate<_Predicate> | |
not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);} | |
template <class __Operation> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) binder1st | |
: public unary_function<typename __Operation::second_argument_type, | |
typename __Operation::result_type> | |
{ | |
protected: | |
__Operation op; | |
typename __Operation::first_argument_type value; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) binder1st(const __Operation& __x, | |
const typename __Operation::first_argument_type __y) | |
: op(__x), value(__y) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) typename __Operation::result_type operator() | |
(typename __Operation::second_argument_type& __x) const | |
{return op(value, __x);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) typename __Operation::result_type operator() | |
(const typename __Operation::second_argument_type& __x) const | |
{return op(value, __x);} | |
}; | |
template <class __Operation, class _Tp> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
binder1st<__Operation> | |
bind1st(const __Operation& __op, const _Tp& __x) | |
{return binder1st<__Operation>(__op, __x);} | |
template <class __Operation> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) binder2nd | |
: public unary_function<typename __Operation::first_argument_type, | |
typename __Operation::result_type> | |
{ | |
protected: | |
__Operation op; | |
typename __Operation::second_argument_type value; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
binder2nd(const __Operation& __x, const typename __Operation::second_argument_type __y) | |
: op(__x), value(__y) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) typename __Operation::result_type operator() | |
( typename __Operation::first_argument_type& __x) const | |
{return op(__x, value);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) typename __Operation::result_type operator() | |
(const typename __Operation::first_argument_type& __x) const | |
{return op(__x, value);} | |
}; | |
template <class __Operation, class _Tp> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
binder2nd<__Operation> | |
bind2nd(const __Operation& __op, const _Tp& __x) | |
{return binder2nd<__Operation>(__op, __x);} | |
template <class _Arg, class _Result> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) pointer_to_unary_function | |
: public unary_function<_Arg, _Result> | |
{ | |
_Result (*__f_)(_Arg); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit pointer_to_unary_function(_Result (*__f)(_Arg)) | |
: __f_(__f) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Result operator()(_Arg __x) const | |
{return __f_(__x);} | |
}; | |
template <class _Arg, class _Result> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer_to_unary_function<_Arg,_Result> | |
ptr_fun(_Result (*__f)(_Arg)) | |
{return pointer_to_unary_function<_Arg,_Result>(__f);} | |
template <class _Arg1, class _Arg2, class _Result> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) pointer_to_binary_function | |
: public binary_function<_Arg1, _Arg2, _Result> | |
{ | |
_Result (*__f_)(_Arg1, _Arg2); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2)) | |
: __f_(__f) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Result operator()(_Arg1 __x, _Arg2 __y) const | |
{return __f_(__x, __y);} | |
}; | |
template <class _Arg1, class _Arg2, class _Result> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pointer_to_binary_function<_Arg1,_Arg2,_Result> | |
ptr_fun(_Result (*__f)(_Arg1,_Arg2)) | |
{return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);} | |
template<class _Sp, class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) mem_fun_t | |
: public unary_function<_Tp*, _Sp> | |
{ | |
_Sp (_Tp::*__p_)(); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit mem_fun_t(_Sp (_Tp::*__p)()) | |
: __p_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Sp operator()(_Tp* __p) const | |
{return (__p->*__p_)();} | |
}; | |
template<class _Sp, class _Tp, class _Ap> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) mem_fun1_t | |
: public binary_function<_Tp*, _Ap, _Sp> | |
{ | |
_Sp (_Tp::*__p_)(_Ap); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit mem_fun1_t(_Sp (_Tp::*__p)(_Ap)) | |
: __p_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Sp operator()(_Tp* __p, _Ap __x) const | |
{return (__p->*__p_)(__x);} | |
}; | |
template<class _Sp, class _Tp> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
mem_fun_t<_Sp,_Tp> | |
mem_fun(_Sp (_Tp::*__f)()) | |
{return mem_fun_t<_Sp,_Tp>(__f);} | |
template<class _Sp, class _Tp, class _Ap> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
mem_fun1_t<_Sp,_Tp,_Ap> | |
mem_fun(_Sp (_Tp::*__f)(_Ap)) | |
{return mem_fun1_t<_Sp,_Tp,_Ap>(__f);} | |
template<class _Sp, class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) mem_fun_ref_t | |
: public unary_function<_Tp, _Sp> | |
{ | |
_Sp (_Tp::*__p_)(); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit mem_fun_ref_t(_Sp (_Tp::*__p)()) | |
: __p_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Sp operator()(_Tp& __p) const | |
{return (__p.*__p_)();} | |
}; | |
template<class _Sp, class _Tp, class _Ap> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) mem_fun1_ref_t | |
: public binary_function<_Tp, _Ap, _Sp> | |
{ | |
_Sp (_Tp::*__p_)(_Ap); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap)) | |
: __p_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Sp operator()(_Tp& __p, _Ap __x) const | |
{return (__p.*__p_)(__x);} | |
}; | |
template<class _Sp, class _Tp> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
mem_fun_ref_t<_Sp,_Tp> | |
mem_fun_ref(_Sp (_Tp::*__f)()) | |
{return mem_fun_ref_t<_Sp,_Tp>(__f);} | |
template<class _Sp, class _Tp, class _Ap> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
mem_fun1_ref_t<_Sp,_Tp,_Ap> | |
mem_fun_ref(_Sp (_Tp::*__f)(_Ap)) | |
{return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);} | |
template <class _Sp, class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) const_mem_fun_t | |
: public unary_function<const _Tp*, _Sp> | |
{ | |
_Sp (_Tp::*__p_)() const; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit const_mem_fun_t(_Sp (_Tp::*__p)() const) | |
: __p_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Sp operator()(const _Tp* __p) const | |
{return (__p->*__p_)();} | |
}; | |
template <class _Sp, class _Tp, class _Ap> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) const_mem_fun1_t | |
: public binary_function<const _Tp*, _Ap, _Sp> | |
{ | |
_Sp (_Tp::*__p_)(_Ap) const; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit const_mem_fun1_t(_Sp (_Tp::*__p)(_Ap) const) | |
: __p_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Sp operator()(const _Tp* __p, _Ap __x) const | |
{return (__p->*__p_)(__x);} | |
}; | |
template <class _Sp, class _Tp> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_mem_fun_t<_Sp,_Tp> | |
mem_fun(_Sp (_Tp::*__f)() const) | |
{return const_mem_fun_t<_Sp,_Tp>(__f);} | |
template <class _Sp, class _Tp, class _Ap> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_mem_fun1_t<_Sp,_Tp,_Ap> | |
mem_fun(_Sp (_Tp::*__f)(_Ap) const) | |
{return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);} | |
template <class _Sp, class _Tp> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) const_mem_fun_ref_t | |
: public unary_function<_Tp, _Sp> | |
{ | |
_Sp (_Tp::*__p_)() const; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit const_mem_fun_ref_t(_Sp (_Tp::*__p)() const) | |
: __p_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Sp operator()(const _Tp& __p) const | |
{return (__p.*__p_)();} | |
}; | |
template <class _Sp, class _Tp, class _Ap> | |
class __attribute__ ((__type_visibility__("default"))) __attribute__ ((deprecated)) const_mem_fun1_ref_t | |
: public binary_function<_Tp, _Ap, _Sp> | |
{ | |
_Sp (_Tp::*__p_)(_Ap) const; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit const_mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap) const) | |
: __p_(__p) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _Sp operator()(const _Tp& __p, _Ap __x) const | |
{return (__p.*__p_)(__x);} | |
}; | |
template <class _Sp, class _Tp> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_mem_fun_ref_t<_Sp,_Tp> | |
mem_fun_ref(_Sp (_Tp::*__f)() const) | |
{return const_mem_fun_ref_t<_Sp,_Tp>(__f);} | |
template <class _Sp, class _Tp, class _Ap> | |
__attribute__ ((deprecated)) inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_mem_fun1_ref_t<_Sp,_Tp,_Ap> | |
mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const) | |
{return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);} | |
template <class _Tp> | |
class __mem_fn | |
: public __weak_result_type<_Tp> | |
{ | |
public: | |
typedef _Tp type; | |
private: | |
type __f_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__mem_fn(type __f) noexcept : __f_(__f) {} | |
template <class... _ArgTypes> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename __invoke_return<type, _ArgTypes...>::type | |
operator() (_ArgTypes&&... __args) const { | |
return std::__1::__invoke(__f_, std::__1::forward<_ArgTypes>(__args)...); | |
} | |
}; | |
template<class _Rp, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__mem_fn<_Rp _Tp::*> | |
mem_fn(_Rp _Tp::* __pm) noexcept | |
{ | |
return __mem_fn<_Rp _Tp::*>(__pm); | |
} | |
class __attribute__ ((__visibility__("default"))) bad_function_call | |
: public exception | |
{ | |
}; | |
[[noreturn]] inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void __throw_bad_function_call() | |
{ | |
std::__1::abort(); | |
} | |
template<class _Fp> class __attribute__ ((__type_visibility__("default"))) function; | |
namespace __function | |
{ | |
template<class _Rp> | |
struct __maybe_derive_from_unary_function | |
{ | |
}; | |
template<class _Rp, class _A1> | |
struct __maybe_derive_from_unary_function<_Rp(_A1)> | |
: public unary_function<_A1, _Rp> | |
{ | |
}; | |
template<class _Rp> | |
struct __maybe_derive_from_binary_function | |
{ | |
}; | |
template<class _Rp, class _A1, class _A2> | |
struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)> | |
: public binary_function<_A1, _A2, _Rp> | |
{ | |
}; | |
template <class _Fp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __not_null(_Fp const&) { return true; } | |
template <class _Fp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __not_null(_Fp* __ptr) { return __ptr; } | |
template <class _Ret, class _Class> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __not_null(_Ret _Class::*__ptr) { return __ptr; } | |
template <class _Fp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __not_null(function<_Fp> const& __f) { return !!__f; } | |
template <class _Rp, class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool __not_null(_Rp (^__p)(_Args...)) { return __p; } | |
} | |
namespace __function { | |
template <class _Fp, class _Ap, class _FB> class __alloc_func; | |
template <class _Fp, class _FB> | |
class __default_alloc_func; | |
template <class _Fp, class _Ap, class _Rp, class... _ArgTypes> | |
class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)> | |
{ | |
__compressed_pair<_Fp, _Ap> __f_; | |
public: | |
typedef _Fp _Target; | |
typedef _Ap _Alloc; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const _Target& __target() const { return __f_.first(); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const _Alloc& __get_allocator() const { return __f_.second(); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __alloc_func(_Target&& __f) | |
: __f_(piecewise_construct, std::__1::forward_as_tuple(std::__1::move(__f)), | |
std::__1::forward_as_tuple()) | |
{ | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __alloc_func(const _Target& __f, const _Alloc& __a) | |
: __f_(piecewise_construct, std::__1::forward_as_tuple(__f), | |
std::__1::forward_as_tuple(__a)) | |
{ | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __alloc_func(const _Target& __f, _Alloc&& __a) | |
: __f_(piecewise_construct, std::__1::forward_as_tuple(__f), | |
std::__1::forward_as_tuple(std::__1::move(__a))) | |
{ | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __alloc_func(_Target&& __f, _Alloc&& __a) | |
: __f_(piecewise_construct, std::__1::forward_as_tuple(std::__1::move(__f)), | |
std::__1::forward_as_tuple(std::__1::move(__a))) | |
{ | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Rp operator()(_ArgTypes&&... __arg) | |
{ | |
typedef __invoke_void_return_wrapper<_Rp> _Invoker; | |
return _Invoker::__call(__f_.first(), | |
std::__1::forward<_ArgTypes>(__arg)...); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__alloc_func* __clone() const | |
{ | |
typedef allocator_traits<_Alloc> __alloc_traits; | |
typedef | |
typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type | |
_AA; | |
_AA __a(__f_.second()); | |
typedef __allocator_destructor<_AA> _Dp; | |
unique_ptr<__alloc_func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); | |
::new ((void*)__hold.get()) __alloc_func(__f_.first(), _Alloc(__a)); | |
return __hold.release(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void destroy() noexcept { __f_.~__compressed_pair<_Target, _Alloc>(); } | |
static void __destroy_and_delete(__alloc_func* __f) { | |
typedef allocator_traits<_Alloc> __alloc_traits; | |
typedef typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type | |
_FunAlloc; | |
_FunAlloc __a(__f->__get_allocator()); | |
__f->destroy(); | |
__a.deallocate(__f, 1); | |
} | |
}; | |
template <class _Fp, class _Rp, class... _ArgTypes> | |
class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> { | |
_Fp __f_; | |
public: | |
typedef _Fp _Target; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const _Target& __target() const { return __f_; } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __default_alloc_func(_Target&& __f) : __f_(std::__1::move(__f)) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __default_alloc_func(const _Target& __f) : __f_(__f) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Rp operator()(_ArgTypes&&... __arg) { | |
typedef __invoke_void_return_wrapper<_Rp> _Invoker; | |
return _Invoker::__call(__f_, std::__1::forward<_ArgTypes>(__arg)...); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__default_alloc_func* __clone() const { | |
__builtin_new_allocator::__holder_t __hold = | |
__builtin_new_allocator::__allocate_type<__default_alloc_func>(1); | |
__default_alloc_func* __res = | |
::new ((void*)__hold.get()) __default_alloc_func(__f_); | |
(void)__hold.release(); | |
return __res; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void destroy() noexcept { __f_.~_Target(); } | |
static void __destroy_and_delete(__default_alloc_func* __f) { | |
__f->destroy(); | |
__builtin_new_allocator::__deallocate_type<__default_alloc_func>(__f, 1); | |
} | |
}; | |
template<class _Fp> class __attribute__ ((__type_visibility__("default"))) __base; | |
template<class _Rp, class ..._ArgTypes> | |
class __base<_Rp(_ArgTypes...)> | |
{ | |
__base(const __base&); | |
__base& operator=(const __base&); | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __base() {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) virtual ~__base() {} | |
virtual __base* __clone() const = 0; | |
virtual void __clone(__base*) const = 0; | |
virtual void destroy() noexcept = 0; | |
virtual void destroy_deallocate() noexcept = 0; | |
virtual _Rp operator()(_ArgTypes&& ...) = 0; | |
}; | |
template<class _FD, class _Alloc, class _FB> class __func; | |
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> | |
class __func<_Fp, _Alloc, _Rp(_ArgTypes...)> | |
: public __base<_Rp(_ArgTypes...)> | |
{ | |
__alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> __f_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __func(_Fp&& __f) | |
: __f_(std::__1::move(__f)) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __func(const _Fp& __f, const _Alloc& __a) | |
: __f_(__f, __a) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __func(const _Fp& __f, _Alloc&& __a) | |
: __f_(__f, std::__1::move(__a)) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __func(_Fp&& __f, _Alloc&& __a) | |
: __f_(std::__1::move(__f), std::__1::move(__a)) {} | |
virtual __base<_Rp(_ArgTypes...)>* __clone() const; | |
virtual void __clone(__base<_Rp(_ArgTypes...)>*) const; | |
virtual void destroy() noexcept; | |
virtual void destroy_deallocate() noexcept; | |
virtual _Rp operator()(_ArgTypes&&... __arg); | |
}; | |
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> | |
__base<_Rp(_ArgTypes...)>* | |
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone() const | |
{ | |
typedef allocator_traits<_Alloc> __alloc_traits; | |
typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; | |
_Ap __a(__f_.__get_allocator()); | |
typedef __allocator_destructor<_Ap> _Dp; | |
unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); | |
::new ((void*)__hold.get()) __func(__f_.__target(), _Alloc(__a)); | |
return __hold.release(); | |
} | |
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> | |
void | |
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const | |
{ | |
::new ((void*)__p) __func(__f_.__target(), __f_.__get_allocator()); | |
} | |
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> | |
void | |
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy() noexcept | |
{ | |
__f_.destroy(); | |
} | |
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> | |
void | |
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate() noexcept | |
{ | |
typedef allocator_traits<_Alloc> __alloc_traits; | |
typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; | |
_Ap __a(__f_.__get_allocator()); | |
__f_.destroy(); | |
__a.deallocate(this, 1); | |
} | |
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> | |
_Rp | |
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg) | |
{ | |
return __f_(std::__1::forward<_ArgTypes>(__arg)...); | |
} | |
template <class _Fp> class __value_func; | |
template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)> | |
{ | |
typename aligned_storage<3 * sizeof(void*)>::type __buf_; | |
typedef __base<_Rp(_ArgTypes...)> __func; | |
__func* __f_; | |
__attribute__((__no_sanitize__("cfi"))) static __func* __as_base(void* p) | |
{ | |
return reinterpret_cast<__func*>(p); | |
} | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__value_func() noexcept : __f_(nullptr) {} | |
template <class _Fp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __value_func(_Fp&& __f, const _Alloc& __a) | |
: __f_(nullptr) | |
{ | |
typedef allocator_traits<_Alloc> __alloc_traits; | |
typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun; | |
typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type | |
_FunAlloc; | |
if (__function::__not_null(__f)) | |
{ | |
_FunAlloc __af(__a); | |
if (sizeof(_Fun) <= sizeof(__buf_) && | |
is_nothrow_copy_constructible<_Fp>::value && | |
is_nothrow_copy_constructible<_FunAlloc>::value) | |
{ | |
__f_ = | |
::new ((void*)&__buf_) _Fun(std::__1::move(__f), _Alloc(__af)); | |
} | |
else | |
{ | |
typedef __allocator_destructor<_FunAlloc> _Dp; | |
unique_ptr<__func, _Dp> __hold(__af.allocate(1), _Dp(__af, 1)); | |
::new ((void*)__hold.get()) _Fun(std::__1::move(__f), _Alloc(__a)); | |
__f_ = __hold.release(); | |
} | |
} | |
} | |
template <class _Fp, | |
class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit __value_func(_Fp&& __f) | |
: __value_func(std::__1::forward<_Fp>(__f), allocator<_Fp>()) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__value_func(const __value_func& __f) | |
{ | |
if (__f.__f_ == nullptr) | |
__f_ = nullptr; | |
else if ((void*)__f.__f_ == &__f.__buf_) | |
{ | |
__f_ = __as_base(&__buf_); | |
__f.__f_->__clone(__f_); | |
} | |
else | |
__f_ = __f.__f_->__clone(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__value_func(__value_func&& __f) noexcept | |
{ | |
if (__f.__f_ == nullptr) | |
__f_ = nullptr; | |
else if ((void*)__f.__f_ == &__f.__buf_) | |
{ | |
__f_ = __as_base(&__buf_); | |
__f.__f_->__clone(__f_); | |
} | |
else | |
{ | |
__f_ = __f.__f_; | |
__f.__f_ = nullptr; | |
} | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
~__value_func() | |
{ | |
if ((void*)__f_ == &__buf_) | |
__f_->destroy(); | |
else if (__f_) | |
__f_->destroy_deallocate(); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__value_func& operator=(__value_func&& __f) | |
{ | |
*this = nullptr; | |
if (__f.__f_ == nullptr) | |
__f_ = nullptr; | |
else if ((void*)__f.__f_ == &__f.__buf_) | |
{ | |
__f_ = __as_base(&__buf_); | |
__f.__f_->__clone(__f_); | |
} | |
else | |
{ | |
__f_ = __f.__f_; | |
__f.__f_ = nullptr; | |
} | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__value_func& operator=(nullptr_t) | |
{ | |
__func* __f = __f_; | |
__f_ = nullptr; | |
if ((void*)__f == &__buf_) | |
__f->destroy(); | |
else if (__f) | |
__f->destroy_deallocate(); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Rp operator()(_ArgTypes&&... __args) const | |
{ | |
if (__f_ == nullptr) | |
__throw_bad_function_call(); | |
return (*__f_)(std::__1::forward<_ArgTypes>(__args)...); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(__value_func& __f) noexcept | |
{ | |
if (&__f == this) | |
return; | |
if ((void*)__f_ == &__buf_ && (void*)__f.__f_ == &__f.__buf_) | |
{ | |
typename aligned_storage<sizeof(__buf_)>::type __tempbuf; | |
__func* __t = __as_base(&__tempbuf); | |
__f_->__clone(__t); | |
__f_->destroy(); | |
__f_ = nullptr; | |
__f.__f_->__clone(__as_base(&__buf_)); | |
__f.__f_->destroy(); | |
__f.__f_ = nullptr; | |
__f_ = __as_base(&__buf_); | |
__t->__clone(__as_base(&__f.__buf_)); | |
__t->destroy(); | |
__f.__f_ = __as_base(&__f.__buf_); | |
} | |
else if ((void*)__f_ == &__buf_) | |
{ | |
__f_->__clone(__as_base(&__f.__buf_)); | |
__f_->destroy(); | |
__f_ = __f.__f_; | |
__f.__f_ = __as_base(&__f.__buf_); | |
} | |
else if ((void*)__f.__f_ == &__f.__buf_) | |
{ | |
__f.__f_->__clone(__as_base(&__buf_)); | |
__f.__f_->destroy(); | |
__f.__f_ = __f_; | |
__f_ = __as_base(&__buf_); | |
} | |
else | |
std::__1::swap(__f_, __f.__f_); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit operator bool() const noexcept { return __f_ != nullptr; } | |
}; | |
union __policy_storage | |
{ | |
mutable char __small[sizeof(void*) * 2]; | |
void* __large; | |
}; | |
template <typename _Fun> | |
struct __use_small_storage | |
: public std::__1::integral_constant< | |
bool, sizeof(_Fun) <= sizeof(__policy_storage) && | |
alignof(_Fun) <= alignof(__policy_storage) && | |
std::__1::is_trivially_copy_constructible<_Fun>::value && | |
std::__1::is_trivially_destructible<_Fun>::value> {}; | |
struct __policy | |
{ | |
void* (*const __clone)(const void*); | |
void (*const __destroy)(void*); | |
const bool __is_null; | |
const std::type_info* const __type_info; | |
template <typename _Fun> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static const __policy* __create() | |
{ | |
return __choose_policy<_Fun>(__use_small_storage<_Fun>()); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static const __policy* __create_empty() | |
{ | |
static const constexpr __policy __policy_ = {nullptr, nullptr, | |
true, | |
nullptr | |
}; | |
return &__policy_; | |
} | |
private: | |
template <typename _Fun> static void* __large_clone(const void* __s) | |
{ | |
const _Fun* __f = static_cast<const _Fun*>(__s); | |
return __f->__clone(); | |
} | |
template <typename _Fun> | |
static void __large_destroy(void* __s) { | |
_Fun::__destroy_and_delete(static_cast<_Fun*>(__s)); | |
} | |
template <typename _Fun> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static const __policy* | |
__choose_policy( false_type) { | |
static const constexpr __policy __policy_ = { | |
&__large_clone<_Fun>, &__large_destroy<_Fun>, false, | |
nullptr | |
}; | |
return &__policy_; | |
} | |
template <typename _Fun> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static const __policy* | |
__choose_policy( true_type) | |
{ | |
static const constexpr __policy __policy_ = { | |
nullptr, nullptr, false, | |
nullptr | |
}; | |
return &__policy_; | |
} | |
}; | |
template <typename _Tp> | |
using __fast_forward = | |
typename std::__1::conditional<std::__1::is_scalar<_Tp>::value, _Tp, _Tp&&>::type; | |
template <class _Fp> struct __policy_invoker; | |
template <class _Rp, class... _ArgTypes> | |
struct __policy_invoker<_Rp(_ArgTypes...)> | |
{ | |
typedef _Rp (*__Call)(const __policy_storage*, | |
__fast_forward<_ArgTypes>...); | |
__Call __call_; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__policy_invoker() : __call_(&__call_empty) {} | |
template <typename _Fun> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static __policy_invoker __create() | |
{ | |
return __policy_invoker(&__call_impl<_Fun>); | |
} | |
private: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __policy_invoker(__Call __c) : __call_(__c) {} | |
static _Rp __call_empty(const __policy_storage*, | |
__fast_forward<_ArgTypes>...) | |
{ | |
__throw_bad_function_call(); | |
} | |
template <typename _Fun> | |
static _Rp __call_impl(const __policy_storage* __buf, | |
__fast_forward<_ArgTypes>... __args) | |
{ | |
_Fun* __f = reinterpret_cast<_Fun*>(__use_small_storage<_Fun>::value | |
? &__buf->__small | |
: __buf->__large); | |
return (*__f)(std::__1::forward<_ArgTypes>(__args)...); | |
} | |
}; | |
template <class _Fp> class __policy_func; | |
template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)> | |
{ | |
__policy_storage __buf_; | |
typedef __function::__policy_invoker<_Rp(_ArgTypes...)> __invoker; | |
__invoker __invoker_; | |
const __policy* __policy_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__policy_func() : __policy_(__policy::__create_empty()) {} | |
template <class _Fp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __policy_func(_Fp&& __f, const _Alloc& __a) | |
: __policy_(__policy::__create_empty()) | |
{ | |
typedef __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun; | |
typedef allocator_traits<_Alloc> __alloc_traits; | |
typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type | |
_FunAlloc; | |
if (__function::__not_null(__f)) | |
{ | |
__invoker_ = __invoker::template __create<_Fun>(); | |
__policy_ = __policy::__create<_Fun>(); | |
_FunAlloc __af(__a); | |
if (__use_small_storage<_Fun>()) | |
{ | |
::new ((void*)&__buf_.__small) | |
_Fun(std::__1::move(__f), _Alloc(__af)); | |
} | |
else | |
{ | |
typedef __allocator_destructor<_FunAlloc> _Dp; | |
unique_ptr<_Fun, _Dp> __hold(__af.allocate(1), _Dp(__af, 1)); | |
::new ((void*)__hold.get()) | |
_Fun(std::__1::move(__f), _Alloc(__af)); | |
__buf_.__large = __hold.release(); | |
} | |
} | |
} | |
template <class _Fp, class = typename enable_if<!is_same<typename decay<_Fp>::type, __policy_func>::value>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit __policy_func(_Fp&& __f) | |
: __policy_(__policy::__create_empty()) { | |
typedef __default_alloc_func<_Fp, _Rp(_ArgTypes...)> _Fun; | |
if (__function::__not_null(__f)) { | |
__invoker_ = __invoker::template __create<_Fun>(); | |
__policy_ = __policy::__create<_Fun>(); | |
if (__use_small_storage<_Fun>()) { | |
::new ((void*)&__buf_.__small) _Fun(std::__1::move(__f)); | |
} else { | |
__builtin_new_allocator::__holder_t __hold = | |
__builtin_new_allocator::__allocate_type<_Fun>(1); | |
__buf_.__large = ::new ((void*)__hold.get()) _Fun(std::__1::move(__f)); | |
(void)__hold.release(); | |
} | |
} | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__policy_func(const __policy_func& __f) | |
: __buf_(__f.__buf_), __invoker_(__f.__invoker_), | |
__policy_(__f.__policy_) | |
{ | |
if (__policy_->__clone) | |
__buf_.__large = __policy_->__clone(__f.__buf_.__large); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__policy_func(__policy_func&& __f) | |
: __buf_(__f.__buf_), __invoker_(__f.__invoker_), | |
__policy_(__f.__policy_) | |
{ | |
if (__policy_->__destroy) | |
{ | |
__f.__policy_ = __policy::__create_empty(); | |
__f.__invoker_ = __invoker(); | |
} | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
~__policy_func() | |
{ | |
if (__policy_->__destroy) | |
__policy_->__destroy(__buf_.__large); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__policy_func& operator=(__policy_func&& __f) | |
{ | |
*this = nullptr; | |
__buf_ = __f.__buf_; | |
__invoker_ = __f.__invoker_; | |
__policy_ = __f.__policy_; | |
__f.__policy_ = __policy::__create_empty(); | |
__f.__invoker_ = __invoker(); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__policy_func& operator=(nullptr_t) | |
{ | |
const __policy* __p = __policy_; | |
__policy_ = __policy::__create_empty(); | |
__invoker_ = __invoker(); | |
if (__p->__destroy) | |
__p->__destroy(__buf_.__large); | |
return *this; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Rp operator()(_ArgTypes&&... __args) const | |
{ | |
return __invoker_.__call_(std::__1::addressof(__buf_), | |
std::__1::forward<_ArgTypes>(__args)...); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(__policy_func& __f) | |
{ | |
std::__1::swap(__invoker_, __f.__invoker_); | |
std::__1::swap(__policy_, __f.__policy_); | |
std::__1::swap(__buf_, __f.__buf_); | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit operator bool() const noexcept | |
{ | |
return !__policy_->__is_null; | |
} | |
}; | |
extern "C" void *_Block_copy(const void *); | |
extern "C" void _Block_release(const void *); | |
template<class _Rp1, class ..._ArgTypes1, class _Alloc, class _Rp, class ..._ArgTypes> | |
class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)> | |
: public __base<_Rp(_ArgTypes...)> | |
{ | |
typedef _Rp1(^__block_type)(_ArgTypes1...); | |
__block_type __f_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __func(__block_type const& __f) | |
: __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr)) | |
{ } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __func(__block_type __f, const _Alloc& ) | |
: __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr)) | |
{ } | |
virtual __base<_Rp(_ArgTypes...)>* __clone() const { | |
((void)0); | |
return nullptr; | |
} | |
virtual void __clone(__base<_Rp(_ArgTypes...)>* __p) const { | |
::new ((void*)__p) __func(__f_); | |
} | |
virtual void destroy() noexcept { | |
if (__f_) | |
_Block_release(__f_); | |
__f_ = 0; | |
} | |
virtual void destroy_deallocate() noexcept { | |
((void)0); | |
} | |
virtual _Rp operator()(_ArgTypes&& ... __arg) { | |
return std::__1::__invoke(__f_, std::__1::forward<_ArgTypes>(__arg)...); | |
} | |
}; | |
} | |
template<class _Rp, class ..._ArgTypes> | |
class __attribute__ ((__type_visibility__("default"))) function<_Rp(_ArgTypes...)> | |
: public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>, | |
public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)> | |
{ | |
typedef __function::__value_func<_Rp(_ArgTypes...)> __func; | |
__func __f_; | |
template <class _Fp, bool = _And< | |
_IsNotSame<__uncvref_t<_Fp>, function>, | |
__invokable<_Fp, _ArgTypes...> | |
>::value> | |
struct __callable; | |
template <class _Fp> | |
struct __callable<_Fp, true> | |
{ | |
static const bool value = is_void<_Rp>::value || | |
__is_core_convertible<typename __invoke_of<_Fp, _ArgTypes...>::type, | |
_Rp>::value; | |
}; | |
template <class _Fp> | |
struct __callable<_Fp, false> | |
{ | |
static const bool value = false; | |
}; | |
template <class _Fp> | |
using _EnableIfLValueCallable = typename enable_if<__callable<_Fp&>::value>::type; | |
public: | |
typedef _Rp result_type; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
function() noexcept { } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
function(nullptr_t) noexcept {} | |
function(const function&); | |
function(function&&) noexcept; | |
template<class _Fp, class = _EnableIfLValueCallable<_Fp>> | |
function(_Fp); | |
template<class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
function(allocator_arg_t, const _Alloc&) noexcept {} | |
template<class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
function(allocator_arg_t, const _Alloc&, nullptr_t) noexcept {} | |
template<class _Alloc> | |
function(allocator_arg_t, const _Alloc&, const function&); | |
template<class _Alloc> | |
function(allocator_arg_t, const _Alloc&, function&&); | |
template<class _Fp, class _Alloc, class = _EnableIfLValueCallable<_Fp>> | |
function(allocator_arg_t, const _Alloc& __a, _Fp __f); | |
function& operator=(const function&); | |
function& operator=(function&&) noexcept; | |
function& operator=(nullptr_t) noexcept; | |
template<class _Fp, class = _EnableIfLValueCallable<typename decay<_Fp>::type>> | |
function& operator=(_Fp&&); | |
~function(); | |
void swap(function&) noexcept; | |
template<class _Fp, class _Alloc> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void assign(_Fp&& __f, const _Alloc& __a) | |
{function(allocator_arg, __a, std::__1::forward<_Fp>(__f)).swap(*this);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit operator bool() const noexcept { | |
return static_cast<bool>(__f_); | |
} | |
template<class _R2, class... _ArgTypes2> | |
bool operator==(const function<_R2(_ArgTypes2...)>&) const = delete; | |
template<class _R2, class... _ArgTypes2> | |
bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete; | |
public: | |
_Rp operator()(_ArgTypes...) const; | |
}; | |
template<class _Rp, class ..._ArgTypes> | |
function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {} | |
template<class _Rp, class ..._ArgTypes> | |
template <class _Alloc> | |
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, | |
const function& __f) : __f_(__f.__f_) {} | |
template <class _Rp, class... _ArgTypes> | |
function<_Rp(_ArgTypes...)>::function(function&& __f) noexcept | |
: __f_(std::__1::move(__f.__f_)) {} | |
template<class _Rp, class ..._ArgTypes> | |
template <class _Alloc> | |
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, | |
function&& __f) | |
: __f_(std::__1::move(__f.__f_)) {} | |
template <class _Rp, class... _ArgTypes> | |
template <class _Fp, class> | |
function<_Rp(_ArgTypes...)>::function(_Fp __f) : __f_(std::__1::move(__f)) {} | |
template <class _Rp, class... _ArgTypes> | |
template <class _Fp, class _Alloc, class> | |
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a, | |
_Fp __f) | |
: __f_(std::__1::move(__f), __a) {} | |
template<class _Rp, class ..._ArgTypes> | |
function<_Rp(_ArgTypes...)>& | |
function<_Rp(_ArgTypes...)>::operator=(const function& __f) | |
{ | |
function(__f).swap(*this); | |
return *this; | |
} | |
template<class _Rp, class ..._ArgTypes> | |
function<_Rp(_ArgTypes...)>& | |
function<_Rp(_ArgTypes...)>::operator=(function&& __f) noexcept | |
{ | |
__f_ = std::__1::move(__f.__f_); | |
return *this; | |
} | |
template<class _Rp, class ..._ArgTypes> | |
function<_Rp(_ArgTypes...)>& | |
function<_Rp(_ArgTypes...)>::operator=(nullptr_t) noexcept | |
{ | |
__f_ = nullptr; | |
return *this; | |
} | |
template<class _Rp, class ..._ArgTypes> | |
template <class _Fp, class> | |
function<_Rp(_ArgTypes...)>& | |
function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f) | |
{ | |
function(std::__1::forward<_Fp>(__f)).swap(*this); | |
return *this; | |
} | |
template<class _Rp, class ..._ArgTypes> | |
function<_Rp(_ArgTypes...)>::~function() {} | |
template<class _Rp, class ..._ArgTypes> | |
void | |
function<_Rp(_ArgTypes...)>::swap(function& __f) noexcept | |
{ | |
__f_.swap(__f.__f_); | |
} | |
template<class _Rp, class ..._ArgTypes> | |
_Rp | |
function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const | |
{ | |
return __f_(std::__1::forward<_ArgTypes>(__arg)...); | |
} | |
template <class _Rp, class... _ArgTypes> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) noexcept {return !__f;} | |
template <class _Rp, class... _ArgTypes> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator==(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) noexcept {return !__f;} | |
template <class _Rp, class... _ArgTypes> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) noexcept {return (bool)__f;} | |
template <class _Rp, class... _ArgTypes> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) noexcept {return (bool)__f;} | |
template <class _Rp, class... _ArgTypes> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) noexcept | |
{return __x.swap(__y);} | |
template<class _Tp> struct __is_bind_expression : public false_type {}; | |
template<class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_bind_expression | |
: public __is_bind_expression<typename remove_cv<_Tp>::type> {}; | |
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {}; | |
template<class _Tp> struct __attribute__ ((__type_visibility__("default"))) is_placeholder | |
: public __is_placeholder<typename remove_cv<_Tp>::type> {}; | |
namespace placeholders | |
{ | |
template <int _Np> struct __ph {}; | |
constexpr __ph<1> _1{}; | |
constexpr __ph<2> _2{}; | |
constexpr __ph<3> _3{}; | |
constexpr __ph<4> _4{}; | |
constexpr __ph<5> _5{}; | |
constexpr __ph<6> _6{}; | |
constexpr __ph<7> _7{}; | |
constexpr __ph<8> _8{}; | |
constexpr __ph<9> _9{}; | |
constexpr __ph<10> _10{}; | |
} | |
template<int _Np> | |
struct __is_placeholder<placeholders::__ph<_Np> > | |
: public integral_constant<int, _Np> {}; | |
template <class _Tp, class _Uj> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Tp& | |
__mu(reference_wrapper<_Tp> __t, _Uj&) | |
{ | |
return __t.get(); | |
} | |
template <class _Ti, class ..._Uj, size_t ..._Indx> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename __invoke_of<_Ti&, _Uj...>::type | |
__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>) | |
{ | |
return __ti(std::__1::forward<_Uj>(std::__1::get<_Indx>(__uj))...); | |
} | |
template <class _Ti, class ..._Uj> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename _EnableIf | |
< | |
is_bind_expression<_Ti>::value, | |
__invoke_of<_Ti&, _Uj...> | |
>::type | |
__mu(_Ti& __ti, tuple<_Uj...>& __uj) | |
{ | |
typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices; | |
return std::__1::__mu_expand(__ti, __uj, __indices()); | |
} | |
template <bool IsPh, class _Ti, class _Uj> | |
struct __mu_return2 {}; | |
template <class _Ti, class _Uj> | |
struct __mu_return2<true, _Ti, _Uj> | |
{ | |
typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type; | |
}; | |
template <class _Ti, class _Uj> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
0 < is_placeholder<_Ti>::value, | |
typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type | |
>::type | |
__mu(_Ti&, _Uj& __uj) | |
{ | |
const size_t _Indx = is_placeholder<_Ti>::value - 1; | |
return std::__1::forward<typename tuple_element<_Indx, _Uj>::type>(std::__1::get<_Indx>(__uj)); | |
} | |
template <class _Ti, class _Uj> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
!is_bind_expression<_Ti>::value && | |
is_placeholder<_Ti>::value == 0 && | |
!__is_reference_wrapper<_Ti>::value, | |
_Ti& | |
>::type | |
__mu(_Ti& __ti, _Uj&) | |
{ | |
return __ti; | |
} | |
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 | |
{ | |
typedef __nat type; | |
}; | |
template <class _Ti, class ..._Uj> | |
struct __mu_return_invokable<true, _Ti, _Uj...> | |
{ | |
typedef typename __invoke_of<_Ti&, _Uj...>::type type; | |
}; | |
template <class _Ti, class ..._Uj> | |
struct __mu_return_impl<_Ti, false, true, false, tuple<_Uj...> > | |
: public __mu_return_invokable<__invokable<_Ti&, _Uj...>::value, _Ti, _Uj...> | |
{ | |
}; | |
template <class _Ti, class _TupleUj> | |
struct __mu_return_impl<_Ti, false, false, true, _TupleUj> | |
{ | |
typedef typename tuple_element<is_placeholder<_Ti>::value - 1, | |
_TupleUj>::type&& type; | |
}; | |
template <class _Ti, class _TupleUj> | |
struct __mu_return_impl<_Ti, true, false, false, _TupleUj> | |
{ | |
typedef typename _Ti::type& type; | |
}; | |
template <class _Ti, class _TupleUj> | |
struct __mu_return_impl<_Ti, false, false, false, _TupleUj> | |
{ | |
typedef _Ti& type; | |
}; | |
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 | |
{ | |
static const bool value = false; | |
}; | |
template <class _Fp, class ..._BoundArgs, class _TupleUj> | |
struct __is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj> | |
{ | |
static const bool value = __invokable<_Fp, | |
typename __mu_return<_BoundArgs, _TupleUj>::type...>::value; | |
}; | |
template <class _Fp, class ..._BoundArgs, class _TupleUj> | |
struct __is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj> | |
{ | |
static const bool value = __invokable<_Fp, | |
typename __mu_return<const _BoundArgs, _TupleUj>::type...>::value; | |
}; | |
template <class _Fp, class _BoundArgs, class _TupleUj, | |
bool = __is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value> | |
struct __bind_return; | |
template <class _Fp, class ..._BoundArgs, class _TupleUj> | |
struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj, true> | |
{ | |
typedef typename __invoke_of | |
< | |
_Fp&, | |
typename __mu_return | |
< | |
_BoundArgs, | |
_TupleUj | |
>::type... | |
>::type type; | |
}; | |
template <class _Fp, class ..._BoundArgs, class _TupleUj> | |
struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true> | |
{ | |
typedef typename __invoke_of | |
< | |
_Fp&, | |
typename __mu_return | |
< | |
const _BoundArgs, | |
_TupleUj | |
>::type... | |
>::type type; | |
}; | |
template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename __bind_return<_Fp, _BoundArgs, _Args>::type | |
__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, | |
_Args&& __args) | |
{ | |
return std::__1::__invoke(__f, std::__1::__mu(std::__1::get<_Indx>(__bound_args), __args)...); | |
} | |
template<class _Fp, class ..._BoundArgs> | |
class __bind | |
: public __weak_result_type<typename decay<_Fp>::type> | |
{ | |
protected: | |
typedef typename decay<_Fp>::type _Fd; | |
typedef tuple<typename decay<_BoundArgs>::type...> _Td; | |
private: | |
_Fd __f_; | |
_Td __bound_args_; | |
typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices; | |
public: | |
template <class _Gp, class ..._BA, | |
class = typename enable_if | |
< | |
is_constructible<_Fd, _Gp>::value && | |
!is_same<typename remove_reference<_Gp>::type, | |
__bind>::value | |
>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __bind(_Gp&& __f, _BA&& ...__bound_args) | |
: __f_(std::__1::forward<_Gp>(__f)), | |
__bound_args_(std::__1::forward<_BA>(__bound_args)...) {} | |
template <class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type | |
operator()(_Args&& ...__args) | |
{ | |
return std::__1::__apply_functor(__f_, __bound_args_, __indices(), | |
tuple<_Args&&...>(std::__1::forward<_Args>(__args)...)); | |
} | |
template <class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type | |
operator()(_Args&& ...__args) const | |
{ | |
return std::__1::__apply_functor(__f_, __bound_args_, __indices(), | |
tuple<_Args&&...>(std::__1::forward<_Args>(__args)...)); | |
} | |
}; | |
template<class _Fp, class ..._BoundArgs> | |
struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {}; | |
template<class _Rp, class _Fp, class ..._BoundArgs> | |
class __bind_r | |
: public __bind<_Fp, _BoundArgs...> | |
{ | |
typedef __bind<_Fp, _BoundArgs...> base; | |
typedef typename base::_Fd _Fd; | |
typedef typename base::_Td _Td; | |
public: | |
typedef _Rp result_type; | |
template <class _Gp, class ..._BA, | |
class = typename enable_if | |
< | |
is_constructible<_Fd, _Gp>::value && | |
!is_same<typename remove_reference<_Gp>::type, | |
__bind_r>::value | |
>::type> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args) | |
: base(std::__1::forward<_Gp>(__f), | |
std::__1::forward<_BA>(__bound_args)...) {} | |
template <class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type, | |
result_type>::value || is_void<_Rp>::value, | |
result_type | |
>::type | |
operator()(_Args&& ...__args) | |
{ | |
typedef __invoke_void_return_wrapper<_Rp> _Invoker; | |
return _Invoker::__call(static_cast<base&>(*this), std::__1::forward<_Args>(__args)...); | |
} | |
template <class ..._Args> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type, | |
result_type>::value || is_void<_Rp>::value, | |
result_type | |
>::type | |
operator()(_Args&& ...__args) const | |
{ | |
typedef __invoke_void_return_wrapper<_Rp> _Invoker; | |
return _Invoker::__call(static_cast<base const&>(*this), std::__1::forward<_Args>(__args)...); | |
} | |
}; | |
template<class _Rp, class _Fp, class ..._BoundArgs> | |
struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {}; | |
template<class _Fp, class ..._BoundArgs> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__bind<_Fp, _BoundArgs...> | |
bind(_Fp&& __f, _BoundArgs&&... __bound_args) | |
{ | |
typedef __bind<_Fp, _BoundArgs...> type; | |
return type(std::__1::forward<_Fp>(__f), std::__1::forward<_BoundArgs>(__bound_args)...); | |
} | |
template<class _Rp, class _Fp, class ..._BoundArgs> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__bind_r<_Rp, _Fp, _BoundArgs...> | |
bind(_Fp&& __f, _BoundArgs&&... __bound_args) | |
{ | |
typedef __bind_r<_Rp, _Fp, _BoundArgs...> type; | |
return type(std::__1::forward<_Fp>(__f), std::__1::forward<_BoundArgs>(__bound_args)...); | |
} | |
template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> | |
pair<_ForwardIterator1, _ForwardIterator1> constexpr | |
__search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, | |
forward_iterator_tag, forward_iterator_tag) | |
{ | |
if (__first2 == __last2) | |
return std::__1::make_pair(__first1, __first1); | |
while (true) | |
{ | |
while (true) | |
{ | |
if (__first1 == __last1) | |
return std::__1::make_pair(__last1, __last1); | |
if (__pred(*__first1, *__first2)) | |
break; | |
++__first1; | |
} | |
_ForwardIterator1 __m1 = __first1; | |
_ForwardIterator2 __m2 = __first2; | |
while (true) | |
{ | |
if (++__m2 == __last2) | |
return std::__1::make_pair(__first1, __m1); | |
if (++__m1 == __last1) | |
return std::__1::make_pair(__last1, __last1); | |
if (!__pred(*__m1, *__m2)) | |
{ | |
++__first1; | |
break; | |
} | |
} | |
} | |
} | |
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> | |
constexpr | |
pair<_RandomAccessIterator1, _RandomAccessIterator1> | |
__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, | |
_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, | |
random_access_iterator_tag, random_access_iterator_tag) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1; | |
typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2; | |
const _D2 __len2 = __last2 - __first2; | |
if (__len2 == 0) | |
return std::__1::make_pair(__first1, __first1); | |
const _D1 __len1 = __last1 - __first1; | |
if (__len1 < __len2) | |
return std::__1::make_pair(__last1, __last1); | |
const _RandomAccessIterator1 __s = __last1 - (__len2 - 1); | |
while (true) | |
{ | |
while (true) | |
{ | |
if (__first1 == __s) | |
return std::__1::make_pair(__last1, __last1); | |
if (__pred(*__first1, *__first2)) | |
break; | |
++__first1; | |
} | |
_RandomAccessIterator1 __m1 = __first1; | |
_RandomAccessIterator2 __m2 = __first2; | |
while (true) | |
{ | |
if (++__m2 == __last2) | |
return std::__1::make_pair(__first1, __first1 + __len2); | |
++__m1; | |
if (!__pred(*__m1, *__m2)) | |
{ | |
++__first1; | |
break; | |
} | |
} | |
} | |
} | |
template <class _Container, class _Predicate> | |
inline typename _Container::size_type | |
__libcpp_erase_if_container(_Container& __c, _Predicate __pred) { | |
typename _Container::size_type __old_size = __c.size(); | |
const typename _Container::iterator __last = __c.end(); | |
for (typename _Container::iterator __iter = __c.begin(); __iter != __last;) { | |
if (__pred(*__iter)) | |
__iter = __c.erase(__iter); | |
else | |
++__iter; | |
} | |
return __old_size - __c.size(); | |
} | |
} } | |
namespace std { inline namespace __1 { | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_ctz(unsigned __x) noexcept { return __builtin_ctz(__x); } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_ctz(unsigned long __x) noexcept { return __builtin_ctzl(__x); } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_ctz(unsigned long long __x) noexcept { return __builtin_ctzll(__x); } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_clz(unsigned __x) noexcept { return __builtin_clz(__x); } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_clz(unsigned long __x) noexcept { return __builtin_clzl(__x); } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_clz(unsigned long long __x) noexcept { return __builtin_clzll(__x); } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_popcount(unsigned __x) noexcept { return __builtin_popcount(__x); } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_popcount(unsigned long __x) noexcept { return __builtin_popcountl(__x); } | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __libcpp_popcount(unsigned long long __x) noexcept { return __builtin_popcountll(__x); } | |
} } | |
namespace std { inline namespace __1 { | |
template <class _Tp> | |
using __bitop_unsigned_integer = integral_constant<bool, | |
is_integral<_Tp>::value && | |
is_unsigned<_Tp>::value && | |
_IsNotSame<typename remove_cv<_Tp>::type, bool>::value && | |
_IsNotSame<typename remove_cv<_Tp>::type, signed char>::value && | |
_IsNotSame<typename remove_cv<_Tp>::type, wchar_t>::value && | |
_IsNotSame<typename remove_cv<_Tp>::type, char16_t>::value && | |
_IsNotSame<typename remove_cv<_Tp>::type, char32_t>::value | |
>; | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp __rotl(_Tp __t, unsigned int __cnt) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__rotl requires unsigned"); | |
const unsigned int __dig = numeric_limits<_Tp>::digits; | |
if ((__cnt % __dig) == 0) | |
return __t; | |
return (__t << (__cnt % __dig)) | (__t >> (__dig - (__cnt % __dig))); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp __rotr(_Tp __t, unsigned int __cnt) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__rotr requires unsigned"); | |
const unsigned int __dig = numeric_limits<_Tp>::digits; | |
if ((__cnt % __dig) == 0) | |
return __t; | |
return (__t >> (__cnt % __dig)) | (__t << (__dig - (__cnt % __dig))); | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __countr_zero(_Tp __t) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__countr_zero requires unsigned"); | |
if (__t == 0) | |
return numeric_limits<_Tp>::digits; | |
if (sizeof(_Tp) <= sizeof(unsigned int)) | |
return __libcpp_ctz(static_cast<unsigned int>(__t)); | |
else if (sizeof(_Tp) <= sizeof(unsigned long)) | |
return __libcpp_ctz(static_cast<unsigned long>(__t)); | |
else if (sizeof(_Tp) <= sizeof(unsigned long long)) | |
return __libcpp_ctz(static_cast<unsigned long long>(__t)); | |
else | |
{ | |
int __ret = 0; | |
int __iter = 0; | |
const unsigned int __ulldigits = numeric_limits<unsigned long long>::digits; | |
while ((__iter = __libcpp_ctz(static_cast<unsigned long long>(__t))) == __ulldigits) | |
{ | |
__ret += __iter; | |
__t >>= __ulldigits; | |
} | |
return __ret + __iter; | |
} | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __countl_zero(_Tp __t) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__countl_zero requires unsigned"); | |
if (__t == 0) | |
return numeric_limits<_Tp>::digits; | |
if (sizeof(_Tp) <= sizeof(unsigned int)) | |
return __libcpp_clz(static_cast<unsigned int>(__t)) | |
- (numeric_limits<unsigned int>::digits - numeric_limits<_Tp>::digits); | |
else if (sizeof(_Tp) <= sizeof(unsigned long)) | |
return __libcpp_clz(static_cast<unsigned long>(__t)) | |
- (numeric_limits<unsigned long>::digits - numeric_limits<_Tp>::digits); | |
else if (sizeof(_Tp) <= sizeof(unsigned long long)) | |
return __libcpp_clz(static_cast<unsigned long long>(__t)) | |
- (numeric_limits<unsigned long long>::digits - numeric_limits<_Tp>::digits); | |
else | |
{ | |
int __ret = 0; | |
int __iter = 0; | |
const unsigned int __ulldigits = numeric_limits<unsigned long long>::digits; | |
while (true) { | |
__t = __rotr(__t, __ulldigits); | |
if ((__iter = __countl_zero(static_cast<unsigned long long>(__t))) != __ulldigits) | |
break; | |
__ret += __iter; | |
} | |
return __ret + __iter; | |
} | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __countl_one(_Tp __t) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__countl_one requires unsigned"); | |
return __t != numeric_limits<_Tp>::max() | |
? __countl_zero(static_cast<_Tp>(~__t)) | |
: numeric_limits<_Tp>::digits; | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int __countr_one(_Tp __t) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__countr_one requires unsigned"); | |
return __t != numeric_limits<_Tp>::max() | |
? __countr_zero(static_cast<_Tp>(~__t)) | |
: numeric_limits<_Tp>::digits; | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
int | |
__popcount(_Tp __t) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__libcpp_popcount requires unsigned"); | |
if (sizeof(_Tp) <= sizeof(unsigned int)) | |
return __libcpp_popcount(static_cast<unsigned int>(__t)); | |
else if (sizeof(_Tp) <= sizeof(unsigned long)) | |
return __libcpp_popcount(static_cast<unsigned long>(__t)); | |
else if (sizeof(_Tp) <= sizeof(unsigned long long)) | |
return __libcpp_popcount(static_cast<unsigned long long>(__t)); | |
else | |
{ | |
int __ret = 0; | |
while (__t != 0) | |
{ | |
__ret += __libcpp_popcount(static_cast<unsigned long long>(__t)); | |
__t >>= numeric_limits<unsigned long long>::digits; | |
} | |
return __ret; | |
} | |
} | |
template<class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
unsigned __bit_log2(_Tp __t) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__bit_log2 requires unsigned"); | |
return numeric_limits<_Tp>::digits - 1 - __countl_zero(__t); | |
} | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool __has_single_bit(_Tp __t) noexcept | |
{ | |
static_assert(__bitop_unsigned_integer<_Tp>::value, "__has_single_bit requires unsigned"); | |
return __t != 0 && (((__t & (__t - 1)) == 0)); | |
} | |
} } | |
namespace std { inline namespace __1 { | |
template <class _T1, class _T2 = _T1> | |
struct __equal_to | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;} | |
}; | |
template <class _T1> | |
struct __equal_to<_T1, _T1> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} | |
}; | |
template <class _T1> | |
struct __equal_to<const _T1, _T1> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} | |
}; | |
template <class _T1> | |
struct __equal_to<_T1, const _T1> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} | |
}; | |
template <class _T1, class _T2 = _T1> | |
struct __less | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;} | |
}; | |
template <class _T1> | |
struct __less<_T1, _T1> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} | |
}; | |
template <class _T1> | |
struct __less<const _T1, _T1> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} | |
}; | |
template <class _T1> | |
struct __less<_T1, const _T1> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} | |
}; | |
template <class _Predicate> | |
class __invert | |
{ | |
private: | |
_Predicate __p_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) __invert() {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
explicit __invert(_Predicate __p) : __p_(__p) {} | |
template <class _T1> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _T1& __x) {return !__p_(__x);} | |
template <class _T1, class _T2> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);} | |
}; | |
template <typename _Integral> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename enable_if | |
< | |
is_integral<_Integral>::value, | |
_Integral | |
>::type | |
__half_positive(_Integral __value) | |
{ | |
return static_cast<_Integral>(static_cast<typename make_unsigned<_Integral>::type>(__value) / 2); | |
} | |
template <typename _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename enable_if | |
< | |
!is_integral<_Tp>::value, | |
_Tp | |
>::type | |
__half_positive(_Tp __value) | |
{ | |
return __value / 2; | |
} | |
template <class _Comp> | |
struct __comp_ref_type { | |
typedef typename add_lvalue_reference<_Comp>::type type; | |
}; | |
template <class _InputIterator, class _Predicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
if (!__pred(*__first)) | |
return false; | |
return true; | |
} | |
template <class _InputIterator, class _Predicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
if (__pred(*__first)) | |
return true; | |
return false; | |
} | |
template <class _InputIterator, class _Predicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
if (__pred(*__first)) | |
return false; | |
return true; | |
} | |
template <class _InputIterator, class _Function> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Function | |
for_each(_InputIterator __first, _InputIterator __last, _Function __f) | |
{ | |
for (; __first != __last; ++__first) | |
__f(*__first); | |
return __f; | |
} | |
template <class _InputIterator, class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_InputIterator | |
find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) | |
{ | |
for (; __first != __last; ++__first) | |
if (*__first == __value_) | |
break; | |
return __first; | |
} | |
template <class _InputIterator, class _Predicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_InputIterator | |
find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
if (__pred(*__first)) | |
break; | |
return __first; | |
} | |
template<class _InputIterator, class _Predicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_InputIterator | |
find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
if (!__pred(*__first)) | |
break; | |
return __first; | |
} | |
template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> | |
_ForwardIterator1 | |
__find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, | |
forward_iterator_tag, forward_iterator_tag) | |
{ | |
_ForwardIterator1 __r = __last1; | |
if (__first2 == __last2) | |
return __r; | |
while (true) | |
{ | |
while (true) | |
{ | |
if (__first1 == __last1) | |
return __r; | |
if (__pred(*__first1, *__first2)) | |
break; | |
++__first1; | |
} | |
_ForwardIterator1 __m1 = __first1; | |
_ForwardIterator2 __m2 = __first2; | |
while (true) | |
{ | |
if (++__m2 == __last2) | |
{ | |
__r = __first1; | |
++__first1; | |
break; | |
} | |
if (++__m1 == __last1) | |
return __r; | |
if (!__pred(*__m1, *__m2)) | |
{ | |
++__first1; | |
break; | |
} | |
} | |
} | |
} | |
template <class _BinaryPredicate, class _BidirectionalIterator1, class _BidirectionalIterator2> | |
_BidirectionalIterator1 | |
__find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, | |
_BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BinaryPredicate __pred, | |
bidirectional_iterator_tag, bidirectional_iterator_tag) | |
{ | |
if (__first2 == __last2) | |
return __last1; | |
_BidirectionalIterator1 __l1 = __last1; | |
_BidirectionalIterator2 __l2 = __last2; | |
--__l2; | |
while (true) | |
{ | |
while (true) | |
{ | |
if (__first1 == __l1) | |
return __last1; | |
if (__pred(*--__l1, *__l2)) | |
break; | |
} | |
_BidirectionalIterator1 __m1 = __l1; | |
_BidirectionalIterator2 __m2 = __l2; | |
while (true) | |
{ | |
if (__m2 == __first2) | |
return __m1; | |
if (__m1 == __first1) | |
return __last1; | |
if (!__pred(*--__m1, *--__m2)) | |
{ | |
break; | |
} | |
} | |
} | |
} | |
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> | |
constexpr _RandomAccessIterator1 | |
__find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, | |
_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, | |
random_access_iterator_tag, random_access_iterator_tag) | |
{ | |
typename iterator_traits<_RandomAccessIterator2>::difference_type __len2 = __last2 - __first2; | |
if (__len2 == 0) | |
return __last1; | |
typename iterator_traits<_RandomAccessIterator1>::difference_type __len1 = __last1 - __first1; | |
if (__len1 < __len2) | |
return __last1; | |
const _RandomAccessIterator1 __s = __first1 + (__len2 - 1); | |
_RandomAccessIterator1 __l1 = __last1; | |
_RandomAccessIterator2 __l2 = __last2; | |
--__l2; | |
while (true) | |
{ | |
while (true) | |
{ | |
if (__s == __l1) | |
return __last1; | |
if (__pred(*--__l1, *__l2)) | |
break; | |
} | |
_RandomAccessIterator1 __m1 = __l1; | |
_RandomAccessIterator2 __m2 = __l2; | |
while (true) | |
{ | |
if (__m2 == __first2) | |
return __m1; | |
if (!__pred(*--__m1, *--__m2)) | |
{ | |
break; | |
} | |
} | |
} | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator1 | |
find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) | |
{ | |
return std::__1::__find_end<typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first1, __last1, __first2, __last2, __pred, | |
typename iterator_traits<_ForwardIterator1>::iterator_category(), | |
typename iterator_traits<_ForwardIterator2>::iterator_category()); | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator1 | |
find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2) | |
{ | |
typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; | |
typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; | |
return std::__1::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> | |
constexpr _ForwardIterator1 | |
__find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) | |
{ | |
for (; __first1 != __last1; ++__first1) | |
for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) | |
if (__pred(*__first1, *__j)) | |
return __first1; | |
return __last1; | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator1 | |
find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) | |
{ | |
return std::__1::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred); | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator1 | |
find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2) | |
{ | |
typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; | |
typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; | |
return std::__1::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); | |
} | |
template <class _ForwardIterator, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) | |
{ | |
if (__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
while (++__i != __last) | |
{ | |
if (__pred(*__first, *__i)) | |
return __first; | |
__first = __i; | |
} | |
} | |
return __last; | |
} | |
template <class _ForwardIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
adjacent_find(_ForwardIterator __first, _ForwardIterator __last) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type __v; | |
return std::__1::adjacent_find(__first, __last, __equal_to<__v>()); | |
} | |
template <class _InputIterator, class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename iterator_traits<_InputIterator>::difference_type | |
count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) | |
{ | |
typename iterator_traits<_InputIterator>::difference_type __r(0); | |
for (; __first != __last; ++__first) | |
if (*__first == __value_) | |
++__r; | |
return __r; | |
} | |
template <class _InputIterator, class _Predicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename iterator_traits<_InputIterator>::difference_type | |
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) | |
{ | |
typename iterator_traits<_InputIterator>::difference_type __r(0); | |
for (; __first != __last; ++__first) | |
if (__pred(*__first)) | |
++__r; | |
return __r; | |
} | |
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair<_InputIterator1, _InputIterator2> | |
mismatch(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _BinaryPredicate __pred) | |
{ | |
for (; __first1 != __last1; ++__first1, (void) ++__first2) | |
if (!__pred(*__first1, *__first2)) | |
break; | |
return pair<_InputIterator1, _InputIterator2>(__first1, __first2); | |
} | |
template <class _InputIterator1, class _InputIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair<_InputIterator1, _InputIterator2> | |
mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) | |
{ | |
typedef typename iterator_traits<_InputIterator1>::value_type __v1; | |
typedef typename iterator_traits<_InputIterator2>::value_type __v2; | |
return std::__1::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>()); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair<_InputIterator1, _InputIterator2> | |
mismatch(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, | |
_BinaryPredicate __pred) | |
{ | |
for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) | |
if (!__pred(*__first1, *__first2)) | |
break; | |
return pair<_InputIterator1, _InputIterator2>(__first1, __first2); | |
} | |
template <class _InputIterator1, class _InputIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair<_InputIterator1, _InputIterator2> | |
mismatch(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2) | |
{ | |
typedef typename iterator_traits<_InputIterator1>::value_type __v1; | |
typedef typename iterator_traits<_InputIterator2>::value_type __v2; | |
return std::__1::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) | |
{ | |
for (; __first1 != __last1; ++__first1, (void) ++__first2) | |
if (!__pred(*__first1, *__first2)) | |
return false; | |
return true; | |
} | |
template <class _InputIterator1, class _InputIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) | |
{ | |
typedef typename iterator_traits<_InputIterator1>::value_type __v1; | |
typedef typename iterator_traits<_InputIterator2>::value_type __v2; | |
return std::__1::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>()); | |
} | |
template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
__equal(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred, | |
input_iterator_tag, input_iterator_tag ) | |
{ | |
for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) | |
if (!__pred(*__first1, *__first2)) | |
return false; | |
return __first1 == __last1 && __first2 == __last2; | |
} | |
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, | |
_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, | |
random_access_iterator_tag, random_access_iterator_tag ) | |
{ | |
if ( std::__1::distance(__first1, __last1) != std::__1::distance(__first2, __last2)) | |
return false; | |
return std::__1::equal<_RandomAccessIterator1, _RandomAccessIterator2, | |
typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first1, __last1, __first2, __pred ); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
equal(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred ) | |
{ | |
return std::__1::__equal<typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first1, __last1, __first2, __last2, __pred, | |
typename iterator_traits<_InputIterator1>::iterator_category(), | |
typename iterator_traits<_InputIterator2>::iterator_category()); | |
} | |
template <class _InputIterator1, class _InputIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
equal(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2) | |
{ | |
typedef typename iterator_traits<_InputIterator1>::value_type __v1; | |
typedef typename iterator_traits<_InputIterator2>::value_type __v2; | |
return std::__1::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(), | |
typename iterator_traits<_InputIterator1>::iterator_category(), | |
typename iterator_traits<_InputIterator2>::iterator_category()); | |
} | |
template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> | |
bool | |
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _BinaryPredicate __pred) | |
{ | |
for (; __first1 != __last1; ++__first1, (void) ++__first2) | |
if (!__pred(*__first1, *__first2)) | |
break; | |
if (__first1 == __last1) | |
return true; | |
typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1; | |
_D1 __l1 = std::__1::distance(__first1, __last1); | |
if (__l1 == _D1(1)) | |
return false; | |
_ForwardIterator2 __last2 = std::__1::next(__first2, __l1); | |
for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) | |
{ | |
_ForwardIterator1 __match = __first1; | |
for (; __match != __i; ++__match) | |
if (__pred(*__match, *__i)) | |
break; | |
if (__match == __i) { | |
_D1 __c2 = 0; | |
for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) | |
if (__pred(*__i, *__j)) | |
++__c2; | |
if (__c2 == 0) | |
return false; | |
_D1 __c1 = 1; | |
for (_ForwardIterator1 __j = std::__1::next(__i); __j != __last1; ++__j) | |
if (__pred(*__i, *__j)) | |
++__c1; | |
if (__c1 != __c2) | |
return false; | |
} | |
} | |
return true; | |
} | |
template<class _ForwardIterator1, class _ForwardIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2) | |
{ | |
typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; | |
typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; | |
return std::__1::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>()); | |
} | |
template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> | |
bool | |
__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2, | |
_BinaryPredicate __pred, | |
forward_iterator_tag, forward_iterator_tag ) | |
{ | |
for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) | |
if (!__pred(*__first1, *__first2)) | |
break; | |
if (__first1 == __last1) | |
return __first2 == __last2; | |
else if (__first2 == __last2) | |
return false; | |
typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1; | |
_D1 __l1 = std::__1::distance(__first1, __last1); | |
typedef typename iterator_traits<_ForwardIterator2>::difference_type _D2; | |
_D2 __l2 = std::__1::distance(__first2, __last2); | |
if (__l1 != __l2) | |
return false; | |
for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) | |
{ | |
_ForwardIterator1 __match = __first1; | |
for (; __match != __i; ++__match) | |
if (__pred(*__match, *__i)) | |
break; | |
if (__match == __i) { | |
_D1 __c2 = 0; | |
for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) | |
if (__pred(*__i, *__j)) | |
++__c2; | |
if (__c2 == 0) | |
return false; | |
_D1 __c1 = 1; | |
for (_ForwardIterator1 __j = std::__1::next(__i); __j != __last1; ++__j) | |
if (__pred(*__i, *__j)) | |
++__c1; | |
if (__c1 != __c2) | |
return false; | |
} | |
} | |
return true; | |
} | |
template<class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> | |
bool | |
__is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1, | |
_RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2, | |
_BinaryPredicate __pred, | |
random_access_iterator_tag, random_access_iterator_tag ) | |
{ | |
if ( std::__1::distance(__first1, __last1) != std::__1::distance(__first2, __last2)) | |
return false; | |
return std::__1::is_permutation<_RandomAccessIterator1, _RandomAccessIterator2, | |
typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first1, __last1, __first2, __pred ); | |
} | |
template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2, | |
_BinaryPredicate __pred ) | |
{ | |
return std::__1::__is_permutation<typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first1, __last1, __first2, __last2, __pred, | |
typename iterator_traits<_ForwardIterator1>::iterator_category(), | |
typename iterator_traits<_ForwardIterator2>::iterator_category()); | |
} | |
template<class _ForwardIterator1, class _ForwardIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2) | |
{ | |
typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; | |
typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; | |
return std::__1::__is_permutation(__first1, __last1, __first2, __last2, | |
__equal_to<__v1, __v2>(), | |
typename iterator_traits<_ForwardIterator1>::iterator_category(), | |
typename iterator_traits<_ForwardIterator2>::iterator_category()); | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator1 | |
search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) | |
{ | |
return std::__1::__search<typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first1, __last1, __first2, __last2, __pred, | |
typename iterator_traits<_ForwardIterator1>::iterator_category(), | |
typename iterator_traits<_ForwardIterator2>::iterator_category()) | |
.first; | |
} | |
template <class _ForwardIterator1, class _ForwardIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator1 | |
search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, | |
_ForwardIterator2 __first2, _ForwardIterator2 __last2) | |
{ | |
typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; | |
typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; | |
return std::__1::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); | |
} | |
template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp> | |
_ForwardIterator | |
__search_n(_ForwardIterator __first, _ForwardIterator __last, | |
_Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag) | |
{ | |
if (__count <= 0) | |
return __first; | |
while (true) | |
{ | |
while (true) | |
{ | |
if (__first == __last) | |
return __last; | |
if (__pred(*__first, __value_)) | |
break; | |
++__first; | |
} | |
_ForwardIterator __m = __first; | |
_Size __c(0); | |
while (true) | |
{ | |
if (++__c == __count) | |
return __first; | |
if (++__m == __last) | |
return __last; | |
if (!__pred(*__m, __value_)) | |
{ | |
__first = __m; | |
++__first; | |
break; | |
} | |
} | |
} | |
} | |
template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp> | |
_RandomAccessIterator | |
__search_n(_RandomAccessIterator __first, _RandomAccessIterator __last, | |
_Size __count, const _Tp& __value_, _BinaryPredicate __pred, random_access_iterator_tag) | |
{ | |
if (__count <= 0) | |
return __first; | |
_Size __len = static_cast<_Size>(__last - __first); | |
if (__len < __count) | |
return __last; | |
const _RandomAccessIterator __s = __last - (__count - 1); | |
while (true) | |
{ | |
while (true) | |
{ | |
if (__first >= __s) | |
return __last; | |
if (__pred(*__first, __value_)) | |
break; | |
++__first; | |
} | |
_RandomAccessIterator __m = __first; | |
_Size __c(0); | |
while (true) | |
{ | |
if (++__c == __count) | |
return __first; | |
++__m; | |
if (!__pred(*__m, __value_)) | |
{ | |
__first = __m; | |
++__first; | |
break; | |
} | |
} | |
} | |
} | |
template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
search_n(_ForwardIterator __first, _ForwardIterator __last, | |
_Size __count, const _Tp& __value_, _BinaryPredicate __pred) | |
{ | |
return std::__1::__search_n<typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first, __last, std::__1::__convert_to_integral(__count), __value_, __pred, | |
typename iterator_traits<_ForwardIterator>::iterator_category()); | |
} | |
template <class _ForwardIterator, class _Size, class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type __v; | |
return std::__1::search_n(__first, __last, std::__1::__convert_to_integral(__count), | |
__value_, __equal_to<__v, _Tp>()); | |
} | |
template <class _Iter> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Iter | |
__unwrap_iter(_Iter __i) | |
{ | |
return __i; | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename enable_if | |
< | |
is_trivially_copy_assignable<_Tp>::value, | |
_Tp* | |
>::type | |
__unwrap_iter(move_iterator<_Tp*> __i) | |
{ | |
return __i.base(); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename enable_if | |
< | |
is_trivially_copy_assignable<_Tp>::value, | |
_Tp* | |
>::type | |
__unwrap_iter(__wrap_iter<_Tp*> __i) | |
{ | |
return __i.base(); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
typename enable_if | |
< | |
is_trivially_copy_assignable<_Tp>::value, | |
const _Tp* | |
>::type | |
__unwrap_iter(__wrap_iter<const _Tp*> __i) | |
{ | |
return __i.base(); | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__copy_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
for (; __first != __last; ++__first, (void) ++__result) | |
*__result = *__first; | |
return __result; | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
return std::__1::__copy_constexpr(__first, __last, __result); | |
} | |
template <class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_same<typename remove_const<_Tp>::type, _Up>::value && | |
is_trivially_copy_assignable<_Up>::value, | |
_Up* | |
>::type | |
__copy(_Tp* __first, _Tp* __last, _Up* __result) | |
{ | |
const size_t __n = static_cast<size_t>(__last - __first); | |
if (__n > 0) | |
std::__1::memmove(__result, __first, __n * sizeof(_Up)); | |
return __result + __n; | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
if (__libcpp_is_constant_evaluated()) { | |
return std::__1::__copy_constexpr( | |
std::__1::__unwrap_iter(__first), std::__1::__unwrap_iter(__last), std::__1::__unwrap_iter(__result)); | |
} else { | |
return std::__1::__copy( | |
std::__1::__unwrap_iter(__first), std::__1::__unwrap_iter(__last), std::__1::__unwrap_iter(__result)); | |
} | |
} | |
template <class _BidirectionalIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__copy_backward_constexpr(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) | |
{ | |
while (__first != __last) | |
*--__result = *--__last; | |
return __result; | |
} | |
template <class _BidirectionalIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) | |
{ | |
return std::__1::__copy_backward_constexpr(__first, __last, __result); | |
} | |
template <class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_same<typename remove_const<_Tp>::type, _Up>::value && | |
is_trivially_copy_assignable<_Up>::value, | |
_Up* | |
>::type | |
__copy_backward(_Tp* __first, _Tp* __last, _Up* __result) | |
{ | |
const size_t __n = static_cast<size_t>(__last - __first); | |
if (__n > 0) | |
{ | |
__result -= __n; | |
std::__1::memmove(__result, __first, __n * sizeof(_Up)); | |
} | |
return __result; | |
} | |
template <class _BidirectionalIterator1, class _BidirectionalIterator2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_BidirectionalIterator2 | |
copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, | |
_BidirectionalIterator2 __result) | |
{ | |
if (__libcpp_is_constant_evaluated()) { | |
return std::__1::__copy_backward_constexpr(std::__1::__unwrap_iter(__first), | |
std::__1::__unwrap_iter(__last), | |
std::__1::__unwrap_iter(__result)); | |
} else { | |
return std::__1::__copy_backward(std::__1::__unwrap_iter(__first), | |
std::__1::__unwrap_iter(__last), | |
std::__1::__unwrap_iter(__result)); | |
} | |
} | |
template<class _InputIterator, class _OutputIterator, class _Predicate> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
copy_if(_InputIterator __first, _InputIterator __last, | |
_OutputIterator __result, _Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
{ | |
if (__pred(*__first)) | |
{ | |
*__result = *__first; | |
++__result; | |
} | |
} | |
return __result; | |
} | |
template<class _InputIterator, class _Size, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
__is_cpp17_input_iterator<_InputIterator>::value && | |
!__is_cpp17_random_access_iterator<_InputIterator>::value, | |
_OutputIterator | |
>::type | |
copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) | |
{ | |
typedef decltype(std::__1::__convert_to_integral(__orig_n)) _IntegralSize; | |
_IntegralSize __n = __orig_n; | |
if (__n > 0) | |
{ | |
*__result = *__first; | |
++__result; | |
for (--__n; __n > 0; --__n) | |
{ | |
++__first; | |
*__result = *__first; | |
++__result; | |
} | |
} | |
return __result; | |
} | |
template<class _InputIterator, class _Size, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
__is_cpp17_random_access_iterator<_InputIterator>::value, | |
_OutputIterator | |
>::type | |
copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) | |
{ | |
typedef decltype(std::__1::__convert_to_integral(__orig_n)) _IntegralSize; | |
_IntegralSize __n = __orig_n; | |
return std::__1::copy(__first, __first + __n, __result); | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__move_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
for (; __first != __last; ++__first, (void) ++__result) | |
*__result = std::__1::move(*__first); | |
return __result; | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
return std::__1::__move_constexpr(__first, __last, __result); | |
} | |
template <class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_same<typename remove_const<_Tp>::type, _Up>::value && | |
is_trivially_copy_assignable<_Up>::value, | |
_Up* | |
>::type | |
__move(_Tp* __first, _Tp* __last, _Up* __result) | |
{ | |
if (__libcpp_is_constant_evaluated()) | |
return std::__1::__move_constexpr(__first, __last, __result); | |
const size_t __n = static_cast<size_t>(__last - __first); | |
if (__n > 0) | |
std::__1::memmove(__result, __first, __n * sizeof(_Up)); | |
return __result + __n; | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
return std::__1::__move(std::__1::__unwrap_iter(__first), std::__1::__unwrap_iter(__last), std::__1::__unwrap_iter(__result)); | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__move_backward_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
while (__first != __last) | |
*--__result = std::__1::move(*--__last); | |
return __result; | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
return std::__1::__move_backward_constexpr(__first, __last, __result); | |
} | |
template <class _Tp, class _Up> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
typename enable_if | |
< | |
is_same<typename remove_const<_Tp>::type, _Up>::value && | |
is_trivially_copy_assignable<_Up>::value, | |
_Up* | |
>::type | |
__move_backward(_Tp* __first, _Tp* __last, _Up* __result) | |
{ | |
if (__libcpp_is_constant_evaluated()) | |
return std::__1::__move_backward_constexpr(__first, __last, __result); | |
const size_t __n = static_cast<size_t>(__last - __first); | |
if (__n > 0) | |
{ | |
__result -= __n; | |
std::__1::memmove(__result, __first, __n * sizeof(_Up)); | |
} | |
return __result; | |
} | |
template <class _BidirectionalIterator1, class _BidirectionalIterator2> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_BidirectionalIterator2 | |
move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, | |
_BidirectionalIterator2 __result) | |
{ | |
return std::__1::__move_backward(std::__1::__unwrap_iter(__first), std::__1::__unwrap_iter(__last), std::__1::__unwrap_iter(__result)); | |
} | |
template <class _InputIterator, class _OutputIterator, class _UnaryOperation> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op) | |
{ | |
for (; __first != __last; ++__first, (void) ++__result) | |
*__result = __op(*__first); | |
return __result; | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, | |
_OutputIterator __result, _BinaryOperation __binary_op) | |
{ | |
for (; __first1 != __last1; ++__first1, (void) ++__first2, ++__result) | |
*__result = __binary_op(*__first1, *__first2); | |
return __result; | |
} | |
template <class _ForwardIterator, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value) | |
{ | |
for (; __first != __last; ++__first) | |
if (*__first == __old_value) | |
*__first = __new_value; | |
} | |
template <class _ForwardIterator, class _Predicate, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value) | |
{ | |
for (; __first != __last; ++__first) | |
if (__pred(*__first)) | |
*__first = __new_value; | |
} | |
template <class _InputIterator, class _OutputIterator, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, | |
const _Tp& __old_value, const _Tp& __new_value) | |
{ | |
for (; __first != __last; ++__first, (void) ++__result) | |
if (*__first == __old_value) | |
*__result = __new_value; | |
else | |
*__result = *__first; | |
return __result; | |
} | |
template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, | |
_Predicate __pred, const _Tp& __new_value) | |
{ | |
for (; __first != __last; ++__first, (void) ++__result) | |
if (__pred(*__first)) | |
*__result = __new_value; | |
else | |
*__result = *__first; | |
return __result; | |
} | |
template <class _OutputIterator, class _Size, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) | |
{ | |
for (; __n > 0; ++__first, (void) --__n) | |
*__first = __value_; | |
return __first; | |
} | |
template <class _OutputIterator, class _Size, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) | |
{ | |
return std::__1::__fill_n(__first, std::__1::__convert_to_integral(__n), __value_); | |
} | |
template <class _ForwardIterator, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag) | |
{ | |
for (; __first != __last; ++__first) | |
*__first = __value_; | |
} | |
template <class _RandomAccessIterator, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag) | |
{ | |
std::__1::fill_n(__first, __last - __first, __value_); | |
} | |
template <class _ForwardIterator, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) | |
{ | |
std::__1::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category()); | |
} | |
template <class _ForwardIterator, class _Generator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) | |
{ | |
for (; __first != __last; ++__first) | |
*__first = __gen(); | |
} | |
template <class _OutputIterator, class _Size, class _Generator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) | |
{ | |
typedef decltype(std::__1::__convert_to_integral(__orig_n)) _IntegralSize; | |
_IntegralSize __n = __orig_n; | |
for (; __n > 0; ++__first, (void) --__n) | |
*__first = __gen(); | |
return __first; | |
} | |
template <class _ForwardIterator, class _Tp> | |
_ForwardIterator | |
remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) | |
{ | |
__first = std::__1::find(__first, __last, __value_); | |
if (__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
while (++__i != __last) | |
{ | |
if (!(*__i == __value_)) | |
{ | |
*__first = std::__1::move(*__i); | |
++__first; | |
} | |
} | |
} | |
return __first; | |
} | |
template <class _ForwardIterator, class _Predicate> | |
_ForwardIterator | |
remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) | |
{ | |
__first = std::__1::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type> | |
(__first, __last, __pred); | |
if (__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
while (++__i != __last) | |
{ | |
if (!__pred(*__i)) | |
{ | |
*__first = std::__1::move(*__i); | |
++__first; | |
} | |
} | |
} | |
return __first; | |
} | |
template <class _InputIterator, class _OutputIterator, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_) | |
{ | |
for (; __first != __last; ++__first) | |
{ | |
if (!(*__first == __value_)) | |
{ | |
*__result = *__first; | |
++__result; | |
} | |
} | |
return __result; | |
} | |
template <class _InputIterator, class _OutputIterator, class _Predicate> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
{ | |
if (!__pred(*__first)) | |
{ | |
*__result = *__first; | |
++__result; | |
} | |
} | |
return __result; | |
} | |
template <class _ForwardIterator, class _BinaryPredicate> | |
_ForwardIterator | |
unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) | |
{ | |
__first = std::__1::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first, __last, __pred); | |
if (__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
for (++__i; ++__i != __last;) | |
if (!__pred(*__first, *__i)) | |
*++__first = std::__1::move(*__i); | |
++__first; | |
} | |
return __first; | |
} | |
template <class _ForwardIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
unique(_ForwardIterator __first, _ForwardIterator __last) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type __v; | |
return std::__1::unique(__first, __last, __equal_to<__v>()); | |
} | |
template <class _BinaryPredicate, class _InputIterator, class _OutputIterator> | |
_OutputIterator | |
__unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred, | |
input_iterator_tag, output_iterator_tag) | |
{ | |
if (__first != __last) | |
{ | |
typename iterator_traits<_InputIterator>::value_type __t(*__first); | |
*__result = __t; | |
++__result; | |
while (++__first != __last) | |
{ | |
if (!__pred(__t, *__first)) | |
{ | |
__t = *__first; | |
*__result = __t; | |
++__result; | |
} | |
} | |
} | |
return __result; | |
} | |
template <class _BinaryPredicate, class _ForwardIterator, class _OutputIterator> | |
_OutputIterator | |
__unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred, | |
forward_iterator_tag, output_iterator_tag) | |
{ | |
if (__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
*__result = *__i; | |
++__result; | |
while (++__first != __last) | |
{ | |
if (!__pred(*__i, *__first)) | |
{ | |
*__result = *__first; | |
++__result; | |
__i = __first; | |
} | |
} | |
} | |
return __result; | |
} | |
template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator> | |
_ForwardIterator | |
__unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred, | |
input_iterator_tag, forward_iterator_tag) | |
{ | |
if (__first != __last) | |
{ | |
*__result = *__first; | |
while (++__first != __last) | |
if (!__pred(*__result, *__first)) | |
*++__result = *__first; | |
++__result; | |
} | |
return __result; | |
} | |
template <class _InputIterator, class _OutputIterator, class _BinaryPredicate> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred) | |
{ | |
return std::__1::__unique_copy<typename add_lvalue_reference<_BinaryPredicate>::type> | |
(__first, __last, __result, __pred, | |
typename iterator_traits<_InputIterator>::iterator_category(), | |
typename iterator_traits<_OutputIterator>::iterator_category()); | |
} | |
template <class _InputIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) | |
{ | |
typedef typename iterator_traits<_InputIterator>::value_type __v; | |
return std::__1::unique_copy(__first, __last, __result, __equal_to<__v>()); | |
} | |
template <class _BidirectionalIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag) | |
{ | |
while (__first != __last) | |
{ | |
if (__first == --__last) | |
break; | |
std::__1::iter_swap(__first, __last); | |
++__first; | |
} | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag) | |
{ | |
if (__first != __last) | |
for (; __first < --__last; ++__first) | |
std::__1::iter_swap(__first, __last); | |
} | |
template <class _BidirectionalIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | |
{ | |
std::__1::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_category()); | |
} | |
template <class _BidirectionalIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) | |
{ | |
for (; __first != __last; ++__result) | |
*__result = *--__last; | |
return __result; | |
} | |
template <class _ForwardIterator> | |
constexpr _ForwardIterator | |
__rotate_left(_ForwardIterator __first, _ForwardIterator __last) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type value_type; | |
value_type __tmp = std::__1::move(*__first); | |
_ForwardIterator __lm1 = std::__1::move(std::__1::next(__first), __last, __first); | |
*__lm1 = std::__1::move(__tmp); | |
return __lm1; | |
} | |
template <class _BidirectionalIterator> | |
constexpr _BidirectionalIterator | |
__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last) | |
{ | |
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; | |
_BidirectionalIterator __lm1 = std::__1::prev(__last); | |
value_type __tmp = std::__1::move(*__lm1); | |
_BidirectionalIterator __fp1 = std::__1::move_backward(__first, __lm1, __last); | |
*__first = std::__1::move(__tmp); | |
return __fp1; | |
} | |
template <class _ForwardIterator> | |
_ForwardIterator | |
__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last) | |
{ | |
_ForwardIterator __i = __middle; | |
while (true) | |
{ | |
swap(*__first, *__i); | |
++__first; | |
if (++__i == __last) | |
break; | |
if (__first == __middle) | |
__middle = __i; | |
} | |
_ForwardIterator __r = __first; | |
if (__first != __middle) | |
{ | |
__i = __middle; | |
while (true) | |
{ | |
swap(*__first, *__i); | |
++__first; | |
if (++__i == __last) | |
{ | |
if (__first == __middle) | |
break; | |
__i = __middle; | |
} | |
else if (__first == __middle) | |
__middle = __i; | |
} | |
} | |
return __r; | |
} | |
template<typename _Integral> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_Integral | |
__algo_gcd(_Integral __x, _Integral __y) | |
{ | |
do | |
{ | |
_Integral __t = __x % __y; | |
__x = __y; | |
__y = __t; | |
} while (__y); | |
return __x; | |
} | |
template<typename _RandomAccessIterator> | |
_RandomAccessIterator | |
__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
const difference_type __m1 = __middle - __first; | |
const difference_type __m2 = __last - __middle; | |
if (__m1 == __m2) | |
{ | |
std::__1::swap_ranges(__first, __middle, __middle); | |
return __middle; | |
} | |
const difference_type __g = std::__1::__algo_gcd(__m1, __m2); | |
for (_RandomAccessIterator __p = __first + __g; __p != __first;) | |
{ | |
value_type __t(std::__1::move(*--__p)); | |
_RandomAccessIterator __p1 = __p; | |
_RandomAccessIterator __p2 = __p1 + __m1; | |
do | |
{ | |
*__p1 = std::__1::move(*__p2); | |
__p1 = __p2; | |
const difference_type __d = __last - __p2; | |
if (__m1 < __d) | |
__p2 += __m1; | |
else | |
__p2 = __first + (__m1 - __d); | |
} while (__p2 != __p); | |
*__p1 = std::__1::move(__t); | |
} | |
return __first + __m2; | |
} | |
template <class _ForwardIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _ForwardIterator | |
__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, | |
std::__1::forward_iterator_tag) | |
{ | |
typedef typename std::__1::iterator_traits<_ForwardIterator>::value_type value_type; | |
if (std::__1::is_trivially_move_assignable<value_type>::value) | |
{ | |
if (std::__1::next(__first) == __middle) | |
return std::__1::__rotate_left(__first, __last); | |
} | |
return std::__1::__rotate_forward(__first, __middle, __last); | |
} | |
template <class _BidirectionalIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _BidirectionalIterator | |
__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, | |
std::__1::bidirectional_iterator_tag) | |
{ | |
typedef typename std::__1::iterator_traits<_BidirectionalIterator>::value_type value_type; | |
if (std::__1::is_trivially_move_assignable<value_type>::value) | |
{ | |
if (std::__1::next(__first) == __middle) | |
return std::__1::__rotate_left(__first, __last); | |
if (std::__1::next(__middle) == __last) | |
return std::__1::__rotate_right(__first, __last); | |
} | |
return std::__1::__rotate_forward(__first, __middle, __last); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr _RandomAccessIterator | |
__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, | |
std::__1::random_access_iterator_tag) | |
{ | |
typedef typename std::__1::iterator_traits<_RandomAccessIterator>::value_type value_type; | |
if (std::__1::is_trivially_move_assignable<value_type>::value) | |
{ | |
if (std::__1::next(__first) == __middle) | |
return std::__1::__rotate_left(__first, __last); | |
if (std::__1::next(__middle) == __last) | |
return std::__1::__rotate_right(__first, __last); | |
return std::__1::__rotate_gcd(__first, __middle, __last); | |
} | |
return std::__1::__rotate_forward(__first, __middle, __last); | |
} | |
template <class _ForwardIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last) | |
{ | |
if (__first == __middle) | |
return __last; | |
if (__middle == __last) | |
return __first; | |
return std::__1::__rotate(__first, __middle, __last, | |
typename std::__1::iterator_traits<_ForwardIterator>::iterator_category()); | |
} | |
template <class _ForwardIterator, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result) | |
{ | |
return std::__1::copy(__first, __middle, std::__1::copy(__middle, __last, __result)); | |
} | |
template <class _ForwardIterator, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_ForwardIterator | |
min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) | |
{ | |
static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, | |
"std::min_element requires a ForwardIterator"); | |
if (__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
while (++__i != __last) | |
if (__comp(*__i, *__first)) | |
__first = __i; | |
} | |
return __first; | |
} | |
template <class _ForwardIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_ForwardIterator | |
min_element(_ForwardIterator __first, _ForwardIterator __last) | |
{ | |
return std::__1::min_element(__first, __last, | |
__less<typename iterator_traits<_ForwardIterator>::value_type>()); | |
} | |
template <class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _Tp& | |
min(const _Tp& __a, const _Tp& __b, _Compare __comp) | |
{ | |
return __comp(__b, __a) ? __b : __a; | |
} | |
template <class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _Tp& | |
min(const _Tp& __a, const _Tp& __b) | |
{ | |
return std::__1::min(__a, __b, __less<_Tp>()); | |
} | |
template<class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp | |
min(initializer_list<_Tp> __t, _Compare __comp) | |
{ | |
return *std::__1::min_element(__t.begin(), __t.end(), __comp); | |
} | |
template<class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp | |
min(initializer_list<_Tp> __t) | |
{ | |
return *std::__1::min_element(__t.begin(), __t.end(), __less<_Tp>()); | |
} | |
template <class _ForwardIterator, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_ForwardIterator | |
max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) | |
{ | |
static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, | |
"std::max_element requires a ForwardIterator"); | |
if (__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
while (++__i != __last) | |
if (__comp(*__first, *__i)) | |
__first = __i; | |
} | |
return __first; | |
} | |
template <class _ForwardIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_ForwardIterator | |
max_element(_ForwardIterator __first, _ForwardIterator __last) | |
{ | |
return std::__1::max_element(__first, __last, | |
__less<typename iterator_traits<_ForwardIterator>::value_type>()); | |
} | |
template <class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _Tp& | |
max(const _Tp& __a, const _Tp& __b, _Compare __comp) | |
{ | |
return __comp(__a, __b) ? __b : __a; | |
} | |
template <class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
const _Tp& | |
max(const _Tp& __a, const _Tp& __b) | |
{ | |
return std::__1::max(__a, __b, __less<_Tp>()); | |
} | |
template<class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp | |
max(initializer_list<_Tp> __t, _Compare __comp) | |
{ | |
return *std::__1::max_element(__t.begin(), __t.end(), __comp); | |
} | |
template<class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
_Tp | |
max(initializer_list<_Tp> __t) | |
{ | |
return *std::__1::max_element(__t.begin(), __t.end(), __less<_Tp>()); | |
} | |
template <class _ForwardIterator, class _Compare> | |
constexpr | |
pair<_ForwardIterator, _ForwardIterator> | |
minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) | |
{ | |
static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, | |
"std::minmax_element requires a ForwardIterator"); | |
pair<_ForwardIterator, _ForwardIterator> __result(__first, __first); | |
if (__first != __last) | |
{ | |
if (++__first != __last) | |
{ | |
if (__comp(*__first, *__result.first)) | |
__result.first = __first; | |
else | |
__result.second = __first; | |
while (++__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
if (++__first == __last) | |
{ | |
if (__comp(*__i, *__result.first)) | |
__result.first = __i; | |
else if (!__comp(*__i, *__result.second)) | |
__result.second = __i; | |
break; | |
} | |
else | |
{ | |
if (__comp(*__first, *__i)) | |
{ | |
if (__comp(*__first, *__result.first)) | |
__result.first = __first; | |
if (!__comp(*__i, *__result.second)) | |
__result.second = __i; | |
} | |
else | |
{ | |
if (__comp(*__i, *__result.first)) | |
__result.first = __i; | |
if (!__comp(*__first, *__result.second)) | |
__result.second = __first; | |
} | |
} | |
} | |
} | |
} | |
return __result; | |
} | |
template <class _ForwardIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair<_ForwardIterator, _ForwardIterator> | |
minmax_element(_ForwardIterator __first, _ForwardIterator __last) | |
{ | |
return std::__1::minmax_element(__first, __last, | |
__less<typename iterator_traits<_ForwardIterator>::value_type>()); | |
} | |
template<class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair<const _Tp&, const _Tp&> | |
minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) | |
{ | |
return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) : | |
pair<const _Tp&, const _Tp&>(__a, __b); | |
} | |
template<class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair<const _Tp&, const _Tp&> | |
minmax(const _Tp& __a, const _Tp& __b) | |
{ | |
return std::__1::minmax(__a, __b, __less<_Tp>()); | |
} | |
template<class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair<_Tp, _Tp> | |
minmax(initializer_list<_Tp> __t, _Compare __comp) | |
{ | |
typedef typename initializer_list<_Tp>::const_iterator _Iter; | |
_Iter __first = __t.begin(); | |
_Iter __last = __t.end(); | |
pair<_Tp, _Tp> __result(*__first, *__first); | |
++__first; | |
if (__t.size() % 2 == 0) | |
{ | |
if (__comp(*__first, __result.first)) | |
__result.first = *__first; | |
else | |
__result.second = *__first; | |
++__first; | |
} | |
while (__first != __last) | |
{ | |
_Tp __prev = *__first++; | |
if (__comp(*__first, __prev)) { | |
if ( __comp(*__first, __result.first)) __result.first = *__first; | |
if (!__comp(__prev, __result.second)) __result.second = __prev; | |
} | |
else { | |
if ( __comp(__prev, __result.first)) __result.first = __prev; | |
if (!__comp(*__first, __result.second)) __result.second = *__first; | |
} | |
__first++; | |
} | |
return __result; | |
} | |
template<class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
pair<_Tp, _Tp> | |
minmax(initializer_list<_Tp> __t) | |
{ | |
return std::__1::minmax(__t, __less<_Tp>()); | |
} | |
template <unsigned long long _Xp, size_t _Rp> | |
struct __log2_imp | |
{ | |
static const size_t value = _Xp & ((unsigned long long)(1) << _Rp) ? _Rp | |
: __log2_imp<_Xp, _Rp - 1>::value; | |
}; | |
template <unsigned long long _Xp> | |
struct __log2_imp<_Xp, 0> | |
{ | |
static const size_t value = 0; | |
}; | |
template <size_t _Rp> | |
struct __log2_imp<0, _Rp> | |
{ | |
static const size_t value = _Rp + 1; | |
}; | |
template <class _UIntType, _UIntType _Xp> | |
struct __log2 | |
{ | |
static const size_t value = __log2_imp<_Xp, | |
sizeof(_UIntType) * 8 - 1>::value; | |
}; | |
template<class _Engine, class _UIntType> | |
class __independent_bits_engine | |
{ | |
public: | |
typedef _UIntType result_type; | |
private: | |
typedef typename _Engine::result_type _Engine_result_type; | |
typedef typename conditional | |
< | |
sizeof(_Engine_result_type) <= sizeof(result_type), | |
result_type, | |
_Engine_result_type | |
>::type _Working_result_type; | |
_Engine& __e_; | |
size_t __w_; | |
size_t __w0_; | |
size_t __n_; | |
size_t __n0_; | |
_Working_result_type __y0_; | |
_Working_result_type __y1_; | |
_Engine_result_type __mask0_; | |
_Engine_result_type __mask1_; | |
static constexpr const _Working_result_type _Rp = _Engine::max() - _Engine::min() | |
+ _Working_result_type(1); | |
static constexpr const size_t __m = __log2<_Working_result_type, _Rp>::value; | |
static constexpr const size_t _WDt = numeric_limits<_Working_result_type>::digits; | |
static constexpr const size_t _EDt = numeric_limits<_Engine_result_type>::digits; | |
public: | |
__independent_bits_engine(_Engine& __e, size_t __w); | |
result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} | |
private: | |
result_type __eval(false_type); | |
result_type __eval(true_type); | |
}; | |
template<class _Engine, class _UIntType> | |
__independent_bits_engine<_Engine, _UIntType> | |
::__independent_bits_engine(_Engine& __e, size_t __w) | |
: __e_(__e), | |
__w_(__w) | |
{ | |
__n_ = __w_ / __m + (__w_ % __m != 0); | |
__w0_ = __w_ / __n_; | |
if (_Rp == 0) | |
__y0_ = _Rp; | |
else if (__w0_ < _WDt) | |
__y0_ = (_Rp >> __w0_) << __w0_; | |
else | |
__y0_ = 0; | |
if (_Rp - __y0_ > __y0_ / __n_) | |
{ | |
++__n_; | |
__w0_ = __w_ / __n_; | |
if (__w0_ < _WDt) | |
__y0_ = (_Rp >> __w0_) << __w0_; | |
else | |
__y0_ = 0; | |
} | |
__n0_ = __n_ - __w_ % __n_; | |
if (__w0_ < _WDt - 1) | |
__y1_ = (_Rp >> (__w0_ + 1)) << (__w0_ + 1); | |
else | |
__y1_ = 0; | |
__mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) : | |
_Engine_result_type(0); | |
__mask1_ = __w0_ < _EDt - 1 ? | |
_Engine_result_type(~0) >> (_EDt - (__w0_ + 1)) : | |
_Engine_result_type(~0); | |
} | |
template<class _Engine, class _UIntType> | |
inline | |
_UIntType | |
__independent_bits_engine<_Engine, _UIntType>::__eval(false_type) | |
{ | |
return static_cast<result_type>(__e_() & __mask0_); | |
} | |
template<class _Engine, class _UIntType> | |
_UIntType | |
__independent_bits_engine<_Engine, _UIntType>::__eval(true_type) | |
{ | |
const size_t _WRt = numeric_limits<result_type>::digits; | |
result_type _Sp = 0; | |
for (size_t __k = 0; __k < __n0_; ++__k) | |
{ | |
_Engine_result_type __u; | |
do | |
{ | |
__u = __e_() - _Engine::min(); | |
} while (__u >= __y0_); | |
if (__w0_ < _WRt) | |
_Sp <<= __w0_; | |
else | |
_Sp = 0; | |
_Sp += __u & __mask0_; | |
} | |
for (size_t __k = __n0_; __k < __n_; ++__k) | |
{ | |
_Engine_result_type __u; | |
do | |
{ | |
__u = __e_() - _Engine::min(); | |
} while (__u >= __y1_); | |
if (__w0_ < _WRt - 1) | |
_Sp <<= __w0_ + 1; | |
else | |
_Sp = 0; | |
_Sp += __u & __mask1_; | |
} | |
return _Sp; | |
} | |
template<class _IntType = int> | |
class uniform_int_distribution | |
{ | |
public: | |
typedef _IntType result_type; | |
class param_type | |
{ | |
result_type __a_; | |
result_type __b_; | |
public: | |
typedef uniform_int_distribution distribution_type; | |
explicit param_type(result_type __a = 0, | |
result_type __b = numeric_limits<result_type>::max()) | |
: __a_(__a), __b_(__b) {} | |
result_type a() const {return __a_;} | |
result_type b() const {return __b_;} | |
friend bool operator==(const param_type& __x, const param_type& __y) | |
{return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;} | |
friend bool operator!=(const param_type& __x, const param_type& __y) | |
{return !(__x == __y);} | |
}; | |
private: | |
param_type __p_; | |
public: | |
uniform_int_distribution() : uniform_int_distribution(0) {} | |
explicit uniform_int_distribution( | |
result_type __a, result_type __b = numeric_limits<result_type>::max()) | |
: __p_(param_type(__a, __b)) {} | |
explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {} | |
void reset() {} | |
template<class _URNG> result_type operator()(_URNG& __g) | |
{return (*this)(__g, __p_);} | |
template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); | |
result_type a() const {return __p_.a();} | |
result_type b() const {return __p_.b();} | |
param_type param() const {return __p_;} | |
void param(const param_type& __p) {__p_ = __p;} | |
result_type min() const {return a();} | |
result_type max() const {return b();} | |
friend bool operator==(const uniform_int_distribution& __x, | |
const uniform_int_distribution& __y) | |
{return __x.__p_ == __y.__p_;} | |
friend bool operator!=(const uniform_int_distribution& __x, | |
const uniform_int_distribution& __y) | |
{return !(__x == __y);} | |
}; | |
template<class _IntType> | |
template<class _URNG> | |
typename uniform_int_distribution<_IntType>::result_type | |
uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p) | |
__attribute__((__no_sanitize__("unsigned-integer-overflow"))) | |
{ | |
typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t), | |
uint32_t, uint64_t>::type _UIntType; | |
const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1); | |
if (_Rp == 1) | |
return __p.a(); | |
const size_t _Dt = numeric_limits<_UIntType>::digits; | |
typedef __independent_bits_engine<_URNG, _UIntType> _Eng; | |
if (_Rp == 0) | |
return static_cast<result_type>(_Eng(__g, _Dt)()); | |
size_t __w = _Dt - __libcpp_clz(_Rp) - 1; | |
if ((_Rp & (numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0) | |
++__w; | |
_Eng __e(__g, __w); | |
_UIntType __u; | |
do | |
{ | |
__u = __e(); | |
} while (__u >= _Rp); | |
return static_cast<result_type>(__u + __p.a()); | |
} | |
class __attribute__ ((__visibility__("default"))) __rs_default; | |
__attribute__ ((__visibility__("default"))) __rs_default __rs_get(); | |
class __attribute__ ((__visibility__("default"))) __rs_default | |
{ | |
static unsigned __c_; | |
__rs_default(); | |
public: | |
typedef uint_fast32_t result_type; | |
static const result_type _Min = 0; | |
static const result_type _Max = 0xFFFFFFFF; | |
__rs_default(const __rs_default&); | |
~__rs_default(); | |
result_type operator()(); | |
static constexpr result_type min() {return _Min;} | |
static constexpr result_type max() {return _Max;} | |
friend __attribute__ ((__visibility__("default"))) __rs_default __rs_get(); | |
}; | |
__attribute__ ((__visibility__("default"))) __rs_default __rs_get(); | |
template <class _RandomAccessIterator> | |
__attribute__ ((deprecated)) void | |
random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
typedef uniform_int_distribution<ptrdiff_t> _Dp; | |
typedef typename _Dp::param_type _Pp; | |
difference_type __d = __last - __first; | |
if (__d > 1) | |
{ | |
_Dp __uid; | |
__rs_default __g = __rs_get(); | |
for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d) | |
{ | |
difference_type __i = __uid(__g, _Pp(0, __d)); | |
if (__i != difference_type(0)) | |
swap(*__first, *(__first + __i)); | |
} | |
} | |
} | |
template <class _RandomAccessIterator, class _RandomNumberGenerator> | |
__attribute__ ((deprecated)) void | |
random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, | |
_RandomNumberGenerator&& __rand) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
difference_type __d = __last - __first; | |
if (__d > 1) | |
{ | |
for (--__last; __first < __last; ++__first, (void) --__d) | |
{ | |
difference_type __i = __rand(__d); | |
if (__i != difference_type(0)) | |
swap(*__first, *(__first + __i)); | |
} | |
} | |
} | |
template <class _PopulationIterator, class _SampleIterator, class _Distance, | |
class _UniformRandomNumberGenerator> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_SampleIterator __sample(_PopulationIterator __first, | |
_PopulationIterator __last, _SampleIterator __output_iter, | |
_Distance __n, | |
_UniformRandomNumberGenerator & __g, | |
input_iterator_tag) { | |
_Distance __k = 0; | |
for (; __first != __last && __k < __n; ++__first, (void) ++__k) | |
__output_iter[__k] = *__first; | |
_Distance __sz = __k; | |
for (; __first != __last; ++__first, (void) ++__k) { | |
_Distance __r = std::__1::uniform_int_distribution<_Distance>(0, __k)(__g); | |
if (__r < __sz) | |
__output_iter[__r] = *__first; | |
} | |
return __output_iter + std::__1::min(__n, __k); | |
} | |
template <class _PopulationIterator, class _SampleIterator, class _Distance, | |
class _UniformRandomNumberGenerator> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_SampleIterator __sample(_PopulationIterator __first, | |
_PopulationIterator __last, _SampleIterator __output_iter, | |
_Distance __n, | |
_UniformRandomNumberGenerator& __g, | |
forward_iterator_tag) { | |
_Distance __unsampled_sz = std::__1::distance(__first, __last); | |
for (__n = std::__1::min(__n, __unsampled_sz); __n != 0; ++__first) { | |
_Distance __r = | |
std::__1::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g); | |
if (__r < __n) { | |
*__output_iter++ = *__first; | |
--__n; | |
} | |
} | |
return __output_iter; | |
} | |
template <class _PopulationIterator, class _SampleIterator, class _Distance, | |
class _UniformRandomNumberGenerator> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_SampleIterator __sample(_PopulationIterator __first, | |
_PopulationIterator __last, _SampleIterator __output_iter, | |
_Distance __n, _UniformRandomNumberGenerator& __g) { | |
typedef typename iterator_traits<_PopulationIterator>::iterator_category | |
_PopCategory; | |
typedef typename iterator_traits<_PopulationIterator>::difference_type | |
_Difference; | |
static_assert(__is_cpp17_forward_iterator<_PopulationIterator>::value || | |
__is_cpp17_random_access_iterator<_SampleIterator>::value, | |
"SampleIterator must meet the requirements of RandomAccessIterator"); | |
typedef typename common_type<_Distance, _Difference>::type _CommonType; | |
((void)0); | |
return std::__1::__sample( | |
__first, __last, __output_iter, _CommonType(__n), | |
__g, _PopCategory()); | |
} | |
template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> | |
void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, | |
_UniformRandomNumberGenerator&& __g) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
typedef uniform_int_distribution<ptrdiff_t> _Dp; | |
typedef typename _Dp::param_type _Pp; | |
difference_type __d = __last - __first; | |
if (__d > 1) | |
{ | |
_Dp __uid; | |
for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d) | |
{ | |
difference_type __i = __uid(__g, _Pp(0, __d)); | |
if (__i != difference_type(0)) | |
swap(*__first, *(__first + __i)); | |
} | |
} | |
} | |
template <class _InputIterator, class _Predicate> | |
bool | |
is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
if (!__pred(*__first)) | |
break; | |
if ( __first == __last ) | |
return true; | |
++__first; | |
for (; __first != __last; ++__first) | |
if (__pred(*__first)) | |
return false; | |
return true; | |
} | |
template <class _Predicate, class _ForwardIterator> | |
_ForwardIterator | |
__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag) | |
{ | |
while (true) | |
{ | |
if (__first == __last) | |
return __first; | |
if (!__pred(*__first)) | |
break; | |
++__first; | |
} | |
for (_ForwardIterator __p = __first; ++__p != __last;) | |
{ | |
if (__pred(*__p)) | |
{ | |
swap(*__first, *__p); | |
++__first; | |
} | |
} | |
return __first; | |
} | |
template <class _Predicate, class _BidirectionalIterator> | |
_BidirectionalIterator | |
__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, | |
bidirectional_iterator_tag) | |
{ | |
while (true) | |
{ | |
while (true) | |
{ | |
if (__first == __last) | |
return __first; | |
if (!__pred(*__first)) | |
break; | |
++__first; | |
} | |
do | |
{ | |
if (__first == --__last) | |
return __first; | |
} while (!__pred(*__last)); | |
swap(*__first, *__last); | |
++__first; | |
} | |
} | |
template <class _ForwardIterator, class _Predicate> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) | |
{ | |
return std::__1::__partition<typename add_lvalue_reference<_Predicate>::type> | |
(__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category()); | |
} | |
template <class _InputIterator, class _OutputIterator1, | |
class _OutputIterator2, class _Predicate> | |
pair<_OutputIterator1, _OutputIterator2> | |
partition_copy(_InputIterator __first, _InputIterator __last, | |
_OutputIterator1 __out_true, _OutputIterator2 __out_false, | |
_Predicate __pred) | |
{ | |
for (; __first != __last; ++__first) | |
{ | |
if (__pred(*__first)) | |
{ | |
*__out_true = *__first; | |
++__out_true; | |
} | |
else | |
{ | |
*__out_false = *__first; | |
++__out_false; | |
} | |
} | |
return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false); | |
} | |
template<class _ForwardIterator, class _Predicate> | |
_ForwardIterator | |
partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; | |
difference_type __len = std::__1::distance(__first, __last); | |
while (__len != 0) | |
{ | |
difference_type __l2 = std::__1::__half_positive(__len); | |
_ForwardIterator __m = __first; | |
std::__1::advance(__m, __l2); | |
if (__pred(*__m)) | |
{ | |
__first = ++__m; | |
__len -= __l2 + 1; | |
} | |
else | |
__len = __l2; | |
} | |
return __first; | |
} | |
template <class _Predicate, class _ForwardIterator, class _Distance, class _Pair> | |
_ForwardIterator | |
__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, | |
_Distance __len, _Pair __p, forward_iterator_tag __fit) | |
{ | |
if (__len == 1) | |
return __first; | |
if (__len == 2) | |
{ | |
_ForwardIterator __m = __first; | |
if (__pred(*++__m)) | |
{ | |
swap(*__first, *__m); | |
return __m; | |
} | |
return __first; | |
} | |
if (__len <= __p.second) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::value_type value_type; | |
__destruct_n __d(0); | |
unique_ptr<value_type, __destruct_n&> __h(__p.first, __d); | |
value_type* __t = __p.first; | |
::new ((void*)__t) value_type(std::__1::move(*__first)); | |
__d.template __incr<value_type>(); | |
++__t; | |
_ForwardIterator __i = __first; | |
while (++__i != __last) | |
{ | |
if (__pred(*__i)) | |
{ | |
*__first = std::__1::move(*__i); | |
++__first; | |
} | |
else | |
{ | |
::new ((void*)__t) value_type(std::__1::move(*__i)); | |
__d.template __incr<value_type>(); | |
++__t; | |
} | |
} | |
__i = __first; | |
for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i) | |
*__i = std::__1::move(*__t2); | |
return __first; | |
} | |
_ForwardIterator __m = __first; | |
_Distance __len2 = __len / 2; | |
std::__1::advance(__m, __len2); | |
typedef typename add_lvalue_reference<_Predicate>::type _PredRef; | |
_ForwardIterator __first_false = std::__1::__stable_partition<_PredRef>(__first, __m, __pred, __len2, __p, __fit); | |
_ForwardIterator __m1 = __m; | |
_ForwardIterator __second_false = __last; | |
_Distance __len_half = __len - __len2; | |
while (__pred(*__m1)) | |
{ | |
if (++__m1 == __last) | |
goto __second_half_done; | |
--__len_half; | |
} | |
__second_false = std::__1::__stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit); | |
__second_half_done: | |
return std::__1::rotate(__first_false, __m, __second_false); | |
} | |
struct __return_temporary_buffer | |
{ | |
template <class _Tp> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void operator()(_Tp* __p) const {std::__1::return_temporary_buffer(__p);} | |
}; | |
template <class _Predicate, class _ForwardIterator> | |
_ForwardIterator | |
__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, | |
forward_iterator_tag) | |
{ | |
const unsigned __alloc_limit = 3; | |
while (true) | |
{ | |
if (__first == __last) | |
return __first; | |
if (!__pred(*__first)) | |
break; | |
++__first; | |
} | |
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; | |
typedef typename iterator_traits<_ForwardIterator>::value_type value_type; | |
difference_type __len = std::__1::distance(__first, __last); | |
pair<value_type*, ptrdiff_t> __p(0, 0); | |
unique_ptr<value_type, __return_temporary_buffer> __h; | |
if (__len >= __alloc_limit) | |
{ | |
__p = std::__1::get_temporary_buffer<value_type>(__len); | |
__h.reset(__p.first); | |
} | |
return std::__1::__stable_partition<typename add_lvalue_reference<_Predicate>::type> | |
(__first, __last, __pred, __len, __p, forward_iterator_tag()); | |
} | |
template <class _Predicate, class _BidirectionalIterator, class _Distance, class _Pair> | |
_BidirectionalIterator | |
__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, | |
_Distance __len, _Pair __p, bidirectional_iterator_tag __bit) | |
{ | |
if (__len == 2) | |
{ | |
swap(*__first, *__last); | |
return __last; | |
} | |
if (__len == 3) | |
{ | |
_BidirectionalIterator __m = __first; | |
if (__pred(*++__m)) | |
{ | |
swap(*__first, *__m); | |
swap(*__m, *__last); | |
return __last; | |
} | |
swap(*__m, *__last); | |
swap(*__first, *__m); | |
return __m; | |
} | |
if (__len <= __p.second) | |
{ | |
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; | |
__destruct_n __d(0); | |
unique_ptr<value_type, __destruct_n&> __h(__p.first, __d); | |
value_type* __t = __p.first; | |
::new ((void*)__t) value_type(std::__1::move(*__first)); | |
__d.template __incr<value_type>(); | |
++__t; | |
_BidirectionalIterator __i = __first; | |
while (++__i != __last) | |
{ | |
if (__pred(*__i)) | |
{ | |
*__first = std::__1::move(*__i); | |
++__first; | |
} | |
else | |
{ | |
::new ((void*)__t) value_type(std::__1::move(*__i)); | |
__d.template __incr<value_type>(); | |
++__t; | |
} | |
} | |
*__first = std::__1::move(*__i); | |
__i = ++__first; | |
for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i) | |
*__i = std::__1::move(*__t2); | |
return __first; | |
} | |
_BidirectionalIterator __m = __first; | |
_Distance __len2 = __len / 2; | |
std::__1::advance(__m, __len2); | |
_BidirectionalIterator __m1 = __m; | |
_BidirectionalIterator __first_false = __first; | |
_Distance __len_half = __len2; | |
while (!__pred(*--__m1)) | |
{ | |
if (__m1 == __first) | |
goto __first_half_done; | |
--__len_half; | |
} | |
typedef typename add_lvalue_reference<_Predicate>::type _PredRef; | |
__first_false = std::__1::__stable_partition<_PredRef>(__first, __m1, __pred, __len_half, __p, __bit); | |
__first_half_done: | |
__m1 = __m; | |
_BidirectionalIterator __second_false = __last; | |
++__second_false; | |
__len_half = __len - __len2; | |
while (__pred(*__m1)) | |
{ | |
if (++__m1 == __last) | |
goto __second_half_done; | |
--__len_half; | |
} | |
__second_false = std::__1::__stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __bit); | |
__second_half_done: | |
return std::__1::rotate(__first_false, __m, __second_false); | |
} | |
template <class _Predicate, class _BidirectionalIterator> | |
_BidirectionalIterator | |
__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, | |
bidirectional_iterator_tag) | |
{ | |
typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; | |
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; | |
const difference_type __alloc_limit = 4; | |
while (true) | |
{ | |
if (__first == __last) | |
return __first; | |
if (!__pred(*__first)) | |
break; | |
++__first; | |
} | |
do | |
{ | |
if (__first == --__last) | |
return __first; | |
} while (!__pred(*__last)); | |
difference_type __len = std::__1::distance(__first, __last) + 1; | |
pair<value_type*, ptrdiff_t> __p(0, 0); | |
unique_ptr<value_type, __return_temporary_buffer> __h; | |
if (__len >= __alloc_limit) | |
{ | |
__p = std::__1::get_temporary_buffer<value_type>(__len); | |
__h.reset(__p.first); | |
} | |
return std::__1::__stable_partition<typename add_lvalue_reference<_Predicate>::type> | |
(__first, __last, __pred, __len, __p, bidirectional_iterator_tag()); | |
} | |
template <class _ForwardIterator, class _Predicate> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) | |
{ | |
return std::__1::__stable_partition<typename add_lvalue_reference<_Predicate>::type> | |
(__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category()); | |
} | |
template <class _ForwardIterator, class _Compare> | |
_ForwardIterator | |
is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) | |
{ | |
if (__first != __last) | |
{ | |
_ForwardIterator __i = __first; | |
while (++__i != __last) | |
{ | |
if (__comp(*__i, *__first)) | |
return __i; | |
__first = __i; | |
} | |
} | |
return __last; | |
} | |
template<class _ForwardIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) | |
{ | |
return std::__1::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>()); | |
} | |
template <class _ForwardIterator, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) | |
{ | |
return std::__1::is_sorted_until(__first, __last, __comp) == __last; | |
} | |
template<class _ForwardIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
is_sorted(_ForwardIterator __first, _ForwardIterator __last) | |
{ | |
return std::__1::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>()); | |
} | |
template <class _Compare, class _ForwardIterator> | |
unsigned | |
__sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z, _Compare __c) | |
{ | |
unsigned __r = 0; | |
if (!__c(*__y, *__x)) | |
{ | |
if (!__c(*__z, *__y)) | |
return __r; | |
swap(*__y, *__z); | |
__r = 1; | |
if (__c(*__y, *__x)) | |
{ | |
swap(*__x, *__y); | |
__r = 2; | |
} | |
return __r; | |
} | |
if (__c(*__z, *__y)) | |
{ | |
swap(*__x, *__z); | |
__r = 1; | |
return __r; | |
} | |
swap(*__x, *__y); | |
__r = 1; | |
if (__c(*__z, *__y)) | |
{ | |
swap(*__y, *__z); | |
__r = 2; | |
} | |
return __r; | |
} | |
template <class _Compare, class _ForwardIterator> | |
unsigned | |
__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, | |
_ForwardIterator __x4, _Compare __c) | |
{ | |
unsigned __r = std::__1::__sort3<_Compare>(__x1, __x2, __x3, __c); | |
if (__c(*__x4, *__x3)) | |
{ | |
swap(*__x3, *__x4); | |
++__r; | |
if (__c(*__x3, *__x2)) | |
{ | |
swap(*__x2, *__x3); | |
++__r; | |
if (__c(*__x2, *__x1)) | |
{ | |
swap(*__x1, *__x2); | |
++__r; | |
} | |
} | |
} | |
return __r; | |
} | |
template <class _Compare, class _ForwardIterator> | |
LDIONNE_HIDDEN | |
unsigned | |
__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, | |
_ForwardIterator __x4, _ForwardIterator __x5, _Compare __c) | |
{ | |
unsigned __r = std::__1::__sort4<_Compare>(__x1, __x2, __x3, __x4, __c); | |
if (__c(*__x5, *__x4)) | |
{ | |
swap(*__x4, *__x5); | |
++__r; | |
if (__c(*__x4, *__x3)) | |
{ | |
swap(*__x3, *__x4); | |
++__r; | |
if (__c(*__x3, *__x2)) | |
{ | |
swap(*__x2, *__x3); | |
++__r; | |
if (__c(*__x2, *__x1)) | |
{ | |
swap(*__x1, *__x2); | |
++__r; | |
} | |
} | |
} | |
} | |
return __r; | |
} | |
template <class _Compare, class _BidirectionalIterator> | |
void | |
__selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) | |
{ | |
_BidirectionalIterator __lm1 = __last; | |
for (--__lm1; __first != __lm1; ++__first) | |
{ | |
_BidirectionalIterator __i = std::__1::min_element<_BidirectionalIterator, | |
typename add_lvalue_reference<_Compare>::type> | |
(__first, __last, __comp); | |
if (__i != __first) | |
swap(*__first, *__i); | |
} | |
} | |
template <class _Compare, class _BidirectionalIterator> | |
void | |
__insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; | |
if (__first != __last) | |
{ | |
_BidirectionalIterator __i = __first; | |
for (++__i; __i != __last; ++__i) | |
{ | |
_BidirectionalIterator __j = __i; | |
value_type __t(std::__1::move(*__j)); | |
for (_BidirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j) | |
*__j = std::__1::move(*__k); | |
*__j = std::__1::move(__t); | |
} | |
} | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
_RandomAccessIterator __j = __first+2; | |
std::__1::__sort3<_Compare>(__first, __first+1, __j, __comp); | |
for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i) | |
{ | |
if (__comp(*__i, *__j)) | |
{ | |
value_type __t(std::__1::move(*__i)); | |
_RandomAccessIterator __k = __j; | |
__j = __i; | |
do | |
{ | |
*__j = std::__1::move(*__k); | |
__j = __k; | |
} while (__j != __first && __comp(__t, *--__k)); | |
*__j = std::__1::move(__t); | |
} | |
__j = __i; | |
} | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
bool | |
__insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
switch (__last - __first) | |
{ | |
case 0: | |
case 1: | |
return true; | |
case 2: | |
if (__comp(*--__last, *__first)) | |
swap(*__first, *__last); | |
return true; | |
case 3: | |
std::__1::__sort3<_Compare>(__first, __first+1, --__last, __comp); | |
return true; | |
case 4: | |
std::__1::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp); | |
return true; | |
case 5: | |
std::__1::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp); | |
return true; | |
} | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
_RandomAccessIterator __j = __first+2; | |
std::__1::__sort3<_Compare>(__first, __first+1, __j, __comp); | |
const unsigned __limit = 8; | |
unsigned __count = 0; | |
for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i) | |
{ | |
if (__comp(*__i, *__j)) | |
{ | |
value_type __t(std::__1::move(*__i)); | |
_RandomAccessIterator __k = __j; | |
__j = __i; | |
do | |
{ | |
*__j = std::__1::move(*__k); | |
__j = __k; | |
} while (__j != __first && __comp(__t, *--__k)); | |
*__j = std::__1::move(__t); | |
if (++__count == __limit) | |
return ++__i == __last; | |
} | |
__j = __i; | |
} | |
return true; | |
} | |
template <class _Compare, class _BidirectionalIterator> | |
void | |
__insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1, | |
typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; | |
if (__first1 != __last1) | |
{ | |
__destruct_n __d(0); | |
unique_ptr<value_type, __destruct_n&> __h(__first2, __d); | |
value_type* __last2 = __first2; | |
::new ((void*)__last2) value_type(std::__1::move(*__first1)); | |
__d.template __incr<value_type>(); | |
for (++__last2; ++__first1 != __last1; ++__last2) | |
{ | |
value_type* __j2 = __last2; | |
value_type* __i2 = __j2; | |
if (__comp(*__first1, *--__i2)) | |
{ | |
::new ((void*)__j2) value_type(std::__1::move(*__i2)); | |
__d.template __incr<value_type>(); | |
for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2) | |
*__j2 = std::__1::move(*__i2); | |
*__j2 = std::__1::move(*__first1); | |
} | |
else | |
{ | |
::new ((void*)__j2) value_type(std::__1::move(*__first1)); | |
__d.template __incr<value_type>(); | |
} | |
} | |
__h.release(); | |
} | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
const difference_type __limit = is_trivially_copy_constructible<value_type>::value && | |
is_trivially_copy_assignable<value_type>::value ? 30 : 6; | |
while (true) | |
{ | |
__restart: | |
difference_type __len = __last - __first; | |
switch (__len) | |
{ | |
case 0: | |
case 1: | |
return; | |
case 2: | |
if (__comp(*--__last, *__first)) | |
swap(*__first, *__last); | |
return; | |
case 3: | |
std::__1::__sort3<_Compare>(__first, __first+1, --__last, __comp); | |
return; | |
case 4: | |
std::__1::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp); | |
return; | |
case 5: | |
std::__1::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp); | |
return; | |
} | |
if (__len <= __limit) | |
{ | |
std::__1::__insertion_sort_3<_Compare>(__first, __last, __comp); | |
return; | |
} | |
_RandomAccessIterator __m = __first; | |
_RandomAccessIterator __lm1 = __last; | |
--__lm1; | |
unsigned __n_swaps; | |
{ | |
difference_type __delta; | |
if (__len >= 1000) | |
{ | |
__delta = __len/2; | |
__m += __delta; | |
__delta /= 2; | |
__n_swaps = std::__1::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp); | |
} | |
else | |
{ | |
__delta = __len/2; | |
__m += __delta; | |
__n_swaps = std::__1::__sort3<_Compare>(__first, __m, __lm1, __comp); | |
} | |
} | |
_RandomAccessIterator __i = __first; | |
_RandomAccessIterator __j = __lm1; | |
if (!__comp(*__i, *__m)) | |
{ | |
while (true) | |
{ | |
if (__i == --__j) | |
{ | |
++__i; | |
__j = __last; | |
if (!__comp(*__first, *--__j)) | |
{ | |
while (true) | |
{ | |
if (__i == __j) | |
return; | |
if (__comp(*__first, *__i)) | |
{ | |
swap(*__i, *__j); | |
++__n_swaps; | |
++__i; | |
break; | |
} | |
++__i; | |
} | |
} | |
if (__i == __j) | |
return; | |
while (true) | |
{ | |
while (!__comp(*__first, *__i)) | |
++__i; | |
while (__comp(*__first, *--__j)) | |
; | |
if (__i >= __j) | |
break; | |
swap(*__i, *__j); | |
++__n_swaps; | |
++__i; | |
} | |
__first = __i; | |
goto __restart; | |
} | |
if (__comp(*__j, *__m)) | |
{ | |
swap(*__i, *__j); | |
++__n_swaps; | |
break; | |
} | |
} | |
} | |
++__i; | |
if (__i < __j) | |
{ | |
while (true) | |
{ | |
while (__comp(*__i, *__m)) | |
++__i; | |
while (!__comp(*--__j, *__m)) | |
; | |
if (__i > __j) | |
break; | |
swap(*__i, *__j); | |
++__n_swaps; | |
if (__m == __i) | |
__m = __j; | |
++__i; | |
} | |
} | |
if (__i != __m && __comp(*__m, *__i)) | |
{ | |
swap(*__i, *__m); | |
++__n_swaps; | |
} | |
if (__n_swaps == 0) | |
{ | |
bool __fs = std::__1::__insertion_sort_incomplete<_Compare>(__first, __i, __comp); | |
if (std::__1::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp)) | |
{ | |
if (__fs) | |
return; | |
__last = __i; | |
continue; | |
} | |
else | |
{ | |
if (__fs) | |
{ | |
__first = ++__i; | |
continue; | |
} | |
} | |
} | |
if (__i - __first < __last - __i) | |
{ | |
std::__1::__sort<_Compare>(__first, __i, __comp); | |
__first = ++__i; | |
} | |
else | |
{ | |
std::__1::__sort<_Compare>(__i+1, __last, __comp); | |
__last = __i; | |
} | |
} | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
std::__1::__sort<_Comp_ref>(__first, __last, _Comp_ref(__comp)); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
std::__1::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
sort(_Tp** __first, _Tp** __last) | |
{ | |
std::__1::sort((uintptr_t*)__first, (uintptr_t*)__last, __less<uintptr_t>()); | |
} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last) | |
{ | |
std::__1::sort(__first.base(), __last.base()); | |
} | |
template <class _Tp, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp) | |
{ | |
typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
std::__1::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp); | |
} | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<char>&, char*>(char*, char*, __less<char>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<short>&, short*>(short*, short*, __less<short>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<int>&, int*>(int*, int*, __less<int>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<long>&, long*>(long*, long*, __less<long>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<float>&, float*>(float*, float*, __less<float>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<double>&, double*>(double*, double*, __less<double>&); | |
extern template __attribute__ ((__visibility__("default"))) void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&); | |
extern template __attribute__ ((__visibility__("default"))) bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&); | |
extern template __attribute__ ((__visibility__("default"))) unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&); | |
template <class _Compare, class _ForwardIterator, class _Tp> | |
_ForwardIterator | |
__lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; | |
difference_type __len = std::__1::distance(__first, __last); | |
while (__len != 0) | |
{ | |
difference_type __l2 = std::__1::__half_positive(__len); | |
_ForwardIterator __m = __first; | |
std::__1::advance(__m, __l2); | |
if (__comp(*__m, __value_)) | |
{ | |
__first = ++__m; | |
__len -= __l2 + 1; | |
} | |
else | |
__len = __l2; | |
} | |
return __first; | |
} | |
template <class _ForwardIterator, class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) | |
{ | |
typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
return std::__1::__lower_bound<_Comp_ref>(__first, __last, __value_, __comp); | |
} | |
template <class _ForwardIterator, class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) | |
{ | |
return std::__1::lower_bound(__first, __last, __value_, | |
__less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); | |
} | |
template <class _Compare, class _ForwardIterator, class _Tp> | |
_ForwardIterator | |
__upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; | |
difference_type __len = std::__1::distance(__first, __last); | |
while (__len != 0) | |
{ | |
difference_type __l2 = std::__1::__half_positive(__len); | |
_ForwardIterator __m = __first; | |
std::__1::advance(__m, __l2); | |
if (__comp(__value_, *__m)) | |
__len = __l2; | |
else | |
{ | |
__first = ++__m; | |
__len -= __l2 + 1; | |
} | |
} | |
return __first; | |
} | |
template <class _ForwardIterator, class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) | |
{ | |
typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
return std::__1::__upper_bound<_Comp_ref>(__first, __last, __value_, __comp); | |
} | |
template <class _ForwardIterator, class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_ForwardIterator | |
upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) | |
{ | |
return std::__1::upper_bound(__first, __last, __value_, | |
__less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>()); | |
} | |
template <class _Compare, class _ForwardIterator, class _Tp> | |
pair<_ForwardIterator, _ForwardIterator> | |
__equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; | |
difference_type __len = std::__1::distance(__first, __last); | |
while (__len != 0) | |
{ | |
difference_type __l2 = std::__1::__half_positive(__len); | |
_ForwardIterator __m = __first; | |
std::__1::advance(__m, __l2); | |
if (__comp(*__m, __value_)) | |
{ | |
__first = ++__m; | |
__len -= __l2 + 1; | |
} | |
else if (__comp(__value_, *__m)) | |
{ | |
__last = __m; | |
__len = __l2; | |
} | |
else | |
{ | |
_ForwardIterator __mp1 = __m; | |
return pair<_ForwardIterator, _ForwardIterator> | |
( | |
std::__1::__lower_bound<_Compare>(__first, __m, __value_, __comp), | |
std::__1::__upper_bound<_Compare>(++__mp1, __last, __value_, __comp) | |
); | |
} | |
} | |
return pair<_ForwardIterator, _ForwardIterator>(__first, __first); | |
} | |
template <class _ForwardIterator, class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair<_ForwardIterator, _ForwardIterator> | |
equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__equal_range<_Comp_ref>(__first, __last, __value_, __comp); | |
} | |
template <class _ForwardIterator, class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
pair<_ForwardIterator, _ForwardIterator> | |
equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) | |
{ | |
return std::__1::equal_range(__first, __last, __value_, | |
__less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); | |
} | |
template <class _Compare, class _ForwardIterator, class _Tp> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) | |
{ | |
__first = std::__1::__lower_bound<_Compare>(__first, __last, __value_, __comp); | |
return __first != __last && !__comp(__value_, *__first); | |
} | |
template <class _ForwardIterator, class _Tp, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__binary_search<_Comp_ref>(__first, __last, __value_, __comp); | |
} | |
template <class _ForwardIterator, class _Tp> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) | |
{ | |
return std::__1::binary_search(__first, __last, __value_, | |
__less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
_OutputIterator | |
__merge(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
for (; __first1 != __last1; ++__result) | |
{ | |
if (__first2 == __last2) | |
return std::__1::copy(__first1, __last1, __result); | |
if (__comp(*__first2, *__first1)) | |
{ | |
*__result = *__first2; | |
++__first2; | |
} | |
else | |
{ | |
*__result = *__first1; | |
++__first1; | |
} | |
} | |
return std::__1::copy(__first2, __last2, __result); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
merge(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
merge(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) | |
{ | |
typedef typename iterator_traits<_InputIterator1>::value_type __v1; | |
typedef typename iterator_traits<_InputIterator2>::value_type __v2; | |
return std::__1::merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2, | |
class _OutputIterator> | |
void __half_inplace_merge(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, | |
_OutputIterator __result, _Compare __comp) | |
{ | |
for (; __first1 != __last1; ++__result) | |
{ | |
if (__first2 == __last2) | |
{ | |
std::__1::move(__first1, __last1, __result); | |
return; | |
} | |
if (__comp(*__first2, *__first1)) | |
{ | |
*__result = std::__1::move(*__first2); | |
++__first2; | |
} | |
else | |
{ | |
*__result = std::__1::move(*__first1); | |
++__first1; | |
} | |
} | |
} | |
template <class _Compare, class _BidirectionalIterator> | |
void | |
__buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, | |
_Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1, | |
typename iterator_traits<_BidirectionalIterator>::difference_type __len2, | |
typename iterator_traits<_BidirectionalIterator>::value_type* __buff) | |
{ | |
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; | |
__destruct_n __d(0); | |
unique_ptr<value_type, __destruct_n&> __h2(__buff, __d); | |
if (__len1 <= __len2) | |
{ | |
value_type* __p = __buff; | |
for (_BidirectionalIterator __i = __first; __i != __middle; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p) | |
::new ((void*)__p) value_type(std::__1::move(*__i)); | |
std::__1::__half_inplace_merge<_Compare>(__buff, __p, __middle, __last, __first, __comp); | |
} | |
else | |
{ | |
value_type* __p = __buff; | |
for (_BidirectionalIterator __i = __middle; __i != __last; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p) | |
::new ((void*)__p) value_type(std::__1::move(*__i)); | |
typedef reverse_iterator<_BidirectionalIterator> _RBi; | |
typedef reverse_iterator<value_type*> _Rv; | |
typedef __invert<_Compare> _Inverted; | |
std::__1::__half_inplace_merge<_Inverted>(_Rv(__p), _Rv(__buff), | |
_RBi(__middle), _RBi(__first), | |
_RBi(__last), _Inverted(__comp)); | |
} | |
} | |
template <class _Compare, class _BidirectionalIterator> | |
void | |
__inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, | |
_Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1, | |
typename iterator_traits<_BidirectionalIterator>::difference_type __len2, | |
typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size) | |
{ | |
typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; | |
while (true) | |
{ | |
if (__len2 == 0) | |
return; | |
if (__len1 <= __buff_size || __len2 <= __buff_size) | |
return std::__1::__buffered_inplace_merge<_Compare> | |
(__first, __middle, __last, __comp, __len1, __len2, __buff); | |
for (; true; ++__first, (void) --__len1) | |
{ | |
if (__len1 == 0) | |
return; | |
if (__comp(*__middle, *__first)) | |
break; | |
} | |
_BidirectionalIterator __m1; | |
_BidirectionalIterator __m2; | |
difference_type __len11; | |
difference_type __len21; | |
if (__len1 < __len2) | |
{ | |
__len21 = __len2 / 2; | |
__m2 = __middle; | |
std::__1::advance(__m2, __len21); | |
__m1 = std::__1::__upper_bound<_Compare>(__first, __middle, *__m2, __comp); | |
__len11 = std::__1::distance(__first, __m1); | |
} | |
else | |
{ | |
if (__len1 == 1) | |
{ | |
swap(*__first, *__middle); | |
return; | |
} | |
__len11 = __len1 / 2; | |
__m1 = __first; | |
std::__1::advance(__m1, __len11); | |
__m2 = std::__1::__lower_bound<_Compare>(__middle, __last, *__m1, __comp); | |
__len21 = std::__1::distance(__middle, __m2); | |
} | |
difference_type __len12 = __len1 - __len11; | |
difference_type __len22 = __len2 - __len21; | |
__middle = std::__1::rotate(__m1, __middle, __m2); | |
if (__len11 + __len21 < __len12 + __len22) | |
{ | |
std::__1::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size); | |
__first = __middle; | |
__middle = __m2; | |
__len1 = __len12; | |
__len2 = __len22; | |
} | |
else | |
{ | |
std::__1::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size); | |
__last = __middle; | |
__middle = __m1; | |
__len1 = __len11; | |
__len2 = __len21; | |
} | |
} | |
} | |
template <class _BidirectionalIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, | |
_Compare __comp) | |
{ | |
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; | |
typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; | |
difference_type __len1 = std::__1::distance(__first, __middle); | |
difference_type __len2 = std::__1::distance(__middle, __last); | |
difference_type __buf_size = std::__1::min(__len1, __len2); | |
pair<value_type*, ptrdiff_t> __buf = std::__1::get_temporary_buffer<value_type>(__buf_size); | |
unique_ptr<value_type, __return_temporary_buffer> __h(__buf.first); | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2, | |
__buf.first, __buf.second); | |
} | |
template <class _BidirectionalIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last) | |
{ | |
std::__1::inplace_merge(__first, __middle, __last, | |
__less<typename iterator_traits<_BidirectionalIterator>::value_type>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2> | |
void | |
__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, | |
typename iterator_traits<_InputIterator1>::value_type* __result, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_InputIterator1>::value_type value_type; | |
__destruct_n __d(0); | |
unique_ptr<value_type, __destruct_n&> __h(__result, __d); | |
for (; true; ++__result) | |
{ | |
if (__first1 == __last1) | |
{ | |
for (; __first2 != __last2; ++__first2, ++__result, (void)__d.template __incr<value_type>()) | |
::new ((void*)__result) value_type(std::__1::move(*__first2)); | |
__h.release(); | |
return; | |
} | |
if (__first2 == __last2) | |
{ | |
for (; __first1 != __last1; ++__first1, ++__result, (void)__d.template __incr<value_type>()) | |
::new ((void*)__result) value_type(std::__1::move(*__first1)); | |
__h.release(); | |
return; | |
} | |
if (__comp(*__first2, *__first1)) | |
{ | |
::new ((void*)__result) value_type(std::__1::move(*__first2)); | |
__d.template __incr<value_type>(); | |
++__first2; | |
} | |
else | |
{ | |
::new ((void*)__result) value_type(std::__1::move(*__first1)); | |
__d.template __incr<value_type>(); | |
++__first1; | |
} | |
} | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
void | |
__merge_move_assign(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, | |
_OutputIterator __result, _Compare __comp) | |
{ | |
for (; __first1 != __last1; ++__result) | |
{ | |
if (__first2 == __last2) | |
{ | |
for (; __first1 != __last1; ++__first1, (void) ++__result) | |
*__result = std::__1::move(*__first1); | |
return; | |
} | |
if (__comp(*__first2, *__first1)) | |
{ | |
*__result = std::__1::move(*__first2); | |
++__first2; | |
} | |
else | |
{ | |
*__result = std::__1::move(*__first1); | |
++__first1; | |
} | |
} | |
for (; __first2 != __last2; ++__first2, (void) ++__result) | |
*__result = std::__1::move(*__first2); | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, | |
typename iterator_traits<_RandomAccessIterator>::difference_type __len, | |
typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size); | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1, _Compare __comp, | |
typename iterator_traits<_RandomAccessIterator>::difference_type __len, | |
typename iterator_traits<_RandomAccessIterator>::value_type* __first2) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
switch (__len) | |
{ | |
case 0: | |
return; | |
case 1: | |
::new ((void*)__first2) value_type(std::__1::move(*__first1)); | |
return; | |
case 2: | |
__destruct_n __d(0); | |
unique_ptr<value_type, __destruct_n&> __h2(__first2, __d); | |
if (__comp(*--__last1, *__first1)) | |
{ | |
::new ((void*)__first2) value_type(std::__1::move(*__last1)); | |
__d.template __incr<value_type>(); | |
++__first2; | |
::new ((void*)__first2) value_type(std::__1::move(*__first1)); | |
} | |
else | |
{ | |
::new ((void*)__first2) value_type(std::__1::move(*__first1)); | |
__d.template __incr<value_type>(); | |
++__first2; | |
::new ((void*)__first2) value_type(std::__1::move(*__last1)); | |
} | |
__h2.release(); | |
return; | |
} | |
if (__len <= 8) | |
{ | |
std::__1::__insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp); | |
return; | |
} | |
typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2; | |
_RandomAccessIterator __m = __first1 + __l2; | |
std::__1::__stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2); | |
std::__1::__stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2); | |
std::__1::__merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp); | |
} | |
template <class _Tp> | |
struct __stable_sort_switch | |
{ | |
static const unsigned value = 128*is_trivially_copy_assignable<_Tp>::value; | |
}; | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, | |
typename iterator_traits<_RandomAccessIterator>::difference_type __len, | |
typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
switch (__len) | |
{ | |
case 0: | |
case 1: | |
return; | |
case 2: | |
if (__comp(*--__last, *__first)) | |
swap(*__first, *__last); | |
return; | |
} | |
if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value)) | |
{ | |
std::__1::__insertion_sort<_Compare>(__first, __last, __comp); | |
return; | |
} | |
typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2; | |
_RandomAccessIterator __m = __first + __l2; | |
if (__len <= __buff_size) | |
{ | |
__destruct_n __d(0); | |
unique_ptr<value_type, __destruct_n&> __h2(__buff, __d); | |
std::__1::__stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff); | |
__d.__set(__l2, (value_type*)nullptr); | |
std::__1::__stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2); | |
__d.__set(__len, (value_type*)nullptr); | |
std::__1::__merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp); | |
return; | |
} | |
std::__1::__stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size); | |
std::__1::__stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size); | |
std::__1::__inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size); | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
difference_type __len = __last - __first; | |
pair<value_type*, ptrdiff_t> __buf(0, 0); | |
unique_ptr<value_type, __return_temporary_buffer> __h; | |
if (__len > static_cast<difference_type>(__stable_sort_switch<value_type>::value)) | |
{ | |
__buf = std::__1::get_temporary_buffer<value_type>(__len); | |
__h.reset(__buf.first); | |
} | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
std::__1::__stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
std::__1::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
_RandomAccessIterator | |
is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename std::__1::iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
difference_type __len = __last - __first; | |
difference_type __p = 0; | |
difference_type __c = 1; | |
_RandomAccessIterator __pp = __first; | |
while (__c < __len) | |
{ | |
_RandomAccessIterator __cp = __first + __c; | |
if (__comp(*__pp, *__cp)) | |
return __cp; | |
++__c; | |
++__cp; | |
if (__c == __len) | |
return __last; | |
if (__comp(*__pp, *__cp)) | |
return __cp; | |
++__p; | |
++__pp; | |
__c = 2 * __p + 1; | |
} | |
return __last; | |
} | |
template<class _RandomAccessIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_RandomAccessIterator | |
is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
return std::__1::is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
return std::__1::is_heap_until(__first, __last, __comp) == __last; | |
} | |
template<class _RandomAccessIterator> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
return std::__1::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, | |
typename iterator_traits<_RandomAccessIterator>::difference_type __len) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
if (__len > 1) | |
{ | |
__len = (__len - 2) / 2; | |
_RandomAccessIterator __ptr = __first + __len; | |
if (__comp(*__ptr, *--__last)) | |
{ | |
value_type __t(std::__1::move(*__last)); | |
do | |
{ | |
*__last = std::__1::move(*__ptr); | |
__last = __ptr; | |
if (__len == 0) | |
break; | |
__len = (__len - 1) / 2; | |
__ptr = __first + __len; | |
} while (__comp(*__ptr, __t)); | |
*__last = std::__1::move(__t); | |
} | |
} | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
std::__1::__sift_up<_Comp_ref>(__first, __last, __comp, __last - __first); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
std::__1::push_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__sift_down(_RandomAccessIterator __first, _RandomAccessIterator , | |
_Compare __comp, | |
typename iterator_traits<_RandomAccessIterator>::difference_type __len, | |
_RandomAccessIterator __start) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; | |
difference_type __child = __start - __first; | |
if (__len < 2 || (__len - 2) / 2 < __child) | |
return; | |
__child = 2 * __child + 1; | |
_RandomAccessIterator __child_i = __first + __child; | |
if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) { | |
++__child_i; | |
++__child; | |
} | |
if (__comp(*__child_i, *__start)) | |
return; | |
value_type __top(std::__1::move(*__start)); | |
do | |
{ | |
*__start = std::__1::move(*__child_i); | |
__start = __child_i; | |
if ((__len - 2) / 2 < __child) | |
break; | |
__child = 2 * __child + 1; | |
__child_i = __first + __child; | |
if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) { | |
++__child_i; | |
++__child; | |
} | |
} while (!__comp(*__child_i, __top)); | |
*__start = std::__1::move(__top); | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, | |
typename iterator_traits<_RandomAccessIterator>::difference_type __len) | |
{ | |
if (__len > 1) | |
{ | |
swap(*__first, *--__last); | |
std::__1::__sift_down<_Compare>(__first, __last, __comp, __len - 1, __first); | |
} | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
std::__1::__pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
std::__1::pop_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
difference_type __n = __last - __first; | |
if (__n > 1) | |
{ | |
for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start) | |
{ | |
std::__1::__sift_down<_Compare>(__first, __last, __comp, __n, __first + __start); | |
} | |
} | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
std::__1::__make_heap<_Comp_ref>(__first, __last, __comp); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
std::__1::make_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
for (difference_type __n = __last - __first; __n > 1; --__last, (void) --__n) | |
std::__1::__pop_heap<_Compare>(__first, __last, __comp, __n); | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
std::__1::__sort_heap<_Comp_ref>(__first, __last, __comp); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) | |
{ | |
std::__1::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, | |
_Compare __comp) | |
{ | |
std::__1::__make_heap<_Compare>(__first, __middle, __comp); | |
typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first; | |
for (_RandomAccessIterator __i = __middle; __i != __last; ++__i) | |
{ | |
if (__comp(*__i, *__first)) | |
{ | |
swap(*__i, *__first); | |
std::__1::__sift_down<_Compare>(__first, __middle, __comp, __len, __first); | |
} | |
} | |
std::__1::__sort_heap<_Compare>(__first, __middle, __comp); | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, | |
_Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
std::__1::__partial_sort<_Comp_ref>(__first, __middle, __last, __comp); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) | |
{ | |
std::__1::partial_sort(__first, __middle, __last, | |
__less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Compare, class _InputIterator, class _RandomAccessIterator> | |
_RandomAccessIterator | |
__partial_sort_copy(_InputIterator __first, _InputIterator __last, | |
_RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) | |
{ | |
_RandomAccessIterator __r = __result_first; | |
if (__r != __result_last) | |
{ | |
for (; __first != __last && __r != __result_last; ++__first, (void) ++__r) | |
*__r = *__first; | |
std::__1::__make_heap<_Compare>(__result_first, __r, __comp); | |
typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first; | |
for (; __first != __last; ++__first) | |
if (__comp(*__first, *__result_first)) | |
{ | |
*__result_first = *__first; | |
std::__1::__sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first); | |
} | |
std::__1::__sort_heap<_Compare>(__result_first, __r, __comp); | |
} | |
return __r; | |
} | |
template <class _InputIterator, class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_RandomAccessIterator | |
partial_sort_copy(_InputIterator __first, _InputIterator __last, | |
_RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp); | |
} | |
template <class _InputIterator, class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_RandomAccessIterator | |
partial_sort_copy(_InputIterator __first, _InputIterator __last, | |
_RandomAccessIterator __result_first, _RandomAccessIterator __result_last) | |
{ | |
return std::__1::partial_sort_copy(__first, __last, __result_first, __result_last, | |
__less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Compare, class _RandomAccessIterator> | |
void | |
__nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; | |
const difference_type __limit = 7; | |
while (true) | |
{ | |
__restart: | |
if (__nth == __last) | |
return; | |
difference_type __len = __last - __first; | |
switch (__len) | |
{ | |
case 0: | |
case 1: | |
return; | |
case 2: | |
if (__comp(*--__last, *__first)) | |
swap(*__first, *__last); | |
return; | |
case 3: | |
{ | |
_RandomAccessIterator __m = __first; | |
std::__1::__sort3<_Compare>(__first, ++__m, --__last, __comp); | |
return; | |
} | |
} | |
if (__len <= __limit) | |
{ | |
std::__1::__selection_sort<_Compare>(__first, __last, __comp); | |
return; | |
} | |
_RandomAccessIterator __m = __first + __len/2; | |
_RandomAccessIterator __lm1 = __last; | |
unsigned __n_swaps = std::__1::__sort3<_Compare>(__first, __m, --__lm1, __comp); | |
_RandomAccessIterator __i = __first; | |
_RandomAccessIterator __j = __lm1; | |
if (!__comp(*__i, *__m)) | |
{ | |
while (true) | |
{ | |
if (__i == --__j) | |
{ | |
++__i; | |
__j = __last; | |
if (!__comp(*__first, *--__j)) | |
{ | |
while (true) | |
{ | |
if (__i == __j) | |
return; | |
if (__comp(*__first, *__i)) | |
{ | |
swap(*__i, *__j); | |
++__n_swaps; | |
++__i; | |
break; | |
} | |
++__i; | |
} | |
} | |
if (__i == __j) | |
return; | |
while (true) | |
{ | |
while (!__comp(*__first, *__i)) | |
++__i; | |
while (__comp(*__first, *--__j)) | |
; | |
if (__i >= __j) | |
break; | |
swap(*__i, *__j); | |
++__n_swaps; | |
++__i; | |
} | |
if (__nth < __i) | |
return; | |
__first = __i; | |
goto __restart; | |
} | |
if (__comp(*__j, *__m)) | |
{ | |
swap(*__i, *__j); | |
++__n_swaps; | |
break; | |
} | |
} | |
} | |
++__i; | |
if (__i < __j) | |
{ | |
while (true) | |
{ | |
while (__comp(*__i, *__m)) | |
++__i; | |
while (!__comp(*--__j, *__m)) | |
; | |
if (__i >= __j) | |
break; | |
swap(*__i, *__j); | |
++__n_swaps; | |
if (__m == __i) | |
__m = __j; | |
++__i; | |
} | |
} | |
if (__i != __m && __comp(*__m, *__i)) | |
{ | |
swap(*__i, *__m); | |
++__n_swaps; | |
} | |
if (__nth == __i) | |
return; | |
if (__n_swaps == 0) | |
{ | |
if (__nth < __i) | |
{ | |
__j = __m = __first; | |
while (++__j != __i) | |
{ | |
if (__comp(*__j, *__m)) | |
goto not_sorted; | |
__m = __j; | |
} | |
return; | |
} | |
else | |
{ | |
__j = __m = __i; | |
while (++__j != __last) | |
{ | |
if (__comp(*__j, *__m)) | |
goto not_sorted; | |
__m = __j; | |
} | |
return; | |
} | |
} | |
not_sorted: | |
if (__nth < __i) | |
{ | |
__last = __i; | |
} | |
else | |
{ | |
__first = ++__i; | |
} | |
} | |
} | |
template <class _RandomAccessIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
std::__1::__nth_element<_Comp_ref>(__first, __nth, __last, __comp); | |
} | |
template <class _RandomAccessIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void | |
nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last) | |
{ | |
std::__1::nth_element(__first, __nth, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2> | |
bool | |
__includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, | |
_Compare __comp) | |
{ | |
for (; __first2 != __last2; ++__first1) | |
{ | |
if (__first1 == __last1 || __comp(*__first2, *__first1)) | |
return false; | |
if (!__comp(*__first1, *__first2)) | |
++__first2; | |
} | |
return true; | |
} | |
template <class _InputIterator1, class _InputIterator2, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, | |
_Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp); | |
} | |
template <class _InputIterator1, class _InputIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) | |
{ | |
return std::__1::includes(__first1, __last1, __first2, __last2, | |
__less<typename iterator_traits<_InputIterator1>::value_type, | |
typename iterator_traits<_InputIterator2>::value_type>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
_OutputIterator | |
__set_union(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
for (; __first1 != __last1; ++__result) | |
{ | |
if (__first2 == __last2) | |
return std::__1::copy(__first1, __last1, __result); | |
if (__comp(*__first2, *__first1)) | |
{ | |
*__result = *__first2; | |
++__first2; | |
} | |
else | |
{ | |
if (!__comp(*__first1, *__first2)) | |
++__first2; | |
*__result = *__first1; | |
++__first1; | |
} | |
} | |
return std::__1::copy(__first2, __last2, __result); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
set_union(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
set_union(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) | |
{ | |
return std::__1::set_union(__first1, __last1, __first2, __last2, __result, | |
__less<typename iterator_traits<_InputIterator1>::value_type, | |
typename iterator_traits<_InputIterator2>::value_type>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
_OutputIterator | |
__set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
while (__first1 != __last1 && __first2 != __last2) | |
{ | |
if (__comp(*__first1, *__first2)) | |
++__first1; | |
else | |
{ | |
if (!__comp(*__first2, *__first1)) | |
{ | |
*__result = *__first1; | |
++__result; | |
++__first1; | |
} | |
++__first2; | |
} | |
} | |
return __result; | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) | |
{ | |
return std::__1::set_intersection(__first1, __last1, __first2, __last2, __result, | |
__less<typename iterator_traits<_InputIterator1>::value_type, | |
typename iterator_traits<_InputIterator2>::value_type>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
_OutputIterator | |
__set_difference(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
while (__first1 != __last1) | |
{ | |
if (__first2 == __last2) | |
return std::__1::copy(__first1, __last1, __result); | |
if (__comp(*__first1, *__first2)) | |
{ | |
*__result = *__first1; | |
++__result; | |
++__first1; | |
} | |
else | |
{ | |
if (!__comp(*__first2, *__first1)) | |
++__first1; | |
++__first2; | |
} | |
} | |
return __result; | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
set_difference(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
set_difference(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) | |
{ | |
return std::__1::set_difference(__first1, __last1, __first2, __last2, __result, | |
__less<typename iterator_traits<_InputIterator1>::value_type, | |
typename iterator_traits<_InputIterator2>::value_type>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
_OutputIterator | |
__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
while (__first1 != __last1) | |
{ | |
if (__first2 == __last2) | |
return std::__1::copy(__first1, __last1, __result); | |
if (__comp(*__first1, *__first2)) | |
{ | |
*__result = *__first1; | |
++__result; | |
++__first1; | |
} | |
else | |
{ | |
if (__comp(*__first2, *__first1)) | |
{ | |
*__result = *__first2; | |
++__result; | |
} | |
else | |
++__first1; | |
++__first2; | |
} | |
} | |
return std::__1::copy(__first2, __last2, __result); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); | |
} | |
template <class _InputIterator1, class _InputIterator2, class _OutputIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
_OutputIterator | |
set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) | |
{ | |
return std::__1::set_symmetric_difference(__first1, __last1, __first2, __last2, __result, | |
__less<typename iterator_traits<_InputIterator1>::value_type, | |
typename iterator_traits<_InputIterator2>::value_type>()); | |
} | |
template <class _Compare, class _InputIterator1, class _InputIterator2> | |
bool | |
__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) | |
{ | |
for (; __first2 != __last2; ++__first1, (void) ++__first2) | |
{ | |
if (__first1 == __last1 || __comp(*__first1, *__first2)) | |
return true; | |
if (__comp(*__first2, *__first1)) | |
return false; | |
} | |
return false; | |
} | |
template <class _InputIterator1, class _InputIterator2, class _Compare> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp); | |
} | |
template <class _InputIterator1, class _InputIterator2> | |
inline | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, | |
_InputIterator2 __first2, _InputIterator2 __last2) | |
{ | |
return std::__1::lexicographical_compare(__first1, __last1, __first2, __last2, | |
__less<typename iterator_traits<_InputIterator1>::value_type, | |
typename iterator_traits<_InputIterator2>::value_type>()); | |
} | |
template <class _Compare, class _BidirectionalIterator> | |
bool | |
__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) | |
{ | |
_BidirectionalIterator __i = __last; | |
if (__first == __last || __first == --__i) | |
return false; | |
while (true) | |
{ | |
_BidirectionalIterator __ip1 = __i; | |
if (__comp(*--__i, *__ip1)) | |
{ | |
_BidirectionalIterator __j = __last; | |
while (!__comp(*__i, *--__j)) | |
; | |
swap(*__i, *__j); | |
std::__1::reverse(__ip1, __last); | |
return true; | |
} | |
if (__i == __first) | |
{ | |
std::__1::reverse(__first, __last); | |
return false; | |
} | |
} | |
} | |
template <class _BidirectionalIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__next_permutation<_Comp_ref>(__first, __last, __comp); | |
} | |
template <class _BidirectionalIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last) | |
{ | |
return std::__1::next_permutation(__first, __last, | |
__less<typename iterator_traits<_BidirectionalIterator>::value_type>()); | |
} | |
template <class _Compare, class _BidirectionalIterator> | |
bool | |
__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) | |
{ | |
_BidirectionalIterator __i = __last; | |
if (__first == __last || __first == --__i) | |
return false; | |
while (true) | |
{ | |
_BidirectionalIterator __ip1 = __i; | |
if (__comp(*__ip1, *--__i)) | |
{ | |
_BidirectionalIterator __j = __last; | |
while (!__comp(*--__j, *__i)) | |
; | |
swap(*__i, *__j); | |
std::__1::reverse(__ip1, __last); | |
return true; | |
} | |
if (__i == __first) | |
{ | |
std::__1::reverse(__first, __last); | |
return false; | |
} | |
} | |
} | |
template <class _BidirectionalIterator, class _Compare> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) | |
{ | |
typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
return std::__1::__prev_permutation<_Comp_ref>(__first, __last, __comp); | |
} | |
template <class _BidirectionalIterator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool | |
prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last) | |
{ | |
return std::__1::prev_permutation(__first, __last, | |
__less<typename iterator_traits<_BidirectionalIterator>::value_type>()); | |
} | |
} } | |
namespace std { inline namespace __1 { | |
using ::FILE __attribute__((using_if_exists)); | |
using ::fpos_t __attribute__((using_if_exists)); | |
using ::size_t; | |
using ::fclose __attribute__((using_if_exists)); | |
using ::fflush __attribute__((using_if_exists)); | |
using ::setbuf __attribute__((using_if_exists)); | |
using ::setvbuf __attribute__((using_if_exists)); | |
using ::fprintf __attribute__((using_if_exists)); | |
using ::fscanf __attribute__((using_if_exists)); | |
using ::snprintf __attribute__((using_if_exists)); | |
using ::sprintf __attribute__((using_if_exists)); | |
using ::sscanf __attribute__((using_if_exists)); | |
using ::vfprintf __attribute__((using_if_exists)); | |
using ::vfscanf __attribute__((using_if_exists)); | |
using ::vsscanf __attribute__((using_if_exists)); | |
using ::vsnprintf __attribute__((using_if_exists)); | |
using ::vsprintf __attribute__((using_if_exists)); | |
using ::fgetc __attribute__((using_if_exists)); | |
using ::fgets __attribute__((using_if_exists)); | |
using ::fputc __attribute__((using_if_exists)); | |
using ::fputs __attribute__((using_if_exists)); | |
using ::getc __attribute__((using_if_exists)); | |
using ::putc __attribute__((using_if_exists)); | |
using ::ungetc __attribute__((using_if_exists)); | |
using ::fread __attribute__((using_if_exists)); | |
using ::fwrite __attribute__((using_if_exists)); | |
using ::fgetpos __attribute__((using_if_exists)); | |
using ::fseek __attribute__((using_if_exists)); | |
using ::fsetpos __attribute__((using_if_exists)); | |
using ::ftell __attribute__((using_if_exists)); | |
using ::rewind __attribute__((using_if_exists)); | |
using ::clearerr __attribute__((using_if_exists)); | |
using ::feof __attribute__((using_if_exists)); | |
using ::ferror __attribute__((using_if_exists)); | |
using ::perror __attribute__((using_if_exists)); | |
using ::fopen __attribute__((using_if_exists)); | |
using ::freopen __attribute__((using_if_exists)); | |
using ::remove; | |
using ::rename __attribute__((using_if_exists)); | |
using ::tmpfile __attribute__((using_if_exists)); | |
using ::tmpnam __attribute__((using_if_exists)); | |
using ::getchar __attribute__((using_if_exists)); | |
using ::scanf __attribute__((using_if_exists)); | |
using ::vscanf __attribute__((using_if_exists)); | |
using ::printf __attribute__((using_if_exists)); | |
using ::putchar __attribute__((using_if_exists)); | |
using ::puts __attribute__((using_if_exists)); | |
using ::vprintf __attribute__((using_if_exists)); | |
} } | |
namespace std { inline namespace __1 { | |
using ::isalnum; | |
using ::isalpha; | |
using ::isblank; | |
using ::iscntrl; | |
using ::isdigit; | |
using ::isgraph; | |
using ::islower; | |
using ::isprint; | |
using ::ispunct; | |
using ::isspace; | |
using ::isupper; | |
using ::isxdigit; | |
using ::tolower; | |
using ::toupper; | |
} } | |
typedef __darwin_wctrans_t wctrans_t; | |
inline int | |
iswblank(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00020000L)); | |
} | |
inline int | |
iswascii(wint_t _wc) | |
{ | |
return ((_wc & ~0x7F) == 0); | |
} | |
inline int | |
iswhexnumber(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00010000L)); | |
} | |
inline int | |
iswideogram(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00080000L)); | |
} | |
inline int | |
iswnumber(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00000400L)); | |
} | |
inline int | |
iswphonogram(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00200000L)); | |
} | |
inline int | |
iswrune(wint_t _wc) | |
{ | |
return (__istype(_wc, 0xFFFFFFF0L)); | |
} | |
inline int | |
iswspecial(wint_t _wc) | |
{ | |
return (__istype(_wc, 0x00100000L)); | |
} | |
extern "C" { | |
wint_t nextwctype(wint_t, wctype_t); | |
wint_t towctrans(wint_t, wctrans_t); | |
wctrans_t | |
wctrans(const char *); | |
} | |
namespace std { inline namespace __1 { | |
using ::wint_t __attribute__((using_if_exists)); | |
using ::wctrans_t __attribute__((using_if_exists)); | |
using ::wctype_t __attribute__((using_if_exists)); | |
using ::iswalnum __attribute__((using_if_exists)); | |
using ::iswalpha __attribute__((using_if_exists)); | |
using ::iswblank __attribute__((using_if_exists)); | |
using ::iswcntrl __attribute__((using_if_exists)); | |
using ::iswdigit __attribute__((using_if_exists)); | |
using ::iswgraph __attribute__((using_if_exists)); | |
using ::iswlower __attribute__((using_if_exists)); | |
using ::iswprint __attribute__((using_if_exists)); | |
using ::iswpunct __attribute__((using_if_exists)); | |
using ::iswspace __attribute__((using_if_exists)); | |
using ::iswupper __attribute__((using_if_exists)); | |
using ::iswxdigit __attribute__((using_if_exists)); | |
using ::iswctype __attribute__((using_if_exists)); | |
using ::wctype __attribute__((using_if_exists)); | |
using ::towlower __attribute__((using_if_exists)); | |
using ::towupper __attribute__((using_if_exists)); | |
using ::towctrans __attribute__((using_if_exists)); | |
using ::wctrans __attribute__((using_if_exists)); | |
} } | |
namespace std { inline namespace __1 { | |
using ::mbstate_t __attribute__((using_if_exists)); | |
using ::size_t; | |
using ::tm __attribute__((using_if_exists)); | |
using ::wint_t __attribute__((using_if_exists)); | |
using ::FILE __attribute__((using_if_exists)); | |
using ::fwprintf __attribute__((using_if_exists)); | |
using ::fwscanf __attribute__((using_if_exists)); | |
using ::swprintf __attribute__((using_if_exists)); | |
using ::vfwprintf __attribute__((using_if_exists)); | |
using ::vswprintf __attribute__((using_if_exists)); | |
using ::swscanf __attribute__((using_if_exists)); | |
using ::vfwscanf __attribute__((using_if_exists)); | |
using ::vswscanf __attribute__((using_if_exists)); | |
using ::fgetwc __attribute__((using_if_exists)); | |
using ::fgetws __attribute__((using_if_exists)); | |
using ::fputwc __attribute__((using_if_exists)); | |
using ::fputws __attribute__((using_if_exists)); | |
using ::fwide __attribute__((using_if_exists)); | |
using ::getwc __attribute__((using_if_exists)); | |
using ::putwc __attribute__((using_if_exists)); | |
using ::ungetwc __attribute__((using_if_exists)); | |
using ::wcstod __attribute__((using_if_exists)); | |
using ::wcstof __attribute__((using_if_exists)); | |
using ::wcstold __attribute__((using_if_exists)); | |
using ::wcstol __attribute__((using_if_exists)); | |
using ::wcstoll __attribute__((using_if_exists)); | |
using ::wcstoul __attribute__((using_if_exists)); | |
using ::wcstoull __attribute__((using_if_exists)); | |
using ::wcscpy __attribute__((using_if_exists)); | |
using ::wcsncpy __attribute__((using_if_exists)); | |
using ::wcscat __attribute__((using_if_exists)); | |
using ::wcsncat __attribute__((using_if_exists)); | |
using ::wcscmp __attribute__((using_if_exists)); | |
using ::wcscoll __attribute__((using_if_exists)); | |
using ::wcsncmp __attribute__((using_if_exists)); | |
using ::wcsxfrm __attribute__((using_if_exists)); | |
using ::wcschr __attribute__((using_if_exists)); | |
using ::wcspbrk __attribute__((using_if_exists)); | |
using ::wcsrchr __attribute__((using_if_exists)); | |
using ::wcsstr __attribute__((using_if_exists)); | |
using ::wmemchr __attribute__((using_if_exists)); | |
using ::wcscspn __attribute__((using_if_exists)); | |
using ::wcslen __attribute__((using_if_exists)); | |
using ::wcsspn __attribute__((using_if_exists)); | |
using ::wcstok __attribute__((using_if_exists)); | |
using ::wmemcmp __attribute__((using_if_exists)); | |
using ::wmemcpy __attribute__((using_if_exists)); | |
using ::wmemmove __attribute__((using_if_exists)); | |
using ::wmemset __attribute__((using_if_exists)); | |
using ::wcsftime __attribute__((using_if_exists)); | |
using ::btowc __attribute__((using_if_exists)); | |
using ::wctob __attribute__((using_if_exists)); | |
using ::mbsinit __attribute__((using_if_exists)); | |
using ::mbrlen __attribute__((using_if_exists)); | |
using ::mbrtowc __attribute__((using_if_exists)); | |
using ::wcrtomb __attribute__((using_if_exists)); | |
using ::mbsrtowcs __attribute__((using_if_exists)); | |
using ::wcsrtombs __attribute__((using_if_exists)); | |
using ::getwchar __attribute__((using_if_exists)); | |
using ::vwscanf __attribute__((using_if_exists)); | |
using ::wscanf __attribute__((using_if_exists)); | |
using ::putwchar __attribute__((using_if_exists)); | |
using ::vwprintf __attribute__((using_if_exists)); | |
using ::wprintf __attribute__((using_if_exists)); | |
} } | |
namespace std { inline namespace __1 { | |
template <class _CharT> | |
struct __attribute__ ((__type_visibility__("default"))) char_traits | |
{ | |
typedef _CharT char_type; | |
typedef int int_type; | |
typedef streamoff off_type; | |
typedef streampos pos_type; | |
typedef mbstate_t state_type; | |
static inline void | |
assign(char_type& __c1, const char_type& __c2) noexcept {__c1 = __c2;} | |
static inline constexpr bool eq(char_type __c1, char_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr bool lt(char_type __c1, char_type __c2) noexcept | |
{return __c1 < __c2;} | |
static | |
int compare(const char_type* __s1, const char_type* __s2, size_t __n); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static | |
size_t length(const char_type* __s); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static | |
const char_type* find(const char_type* __s, size_t __n, const char_type& __a); | |
static | |
char_type* move(char_type* __s1, const char_type* __s2, size_t __n); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static | |
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static | |
char_type* assign(char_type* __s, size_t __n, char_type __a); | |
static inline constexpr int_type not_eof(int_type __c) noexcept | |
{return eq_int_type(__c, eof()) ? ~eof() : __c;} | |
static inline constexpr char_type to_char_type(int_type __c) noexcept | |
{return char_type(__c);} | |
static inline constexpr int_type to_int_type(char_type __c) noexcept | |
{return int_type(__c);} | |
static inline constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr int_type eof() noexcept | |
{return int_type((-1));} | |
}; | |
template <class _CharT> | |
int | |
char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_t __n) | |
{ | |
for (; __n; --__n, ++__s1, ++__s2) | |
{ | |
if (lt(*__s1, *__s2)) | |
return -1; | |
if (lt(*__s2, *__s1)) | |
return 1; | |
} | |
return 0; | |
} | |
template <class _CharT> | |
inline | |
size_t | |
char_traits<_CharT>::length(const char_type* __s) | |
{ | |
size_t __len = 0; | |
for (; !eq(*__s, char_type(0)); ++__s) | |
++__len; | |
return __len; | |
} | |
template <class _CharT> | |
inline | |
const _CharT* | |
char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a) | |
{ | |
for (; __n; --__n) | |
{ | |
if (eq(*__s, __a)) | |
return __s; | |
++__s; | |
} | |
return nullptr; | |
} | |
template <class _CharT> | |
_CharT* | |
char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n) | |
{ | |
if (__n == 0) return __s1; | |
char_type* __r = __s1; | |
if (__s1 < __s2) | |
{ | |
for (; __n; --__n, ++__s1, ++__s2) | |
assign(*__s1, *__s2); | |
} | |
else if (__s2 < __s1) | |
{ | |
__s1 += __n; | |
__s2 += __n; | |
for (; __n; --__n) | |
assign(*--__s1, *--__s2); | |
} | |
return __r; | |
} | |
template <class _CharT> | |
inline | |
_CharT* | |
char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n) | |
{ | |
((void)0); | |
char_type* __r = __s1; | |
for (; __n; --__n, ++__s1, ++__s2) | |
assign(*__s1, *__s2); | |
return __r; | |
} | |
template <class _CharT> | |
inline | |
_CharT* | |
char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a) | |
{ | |
char_type* __r = __s; | |
for (; __n; --__n, ++__s) | |
assign(*__s, __a); | |
return __r; | |
} | |
template <class _CharT> | |
static inline | |
_CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) noexcept | |
{ | |
if (__n == 0) return __s1; | |
if (__s1 < __s2) { | |
std::__1::copy(__s2, __s2 + __n, __s1); | |
} else if (__s2 < __s1) { | |
std::__1::copy_backward(__s2, __s2 + __n, __s1 + __n); | |
} | |
return __s1; | |
} | |
template <class _CharT> | |
static inline | |
_CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) noexcept | |
{ | |
std::__1::copy_n(__s2, __n, __s1); | |
return __s1; | |
} | |
template <class _CharT> | |
static inline | |
_CharT* __assign_constexpr(_CharT* __s, size_t __n, _CharT __a) noexcept | |
{ | |
std::__1::fill_n(__s, __n, __a); | |
return __s; | |
} | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) char_traits<char> | |
{ | |
typedef char char_type; | |
typedef int int_type; | |
typedef streamoff off_type; | |
typedef streampos pos_type; | |
typedef mbstate_t state_type; | |
static inline | |
void assign(char_type& __c1, const char_type& __c2) noexcept {__c1 = __c2;} | |
static inline constexpr bool eq(char_type __c1, char_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr bool lt(char_type __c1, char_type __c2) noexcept | |
{return (unsigned char)__c1 < (unsigned char)__c2;} | |
static | |
int compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept; | |
static inline size_t | |
length(const char_type* __s) noexcept {return __builtin_strlen(__s);} | |
static | |
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) noexcept; | |
static inline | |
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
return __libcpp_is_constant_evaluated() | |
? std::__1::__move_constexpr(__s1, __s2, __n) | |
: __n == 0 ? __s1 : (char_type*)std::__1::memmove(__s1, __s2, __n); | |
} | |
static inline | |
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
((void)0); | |
return __libcpp_is_constant_evaluated() | |
? std::__1::__copy_constexpr(__s1, __s2, __n) | |
: __n == 0 ? __s1 : (char_type*)std::__1::memcpy(__s1, __s2, __n); | |
} | |
static inline | |
char_type* assign(char_type* __s, size_t __n, char_type __a) noexcept | |
{ | |
return __libcpp_is_constant_evaluated() | |
? std::__1::__assign_constexpr(__s, __n, __a) | |
: __n == 0 ? __s : (char_type*)std::__1::memset(__s, to_int_type(__a), __n); | |
} | |
static inline constexpr int_type not_eof(int_type __c) noexcept | |
{return eq_int_type(__c, eof()) ? ~eof() : __c;} | |
static inline constexpr char_type to_char_type(int_type __c) noexcept | |
{return char_type(__c);} | |
static inline constexpr int_type to_int_type(char_type __c) noexcept | |
{return int_type((unsigned char)__c);} | |
static inline constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr int_type eof() noexcept | |
{return int_type((-1));} | |
}; | |
inline | |
int | |
char_traits<char>::compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
if (__n == 0) | |
return 0; | |
return __builtin_memcmp(__s1, __s2, __n); | |
} | |
inline | |
const char* | |
char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a) noexcept | |
{ | |
if (__n == 0) | |
return nullptr; | |
return __builtin_char_memchr(__s, to_int_type(__a), __n); | |
} | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) char_traits<wchar_t> | |
{ | |
typedef wchar_t char_type; | |
typedef wint_t int_type; | |
typedef streamoff off_type; | |
typedef streampos pos_type; | |
typedef mbstate_t state_type; | |
static inline | |
void assign(char_type& __c1, const char_type& __c2) noexcept {__c1 = __c2;} | |
static inline constexpr bool eq(char_type __c1, char_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr bool lt(char_type __c1, char_type __c2) noexcept | |
{return __c1 < __c2;} | |
static | |
int compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept; | |
static | |
size_t length(const char_type* __s) noexcept; | |
static | |
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) noexcept; | |
static inline | |
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
return __libcpp_is_constant_evaluated() | |
? std::__1::__move_constexpr(__s1, __s2, __n) | |
: __n == 0 ? __s1 : std::__1::wmemmove(__s1, __s2, __n); | |
} | |
static inline | |
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
((void)0); | |
return __libcpp_is_constant_evaluated() | |
? std::__1::__copy_constexpr(__s1, __s2, __n) | |
: __n == 0 ? __s1 : std::__1::wmemcpy(__s1, __s2, __n); | |
} | |
static inline | |
char_type* assign(char_type* __s, size_t __n, char_type __a) noexcept | |
{ | |
return __libcpp_is_constant_evaluated() | |
? std::__1::__assign_constexpr(__s, __n, __a) | |
: __n == 0 ? __s : std::__1::wmemset(__s, __a, __n); | |
} | |
static inline constexpr int_type not_eof(int_type __c) noexcept | |
{return eq_int_type(__c, eof()) ? ~eof() : __c;} | |
static inline constexpr char_type to_char_type(int_type __c) noexcept | |
{return char_type(__c);} | |
static inline constexpr int_type to_int_type(char_type __c) noexcept | |
{return int_type(__c);} | |
static inline constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr int_type eof() noexcept | |
{return int_type(((__darwin_wint_t)-1));} | |
}; | |
inline | |
int | |
char_traits<wchar_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
if (__n == 0) | |
return 0; | |
return __builtin_wmemcmp(__s1, __s2, __n); | |
} | |
template <class _Traits> | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
constexpr | |
inline size_t __char_traits_length_checked(const typename _Traits::char_type* __s) noexcept { | |
return _Traits::length(__s); | |
} | |
inline | |
size_t | |
char_traits<wchar_t>::length(const char_type* __s) noexcept | |
{ | |
return __builtin_wcslen(__s); | |
} | |
inline | |
const wchar_t* | |
char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __a) noexcept | |
{ | |
if (__n == 0) | |
return nullptr; | |
return __builtin_wmemchr(__s, __a, __n); | |
} | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) char_traits<char16_t> | |
{ | |
typedef char16_t char_type; | |
typedef uint_least16_t int_type; | |
typedef streamoff off_type; | |
typedef u16streampos pos_type; | |
typedef mbstate_t state_type; | |
static inline | |
void assign(char_type& __c1, const char_type& __c2) noexcept {__c1 = __c2;} | |
static inline constexpr bool eq(char_type __c1, char_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr bool lt(char_type __c1, char_type __c2) noexcept | |
{return __c1 < __c2;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static | |
int compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static | |
size_t length(const char_type* __s) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static | |
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static char_type* assign(char_type* __s, size_t __n, char_type __a) noexcept; | |
static inline constexpr int_type not_eof(int_type __c) noexcept | |
{return eq_int_type(__c, eof()) ? ~eof() : __c;} | |
static inline constexpr char_type to_char_type(int_type __c) noexcept | |
{return char_type(__c);} | |
static inline constexpr int_type to_int_type(char_type __c) noexcept | |
{return int_type(__c);} | |
static inline constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr int_type eof() noexcept | |
{return int_type(0xFFFF);} | |
}; | |
inline | |
int | |
char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
for (; __n; --__n, ++__s1, ++__s2) | |
{ | |
if (lt(*__s1, *__s2)) | |
return -1; | |
if (lt(*__s2, *__s1)) | |
return 1; | |
} | |
return 0; | |
} | |
inline | |
size_t | |
char_traits<char16_t>::length(const char_type* __s) noexcept | |
{ | |
size_t __len = 0; | |
for (; !eq(*__s, char_type(0)); ++__s) | |
++__len; | |
return __len; | |
} | |
inline | |
const char16_t* | |
char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a) noexcept | |
{ | |
for (; __n; --__n) | |
{ | |
if (eq(*__s, __a)) | |
return __s; | |
++__s; | |
} | |
return nullptr; | |
} | |
inline | |
char16_t* | |
char_traits<char16_t>::move(char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
if (__n == 0) return __s1; | |
char_type* __r = __s1; | |
if (__s1 < __s2) | |
{ | |
for (; __n; --__n, ++__s1, ++__s2) | |
assign(*__s1, *__s2); | |
} | |
else if (__s2 < __s1) | |
{ | |
__s1 += __n; | |
__s2 += __n; | |
for (; __n; --__n) | |
assign(*--__s1, *--__s2); | |
} | |
return __r; | |
} | |
inline | |
char16_t* | |
char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
((void)0); | |
char_type* __r = __s1; | |
for (; __n; --__n, ++__s1, ++__s2) | |
assign(*__s1, *__s2); | |
return __r; | |
} | |
inline | |
char16_t* | |
char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a) noexcept | |
{ | |
char_type* __r = __s; | |
for (; __n; --__n, ++__s) | |
assign(*__s, __a); | |
return __r; | |
} | |
template <> | |
struct __attribute__ ((__type_visibility__("default"))) char_traits<char32_t> | |
{ | |
typedef char32_t char_type; | |
typedef uint_least32_t int_type; | |
typedef streamoff off_type; | |
typedef u32streampos pos_type; | |
typedef mbstate_t state_type; | |
static inline | |
void assign(char_type& __c1, const char_type& __c2) noexcept {__c1 = __c2;} | |
static inline constexpr bool eq(char_type __c1, char_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr bool lt(char_type __c1, char_type __c2) noexcept | |
{return __c1 < __c2;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static | |
int compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static | |
size_t length(const char_type* __s) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) static | |
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
static char_type* assign(char_type* __s, size_t __n, char_type __a) noexcept; | |
static inline constexpr int_type not_eof(int_type __c) noexcept | |
{return eq_int_type(__c, eof()) ? ~eof() : __c;} | |
static inline constexpr char_type to_char_type(int_type __c) noexcept | |
{return char_type(__c);} | |
static inline constexpr int_type to_int_type(char_type __c) noexcept | |
{return int_type(__c);} | |
static inline constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept | |
{return __c1 == __c2;} | |
static inline constexpr int_type eof() noexcept | |
{return int_type(0xFFFFFFFF);} | |
}; | |
inline | |
int | |
char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
for (; __n; --__n, ++__s1, ++__s2) | |
{ | |
if (lt(*__s1, *__s2)) | |
return -1; | |
if (lt(*__s2, *__s1)) | |
return 1; | |
} | |
return 0; | |
} | |
inline | |
size_t | |
char_traits<char32_t>::length(const char_type* __s) noexcept | |
{ | |
size_t __len = 0; | |
for (; !eq(*__s, char_type(0)); ++__s) | |
++__len; | |
return __len; | |
} | |
inline | |
const char32_t* | |
char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a) noexcept | |
{ | |
for (; __n; --__n) | |
{ | |
if (eq(*__s, __a)) | |
return __s; | |
++__s; | |
} | |
return nullptr; | |
} | |
inline | |
char32_t* | |
char_traits<char32_t>::move(char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
if (__n == 0) return __s1; | |
char_type* __r = __s1; | |
if (__s1 < __s2) | |
{ | |
for (; __n; --__n, ++__s1, ++__s2) | |
assign(*__s1, *__s2); | |
} | |
else if (__s2 < __s1) | |
{ | |
__s1 += __n; | |
__s2 += __n; | |
for (; __n; --__n) | |
assign(*--__s1, *--__s2); | |
} | |
return __r; | |
} | |
inline | |
char32_t* | |
char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n) noexcept | |
{ | |
((void)0); | |
char_type* __r = __s1; | |
for (; __n; --__n, ++__s1, ++__s2) | |
assign(*__s1, *__s2); | |
return __r; | |
} | |
inline | |
char32_t* | |
char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a) noexcept | |
{ | |
char_type* __r = __s; | |
for (; __n; --__n, ++__s) | |
assign(*__s, __a); | |
return __r; | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_find(const _CharT *__p, _SizeT __sz, | |
_CharT __c, _SizeT __pos) noexcept | |
{ | |
if (__pos >= __sz) | |
return __npos; | |
const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c); | |
if (__r == nullptr) | |
return __npos; | |
return static_cast<_SizeT>(__r - __p); | |
} | |
template <class _CharT, class _Traits> | |
inline constexpr const _CharT * | |
__search_substring(const _CharT *__first1, const _CharT *__last1, | |
const _CharT *__first2, const _CharT *__last2) { | |
const ptrdiff_t __len2 = __last2 - __first2; | |
if (__len2 == 0) | |
return __first1; | |
ptrdiff_t __len1 = __last1 - __first1; | |
if (__len1 < __len2) | |
return __last1; | |
_CharT __f2 = *__first2; | |
while (true) { | |
__len1 = __last1 - __first1; | |
if (__len1 < __len2) | |
return __last1; | |
__first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2); | |
if (__first1 == nullptr) | |
return __last1; | |
if (_Traits::compare(__first1, __first2, __len2) == 0) | |
return __first1; | |
++__first1; | |
} | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_find(const _CharT *__p, _SizeT __sz, | |
const _CharT* __s, _SizeT __pos, _SizeT __n) noexcept | |
{ | |
if (__pos > __sz) | |
return __npos; | |
if (__n == 0) | |
return __pos; | |
const _CharT *__r = __search_substring<_CharT, _Traits>( | |
__p + __pos, __p + __sz, __s, __s + __n); | |
if (__r == __p + __sz) | |
return __npos; | |
return static_cast<_SizeT>(__r - __p); | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_rfind(const _CharT *__p, _SizeT __sz, | |
_CharT __c, _SizeT __pos) noexcept | |
{ | |
if (__sz < 1) | |
return __npos; | |
if (__pos < __sz) | |
++__pos; | |
else | |
__pos = __sz; | |
for (const _CharT* __ps = __p + __pos; __ps != __p;) | |
{ | |
if (_Traits::eq(*--__ps, __c)) | |
return static_cast<_SizeT>(__ps - __p); | |
} | |
return __npos; | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_rfind(const _CharT *__p, _SizeT __sz, | |
const _CharT* __s, _SizeT __pos, _SizeT __n) noexcept | |
{ | |
__pos = std::__1::min(__pos, __sz); | |
if (__n < __sz - __pos) | |
__pos += __n; | |
else | |
__pos = __sz; | |
const _CharT* __r = std::__1::__find_end( | |
__p, __p + __pos, __s, __s + __n, _Traits::eq, | |
random_access_iterator_tag(), random_access_iterator_tag()); | |
if (__n > 0 && __r == __p + __pos) | |
return __npos; | |
return static_cast<_SizeT>(__r - __p); | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_find_first_of(const _CharT *__p, _SizeT __sz, | |
const _CharT* __s, _SizeT __pos, _SizeT __n) noexcept | |
{ | |
if (__pos >= __sz || __n == 0) | |
return __npos; | |
const _CharT* __r = std::__1::__find_first_of_ce | |
(__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq ); | |
if (__r == __p + __sz) | |
return __npos; | |
return static_cast<_SizeT>(__r - __p); | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_find_last_of(const _CharT *__p, _SizeT __sz, | |
const _CharT* __s, _SizeT __pos, _SizeT __n) noexcept | |
{ | |
if (__n != 0) | |
{ | |
if (__pos < __sz) | |
++__pos; | |
else | |
__pos = __sz; | |
for (const _CharT* __ps = __p + __pos; __ps != __p;) | |
{ | |
const _CharT* __r = _Traits::find(__s, __n, *--__ps); | |
if (__r) | |
return static_cast<_SizeT>(__ps - __p); | |
} | |
} | |
return __npos; | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_find_first_not_of(const _CharT *__p, _SizeT __sz, | |
const _CharT* __s, _SizeT __pos, _SizeT __n) noexcept | |
{ | |
if (__pos < __sz) | |
{ | |
const _CharT* __pe = __p + __sz; | |
for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps) | |
if (_Traits::find(__s, __n, *__ps) == nullptr) | |
return static_cast<_SizeT>(__ps - __p); | |
} | |
return __npos; | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_find_first_not_of(const _CharT *__p, _SizeT __sz, | |
_CharT __c, _SizeT __pos) noexcept | |
{ | |
if (__pos < __sz) | |
{ | |
const _CharT* __pe = __p + __sz; | |
for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps) | |
if (!_Traits::eq(*__ps, __c)) | |
return static_cast<_SizeT>(__ps - __p); | |
} | |
return __npos; | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_find_last_not_of(const _CharT *__p, _SizeT __sz, | |
const _CharT* __s, _SizeT __pos, _SizeT __n) noexcept | |
{ | |
if (__pos < __sz) | |
++__pos; | |
else | |
__pos = __sz; | |
for (const _CharT* __ps = __p + __pos; __ps != __p;) | |
if (_Traits::find(__s, __n, *--__ps) == nullptr) | |
return static_cast<_SizeT>(__ps - __p); | |
return __npos; | |
} | |
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos> | |
inline _SizeT constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
__str_find_last_not_of(const _CharT *__p, _SizeT __sz, | |
_CharT __c, _SizeT __pos) noexcept | |
{ | |
if (__pos < __sz) | |
++__pos; | |
else | |
__pos = __sz; | |
for (const _CharT* __ps = __p + __pos; __ps != __p;) | |
if (!_Traits::eq(*--__ps, __c)) | |
return static_cast<_SizeT>(__ps - __p); | |
return __npos; | |
} | |
template<class _Ptr> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t __do_string_hash(_Ptr __p, _Ptr __e) | |
{ | |
typedef typename iterator_traits<_Ptr>::value_type value_type; | |
return __murmur2_or_cityhash<size_t>()(__p, (__e-__p)*sizeof(value_type)); | |
} | |
template <class _CharT, class _Iter, class _Traits=char_traits<_CharT> > | |
struct __quoted_output_proxy | |
{ | |
_Iter __first; | |
_Iter __last; | |
_CharT __delim; | |
_CharT __escape; | |
__quoted_output_proxy(_Iter __f, _Iter __l, _CharT __d, _CharT __e) | |
: __first(__f), __last(__l), __delim(__d), __escape(__e) {} | |
}; | |
} } | |
namespace std { inline namespace __1 { | |
template<class _CharT, class _Traits = char_traits<_CharT> > | |
class __attribute__ ((__type_visibility__("default"))) basic_string_view; | |
typedef basic_string_view<char> string_view; | |
typedef basic_string_view<char16_t> u16string_view; | |
typedef basic_string_view<char32_t> u32string_view; | |
typedef basic_string_view<wchar_t> wstring_view; | |
template<class _CharT, class _Traits> | |
class | |
__attribute__((__preferred_name__(string_view))) | |
__attribute__((__preferred_name__(u16string_view))) | |
__attribute__((__preferred_name__(u32string_view))) | |
__attribute__((__preferred_name__(wstring_view))) | |
basic_string_view { | |
public: | |
typedef _Traits traits_type; | |
typedef _CharT value_type; | |
typedef _CharT* pointer; | |
typedef const _CharT* const_pointer; | |
typedef _CharT& reference; | |
typedef const _CharT& const_reference; | |
typedef const_pointer const_iterator; | |
typedef const_iterator iterator; | |
typedef std::__1::reverse_iterator<const_iterator> const_reverse_iterator; | |
typedef const_reverse_iterator reverse_iterator; | |
typedef size_t size_type; | |
typedef ptrdiff_t difference_type; | |
static constexpr const size_type npos = -1; | |
static_assert((!is_array<value_type>::value), "Character type of basic_string_view must not be an array"); | |
static_assert(( is_standard_layout<value_type>::value), "Character type of basic_string_view must be standard-layout"); | |
static_assert(( is_trivial<value_type>::value), "Character type of basic_string_view must be trivial"); | |
static_assert((is_same<_CharT, typename traits_type::char_type>::value), | |
"traits_type::char_type must be the same type as CharT"); | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string_view() noexcept : __data (nullptr), __size(0) {} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string_view(const basic_string_view&) noexcept = default; | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string_view& operator=(const basic_string_view&) noexcept = default; | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string_view(const _CharT* __s, size_type __len) noexcept | |
: __data(__s), __size(__len) | |
{ | |
((void)0); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string_view(const _CharT* __s) | |
: __data(__s), __size(std::__1::__char_traits_length_checked<_Traits>(__s)) {} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_iterator begin() const noexcept { return cbegin(); } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_iterator end() const noexcept { return cend(); } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_iterator cbegin() const noexcept { return __data; } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_iterator cend() const noexcept { return __data + __size; } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(cend()); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reverse_iterator rend() const noexcept { return const_reverse_iterator(cbegin()); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(cend()); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reverse_iterator crend() const noexcept { return const_reverse_iterator(cbegin()); } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type size() const noexcept { return __size; } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type length() const noexcept { return __size; } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type max_size() const noexcept { return numeric_limits<size_type>::max(); } | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) constexpr | |
bool empty() const noexcept { return __size == 0; } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reference operator[](size_type __pos) const noexcept { | |
return ((void)0), __data[__pos]; | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reference at(size_type __pos) const | |
{ | |
return __pos >= size() | |
? (__throw_out_of_range("string_view::at"), __data[0]) | |
: __data[__pos]; | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reference front() const noexcept | |
{ | |
return ((void)0), __data[0]; | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reference back() const noexcept | |
{ | |
return ((void)0), __data[__size-1]; | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_pointer data() const noexcept { return __data; } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void remove_prefix(size_type __n) noexcept | |
{ | |
((void)0); | |
__data += __n; | |
__size -= __n; | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void remove_suffix(size_type __n) noexcept | |
{ | |
((void)0); | |
__size -= __n; | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void swap(basic_string_view& __other) noexcept | |
{ | |
const value_type *__p = __data; | |
__data = __other.__data; | |
__other.__data = __p; | |
size_type __sz = __size; | |
__size = __other.__size; | |
__other.__size = __sz; | |
} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const | |
{ | |
if (__pos > size()) | |
__throw_out_of_range("string_view::copy"); | |
size_type __rlen = std::__1::min(__n, size() - __pos); | |
_Traits::copy(__s, data() + __pos, __rlen); | |
return __rlen; | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string_view substr(size_type __pos = 0, size_type __n = npos) const | |
{ | |
return __pos > size() | |
? (__throw_out_of_range("string_view::substr"), basic_string_view()) | |
: basic_string_view(data() + __pos, std::__1::min(__n, size() - __pos)); | |
} | |
constexpr int compare(basic_string_view __sv) const noexcept | |
{ | |
size_type __rlen = std::__1::min( size(), __sv.size()); | |
int __retval = _Traits::compare(data(), __sv.data(), __rlen); | |
if ( __retval == 0 ) | |
__retval = size() == __sv.size() ? 0 : ( size() < __sv.size() ? -1 : 1 ); | |
return __retval; | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int compare(size_type __pos1, size_type __n1, basic_string_view __sv) const | |
{ | |
return substr(__pos1, __n1).compare(__sv); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int compare( size_type __pos1, size_type __n1, | |
basic_string_view __sv, size_type __pos2, size_type __n2) const | |
{ | |
return substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int compare(const _CharT* __s) const noexcept | |
{ | |
return compare(basic_string_view(__s)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int compare(size_type __pos1, size_type __n1, const _CharT* __s) const | |
{ | |
return substr(__pos1, __n1).compare(basic_string_view(__s)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
int compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const | |
{ | |
return substr(__pos1, __n1).compare(basic_string_view(__s, __n2)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find(basic_string_view __s, size_type __pos = 0) const noexcept | |
{ | |
((void)0); | |
return __str_find<value_type, size_type, traits_type, npos> | |
(data(), size(), __s.data(), __pos, __s.size()); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find(_CharT __c, size_type __pos = 0) const noexcept | |
{ | |
return __str_find<value_type, size_type, traits_type, npos> | |
(data(), size(), __c, __pos); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find(const _CharT* __s, size_type __pos, size_type __n) const | |
{ | |
((void)0); | |
return __str_find<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, __n); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find(const _CharT* __s, size_type __pos = 0) const | |
{ | |
((void)0); | |
return __str_find<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, traits_type::length(__s)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type rfind(basic_string_view __s, size_type __pos = npos) const noexcept | |
{ | |
((void)0); | |
return __str_rfind<value_type, size_type, traits_type, npos> | |
(data(), size(), __s.data(), __pos, __s.size()); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type rfind(_CharT __c, size_type __pos = npos) const noexcept | |
{ | |
return __str_rfind<value_type, size_type, traits_type, npos> | |
(data(), size(), __c, __pos); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const | |
{ | |
((void)0); | |
return __str_rfind<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, __n); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type rfind(const _CharT* __s, size_type __pos=npos) const | |
{ | |
((void)0); | |
return __str_rfind<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, traits_type::length(__s)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_first_of(basic_string_view __s, size_type __pos = 0) const noexcept | |
{ | |
((void)0); | |
return __str_find_first_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s.data(), __pos, __s.size()); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_first_of(_CharT __c, size_type __pos = 0) const noexcept | |
{ return find(__c, __pos); } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const | |
{ | |
((void)0); | |
return __str_find_first_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, __n); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_first_of(const _CharT* __s, size_type __pos=0) const | |
{ | |
((void)0); | |
return __str_find_first_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, traits_type::length(__s)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_last_of(basic_string_view __s, size_type __pos=npos) const noexcept | |
{ | |
((void)0); | |
return __str_find_last_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s.data(), __pos, __s.size()); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_last_of(_CharT __c, size_type __pos = npos) const noexcept | |
{ return rfind(__c, __pos); } | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const | |
{ | |
((void)0); | |
return __str_find_last_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, __n); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_last_of(const _CharT* __s, size_type __pos=npos) const | |
{ | |
((void)0); | |
return __str_find_last_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, traits_type::length(__s)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_first_not_of(basic_string_view __s, size_type __pos=0) const noexcept | |
{ | |
((void)0); | |
return __str_find_first_not_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s.data(), __pos, __s.size()); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_first_not_of(_CharT __c, size_type __pos=0) const noexcept | |
{ | |
return __str_find_first_not_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __c, __pos); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const | |
{ | |
((void)0); | |
return __str_find_first_not_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, __n); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const | |
{ | |
((void)0); | |
return __str_find_first_not_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, traits_type::length(__s)); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_last_not_of(basic_string_view __s, size_type __pos=npos) const noexcept | |
{ | |
((void)0); | |
return __str_find_last_not_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s.data(), __pos, __s.size()); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_last_not_of(_CharT __c, size_type __pos=npos) const noexcept | |
{ | |
return __str_find_last_not_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __c, __pos); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const | |
{ | |
((void)0); | |
return __str_find_last_not_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, __n); | |
} | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const | |
{ | |
((void)0); | |
return __str_find_last_not_of<value_type, size_type, traits_type, npos> | |
(data(), size(), __s, __pos, traits_type::length(__s)); | |
} | |
private: | |
const value_type* __data; | |
size_type __size; | |
}; | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(basic_string_view<_CharT, _Traits> __lhs, | |
basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
if ( __lhs.size() != __rhs.size()) return false; | |
return __lhs.compare(__rhs) == 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(basic_string_view<_CharT, _Traits> __lhs, | |
typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) noexcept | |
{ | |
if ( __lhs.size() != __rhs.size()) return false; | |
return __lhs.compare(__rhs) == 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
if ( __lhs.size() != __rhs.size()) return false; | |
return __lhs.compare(__rhs) == 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
if ( __lhs.size() != __rhs.size()) | |
return true; | |
return __lhs.compare(__rhs) != 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(basic_string_view<_CharT, _Traits> __lhs, | |
typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) noexcept | |
{ | |
if ( __lhs.size() != __rhs.size()) | |
return true; | |
return __lhs.compare(__rhs) != 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
if ( __lhs.size() != __rhs.size()) | |
return true; | |
return __lhs.compare(__rhs) != 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator<(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) < 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator<(basic_string_view<_CharT, _Traits> __lhs, | |
typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) < 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator<(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) < 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator> (basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) > 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator>(basic_string_view<_CharT, _Traits> __lhs, | |
typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) > 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator>(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) > 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator<=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) <= 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator<=(basic_string_view<_CharT, _Traits> __lhs, | |
typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) <= 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator<=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) <= 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator>=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) >= 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator>=(basic_string_view<_CharT, _Traits> __lhs, | |
typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) >= 0; | |
} | |
template<class _CharT, class _Traits> | |
constexpr LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator>=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
basic_string_view<_CharT, _Traits> __rhs) noexcept | |
{ | |
return __lhs.compare(__rhs) >= 0; | |
} | |
template<class _CharT, class _Traits> | |
basic_ostream<_CharT, _Traits>& | |
operator<<(basic_ostream<_CharT, _Traits>& __os, | |
basic_string_view<_CharT, _Traits> __str); | |
template<class _CharT> | |
struct __attribute__ ((__type_visibility__("default"))) hash<basic_string_view<_CharT, char_traits<_CharT> > > | |
: public unary_function<basic_string_view<_CharT, char_traits<_CharT> >, size_t> | |
{ | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
size_t operator()(const basic_string_view<_CharT, char_traits<_CharT> > __val) const noexcept { | |
return __do_string_hash(__val.data(), __val.data() + __val.size()); | |
} | |
}; | |
inline namespace literals | |
{ | |
inline namespace string_view_literals | |
{ | |
} | |
} | |
} } | |
namespace std { inline namespace __1 { | |
template <class _StateT> | |
class __attribute__ ((__type_visibility__("default"))) fpos | |
{ | |
private: | |
_StateT __st_; | |
streamoff __off_; | |
public: | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) fpos(streamoff __off = streamoff()) : __st_(), __off_(__off) {} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) operator streamoff() const {return __off_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) _StateT state() const {return __st_;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void state(_StateT __st) {__st_ = __st;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) fpos& operator+=(streamoff __off) {__off_ += __off; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) fpos operator+ (streamoff __off) const {fpos __t(*this); __t += __off; return __t;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) fpos& operator-=(streamoff __off) {__off_ -= __off; return *this;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) fpos operator- (streamoff __off) const {fpos __t(*this); __t -= __off; return __t;} | |
}; | |
template <class _StateT> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
streamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y) | |
{return streamoff(__x) - streamoff(__y);} | |
template <class _StateT> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator==(const fpos<_StateT>& __x, const fpos<_StateT>& __y) | |
{return streamoff(__x) == streamoff(__y);} | |
template <class _StateT> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y) | |
{return streamoff(__x) != streamoff(__y);} | |
template<class _CharT, class _Traits, class _Allocator> | |
basic_string<_CharT, _Traits, _Allocator> | |
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, | |
const basic_string<_CharT, _Traits, _Allocator>& __y); | |
template<class _CharT, class _Traits, class _Allocator> | |
basic_string<_CharT, _Traits, _Allocator> | |
operator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y); | |
template<class _CharT, class _Traits, class _Allocator> | |
basic_string<_CharT, _Traits, _Allocator> | |
operator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y); | |
template<class _CharT, class _Traits, class _Allocator> | |
inline LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string<_CharT, _Traits, _Allocator> | |
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y); | |
template<class _CharT, class _Traits, class _Allocator> | |
basic_string<_CharT, _Traits, _Allocator> | |
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y); | |
extern template __attribute__ ((__visibility__("default"))) string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&); | |
template <bool> | |
class __attribute__ ((__type_visibility__("default"))) __basic_string_common | |
{ | |
protected: | |
[[noreturn]] void __throw_length_error() const; | |
[[noreturn]] void __throw_out_of_range() const; | |
}; | |
template <bool __b> | |
void | |
__basic_string_common<__b>::__throw_length_error() const | |
{ | |
std::__1::__throw_length_error("basic_string"); | |
} | |
template <bool __b> | |
void | |
__basic_string_common<__b>::__throw_out_of_range() const | |
{ | |
std::__1::__throw_out_of_range("basic_string"); | |
} | |
extern template class __attribute__ ((__visibility__("default"))) __basic_string_common<true>; | |
template <class _Iter> | |
struct __libcpp_string_gets_noexcept_iterator_impl : public true_type {}; | |
template <class _Iter> | |
struct __libcpp_string_gets_noexcept_iterator | |
: public integral_constant<bool,(__libcpp_is_trivial_iterator<_Iter>::value || __libcpp_string_gets_noexcept_iterator_impl<_Iter>::value)> {}; | |
template <class _CharT, class _Traits, class _Tp> | |
struct __can_be_converted_to_string_view : public _BoolConstant< | |
is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value && | |
!is_convertible<const _Tp&, const _CharT*>::value | |
> {}; | |
typedef basic_string<char16_t> u16string; | |
typedef basic_string<char32_t> u32string; | |
template<class _CharT, class _Traits, class _Allocator> | |
class | |
__attribute__ ((__type_visibility__("default"))) | |
__attribute__((__preferred_name__(u16string))) | |
__attribute__((__preferred_name__(u32string))) | |
basic_string | |
: private __basic_string_common<true> | |
{ | |
public: | |
typedef basic_string __self; | |
typedef basic_string_view<_CharT, _Traits> __self_view; | |
typedef _Traits traits_type; | |
typedef _CharT value_type; | |
typedef _Allocator allocator_type; | |
typedef allocator_traits<allocator_type> __alloc_traits; | |
typedef typename __alloc_traits::size_type size_type; | |
typedef typename __alloc_traits::difference_type difference_type; | |
typedef value_type& reference; | |
typedef const value_type& const_reference; | |
typedef typename __alloc_traits::pointer pointer; | |
typedef typename __alloc_traits::const_pointer const_pointer; | |
static_assert((!is_array<value_type>::value), "Character type of basic_string must not be an array"); | |
static_assert(( is_standard_layout<value_type>::value), "Character type of basic_string must be standard-layout"); | |
static_assert(( is_trivial<value_type>::value), "Character type of basic_string must be trivial"); | |
static_assert(( is_same<_CharT, typename traits_type::char_type>::value), | |
"traits_type::char_type must be the same type as CharT"); | |
static_assert(( is_same<typename allocator_type::value_type, value_type>::value), | |
"Allocator::value_type must be same type as value_type"); | |
typedef __wrap_iter<pointer> iterator; | |
typedef __wrap_iter<const_pointer> const_iterator; | |
typedef std::__1::reverse_iterator<iterator> reverse_iterator; | |
typedef std::__1::reverse_iterator<const_iterator> const_reverse_iterator; | |
private: | |
struct __long | |
{ | |
size_type __cap_; | |
size_type __size_; | |
pointer __data_; | |
}; | |
static const size_type __short_mask = 0x01; | |
static const size_type __long_mask = 0x1ul; | |
enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ? | |
(sizeof(__long) - 1)/sizeof(value_type) : 2}; | |
struct __short | |
{ | |
union | |
{ | |
unsigned char __size_; | |
value_type __lx; | |
}; | |
value_type __data_[__min_cap]; | |
}; | |
union __ulx{__long __lx; __short __lxx;}; | |
enum {__n_words = sizeof(__ulx) / sizeof(size_type)}; | |
struct __raw | |
{ | |
size_type __words[__n_words]; | |
}; | |
struct __rep | |
{ | |
union | |
{ | |
__long __l; | |
__short __s; | |
__raw __r; | |
}; | |
}; | |
__compressed_pair<__rep, allocator_type> __r_; | |
public: | |
__attribute__ ((__visibility__("default"))) | |
static const size_type npos = -1; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) basic_string() | |
noexcept(is_nothrow_default_constructible<allocator_type>::value); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) explicit basic_string(const allocator_type& __a) | |
noexcept(is_nothrow_copy_constructible<allocator_type>::value); | |
basic_string(const basic_string& __str); | |
basic_string(const basic_string& __str, const allocator_type& __a); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(basic_string&& __str) | |
noexcept(is_nothrow_move_constructible<allocator_type>::value); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(basic_string&& __str, const allocator_type& __a); | |
template <class = _EnableIf<__is_allocator<_Allocator>::value, nullptr_t> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) { | |
((void)0); | |
__init(__s, traits_type::length(__s)); | |
} | |
template <class = _EnableIf<__is_allocator<_Allocator>::value, nullptr_t> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(const _CharT* __s, const _Allocator& __a); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(const _CharT* __s, size_type __n); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(const _CharT* __s, size_type __n, const _Allocator& __a); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(size_type __n, _CharT __c); | |
template <class = _EnableIf<__is_allocator<_Allocator>::value, nullptr_t> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(size_type __n, _CharT __c, const _Allocator& __a); | |
basic_string(const basic_string& __str, size_type __pos, size_type __n, | |
const _Allocator& __a = _Allocator()); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(const basic_string& __str, size_type __pos, | |
const _Allocator& __a = _Allocator()); | |
template<class _Tp, class = _EnableIf<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value> > | |
inline LDIONNE_HIDDEN | |
basic_string(const _Tp& __t, size_type __pos, size_type __n, | |
const allocator_type& __a = allocator_type()); | |
template<class _Tp, class = _EnableIf<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && | |
!__is_same_uncvref<_Tp, basic_string>::value> > | |
inline LDIONNE_HIDDEN | |
explicit basic_string(const _Tp& __t); | |
template<class _Tp, class = _EnableIf<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value> > | |
inline LDIONNE_HIDDEN | |
explicit basic_string(const _Tp& __t, const allocator_type& __a); | |
template<class _InputIterator, class = _EnableIf<__is_cpp17_input_iterator<_InputIterator>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(_InputIterator __first, _InputIterator __last); | |
template<class _InputIterator, class = _EnableIf<__is_cpp17_input_iterator<_InputIterator>::value> > | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(initializer_list<_CharT> __il); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string(initializer_list<_CharT> __il, const _Allocator& __a); | |
inline ~basic_string(); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
operator __self_view() const noexcept { return __self_view(data(), size()); } | |
basic_string& operator=(const basic_string& __str); | |
template <class _Tp, class = _EnableIf<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value> > | |
basic_string& operator=(const _Tp& __t) | |
{__self_view __sv = __t; return assign(__sv);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string& operator=(basic_string&& __str) | |
noexcept((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) basic_string& operator=(const value_type* __s) {return assign(__s);} | |
basic_string& operator=(value_type __c); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
iterator begin() noexcept | |
{return iterator(__get_pointer());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_iterator begin() const noexcept | |
{return const_iterator(__get_pointer());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
iterator end() noexcept | |
{return iterator(__get_pointer() + size());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_iterator end() const noexcept | |
{return const_iterator(__get_pointer() + size());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator rbegin() noexcept | |
{return reverse_iterator(end());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reverse_iterator rbegin() const noexcept | |
{return const_reverse_iterator(end());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
reverse_iterator rend() noexcept | |
{return reverse_iterator(begin());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reverse_iterator rend() const noexcept | |
{return const_reverse_iterator(begin());} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_iterator cbegin() const noexcept | |
{return begin();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_iterator cend() const noexcept | |
{return end();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reverse_iterator crbegin() const noexcept | |
{return rbegin();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
const_reverse_iterator crend() const noexcept | |
{return rend();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) size_type size() const noexcept | |
{return __is_long() ? __get_long_size() : __get_short_size();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) size_type length() const noexcept {return size();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) size_type max_size() const noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) size_type capacity() const noexcept | |
{return (__is_long() ? __get_long_cap() | |
: static_cast<size_type>(__min_cap)) - 1;} | |
void resize(size_type __n, value_type __c); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void resize(size_type __n) {resize(__n, value_type());} | |
void reserve(size_type __requested_capacity); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) void __resize_default_init(size_type __n); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void reserve() noexcept {shrink_to_fit();} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void shrink_to_fit() noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
void clear() noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) | |
bool empty() const noexcept {return size() == 0;} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) const_reference operator[](size_type __pos) const noexcept; | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) reference operator[](size_type __pos) noexcept; | |
const_reference at(size_type __n) const; | |
reference at(size_type __n); | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) basic_string& operator+=(const basic_string& __str) {return append(__str);} | |
template <class _Tp> | |
inline LDIONNE_HIDDEN | |
_EnableIf | |
< | |
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value | |
&& !__is_same_uncvref<_Tp, basic_string >::value, | |
basic_string& | |
> | |
operator+=(const _Tp& __t) {__self_view __sv = __t; return append(__sv);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) basic_string& operator+=(const value_type* __s) {return append(__s);} | |
LDIONNE_HIDDEN __attribute__ ((internal_linkage)) basic_string& operator+=(value_type __c) {push_back(__c); return *this;} | |
View raw
(Sorry about that, but we can’t show files that are this big right now.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment