# 0 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Sources/Utilities/Hash.cc" # 0 "" # 0 "" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 0 "" 2 # 1 "/usr/include/c++/15/cstring" 1 3 # 47 "/usr/include/c++/15/cstring" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 51 "/usr/include/c++/15/bits/version.h" 3 # 1 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 1 3 # 37 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvariadic-macros" #pragma GCC diagnostic ignored "-Wc++11-extensions" #pragma GCC diagnostic ignored "-Wc++23-extensions" # 336 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 namespace std { typedef long unsigned int size_t; typedef long int ptrdiff_t; typedef decltype(nullptr) nullptr_t; #pragma GCC visibility push(default) extern "C++" __attribute__ ((__noreturn__, __always_inline__)) inline void __terminate() noexcept { void terminate() noexcept __attribute__ ((__noreturn__,__cold__)); terminate(); } #pragma GCC visibility pop } # 369 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 namespace std { inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } } namespace __gnu_cxx { inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } } # 573 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 namespace std { #pragma GCC visibility push(default) __attribute__((__always_inline__)) constexpr inline bool __is_constant_evaluated() noexcept { if consteval { return true; } else { return false; } } #pragma GCC visibility pop } # 617 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 namespace std { #pragma GCC visibility push(default) extern "C++" __attribute__ ((__noreturn__)) __attribute__((__cold__)) void __glibcxx_assert_fail (const char* __file, int __line, const char* __function, const char* __condition) noexcept; #pragma GCC visibility pop } # 648 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 namespace std { __attribute__((__always_inline__,__visibility__("default"))) inline void __glibcxx_assert_fail() { } } # 727 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 # 1 "/usr/include/x86_64-linux-gnu/c++/15/bits/os_defines.h" 1 3 # 39 "/usr/include/x86_64-linux-gnu/c++/15/bits/os_defines.h" 3 # 1 "/usr/include/features.h" 1 3 4 # 431 "/usr/include/features.h" 3 4 # 1 "/usr/include/features-time64.h" 1 3 4 # 20 "/usr/include/features-time64.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 21 "/usr/include/features-time64.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4 # 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4 # 22 "/usr/include/features-time64.h" 2 3 4 # 432 "/usr/include/features.h" 2 3 4 # 539 "/usr/include/features.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4 # 730 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 731 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4 # 732 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4 # 540 "/usr/include/features.h" 2 3 4 # 563 "/usr/include/features.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4 # 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4 # 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4 # 564 "/usr/include/features.h" 2 3 4 # 40 "/usr/include/x86_64-linux-gnu/c++/15/bits/os_defines.h" 2 3 # 728 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 2 3 # 1 "/usr/include/x86_64-linux-gnu/c++/15/bits/cpu_defines.h" 1 3 # 731 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 2 3 # 887 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 namespace __gnu_cxx { typedef __decltype(0.0bf16) __bfloat16_t; } # 949 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 3 # 1 "/usr/include/c++/15/pstl/pstl_config.h" 1 3 # 950 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h" 2 3 #pragma GCC diagnostic pop # 52 "/usr/include/c++/15/bits/version.h" 2 3 # 48 "/usr/include/c++/15/cstring" 2 3 # 1 "/usr/include/string.h" 1 3 4 # 26 "/usr/include/string.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/string.h" 2 3 4 extern "C" { # 37 "/usr/include/string.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h" 1 3 4 # 229 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h" 3 4 typedef long unsigned int size_t; # 38 "/usr/include/string.h" 2 3 4 # 47 "/usr/include/string.h" 3 4 extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, const void *__src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4))); extern void *memset (void *__s, int __c, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1))); extern void *memset_explicit (void *__s, int __c, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1))) ; extern int memcmp (const void *__s1, const void *__s2, size_t __n) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 91 "/usr/include/string.h" 3 4 extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern "C++" { extern void *memchr (void *__s, int __c, size_t __n) noexcept (true) __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const void *memchr (const void *__s, int __c, size_t __n) noexcept (true) __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) void * memchr (void *__s, int __c, size_t __n) noexcept (true) { return __builtin_memchr (__s, __c, __n); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const void * memchr (const void *__s, int __c, size_t __n) noexcept (true) { return __builtin_memchr (__s, __c, __n); } } # 130 "/usr/include/string.h" 3 4 extern "C++" void *rawmemchr (void *__s, int __c) noexcept (true) __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern "C++" const void *rawmemchr (const void *__s, int __c) noexcept (true) __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern "C++" void *memrchr (void *__s, int __c, size_t __n) noexcept (true) __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 3))); extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) noexcept (true) __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 3))); # 156 "/usr/include/string.h" 3 4 extern char *strcpy (char *__restrict __dest, const char *__restrict __src) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, const char *__restrict __src) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (const char *__s1, const char *__s2) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (const char *__s1, const char *__s2, size_t __n) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (const char *__s1, const char *__s2) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3))); # 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4 struct __locale_struct { struct __locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; }; typedef struct __locale_struct *__locale_t; # 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4 typedef __locale_t locale_t; # 188 "/usr/include/string.h" 2 3 4 extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, locale_t __l) noexcept (true) __attribute__ ((__nonnull__ (2, 4))) __attribute__ ((__access__ (__write_only__, 1, 3))); extern char *strdup (const char *__s) noexcept (true) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); extern char *strndup (const char *__string, size_t __n) noexcept (true) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 239 "/usr/include/string.h" 3 4 extern "C++" { extern char *strchr (char *__s, int __c) noexcept (true) __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const char *strchr (const char *__s, int __c) noexcept (true) __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strchr (char *__s, int __c) noexcept (true) { return __builtin_strchr (__s, __c); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * strchr (const char *__s, int __c) noexcept (true) { return __builtin_strchr (__s, __c); } } # 270 "/usr/include/string.h" 3 4 extern "C++" { extern char *strrchr (char *__s, int __c) noexcept (true) __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const char *strrchr (const char *__s, int __c) noexcept (true) __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr (char *__s, int __c) noexcept (true) { return __builtin_strrchr (__s, __c); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * strrchr (const char *__s, int __c) noexcept (true) { return __builtin_strrchr (__s, __c); } } # 304 "/usr/include/string.h" 3 4 extern "C++" char *strchrnul (char *__s, int __c) noexcept (true) __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern "C++" const char *strchrnul (const char *__s, int __c) noexcept (true) __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 316 "/usr/include/string.h" 3 4 extern size_t strcspn (const char *__s, const char *__reject) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (const char *__s, const char *__accept) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern "C++" { extern char *strpbrk (char *__s, const char *__accept) noexcept (true) __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern const char *strpbrk (const char *__s, const char *__accept) noexcept (true) __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strpbrk (char *__s, const char *__accept) noexcept (true) { return __builtin_strpbrk (__s, __accept); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * strpbrk (const char *__s, const char *__accept) noexcept (true) { return __builtin_strpbrk (__s, __accept); } } # 355 "/usr/include/string.h" 3 4 extern "C++" { extern char *strstr (char *__haystack, const char *__needle) noexcept (true) __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern const char *strstr (const char *__haystack, const char *__needle) noexcept (true) __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strstr (char *__haystack, const char *__needle) noexcept (true) { return __builtin_strstr (__haystack, __needle); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * strstr (const char *__haystack, const char *__needle) noexcept (true) { return __builtin_strstr (__haystack, __needle); } } # 388 "/usr/include/string.h" 3 4 extern char *strtok (char *__restrict __s, const char *__restrict __delim) noexcept (true) __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) noexcept (true) __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) noexcept (true) __attribute__ ((__nonnull__ (2, 3))); extern "C++" char *strcasestr (char *__haystack, const char *__needle) noexcept (true) __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern "C++" const char *strcasestr (const char *__haystack, const char *__needle) noexcept (true) __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 421 "/usr/include/string.h" 3 4 extern void *memmem (const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__access__ (__read_only__, 1, 2))) __attribute__ ((__access__ (__read_only__, 3, 4))); extern void *__mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern void *mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern size_t strlen (const char *__s) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strnlen (const char *__string, size_t __maxlen) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strerror (int __errnum) noexcept (true); # 476 "/usr/include/string.h" 3 4 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) noexcept (true) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__)) __attribute__ ((__access__ (__write_only__, 2, 3))); extern const char *strerrordesc_np (int __err) noexcept (true); extern const char *strerrorname_np (int __err) noexcept (true); extern char *strerror_l (int __errnum, locale_t __l) noexcept (true); # 1 "/usr/include/strings.h" 1 3 4 # 23 "/usr/include/strings.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h" 1 3 4 # 24 "/usr/include/strings.h" 2 3 4 extern "C" { extern int bcmp (const void *__s1, const void *__s2, size_t __n) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void bcopy (const void *__src, void *__dest, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1))); extern "C++" { extern char *index (char *__s, int __c) noexcept (true) __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const char *index (const char *__s, int __c) noexcept (true) __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * index (char *__s, int __c) noexcept (true) { return __builtin_index (__s, __c); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * index (const char *__s, int __c) noexcept (true) { return __builtin_index (__s, __c); } } extern "C++" { extern char *rindex (char *__s, int __c) noexcept (true) __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const char *rindex (const char *__s, int __c) noexcept (true) __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * rindex (char *__s, int __c) noexcept (true) { return __builtin_rindex (__s, __c); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * rindex (const char *__s, int __c) noexcept (true) { return __builtin_rindex (__s, __c); } } # 104 "/usr/include/strings.h" 3 4 extern int ffs (int __i) noexcept (true) __attribute__ ((__const__)); extern int ffsl (long int __l) noexcept (true) __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) noexcept (true) __attribute__ ((__const__)); extern int strcasecmp (const char *__s1, const char *__s2) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern int strncasecmp_l (const char *__s1, const char *__s2, size_t __n, locale_t __loc) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4))); } # 1 "/usr/include/x86_64-linux-gnu/bits/strings_fortified.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/strings_fortified.h" 3 4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void __attribute__ ((__leaf__)) bcopy (const void *__src, void *__dest, size_t __len) noexcept (true) { (void) __builtin___memmove_chk (__dest, __src, __len, __builtin_dynamic_object_size (__dest, 0)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void __attribute__ ((__leaf__)) bzero (void *__dest, size_t __len) noexcept (true) { (void) __builtin___memset_chk (__dest, '\0', __len, __builtin_dynamic_object_size (__dest, 0)); } # 145 "/usr/include/strings.h" 2 3 4 # 495 "/usr/include/string.h" 2 3 4 extern void explicit_bzero (void *__s, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1))) ; extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern char *strsignal (int __sig) noexcept (true); extern const char *sigabbrev_np (int __sig) noexcept (true); extern const char *sigdescr_np (int __sig) noexcept (true); extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern char *__stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern char *stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))); extern size_t strlcpy (char *__restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 3))); extern size_t strlcat (char *__restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__read_write__, 1, 3))); extern int strverscmp (const char *__s1, const char *__s2) noexcept (true) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strfry (char *__string) noexcept (true) __attribute__ ((__nonnull__ (1))); extern void *memfrob (void *__s, size_t __n) noexcept (true) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_write__, 1, 2))); extern "C++" char *basename (char *__filename) noexcept (true) __asm ("basename") __attribute__ ((__nonnull__ (1))); extern "C++" const char *basename (const char *__filename) noexcept (true) __asm ("basename") __attribute__ ((__nonnull__ (1))); # 580 "/usr/include/string.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/string_fortified.h" 1 3 4 # 25 "/usr/include/x86_64-linux-gnu/bits/string_fortified.h" 3 4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__leaf__)) memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len) noexcept (true) { return __builtin___memcpy_chk (__dest, __src, __len, __builtin_dynamic_object_size (__dest, 0)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__leaf__)) memmove (void *__dest, const void *__src, size_t __len) noexcept (true) { return __builtin___memmove_chk (__dest, __src, __len, __builtin_dynamic_object_size (__dest, 0)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__leaf__)) mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __len) noexcept (true) { return __builtin___mempcpy_chk (__dest, __src, __len, __builtin_dynamic_object_size (__dest, 0)); } # 56 "/usr/include/x86_64-linux-gnu/bits/string_fortified.h" 3 4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__leaf__)) memset (void *__dest, int __ch, size_t __len) noexcept (true) { return __builtin___memset_chk (__dest, __ch, __len, __builtin_dynamic_object_size (__dest, 0)); } void *__memset_explicit_chk (void *__s, int __c, size_t __n, size_t __destlen) noexcept (true) __attribute__ ((__nonnull__ (1))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__leaf__)) memset_explicit (void *__dest, int __ch, size_t __len) noexcept (true) { return __memset_explicit_chk (__dest, __ch, __len, __builtin_dynamic_object_size (__dest, 0)); } void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen) noexcept (true) __attribute__ ((__nonnull__ (1))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void __attribute__ ((__leaf__)) explicit_bzero (void *__dest, size_t __len) noexcept (true) { __explicit_bzero_chk (__dest, __len, __builtin_dynamic_object_size (__dest, 0)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__leaf__)) strcpy (char * __restrict __dest, const char *__restrict __src) noexcept (true) { return __builtin___strcpy_chk (__dest, __src, __builtin_dynamic_object_size (__dest, 1)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__leaf__)) stpcpy (char * __restrict __dest, const char *__restrict __src) noexcept (true) { return __builtin___stpcpy_chk (__dest, __src, __builtin_dynamic_object_size (__dest, 1)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__leaf__)) strncpy (char * __restrict __dest, const char *__restrict __src, size_t __len) noexcept (true) { return __builtin___strncpy_chk (__dest, __src, __len, __builtin_dynamic_object_size (__dest, 1)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__leaf__)) stpncpy (char * __dest, const char *__src, size_t __n) noexcept (true) { return __builtin___stpncpy_chk (__dest, __src, __n, __builtin_dynamic_object_size (__dest, 1)); } # 147 "/usr/include/x86_64-linux-gnu/bits/string_fortified.h" 3 4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__leaf__)) strcat (char * __restrict __dest, const char *__restrict __src) noexcept (true) { return __builtin___strcat_chk (__dest, __src, __builtin_dynamic_object_size (__dest, 1)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__leaf__)) strncat (char * __restrict __dest, const char *__restrict __src, size_t __len) noexcept (true) { return __builtin___strncat_chk (__dest, __src, __len, __builtin_dynamic_object_size (__dest, 1)); } extern size_t __strlcpy_chk (char *__dest, const char *__src, size_t __n, size_t __destlen) noexcept (true); extern size_t __strlcpy_alias (char *__dest, const char *__src, size_t __n) noexcept (true) __asm__ ("" "strlcpy") ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) size_t __attribute__ ((__leaf__)) strlcpy (char * __restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) { if (__builtin_dynamic_object_size (__dest, 1) != (size_t) -1 && (!__builtin_constant_p (__n > __builtin_dynamic_object_size (__dest, 1)) || __n > __builtin_dynamic_object_size (__dest, 1))) return __strlcpy_chk (__dest, __src, __n, __builtin_dynamic_object_size (__dest, 1)); return __strlcpy_alias (__dest, __src, __n); } extern size_t __strlcat_chk (char *__dest, const char *__src, size_t __n, size_t __destlen) noexcept (true); extern size_t __strlcat_alias (char *__dest, const char *__src, size_t __n) noexcept (true) __asm__ ("" "strlcat") ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) size_t __attribute__ ((__leaf__)) strlcat (char * __restrict __dest, const char *__restrict __src, size_t __n) noexcept (true) { if (__builtin_dynamic_object_size (__dest, 1) != (size_t) -1 && (!__builtin_constant_p (__n > __builtin_dynamic_object_size (__dest, 1)) || __n > __builtin_dynamic_object_size (__dest, 1))) return __strlcat_chk (__dest, __src, __n, __builtin_dynamic_object_size (__dest, 1)); return __strlcat_alias (__dest, __src, __n); } # 581 "/usr/include/string.h" 2 3 4 } # 49 "/usr/include/c++/15/cstring" 2 3 # 74 "/usr/include/c++/15/cstring" 3 extern "C++" { namespace std __attribute__ ((__visibility__ ("default"))) { using ::memchr; using ::memcmp; using ::memcpy; using ::memmove; using ::memset; using ::strcat; using ::strcmp; using ::strcoll; using ::strcpy; using ::strcspn; using ::strerror; using ::strlen; using ::strncat; using ::strncmp; using ::strncpy; using ::strspn; using ::strtok; using ::strxfrm; using ::strchr; using ::strpbrk; using ::strrchr; using ::strstr; # 127 "/usr/include/c++/15/cstring" 3 } } # 0 "" 2 # 1 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Sources/Utilities/Hash.cc" # 1 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Utilities/Hash.hh" 1 # 1 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Base.hh" 1 # 1 "/usr/include/c++/15/cstddef" 1 3 # 52 "/usr/include/c++/15/cstddef" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h" 1 3 4 # 160 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h" 3 4 typedef long int ptrdiff_t; # 440 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h" 3 4 typedef struct { long long __max_align_ll __attribute__((__aligned__(__alignof__(long long)))); long double __max_align_ld __attribute__((__aligned__(__alignof__(long double)))); # 451 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h" 3 4 } max_align_t; typedef decltype(nullptr) nullptr_t; # 53 "/usr/include/c++/15/cstddef" 2 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 56 "/usr/include/c++/15/cstddef" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" extern "C++" { namespace std { using ::max_align_t; } namespace std { enum class byte : unsigned char {}; template struct __byte_operand { }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; template<> struct __byte_operand<__int128> { using __type = byte; }; template<> struct __byte_operand { using __type = byte; }; # 114 "/usr/include/c++/15/cstddef" 3 template struct __byte_operand : __byte_operand<_IntegerType> { }; template struct __byte_operand : __byte_operand<_IntegerType> { }; template struct __byte_operand : __byte_operand<_IntegerType> { }; template using __byte_op_t = typename __byte_operand<_IntegerType>::__type; template [[__gnu__::__always_inline__]] constexpr __byte_op_t<_IntegerType> operator<<(byte __b, _IntegerType __shift) noexcept { return (byte)(unsigned char)((unsigned)__b << __shift); } template [[__gnu__::__always_inline__]] constexpr __byte_op_t<_IntegerType> operator>>(byte __b, _IntegerType __shift) noexcept { return (byte)(unsigned char)((unsigned)__b >> __shift); } [[__gnu__::__always_inline__]] constexpr byte operator|(byte __l, byte __r) noexcept { return (byte)(unsigned char)((unsigned)__l | (unsigned)__r); } [[__gnu__::__always_inline__]] constexpr byte operator&(byte __l, byte __r) noexcept { return (byte)(unsigned char)((unsigned)__l & (unsigned)__r); } [[__gnu__::__always_inline__]] constexpr byte operator^(byte __l, byte __r) noexcept { return (byte)(unsigned char)((unsigned)__l ^ (unsigned)__r); } [[__gnu__::__always_inline__]] constexpr byte operator~(byte __b) noexcept { return (byte)(unsigned char)~(unsigned)__b; } template [[__gnu__::__always_inline__]] constexpr __byte_op_t<_IntegerType>& operator<<=(byte& __b, _IntegerType __shift) noexcept { return __b = __b << __shift; } template [[__gnu__::__always_inline__]] constexpr __byte_op_t<_IntegerType>& operator>>=(byte& __b, _IntegerType __shift) noexcept { return __b = __b >> __shift; } [[__gnu__::__always_inline__]] constexpr byte& operator|=(byte& __l, byte __r) noexcept { return __l = __l | __r; } [[__gnu__::__always_inline__]] constexpr byte& operator&=(byte& __l, byte __r) noexcept { return __l = __l & __r; } [[__gnu__::__always_inline__]] constexpr byte& operator^=(byte& __l, byte __r) noexcept { return __l = __l ^ __r; } template [[nodiscard,__gnu__::__always_inline__]] constexpr _IntegerType to_integer(__byte_op_t<_IntegerType> __b) noexcept { return _IntegerType(__b); } } } #pragma GCC diagnostic pop # 7 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Base.hh" 2 # 1 "/usr/include/c++/15/cstdint" 1 3 # 47 "/usr/include/c++/15/cstdint" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stdint.h" 1 3 4 # 9 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stdint.h" 3 4 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" # 1 "/usr/include/stdint.h" 1 3 4 # 26 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4 # 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4 # 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; typedef signed long int __int64_t; typedef unsigned long int __uint64_t; typedef __int8_t __int_least8_t; typedef __uint8_t __uint_least8_t; typedef __int16_t __int_least16_t; typedef __uint16_t __uint_least16_t; typedef __int32_t __int_least32_t; typedef __uint32_t __uint_least32_t; typedef __int64_t __int_least64_t; typedef __uint64_t __uint_least64_t; typedef long int __quad_t; typedef unsigned long int __u_quad_t; typedef long int __intmax_t; typedef unsigned long int __uintmax_t; # 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4 # 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4 # 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 typedef unsigned long int __dev_t; typedef unsigned int __uid_t; typedef unsigned int __gid_t; typedef unsigned long int __ino_t; typedef unsigned long int __ino64_t; typedef unsigned int __mode_t; typedef unsigned long int __nlink_t; typedef long int __off_t; typedef long int __off64_t; typedef int __pid_t; typedef struct { int __val[2]; } __fsid_t; typedef long int __clock_t; typedef unsigned long int __rlim_t; typedef unsigned long int __rlim64_t; typedef unsigned int __id_t; typedef long int __time_t; typedef unsigned int __useconds_t; typedef long int __suseconds_t; typedef long int __suseconds64_t; typedef int __daddr_t; typedef int __key_t; typedef int __clockid_t; typedef void * __timer_t; typedef long int __blksize_t; typedef long int __blkcnt_t; typedef long int __blkcnt64_t; typedef unsigned long int __fsblkcnt_t; typedef unsigned long int __fsblkcnt64_t; typedef unsigned long int __fsfilcnt_t; typedef unsigned long int __fsfilcnt64_t; typedef long int __fsword_t; typedef long int __ssize_t; typedef long int __syscall_slong_t; typedef unsigned long int __syscall_ulong_t; typedef __off64_t __loff_t; typedef char *__caddr_t; typedef long int __intptr_t; typedef unsigned int __socklen_t; typedef int __sig_atomic_t; # 28 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4 # 29 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 30 "/usr/include/stdint.h" 2 3 4 # 38 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4 typedef __int8_t int8_t; typedef __int16_t int16_t; typedef __int32_t int32_t; typedef __int64_t int64_t; # 39 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4 typedef __uint8_t uint8_t; typedef __uint16_t uint16_t; typedef __uint32_t uint32_t; typedef __uint64_t uint64_t; # 42 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdint-least.h" 1 3 4 # 25 "/usr/include/x86_64-linux-gnu/bits/stdint-least.h" 3 4 typedef __int_least8_t int_least8_t; typedef __int_least16_t int_least16_t; typedef __int_least32_t int_least32_t; typedef __int_least64_t int_least64_t; typedef __uint_least8_t uint_least8_t; typedef __uint_least16_t uint_least16_t; typedef __uint_least32_t uint_least32_t; typedef __uint_least64_t uint_least64_t; # 46 "/usr/include/stdint.h" 2 3 4 typedef signed char int_fast8_t; typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; # 64 "/usr/include/stdint.h" 3 4 typedef unsigned char uint_fast8_t; typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; # 80 "/usr/include/stdint.h" 3 4 typedef long int intptr_t; typedef unsigned long int uintptr_t; # 94 "/usr/include/stdint.h" 3 4 typedef __intmax_t intmax_t; typedef __uintmax_t uintmax_t; # 12 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stdint.h" 2 3 4 #pragma GCC diagnostic pop # 48 "/usr/include/c++/15/cstdint" 2 3 namespace std { using ::int8_t; using ::int16_t; using ::int32_t; using ::int64_t; using ::int_fast8_t; using ::int_fast16_t; using ::int_fast32_t; using ::int_fast64_t; using ::int_least8_t; using ::int_least16_t; using ::int_least32_t; using ::int_least64_t; using ::intmax_t; using ::intptr_t; using ::uint8_t; using ::uint16_t; using ::uint32_t; using ::uint64_t; using ::uint_fast8_t; using ::uint_fast16_t; using ::uint_fast32_t; using ::uint_fast64_t; using ::uint_least8_t; using ::uint_least16_t; using ::uint_least32_t; using ::uint_least64_t; using ::uintmax_t; using ::uintptr_t; # 144 "/usr/include/c++/15/cstdint" 3 } # 8 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Base.hh" 2 # 1 "/usr/include/c++/15/limits" 1 3 # 44 "/usr/include/c++/15/limits" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #pragma GCC diagnostic ignored "-Wlong-long" #pragma GCC diagnostic ignored "-Wc++23-extensions" # 165 "/usr/include/c++/15/limits" 3 namespace std __attribute__ ((__visibility__ ("default"))) { 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 }; # 209 "/usr/include/c++/15/limits" 3 struct __numeric_limits_base { static constexpr bool is_specialized = false; static constexpr int digits = 0; static constexpr int digits10 = 0; static constexpr int max_digits10 = 0; static constexpr bool is_signed = false; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 0; static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr bool is_iec559 = false; static constexpr bool is_bounded = false; # 295 "/usr/include/c++/15/limits" 3 static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; # 318 "/usr/include/c++/15/limits" 3 template struct numeric_limits : public __numeric_limits_base { static constexpr _Tp min() noexcept { return _Tp(); } static constexpr _Tp max() noexcept { return _Tp(); } static constexpr _Tp lowest() noexcept { return _Tp(); } static constexpr _Tp epsilon() noexcept { return _Tp(); } static constexpr _Tp round_error() noexcept { return _Tp(); } static constexpr _Tp infinity() noexcept { return _Tp(); } static constexpr _Tp quiet_NaN() noexcept { return _Tp(); } static constexpr _Tp signaling_NaN() noexcept { return _Tp(); } static constexpr _Tp denorm_min() noexcept { return _Tp(); } }; template struct numeric_limits : public numeric_limits<_Tp> { }; template struct numeric_limits : public numeric_limits<_Tp> { }; template struct numeric_limits : public numeric_limits<_Tp> { }; # 390 "/usr/include/c++/15/limits" 3 template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr bool min() noexcept { return false; } static constexpr bool max() noexcept { return true; } static constexpr bool lowest() noexcept { return min(); } static constexpr int digits = 1; static constexpr int digits10 = 0; static constexpr int max_digits10 = 0; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr bool epsilon() noexcept { return false; } static constexpr bool round_error() noexcept { return false; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr bool infinity() noexcept { return false; } static constexpr bool quiet_NaN() noexcept { return false; } static constexpr bool signaling_NaN() noexcept { return false; } static constexpr bool denorm_min() noexcept { return false; } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr char min() noexcept { return (((char)(-1) < 0) ? -(((char)(-1) < 0) ? (((((char)1 << ((sizeof(char) * 8 - ((char)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char)0) - 1 : (char)0); } static constexpr char max() noexcept { return (((char)(-1) < 0) ? (((((char)1 << ((sizeof(char) * 8 - ((char)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char)0); } static constexpr char lowest() noexcept { return min(); } static constexpr int digits = (sizeof(char) * 8 - ((char)(-1) < 0)); static constexpr int digits10 = ((sizeof(char) * 8 - ((char)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = ((char)(-1) < 0); static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr char epsilon() noexcept { return 0; } static constexpr char round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr char infinity() noexcept { return char(); } static constexpr char quiet_NaN() noexcept { return char(); } static constexpr char signaling_NaN() noexcept { return char(); } static constexpr char denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = !is_signed; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr signed char min() noexcept { return -0x7f - 1; } static constexpr signed char max() noexcept { return 0x7f; } static constexpr signed char lowest() noexcept { return min(); } static constexpr int digits = (sizeof(signed char) * 8 - ((signed char)(-1) < 0)); static constexpr int digits10 = ((sizeof(signed char) * 8 - ((signed char)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = true; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr signed char epsilon() noexcept { return 0; } static constexpr signed char round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr signed char infinity() noexcept { return static_cast(0); } static constexpr signed char quiet_NaN() noexcept { return static_cast(0); } static constexpr signed char signaling_NaN() noexcept { return static_cast(0); } static constexpr signed char denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr unsigned char min() noexcept { return 0; } static constexpr unsigned char max() noexcept { return 0x7f * 2U + 1; } static constexpr unsigned char lowest() noexcept { return min(); } static constexpr int digits = (sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0)); static constexpr int digits10 = ((sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr unsigned char epsilon() noexcept { return 0; } static constexpr unsigned char round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr unsigned char infinity() noexcept { return static_cast(0); } static constexpr unsigned char quiet_NaN() noexcept { return static_cast(0); } static constexpr unsigned char signaling_NaN() noexcept { return static_cast(0); } static constexpr unsigned char denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = true; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr wchar_t min() noexcept { return (((wchar_t)(-1) < 0) ? -(((wchar_t)(-1) < 0) ? (((((wchar_t)1 << ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(wchar_t)0) - 1 : (wchar_t)0); } static constexpr wchar_t max() noexcept { return (((wchar_t)(-1) < 0) ? (((((wchar_t)1 << ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(wchar_t)0); } static constexpr wchar_t lowest() noexcept { return min(); } static constexpr int digits = (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)); static constexpr int digits10 = ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = ((wchar_t)(-1) < 0); static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr wchar_t epsilon() noexcept { return 0; } static constexpr wchar_t round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr wchar_t infinity() noexcept { return wchar_t(); } static constexpr wchar_t quiet_NaN() noexcept { return wchar_t(); } static constexpr wchar_t signaling_NaN() noexcept { return wchar_t(); } static constexpr wchar_t denorm_min() noexcept { return wchar_t(); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = !is_signed; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr char8_t min() noexcept { return (((char8_t)(-1) < 0) ? -(((char8_t)(-1) < 0) ? (((((char8_t)1 << ((sizeof(char8_t) * 8 - ((char8_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char8_t)0) - 1 : (char8_t)0); } static constexpr char8_t max() noexcept { return (((char8_t)(-1) < 0) ? (((((char8_t)1 << ((sizeof(char8_t) * 8 - ((char8_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char8_t)0); } static constexpr char8_t lowest() noexcept { return min(); } static constexpr int digits = (sizeof(char8_t) * 8 - ((char8_t)(-1) < 0)); static constexpr int digits10 = ((sizeof(char8_t) * 8 - ((char8_t)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = ((char8_t)(-1) < 0); static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr char8_t epsilon() noexcept { return 0; } static constexpr char8_t round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr char8_t infinity() noexcept { return char8_t(); } static constexpr char8_t quiet_NaN() noexcept { return char8_t(); } static constexpr char8_t signaling_NaN() noexcept { return char8_t(); } static constexpr char8_t denorm_min() noexcept { return char8_t(); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = !is_signed; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr char16_t min() noexcept { return (((char16_t)(-1) < 0) ? -(((char16_t)(-1) < 0) ? (((((char16_t)1 << ((sizeof(char16_t) * 8 - ((char16_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char16_t)0) - 1 : (char16_t)0); } static constexpr char16_t max() noexcept { return (((char16_t)(-1) < 0) ? (((((char16_t)1 << ((sizeof(char16_t) * 8 - ((char16_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char16_t)0); } static constexpr char16_t lowest() noexcept { return min(); } static constexpr int digits = (sizeof(char16_t) * 8 - ((char16_t)(-1) < 0)); static constexpr int digits10 = ((sizeof(char16_t) * 8 - ((char16_t)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = ((char16_t)(-1) < 0); static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr char16_t epsilon() noexcept { return 0; } static constexpr char16_t round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr char16_t infinity() noexcept { return char16_t(); } static constexpr char16_t quiet_NaN() noexcept { return char16_t(); } static constexpr char16_t signaling_NaN() noexcept { return char16_t(); } static constexpr char16_t denorm_min() noexcept { return char16_t(); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = !is_signed; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr char32_t min() noexcept { return (((char32_t)(-1) < 0) ? -(((char32_t)(-1) < 0) ? (((((char32_t)1 << ((sizeof(char32_t) * 8 - ((char32_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char32_t)0) - 1 : (char32_t)0); } static constexpr char32_t max() noexcept { return (((char32_t)(-1) < 0) ? (((((char32_t)1 << ((sizeof(char32_t) * 8 - ((char32_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char32_t)0); } static constexpr char32_t lowest() noexcept { return min(); } static constexpr int digits = (sizeof(char32_t) * 8 - ((char32_t)(-1) < 0)); static constexpr int digits10 = ((sizeof(char32_t) * 8 - ((char32_t)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = ((char32_t)(-1) < 0); static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr char32_t epsilon() noexcept { return 0; } static constexpr char32_t round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr char32_t infinity() noexcept { return char32_t(); } static constexpr char32_t quiet_NaN() noexcept { return char32_t(); } static constexpr char32_t signaling_NaN() noexcept { return char32_t(); } static constexpr char32_t denorm_min() noexcept { return char32_t(); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = !is_signed; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr short min() noexcept { return -0x7fff - 1; } static constexpr short max() noexcept { return 0x7fff; } static constexpr short lowest() noexcept { return min(); } static constexpr int digits = (sizeof(short) * 8 - ((short)(-1) < 0)); static constexpr int digits10 = ((sizeof(short) * 8 - ((short)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = true; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr short epsilon() noexcept { return 0; } static constexpr short round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr short infinity() noexcept { return short(); } static constexpr short quiet_NaN() noexcept { return short(); } static constexpr short signaling_NaN() noexcept { return short(); } static constexpr short denorm_min() noexcept { return short(); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr unsigned short min() noexcept { return 0; } static constexpr unsigned short max() noexcept { return 0x7fff * 2U + 1; } static constexpr unsigned short lowest() noexcept { return min(); } static constexpr int digits = (sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0)); static constexpr int digits10 = ((sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr unsigned short epsilon() noexcept { return 0; } static constexpr unsigned short round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr unsigned short infinity() noexcept { return static_cast(0); } static constexpr unsigned short quiet_NaN() noexcept { return static_cast(0); } static constexpr unsigned short signaling_NaN() noexcept { return static_cast(0); } static constexpr unsigned short denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = true; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr int min() noexcept { return -0x7fffffff - 1; } static constexpr int max() noexcept { return 0x7fffffff; } static constexpr int lowest() noexcept { return min(); } static constexpr int digits = (sizeof(int) * 8 - ((int)(-1) < 0)); static constexpr int digits10 = ((sizeof(int) * 8 - ((int)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = true; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr int epsilon() noexcept { return 0; } static constexpr int round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr int infinity() noexcept { return static_cast(0); } static constexpr int quiet_NaN() noexcept { return static_cast(0); } static constexpr int signaling_NaN() noexcept { return static_cast(0); } static constexpr int denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr unsigned int min() noexcept { return 0; } static constexpr unsigned int max() noexcept { return 0x7fffffff * 2U + 1; } static constexpr unsigned int lowest() noexcept { return min(); } static constexpr int digits = (sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0)); static constexpr int digits10 = ((sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr unsigned int epsilon() noexcept { return 0; } static constexpr unsigned int round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr unsigned int infinity() noexcept { return static_cast(0); } static constexpr unsigned int quiet_NaN() noexcept { return static_cast(0); } static constexpr unsigned int signaling_NaN() noexcept { return static_cast(0); } static constexpr unsigned int denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = true; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr long min() noexcept { return -0x7fffffffffffffffL - 1; } static constexpr long max() noexcept { return 0x7fffffffffffffffL; } static constexpr long lowest() noexcept { return min(); } static constexpr int digits = (sizeof(long) * 8 - ((long)(-1) < 0)); static constexpr int digits10 = ((sizeof(long) * 8 - ((long)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = true; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr long epsilon() noexcept { return 0; } static constexpr long round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr long infinity() noexcept { return static_cast(0); } static constexpr long quiet_NaN() noexcept { return static_cast(0); } static constexpr long signaling_NaN() noexcept { return static_cast(0); } static constexpr long denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr unsigned long min() noexcept { return 0; } static constexpr unsigned long max() noexcept { return 0x7fffffffffffffffL * 2UL + 1; } static constexpr unsigned long lowest() noexcept { return min(); } static constexpr int digits = (sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0)); static constexpr int digits10 = ((sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr unsigned long epsilon() noexcept { return 0; } static constexpr unsigned long round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr unsigned long infinity() noexcept { return static_cast(0); } static constexpr unsigned long quiet_NaN() noexcept { return static_cast(0); } static constexpr unsigned long signaling_NaN() noexcept { return static_cast(0); } static constexpr unsigned long denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = true; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr long long min() noexcept { return -0x7fffffffffffffffLL - 1; } static constexpr long long max() noexcept { return 0x7fffffffffffffffLL; } static constexpr long long lowest() noexcept { return min(); } static constexpr int digits = (sizeof(long long) * 8 - ((long long)(-1) < 0)); static constexpr int digits10 = ((sizeof(long long) * 8 - ((long long)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = true; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr long long epsilon() noexcept { return 0; } static constexpr long long round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr long long infinity() noexcept { return static_cast(0); } static constexpr long long quiet_NaN() noexcept { return static_cast(0); } static constexpr long long signaling_NaN() noexcept { return static_cast(0); } static constexpr long long denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr unsigned long long min() noexcept { return 0; } static constexpr unsigned long long max() noexcept { return 0x7fffffffffffffffLL * 2ULL + 1; } static constexpr unsigned long long lowest() noexcept { return min(); } static constexpr int digits = (sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0)); static constexpr int digits10 = ((sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0)) * 643L / 2136); static constexpr int max_digits10 = 0; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr unsigned long long epsilon() noexcept { return 0; } static constexpr unsigned long long round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr unsigned long long infinity() noexcept { return static_cast(0); } static constexpr unsigned long long quiet_NaN() noexcept { return static_cast(0); } static constexpr unsigned long long signaling_NaN() noexcept { return static_cast(0); } static constexpr unsigned long long denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = true; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; # 1644 "/usr/include/c++/15/limits" 3 __extension__ template<> struct numeric_limits<__int128> { static constexpr bool is_specialized = true; static constexpr __int128 min() noexcept { return (((__int128)(-1) < 0) ? -(((__int128)(-1) < 0) ? (((((__int128)1 << ((128 - ((__int128)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(__int128)0) - 1 : (__int128)0); } static constexpr __int128 max() noexcept { return (((__int128)(-1) < 0) ? (((((__int128)1 << ((128 - ((__int128)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(__int128)0); } static constexpr int digits = 128 - 1; static constexpr int digits10 = (128 - 1) * 643L / 2136; static constexpr bool is_signed = true; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr __int128 epsilon() noexcept { return 0; } static constexpr __int128 round_error() noexcept { return 0; } static constexpr __int128 lowest() noexcept { return min(); } static constexpr int max_digits10 = 0; static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr __int128 infinity() noexcept { return static_cast<__int128>(0); } static constexpr __int128 quiet_NaN() noexcept { return static_cast<__int128>(0); } static constexpr __int128 signaling_NaN() noexcept { return static_cast<__int128>(0); } static constexpr __int128 denorm_min() noexcept { return static_cast<__int128>(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; __extension__ template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr unsigned __int128 min() noexcept { return 0; } static constexpr unsigned __int128 max() noexcept { return (((unsigned __int128)(-1) < 0) ? (((((unsigned __int128)1 << ((128 - ((unsigned __int128)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(unsigned __int128)0); } static constexpr unsigned __int128 lowest() noexcept { return min(); } static constexpr int max_digits10 = 0; static constexpr int digits = 128; static constexpr int digits10 = 128 * 643L / 2136; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr unsigned __int128 epsilon() noexcept { return 0; } static constexpr unsigned __int128 round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr unsigned __int128 infinity() noexcept { return static_cast(0); } static constexpr unsigned __int128 quiet_NaN() noexcept { return static_cast(0); } static constexpr unsigned __int128 signaling_NaN() noexcept { return static_cast(0); } static constexpr unsigned __int128 denorm_min() noexcept { return static_cast(0); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = true; static constexpr bool traps = true; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; # 1676 "/usr/include/c++/15/limits" 3 template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr float min() noexcept { return 1.17549435082228750796873653722224568e-38F; } static constexpr float max() noexcept { return 3.40282346638528859811704183484516925e+38F; } static constexpr float lowest() noexcept { return -3.40282346638528859811704183484516925e+38F; } static constexpr int digits = 24; static constexpr int digits10 = 6; static constexpr int max_digits10 = (2 + (24) * 643L / 2136); static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr float epsilon() noexcept { return 1.19209289550781250000000000000000000e-7F; } static constexpr float round_error() noexcept { return 0.5F; } static constexpr int min_exponent = (-125); static constexpr int min_exponent10 = (-37); static constexpr int max_exponent = 128; static constexpr int max_exponent10 = 38; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = has_quiet_NaN; static constexpr float_denorm_style has_denorm = bool(1) ? denorm_present : denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr float infinity() noexcept { return __builtin_huge_valf(); } static constexpr float quiet_NaN() noexcept { return __builtin_nanf(""); } static constexpr float signaling_NaN() noexcept { return __builtin_nansf(""); } static constexpr float denorm_min() noexcept { return 1.40129846432481707092372958328991613e-45F; } static constexpr bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr double min() noexcept { return double(2.22507385850720138309023271733240406e-308L); } static constexpr double max() noexcept { return double(1.79769313486231570814527423731704357e+308L); } static constexpr double lowest() noexcept { return -double(1.79769313486231570814527423731704357e+308L); } static constexpr int digits = 53; static constexpr int digits10 = 15; static constexpr int max_digits10 = (2 + (53) * 643L / 2136); static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr double epsilon() noexcept { return double(2.22044604925031308084726333618164062e-16L); } static constexpr double round_error() noexcept { return 0.5; } static constexpr int min_exponent = (-1021); static constexpr int min_exponent10 = (-307); static constexpr int max_exponent = 1024; static constexpr int max_exponent10 = 308; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = has_quiet_NaN; static constexpr float_denorm_style has_denorm = bool(1) ? denorm_present : denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr double infinity() noexcept { return __builtin_huge_val(); } static constexpr double quiet_NaN() noexcept { return __builtin_nan(""); } static constexpr double signaling_NaN() noexcept { return __builtin_nans(""); } static constexpr double denorm_min() noexcept { return double(4.94065645841246544176568792868221372e-324L); } static constexpr bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; }; template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr long double min() noexcept { return 3.36210314311209350626267781732175260e-4932L; } static constexpr long double max() noexcept { return 1.18973149535723176502126385303097021e+4932L; } static constexpr long double lowest() noexcept { return -1.18973149535723176502126385303097021e+4932L; } static constexpr int digits = 64; static constexpr int digits10 = 18; static constexpr int max_digits10 = (2 + (64) * 643L / 2136); static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr long double epsilon() noexcept { return 1.08420217248550443400745280086994171e-19L; } static constexpr long double round_error() noexcept { return 0.5L; } static constexpr int min_exponent = (-16381); static constexpr int min_exponent10 = (-4931); static constexpr int max_exponent = 16384; static constexpr int max_exponent10 = 4932; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = has_quiet_NaN; static constexpr float_denorm_style has_denorm = bool(1) ? denorm_present : denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr long double infinity() noexcept { return __builtin_huge_vall(); } static constexpr long double quiet_NaN() noexcept { return __builtin_nanl(""); } static constexpr long double signaling_NaN() noexcept { return __builtin_nansl(""); } static constexpr long double denorm_min() noexcept { return 3.64519953188247460252840593361941982e-4951L; } static constexpr bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; }; # 1993 "/usr/include/c++/15/limits" 3 __extension__ template<> struct numeric_limits<_Float16> { static constexpr bool is_specialized = true; static constexpr _Float16 min() noexcept { return 6.10351562500000000000000000000000000e-5F16; } static constexpr _Float16 max() noexcept { return 6.55040000000000000000000000000000000e+4F16; } static constexpr _Float16 lowest() noexcept { return -6.55040000000000000000000000000000000e+4F16; } static constexpr int digits = 11; static constexpr int digits10 = 3; static constexpr int max_digits10 = (2 + (11) * 643L / 2136); static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr _Float16 epsilon() noexcept { return 9.76562500000000000000000000000000000e-4F16; } static constexpr _Float16 round_error() noexcept { return 0.5F16; } static constexpr int min_exponent = (-13); static constexpr int min_exponent10 = (-4); static constexpr int max_exponent = 16; static constexpr int max_exponent10 = 4; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = has_quiet_NaN; static constexpr float_denorm_style has_denorm = bool(1) ? denorm_present : denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr _Float16 infinity() noexcept { return __builtin_huge_valf16(); } static constexpr _Float16 quiet_NaN() noexcept { return __builtin_nanf16(""); } static constexpr _Float16 signaling_NaN() noexcept { return __builtin_nansf16(""); } static constexpr _Float16 denorm_min() noexcept { return 5.96046447753906250000000000000000000e-8F16; } static constexpr bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; }; __extension__ template<> struct numeric_limits<_Float32> { static constexpr bool is_specialized = true; static constexpr _Float32 min() noexcept { return 1.17549435082228750796873653722224568e-38F32; } static constexpr _Float32 max() noexcept { return 3.40282346638528859811704183484516925e+38F32; } static constexpr _Float32 lowest() noexcept { return -3.40282346638528859811704183484516925e+38F32; } static constexpr int digits = 24; static constexpr int digits10 = 6; static constexpr int max_digits10 = (2 + (24) * 643L / 2136); static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr _Float32 epsilon() noexcept { return 1.19209289550781250000000000000000000e-7F32; } static constexpr _Float32 round_error() noexcept { return 0.5F32; } static constexpr int min_exponent = (-125); static constexpr int min_exponent10 = (-37); static constexpr int max_exponent = 128; static constexpr int max_exponent10 = 38; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = has_quiet_NaN; static constexpr float_denorm_style has_denorm = bool(1) ? denorm_present : denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr _Float32 infinity() noexcept { return __builtin_huge_valf32(); } static constexpr _Float32 quiet_NaN() noexcept { return __builtin_nanf32(""); } static constexpr _Float32 signaling_NaN() noexcept { return __builtin_nansf32(""); } static constexpr _Float32 denorm_min() noexcept { return 1.40129846432481707092372958328991613e-45F32; } static constexpr bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; }; __extension__ template<> struct numeric_limits<_Float64> { static constexpr bool is_specialized = true; static constexpr _Float64 min() noexcept { return 2.22507385850720138309023271733240406e-308F64; } static constexpr _Float64 max() noexcept { return 1.79769313486231570814527423731704357e+308F64; } static constexpr _Float64 lowest() noexcept { return -1.79769313486231570814527423731704357e+308F64; } static constexpr int digits = 53; static constexpr int digits10 = 15; static constexpr int max_digits10 = (2 + (53) * 643L / 2136); static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr _Float64 epsilon() noexcept { return 2.22044604925031308084726333618164062e-16F64; } static constexpr _Float64 round_error() noexcept { return 0.5F64; } static constexpr int min_exponent = (-1021); static constexpr int min_exponent10 = (-307); static constexpr int max_exponent = 1024; static constexpr int max_exponent10 = 308; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = has_quiet_NaN; static constexpr float_denorm_style has_denorm = bool(1) ? denorm_present : denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr _Float64 infinity() noexcept { return __builtin_huge_valf64(); } static constexpr _Float64 quiet_NaN() noexcept { return __builtin_nanf64(""); } static constexpr _Float64 signaling_NaN() noexcept { return __builtin_nansf64(""); } static constexpr _Float64 denorm_min() noexcept { return 4.94065645841246544176568792868221372e-324F64; } static constexpr bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; }; __extension__ template<> struct numeric_limits<_Float128> { static constexpr bool is_specialized = true; static constexpr _Float128 min() noexcept { return 3.36210314311209350626267781732175260e-4932F128; } static constexpr _Float128 max() noexcept { return 1.18973149535723176508575932662800702e+4932F128; } static constexpr _Float128 lowest() noexcept { return -1.18973149535723176508575932662800702e+4932F128; } static constexpr int digits = 113; static constexpr int digits10 = 33; static constexpr int max_digits10 = (2 + (113) * 643L / 2136); static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr _Float128 epsilon() noexcept { return 1.92592994438723585305597794258492732e-34F128; } static constexpr _Float128 round_error() noexcept { return 0.5F128; } static constexpr int min_exponent = (-16381); static constexpr int min_exponent10 = (-4931); static constexpr int max_exponent = 16384; static constexpr int max_exponent10 = 4932; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = has_quiet_NaN; static constexpr float_denorm_style has_denorm = bool(1) ? denorm_present : denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr _Float128 infinity() noexcept { return __builtin_huge_valf128(); } static constexpr _Float128 quiet_NaN() noexcept { return __builtin_nanf128(""); } static constexpr _Float128 signaling_NaN() noexcept { return __builtin_nansf128(""); } static constexpr _Float128 denorm_min() noexcept { return 6.47517511943802511092443895822764655e-4966F128; } static constexpr bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; }; # 2013 "/usr/include/c++/15/limits" 3 __extension__ template<> struct numeric_limits<__gnu_cxx::__bfloat16_t> { static constexpr bool is_specialized = true; static constexpr __gnu_cxx::__bfloat16_t min() noexcept { return 1.17549435082228750796873653722224568e-38BF16; } static constexpr __gnu_cxx::__bfloat16_t max() noexcept { return 3.38953138925153547590470800371487867e+38BF16; } static constexpr __gnu_cxx::__bfloat16_t lowest() noexcept { return -3.38953138925153547590470800371487867e+38BF16; } static constexpr int digits = 8; static constexpr int digits10 = 2; static constexpr int max_digits10 = (2 + (8) * 643L / 2136); static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr __gnu_cxx::__bfloat16_t epsilon() noexcept { return 7.81250000000000000000000000000000000e-3BF16; } static constexpr __gnu_cxx::__bfloat16_t round_error() noexcept { return 0.5BF16; } static constexpr int min_exponent = (-125); static constexpr int min_exponent10 = (-37); static constexpr int max_exponent = 128; static constexpr int max_exponent10 = 38; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = has_quiet_NaN; static constexpr float_denorm_style has_denorm = bool(1) ? denorm_present : denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr __gnu_cxx::__bfloat16_t infinity() noexcept { return __gnu_cxx::__bfloat16_t(__builtin_huge_valf()); } static constexpr __gnu_cxx::__bfloat16_t quiet_NaN() noexcept { return __gnu_cxx::__bfloat16_t(__builtin_nanf("")); } static constexpr __gnu_cxx::__bfloat16_t signaling_NaN() noexcept { return __builtin_nansf16b(""); } static constexpr __gnu_cxx::__bfloat16_t denorm_min() noexcept { return 9.18354961579912115600575419704879436e-41BF16; } static constexpr bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; }; __extension__ template<> struct numeric_limits<__float128> { static constexpr bool is_specialized = true; static constexpr __float128 min() noexcept { return __extension__ 0x1.0p-16382Q; } static constexpr __float128 max() noexcept { return __extension__ 0x1.ffffffffffffffffffffffffffffp+16383Q; } static constexpr __float128 lowest() noexcept { return -max(); } static constexpr int digits = 113; static constexpr int digits10 = 33; static constexpr int max_digits10 = 36; static constexpr bool is_signed = true; static constexpr bool is_integer = false; static constexpr bool is_exact = false; static constexpr int radix = 2; static constexpr __float128 epsilon() noexcept { return double(1.9259299443872359e-34); } static constexpr __float128 round_error() noexcept { return 0.5; } static constexpr int min_exponent = -16381; static constexpr int min_exponent10 = -4931; static constexpr int max_exponent = 16384; static constexpr int max_exponent10 = 4932; static constexpr bool has_infinity = 1; static constexpr bool has_quiet_NaN = 1; static constexpr bool has_signaling_NaN = true; static constexpr float_denorm_style has_denorm = denorm_present; static constexpr bool has_denorm_loss = false; static constexpr __float128 infinity() noexcept { return __builtin_huge_val(); } static constexpr __float128 quiet_NaN() noexcept { return __builtin_nan(""); } static constexpr __float128 signaling_NaN() noexcept { return __builtin_nansq(""); } static constexpr __float128 denorm_min() noexcept { return __extension__ 0x1.0p-16494Q; } static constexpr bool is_iec559 = has_signaling_NaN; static constexpr bool is_bounded = true; static constexpr bool is_modulo = false; static constexpr bool traps = false; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_to_nearest; # 2225 "/usr/include/c++/15/limits" 3 }; } # 2239 "/usr/include/c++/15/limits" 3 #pragma GCC diagnostic pop # 9 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Base.hh" 2 # 1 "/usr/include/c++/15/tuple" 1 3 # 40 "/usr/include/c++/15/tuple" 3 # 1 "/usr/include/c++/15/bits/stl_pair.h" 1 3 # 60 "/usr/include/c++/15/bits/stl_pair.h" 3 # 1 "/usr/include/c++/15/type_traits" 1 3 # 67 "/usr/include/c++/15/type_traits" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 68 "/usr/include/c++/15/type_traits" 2 3 extern "C++" { namespace std __attribute__ ((__visibility__ ("default"))) { template class reference_wrapper; # 92 "/usr/include/c++/15/type_traits" 3 template struct integral_constant { static constexpr _Tp value = __v; using value_type = _Tp; using type = integral_constant<_Tp, __v>; constexpr operator value_type() const noexcept { return value; } constexpr value_type operator()() const noexcept { return value; } }; # 112 "/usr/include/c++/15/type_traits" 3 template using __bool_constant = integral_constant; using true_type = __bool_constant; using false_type = __bool_constant; template using bool_constant = __bool_constant<__v>; template struct enable_if { }; template struct enable_if { using type = _Tp; }; template using __enable_if_t = typename enable_if<_Cond, _Tp>::type; template struct __conditional { template using type = _Tp; }; template<> struct __conditional { template using type = _Up; }; template using __conditional_t = typename __conditional<_Cond>::template type<_If, _Else>; template struct __type_identity { using type = _Type; }; template using __type_identity_t = typename __type_identity<_Tp>::type; namespace __detail { template using __first_t = _Tp; template auto __or_fn(int) -> __first_t...>; template auto __or_fn(...) -> true_type; template auto __and_fn(int) -> __first_t...>; template auto __and_fn(...) -> false_type; } template struct __or_ : decltype(__detail::__or_fn<_Bn...>(0)) { }; template struct __and_ : decltype(__detail::__and_fn<_Bn...>(0)) { }; template struct __not_ : __bool_constant { }; template inline constexpr bool __or_v = __or_<_Bn...>::value; template inline constexpr bool __and_v = __and_<_Bn...>::value; namespace __detail { template struct __disjunction_impl { using type = _B1; }; template struct __disjunction_impl<__enable_if_t, _B1, _B2, _Bn...> { using type = typename __disjunction_impl::type; }; template struct __conjunction_impl { using type = _B1; }; template struct __conjunction_impl<__enable_if_t, _B1, _B2, _Bn...> { using type = typename __conjunction_impl::type; }; } template struct conjunction : __detail::__conjunction_impl::type { }; template<> struct conjunction<> : true_type { }; template struct disjunction : __detail::__disjunction_impl::type { }; template<> struct disjunction<> : false_type { }; template struct negation : __not_<_Pp>::type { }; template inline constexpr bool conjunction_v = conjunction<_Bn...>::value; template inline constexpr bool disjunction_v = disjunction<_Bn...>::value; template inline constexpr bool negation_v = negation<_Pp>::value; template struct is_reference; template struct is_function; template struct is_void; template struct remove_cv; template struct is_const; template struct __is_array_unknown_bounds; template constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>) { return {}; } template constexpr typename __or_< is_reference<_NestedType>, is_function<_NestedType>, is_void<_NestedType>, __is_array_unknown_bounds<_NestedType> >::type __is_complete_or_unbounded(_TypeIdentity) { return {}; } template using __remove_cv_t = typename remove_cv<_Tp>::type; template struct is_void : public false_type { }; template<> struct is_void : public true_type { }; template<> struct is_void : public true_type { }; template<> struct is_void : public true_type { }; template<> struct is_void : public true_type { }; template struct __is_integral_helper : public false_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; __extension__ template<> struct __is_integral_helper<__int128> : public true_type { }; __extension__ template<> struct __is_integral_helper : public true_type { }; # 466 "/usr/include/c++/15/type_traits" 3 template struct is_integral : public __is_integral_helper<__remove_cv_t<_Tp>>::type { }; template struct __is_floating_point_helper : public false_type { }; template<> struct __is_floating_point_helper : public true_type { }; template<> struct __is_floating_point_helper : public true_type { }; template<> struct __is_floating_point_helper : public true_type { }; template<> struct __is_floating_point_helper<_Float16> : public true_type { }; template<> struct __is_floating_point_helper<_Float32> : public true_type { }; template<> struct __is_floating_point_helper<_Float64> : public true_type { }; template<> struct __is_floating_point_helper<_Float128> : public true_type { }; template<> struct __is_floating_point_helper<__gnu_cxx::__bfloat16_t> : public true_type { }; template<> struct __is_floating_point_helper<__float128> : public true_type { }; template struct is_floating_point : public __is_floating_point_helper<__remove_cv_t<_Tp>>::type { }; template struct is_array : public __bool_constant<__is_array(_Tp)> { }; # 553 "/usr/include/c++/15/type_traits" 3 template struct is_pointer : public __bool_constant<__is_pointer(_Tp)> { }; # 580 "/usr/include/c++/15/type_traits" 3 template struct is_lvalue_reference : public false_type { }; template struct is_lvalue_reference<_Tp&> : public true_type { }; template struct is_rvalue_reference : public false_type { }; template struct is_rvalue_reference<_Tp&&> : public true_type { }; template struct is_member_object_pointer : public __bool_constant<__is_member_object_pointer(_Tp)> { }; # 621 "/usr/include/c++/15/type_traits" 3 template struct is_member_function_pointer : public __bool_constant<__is_member_function_pointer(_Tp)> { }; # 642 "/usr/include/c++/15/type_traits" 3 template struct is_enum : public __bool_constant<__is_enum(_Tp)> { }; template struct is_union : public __bool_constant<__is_union(_Tp)> { }; template struct is_class : public __bool_constant<__is_class(_Tp)> { }; template struct is_function : public __bool_constant<__is_function(_Tp)> { }; # 681 "/usr/include/c++/15/type_traits" 3 template struct is_null_pointer : public false_type { }; template<> struct is_null_pointer : public true_type { }; template<> struct is_null_pointer : public true_type { }; template<> struct is_null_pointer : public true_type { }; template<> struct is_null_pointer : public true_type { }; template struct __is_nullptr_t : public is_null_pointer<_Tp> { } __attribute__ ((__deprecated__ ("use '" "std::is_null_pointer" "' instead"))); template struct is_reference : public __bool_constant<__is_reference(_Tp)> { }; # 735 "/usr/include/c++/15/type_traits" 3 template struct is_arithmetic : public __or_, is_floating_point<_Tp>>::type { }; template struct is_fundamental : public __or_, is_void<_Tp>, is_null_pointer<_Tp>>::type { }; template struct is_object : public __bool_constant<__is_object(_Tp)> { }; # 761 "/usr/include/c++/15/type_traits" 3 template struct is_member_pointer; template struct is_scalar : public __or_, is_enum<_Tp>, is_pointer<_Tp>, is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type { }; template struct is_compound : public __bool_constant::value> { }; template struct is_member_pointer : public __bool_constant<__is_member_pointer(_Tp)> { }; # 799 "/usr/include/c++/15/type_traits" 3 template struct is_same; template using __is_one_of = __or_...>; __extension__ template using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>, signed char, signed short, signed int, signed long, signed long long , signed __int128 # 824 "/usr/include/c++/15/type_traits" 3 >; __extension__ template using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>, unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long , unsigned __int128 # 844 "/usr/include/c++/15/type_traits" 3 >; template using __is_standard_integer = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>; template using __void_t = void; template struct is_const : public __bool_constant<__is_const(_Tp)> { }; # 875 "/usr/include/c++/15/type_traits" 3 template struct is_volatile : public __bool_constant<__is_volatile(_Tp)> { }; # 896 "/usr/include/c++/15/type_traits" 3 template struct is_trivial : public __bool_constant<__is_trivial(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_trivially_copyable : public __bool_constant<__is_trivially_copyable(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_standard_layout : public __bool_constant<__is_standard_layout(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct __attribute__ ((__deprecated__ ("use '" "is_standard_layout && is_trivial" "' instead"))) is_pod : public __bool_constant<__is_pod(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct [[__deprecated__]] is_literal_type : public __bool_constant<__is_literal_type(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_empty : public __bool_constant<__is_empty(_Tp)> { }; template struct is_polymorphic : public __bool_constant<__is_polymorphic(_Tp)> { }; template struct is_final : public __bool_constant<__is_final(_Tp)> { }; template struct is_abstract : public __bool_constant<__is_abstract(_Tp)> { }; template::value> struct __is_signed_helper : public false_type { }; template struct __is_signed_helper<_Tp, true> : public __bool_constant<_Tp(-1) < _Tp(0)> { }; template struct is_signed : public __is_signed_helper<_Tp>::type { }; template struct is_unsigned : public __and_, __not_>>::type { }; template _Up __declval(int); template _Tp __declval(long); template auto declval() noexcept -> decltype(__declval<_Tp>(0)); template struct remove_all_extents; template struct __is_array_known_bounds : public false_type { }; template struct __is_array_known_bounds<_Tp[_Size]> : public true_type { }; template struct __is_array_unknown_bounds : public false_type { }; template struct __is_array_unknown_bounds<_Tp[]> : public true_type { }; # 1048 "/usr/include/c++/15/type_traits" 3 struct __do_is_destructible_impl { template().~_Tp())> static true_type __test(int); template static false_type __test(...); }; template struct __is_destructible_impl : public __do_is_destructible_impl { using type = decltype(__test<_Tp>(0)); }; template, __is_array_unknown_bounds<_Tp>, is_function<_Tp>>::value, bool = __or_, is_scalar<_Tp>>::value> struct __is_destructible_safe; template struct __is_destructible_safe<_Tp, false, false> : public __is_destructible_impl::type>::type { }; template struct __is_destructible_safe<_Tp, true, false> : public false_type { }; template struct __is_destructible_safe<_Tp, false, true> : public true_type { }; template struct is_destructible : public __is_destructible_safe<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; struct __do_is_nt_destructible_impl { template static __bool_constant().~_Tp())> __test(int); template static false_type __test(...); }; template struct __is_nt_destructible_impl : public __do_is_nt_destructible_impl { using type = decltype(__test<_Tp>(0)); }; template, __is_array_unknown_bounds<_Tp>, is_function<_Tp>>::value, bool = __or_, is_scalar<_Tp>>::value> struct __is_nt_destructible_safe; template struct __is_nt_destructible_safe<_Tp, false, false> : public __is_nt_destructible_impl::type>::type { }; template struct __is_nt_destructible_safe<_Tp, true, false> : public false_type { }; template struct __is_nt_destructible_safe<_Tp, false, true> : public true_type { }; template struct is_nothrow_destructible : public __is_nt_destructible_safe<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template using __is_constructible_impl = __bool_constant<__is_constructible(_Tp, _Args...)>; template struct is_constructible : public __is_constructible_impl<_Tp, _Args...> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_default_constructible : public __is_constructible_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template using __add_lval_ref_t = __add_lvalue_reference(_Tp); # 1192 "/usr/include/c++/15/type_traits" 3 template struct is_copy_constructible : public __is_constructible_impl<_Tp, __add_lval_ref_t> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template using __add_rval_ref_t = __add_rvalue_reference(_Tp); # 1219 "/usr/include/c++/15/type_traits" 3 template struct is_move_constructible : public __is_constructible_impl<_Tp, __add_rval_ref_t<_Tp>> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template using __is_nothrow_constructible_impl = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>; template struct is_nothrow_constructible : public __is_nothrow_constructible_impl<_Tp, _Args...> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_nothrow_default_constructible : public __is_nothrow_constructible_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_nothrow_copy_constructible : public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_nothrow_move_constructible : public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>; template struct is_assignable : public __is_assignable_impl<_Tp, _Up> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_copy_assignable : public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_lval_ref_t> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_move_assignable : public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template using __is_nothrow_assignable_impl = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>; template struct is_nothrow_assignable : public __is_nothrow_assignable_impl<_Tp, _Up> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_nothrow_copy_assignable : public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>, __add_lval_ref_t> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_nothrow_move_assignable : public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template using __is_trivially_constructible_impl = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>; template struct is_trivially_constructible : public __is_trivially_constructible_impl<_Tp, _Args...> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_trivially_default_constructible : public __is_trivially_constructible_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template constexpr bool __is_implicitly_default_constructible_v = requires (void(&__f)(_Tp)) { __f({}); }; template struct __is_implicitly_default_constructible : __bool_constant<__is_implicitly_default_constructible_v<_Tp>> { }; # 1403 "/usr/include/c++/15/type_traits" 3 template struct is_trivially_copy_constructible : public __is_trivially_constructible_impl<_Tp, __add_lval_ref_t> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_trivially_move_constructible : public __is_trivially_constructible_impl<_Tp, __add_rval_ref_t<_Tp>> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template using __is_trivially_assignable_impl = __bool_constant<__is_trivially_assignable(_Tp, _Up)>; template struct is_trivially_assignable : public __is_trivially_assignable_impl<_Tp, _Up> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_trivially_copy_assignable : public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>, __add_lval_ref_t> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_trivially_move_assignable : public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_trivially_destructible : public __and_<__is_destructible_safe<_Tp>, __bool_constant<__has_trivial_destructor(_Tp)>>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct has_virtual_destructor : public __bool_constant<__has_virtual_destructor(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct alignment_of : public integral_constant { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct rank : public integral_constant { }; # 1508 "/usr/include/c++/15/type_traits" 3 template struct extent : public integral_constant { }; template struct extent<_Tp[_Size], 0> : public integral_constant { }; template struct extent<_Tp[_Size], _Uint> : public extent<_Tp, _Uint - 1>::type { }; template struct extent<_Tp[], 0> : public integral_constant { }; template struct extent<_Tp[], _Uint> : public extent<_Tp, _Uint - 1>::type { }; template struct is_same : public __bool_constant<__is_same(_Tp, _Up)> { }; # 1550 "/usr/include/c++/15/type_traits" 3 template struct is_base_of : public __bool_constant<__is_base_of(_Base, _Derived)> { }; # 1565 "/usr/include/c++/15/type_traits" 3 template struct is_convertible : public __bool_constant<__is_convertible(_From, _To)> { }; # 1608 "/usr/include/c++/15/type_traits" 3 template using __is_array_convertible = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>; template inline constexpr bool is_nothrow_convertible_v = __is_nothrow_convertible(_From, _To); template struct is_nothrow_convertible : public bool_constant> { }; # 1668 "/usr/include/c++/15/type_traits" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++14-extensions" template struct __is_nothrow_new_constructible_impl : __bool_constant< noexcept(::new(std::declval()) _Tp(std::declval<_Args>()...)) > { }; template inline constexpr bool __is_nothrow_new_constructible = __and_, __is_nothrow_new_constructible_impl<_Tp, _Args...>>::value; #pragma GCC diagnostic pop template struct remove_const { using type = _Tp; }; template struct remove_const<_Tp const> { using type = _Tp; }; template struct remove_volatile { using type = _Tp; }; template struct remove_volatile<_Tp volatile> { using type = _Tp; }; template struct remove_cv { using type = __remove_cv(_Tp); }; # 1727 "/usr/include/c++/15/type_traits" 3 template struct add_const { using type = _Tp const; }; template struct add_volatile { using type = _Tp volatile; }; template struct add_cv { using type = _Tp const volatile; }; template using remove_const_t = typename remove_const<_Tp>::type; template using remove_volatile_t = typename remove_volatile<_Tp>::type; template using remove_cv_t = typename remove_cv<_Tp>::type; template using add_const_t = typename add_const<_Tp>::type; template using add_volatile_t = typename add_volatile<_Tp>::type; template using add_cv_t = typename add_cv<_Tp>::type; template struct remove_reference { using type = __remove_reference(_Tp); }; # 1789 "/usr/include/c++/15/type_traits" 3 template struct add_lvalue_reference { using type = __add_lval_ref_t<_Tp>; }; template struct add_rvalue_reference { using type = __add_rval_ref_t<_Tp>; }; template using remove_reference_t = typename remove_reference<_Tp>::type; template using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; template struct __cv_selector; template struct __cv_selector<_Unqualified, false, false> { using __type = _Unqualified; }; template struct __cv_selector<_Unqualified, false, true> { using __type = volatile _Unqualified; }; template struct __cv_selector<_Unqualified, true, false> { using __type = const _Unqualified; }; template struct __cv_selector<_Unqualified, true, true> { using __type = const volatile _Unqualified; }; template::value, bool _IsVol = is_volatile<_Qualified>::value> class __match_cv_qualifiers { using __match = __cv_selector<_Unqualified, _IsConst, _IsVol>; public: using __type = typename __match::__type; }; template struct __make_unsigned { using __type = _Tp; }; template<> struct __make_unsigned { using __type = unsigned char; }; template<> struct __make_unsigned { using __type = unsigned char; }; template<> struct __make_unsigned { using __type = unsigned short; }; template<> struct __make_unsigned { using __type = unsigned int; }; template<> struct __make_unsigned { using __type = unsigned long; }; template<> struct __make_unsigned { using __type = unsigned long long; }; __extension__ template<> struct __make_unsigned<__int128> { using __type = unsigned __int128; }; # 1902 "/usr/include/c++/15/type_traits" 3 template::value, bool _IsEnum = __is_enum(_Tp)> class __make_unsigned_selector; template class __make_unsigned_selector<_Tp, true, false> { using __unsigned_type = typename __make_unsigned<__remove_cv_t<_Tp>>::__type; public: using __type = typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type; }; class __make_unsigned_selector_base { protected: template struct _List { }; template struct _List<_Tp, _Up...> : _List<_Up...> { static constexpr size_t __size = sizeof(_Tp); }; template struct __select; template struct __select<_Sz, _List<_Uint, _UInts...>, true> { using __type = _Uint; }; template struct __select<_Sz, _List<_Uint, _UInts...>, false> : __select<_Sz, _List<_UInts...>> { }; }; template class __make_unsigned_selector<_Tp, false, true> : __make_unsigned_selector_base { using _UInts = _List; using __unsigned_type = typename __select::__type; public: using __type = typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type; }; template<> struct __make_unsigned { using __type = typename __make_unsigned_selector::__type; }; template<> struct __make_unsigned { using __type = typename __make_unsigned_selector::__type; }; template<> struct __make_unsigned { using __type = typename __make_unsigned_selector::__type; }; template<> struct __make_unsigned { using __type = typename __make_unsigned_selector::__type; }; template struct make_unsigned { using type = typename __make_unsigned_selector<_Tp>::__type; }; template<> struct make_unsigned; template<> struct make_unsigned; template<> struct make_unsigned; template<> struct make_unsigned; template struct __make_signed { using __type = _Tp; }; template<> struct __make_signed { using __type = signed char; }; template<> struct __make_signed { using __type = signed char; }; template<> struct __make_signed { using __type = signed short; }; template<> struct __make_signed { using __type = signed int; }; template<> struct __make_signed { using __type = signed long; }; template<> struct __make_signed { using __type = signed long long; }; __extension__ template<> struct __make_signed { using __type = __int128; }; # 2062 "/usr/include/c++/15/type_traits" 3 template::value, bool _IsEnum = __is_enum(_Tp)> class __make_signed_selector; template class __make_signed_selector<_Tp, true, false> { using __signed_type = typename __make_signed<__remove_cv_t<_Tp>>::__type; public: using __type = typename __match_cv_qualifiers<_Tp, __signed_type>::__type; }; template class __make_signed_selector<_Tp, false, true> { using __unsigned_type = typename __make_unsigned_selector<_Tp>::__type; public: using __type = typename __make_signed_selector<__unsigned_type>::__type; }; template<> struct __make_signed { using __type = typename __make_signed_selector::__type; }; template<> struct __make_signed { using __type = typename __make_signed_selector::__type; }; template<> struct __make_signed { using __type = typename __make_signed_selector::__type; }; template<> struct __make_signed { using __type = typename __make_signed_selector::__type; }; template struct make_signed { using type = typename __make_signed_selector<_Tp>::__type; }; template<> struct make_signed; template<> struct make_signed; template<> struct make_signed; template<> struct make_signed; template using make_signed_t = typename make_signed<_Tp>::type; template using make_unsigned_t = typename make_unsigned<_Tp>::type; template struct remove_extent { using type = __remove_extent(_Tp); }; # 2170 "/usr/include/c++/15/type_traits" 3 template struct remove_all_extents { using type = __remove_all_extents(_Tp); }; # 2189 "/usr/include/c++/15/type_traits" 3 template using remove_extent_t = typename remove_extent<_Tp>::type; template using remove_all_extents_t = typename remove_all_extents<_Tp>::type; template struct remove_pointer { using type = __remove_pointer(_Tp); }; # 2221 "/usr/include/c++/15/type_traits" 3 template struct add_pointer { using type = __add_pointer(_Tp); }; # 2249 "/usr/include/c++/15/type_traits" 3 template using remove_pointer_t = typename remove_pointer<_Tp>::type; template using add_pointer_t = typename add_pointer<_Tp>::type; struct __attribute__((__aligned__)) __aligned_storage_max_align_t { }; constexpr size_t __aligned_storage_default_alignment([[__maybe_unused__]] size_t __len) { # 2280 "/usr/include/c++/15/type_traits" 3 return alignof(__aligned_storage_max_align_t); } # 2316 "/usr/include/c++/15/type_traits" 3 template struct [[__deprecated__]] aligned_storage { struct type { alignas(_Align) unsigned char __data[_Len]; }; }; template struct __strictest_alignment { static const size_t _S_alignment = 0; static const size_t _S_size = 0; }; template struct __strictest_alignment<_Tp, _Types...> { static const size_t _S_alignment = alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment ? alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment; static const size_t _S_size = sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size ? sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size; }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" # 2361 "/usr/include/c++/15/type_traits" 3 template struct [[__deprecated__]] aligned_union { private: static_assert(sizeof...(_Types) != 0, "At least one type is required"); using __strictest = __strictest_alignment<_Types...>; static const size_t _S_len = _Len > __strictest::_S_size ? _Len : __strictest::_S_size; public: static const size_t alignment_value = __strictest::_S_alignment; using type = typename aligned_storage<_S_len, alignment_value>::type; }; template const size_t aligned_union<_Len, _Types...>::alignment_value; #pragma GCC diagnostic pop template struct decay { using type = __decay(_Tp); }; # 2426 "/usr/include/c++/15/type_traits" 3 template struct __strip_reference_wrapper { using __type = _Tp; }; template struct __strip_reference_wrapper > { using __type = _Tp&; }; template using __decay_t = typename decay<_Tp>::type; template using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>; template using _Require = __enable_if_t<__and_<_Cond...>::value>; template using __remove_cvref_t = typename remove_cv::type>::type; template struct conditional { using type = _Iftrue; }; template struct conditional { using type = _Iffalse; }; template struct common_type; # 2482 "/usr/include/c++/15/type_traits" 3 template struct __success_type { using type = _Tp; }; struct __failure_type { }; struct __do_common_type_impl { template using __cond_t = decltype(true ? std::declval<_Tp>() : std::declval<_Up>()); template static __success_type<__decay_t<__cond_t<_Tp, _Up>>> _S_test(int); template static __success_type<__remove_cvref_t<__cond_t>> _S_test_2(int); template static __failure_type _S_test_2(...); template static decltype(_S_test_2<_Tp, _Up>(0)) _S_test(...); }; template<> struct common_type<> { }; template struct common_type<_Tp0> : public common_type<_Tp0, _Tp0> { }; template, typename _Dp2 = __decay_t<_Tp2>> struct __common_type_impl { using type = common_type<_Dp1, _Dp2>; }; template struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2> : private __do_common_type_impl { using type = decltype(_S_test<_Tp1, _Tp2>(0)); }; template struct common_type<_Tp1, _Tp2> : public __common_type_impl<_Tp1, _Tp2>::type { }; template struct __common_type_pack { }; template struct __common_type_fold; template struct common_type<_Tp1, _Tp2, _Rp...> : public __common_type_fold, __common_type_pack<_Rp...>> { }; template struct __common_type_fold<_CTp, __common_type_pack<_Rp...>, __void_t> : public common_type { }; template struct __common_type_fold<_CTp, _Rp, void> { }; template struct __underlying_type_impl { using type = __underlying_type(_Tp); }; template struct __underlying_type_impl<_Tp, false> { }; template struct underlying_type : public __underlying_type_impl<_Tp> { }; template struct __declval_protector { static const bool __stop = false; }; template auto declval() noexcept -> decltype(__declval<_Tp>(0)) { static_assert(__declval_protector<_Tp>::__stop, "declval() must not be used!"); return __declval<_Tp>(0); } template struct result_of; struct __invoke_memfun_ref { }; struct __invoke_memfun_deref { }; struct __invoke_memobj_ref { }; struct __invoke_memobj_deref { }; struct __invoke_other { }; template struct __result_of_success : __success_type<_Tp> { using __invoke_type = _Tag; }; struct __result_of_memfun_ref_impl { template static __result_of_success().*std::declval<_Fp>())(std::declval<_Args>()...) ), __invoke_memfun_ref> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_memfun_ref : private __result_of_memfun_ref_impl { using type = decltype(_S_test<_MemPtr, _Arg, _Args...>(0)); }; struct __result_of_memfun_deref_impl { template static __result_of_success()).*std::declval<_Fp>())(std::declval<_Args>()...) ), __invoke_memfun_deref> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_memfun_deref : private __result_of_memfun_deref_impl { using type = decltype(_S_test<_MemPtr, _Arg, _Args...>(0)); }; struct __result_of_memobj_ref_impl { template static __result_of_success().*std::declval<_Fp>() ), __invoke_memobj_ref> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_memobj_ref : private __result_of_memobj_ref_impl { using type = decltype(_S_test<_MemPtr, _Arg>(0)); }; struct __result_of_memobj_deref_impl { template static __result_of_success()).*std::declval<_Fp>() ), __invoke_memobj_deref> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_memobj_deref : private __result_of_memobj_deref_impl { using type = decltype(_S_test<_MemPtr, _Arg>(0)); }; template struct __result_of_memobj; template struct __result_of_memobj<_Res _Class::*, _Arg> { using _Argval = __remove_cvref_t<_Arg>; using _MemPtr = _Res _Class::*; using type = typename __conditional_t<__or_, is_base_of<_Class, _Argval>>::value, __result_of_memobj_ref<_MemPtr, _Arg>, __result_of_memobj_deref<_MemPtr, _Arg> >::type; }; template struct __result_of_memfun; template struct __result_of_memfun<_Res _Class::*, _Arg, _Args...> { using _Argval = typename remove_reference<_Arg>::type; using _MemPtr = _Res _Class::*; using type = typename __conditional_t::value, __result_of_memfun_ref<_MemPtr, _Arg, _Args...>, __result_of_memfun_deref<_MemPtr, _Arg, _Args...> >::type; }; template> struct __inv_unwrap { using type = _Tp; }; template struct __inv_unwrap<_Tp, reference_wrapper<_Up>> { using type = _Up&; }; template struct __result_of_impl { using type = __failure_type; }; template struct __result_of_impl : public __result_of_memobj<__decay_t<_MemPtr>, typename __inv_unwrap<_Arg>::type> { }; template struct __result_of_impl : public __result_of_memfun<__decay_t<_MemPtr>, typename __inv_unwrap<_Arg>::type, _Args...> { }; struct __result_of_other_impl { template static __result_of_success()(std::declval<_Args>()...) ), __invoke_other> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_impl : private __result_of_other_impl { using type = decltype(_S_test<_Functor, _ArgTypes...>(0)); }; template struct __invoke_result : public __result_of_impl< is_member_object_pointer< typename remove_reference<_Functor>::type >::value, is_member_function_pointer< typename remove_reference<_Functor>::type >::value, _Functor, _ArgTypes... >::type { }; template using __invoke_result_t = typename __invoke_result<_Fn, _Args...>::type; template struct result_of<_Functor(_ArgTypes...)> : public __invoke_result<_Functor, _ArgTypes...> { } __attribute__ ((__deprecated__ ("use '" "std::invoke_result" "' instead"))); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" template using aligned_storage_t [[__deprecated__]] = typename aligned_storage<_Len, _Align>::type; template using aligned_union_t [[__deprecated__]] = typename aligned_union<_Len, _Types...>::type; #pragma GCC diagnostic pop template using decay_t = typename decay<_Tp>::type; template using enable_if_t = typename enable_if<_Cond, _Tp>::type; template using conditional_t = typename conditional<_Cond, _Iftrue, _Iffalse>::type; template using common_type_t = typename common_type<_Tp...>::type; template using underlying_type_t = typename underlying_type<_Tp>::type; template using result_of_t = typename result_of<_Tp>::type; template using void_t = void; # 2869 "/usr/include/c++/15/type_traits" 3 template class _Op, typename... _Args> struct __detected_or { using type = _Def; using __is_detected = false_type; }; template class _Op, typename... _Args> requires requires { typename _Op<_Args...>; } struct __detected_or<_Def, _Op, _Args...> { using type = _Op<_Args...>; using __is_detected = true_type; }; # 2909 "/usr/include/c++/15/type_traits" 3 template class _Op, typename... _Args> using __detected_or_t = typename __detected_or<_Default, _Op, _Args...>::type; # 2928 "/usr/include/c++/15/type_traits" 3 template struct __is_swappable; template struct __is_nothrow_swappable; template struct __is_tuple_like_impl : false_type { }; template struct __is_tuple_like : public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type { }; template constexpr inline _Require<__not_<__is_tuple_like<_Tp>>, is_move_constructible<_Tp>, is_move_assignable<_Tp>> swap(_Tp&, _Tp&) noexcept(__and_, is_nothrow_move_assignable<_Tp>>::value); template constexpr inline __enable_if_t<__is_swappable<_Tp>::value> swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) noexcept(__is_nothrow_swappable<_Tp>::value); namespace __swappable_details { using std::swap; struct __do_is_swappable_impl { template(), std::declval<_Tp&>()))> static true_type __test(int); template static false_type __test(...); }; struct __do_is_nothrow_swappable_impl { template static __bool_constant< noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>())) > __test(int); template static false_type __test(...); }; } template struct __is_swappable_impl : public __swappable_details::__do_is_swappable_impl { using type = decltype(__test<_Tp>(0)); }; template struct __is_nothrow_swappable_impl : public __swappable_details::__do_is_nothrow_swappable_impl { using type = decltype(__test<_Tp>(0)); }; template struct __is_swappable : public __is_swappable_impl<_Tp>::type { }; template struct __is_nothrow_swappable : public __is_nothrow_swappable_impl<_Tp>::type { }; template struct is_swappable : public __is_swappable_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template struct is_nothrow_swappable : public __is_nothrow_swappable_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template inline constexpr bool is_swappable_v = is_swappable<_Tp>::value; template inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<_Tp>::value; namespace __swappable_with_details { using std::swap; struct __do_is_swappable_with_impl { template(), std::declval<_Up>())), typename = decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))> static true_type __test(int); template static false_type __test(...); }; struct __do_is_nothrow_swappable_with_impl { template static __bool_constant< noexcept(swap(std::declval<_Tp>(), std::declval<_Up>())) && noexcept(swap(std::declval<_Up>(), std::declval<_Tp>())) > __test(int); template static false_type __test(...); }; } template struct __is_swappable_with_impl : public __swappable_with_details::__do_is_swappable_with_impl { using type = decltype(__test<_Tp, _Up>(0)); }; template struct __is_swappable_with_impl<_Tp&, _Tp&> : public __swappable_details::__do_is_swappable_impl { using type = decltype(__test<_Tp&>(0)); }; template struct __is_nothrow_swappable_with_impl : public __swappable_with_details::__do_is_nothrow_swappable_with_impl { using type = decltype(__test<_Tp, _Up>(0)); }; template struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&> : public __swappable_details::__do_is_nothrow_swappable_impl { using type = decltype(__test<_Tp&>(0)); }; template struct is_swappable_with : public __is_swappable_with_impl<_Tp, _Up>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "first template argument must be a complete class or an unbounded array"); static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}), "second template argument must be a complete class or an unbounded array"); }; template struct is_nothrow_swappable_with : public __is_nothrow_swappable_with_impl<_Tp, _Up>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "first template argument must be a complete class or an unbounded array"); static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}), "second template argument must be a complete class or an unbounded array"); }; template inline constexpr bool is_swappable_with_v = is_swappable_with<_Tp, _Up>::value; template inline constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<_Tp, _Up>::value; # 3150 "/usr/include/c++/15/type_traits" 3 template::value, typename = void> struct __is_invocable_impl : false_type { using __nothrow_conv = false_type; }; template struct __is_invocable_impl<_Result, _Ret, true, __void_t> : true_type { using __nothrow_conv = true_type; }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" template struct __is_invocable_impl<_Result, _Ret, false, __void_t> { private: using _Res_t = typename _Result::type; static _Res_t _S_get() noexcept; template static void _S_conv(__type_identity_t<_Tp>) noexcept; template(_S_get())), typename = decltype(_S_conv<_Tp>(_S_get())), bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t) > static __bool_constant<_Nothrow && !_Dangle> _S_test(int); template static false_type _S_test(...); public: using type = decltype(_S_test<_Ret, true>(1)); using __nothrow_conv = decltype(_S_test<_Ret>(1)); }; #pragma GCC diagnostic pop template struct __is_invocable : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type { }; template constexpr bool __call_is_nt(__invoke_memfun_ref) { using _Up = typename __inv_unwrap<_Tp>::type; return noexcept((std::declval<_Up>().*std::declval<_Fn>())( std::declval<_Args>()...)); } template constexpr bool __call_is_nt(__invoke_memfun_deref) { return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())( std::declval<_Args>()...)); } template constexpr bool __call_is_nt(__invoke_memobj_ref) { using _Up = typename __inv_unwrap<_Tp>::type; return noexcept(std::declval<_Up>().*std::declval<_Fn>()); } template constexpr bool __call_is_nt(__invoke_memobj_deref) { return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>()); } template constexpr bool __call_is_nt(__invoke_other) { return noexcept(std::declval<_Fn>()(std::declval<_Args>()...)); } template struct __call_is_nothrow : __bool_constant< std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{}) > { }; template using __call_is_nothrow_ = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>; template struct __is_nothrow_invocable : __and_<__is_invocable<_Fn, _Args...>, __call_is_nothrow_<_Fn, _Args...>>::type { }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" struct __nonesuchbase {}; struct __nonesuch : private __nonesuchbase { ~__nonesuch() = delete; __nonesuch(__nonesuch const&) = delete; void operator=(__nonesuch const&) = delete; }; #pragma GCC diagnostic pop template struct invoke_result : public __invoke_result<_Functor, _ArgTypes...> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}), "_Functor must be a complete class or an unbounded array"); static_assert((std::__is_complete_or_unbounded( __type_identity<_ArgTypes>{}) && ...), "each argument type must be a complete class or an unbounded array"); }; template using invoke_result_t = typename invoke_result<_Fn, _Args...>::type; template struct is_invocable : public __bool_constant<__is_invocable(_Fn, _ArgTypes...)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}), "_Fn must be a complete class or an unbounded array"); static_assert((std::__is_complete_or_unbounded( __type_identity<_ArgTypes>{}) && ...), "each argument type must be a complete class or an unbounded array"); }; template struct is_invocable_r : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}), "_Fn must be a complete class or an unbounded array"); static_assert((std::__is_complete_or_unbounded( __type_identity<_ArgTypes>{}) && ...), "each argument type must be a complete class or an unbounded array"); static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}), "_Ret must be a complete class or an unbounded array"); }; template struct is_nothrow_invocable : public __bool_constant<__is_nothrow_invocable(_Fn, _ArgTypes...)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}), "_Fn must be a complete class or an unbounded array"); static_assert((std::__is_complete_or_unbounded( __type_identity<_ArgTypes>{}) && ...), "each argument type must be a complete class or an unbounded array"); }; template using __is_nt_invocable_impl = typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv; template struct is_nothrow_invocable_r : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>, __call_is_nothrow_<_Fn, _ArgTypes...>>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}), "_Fn must be a complete class or an unbounded array"); static_assert((std::__is_complete_or_unbounded( __type_identity<_ArgTypes>{}) && ...), "each argument type must be a complete class or an unbounded array"); static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}), "_Ret must be a complete class or an unbounded array"); }; # 3386 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_void_v = is_void<_Tp>::value; template inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value; template inline constexpr bool is_integral_v = is_integral<_Tp>::value; template inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value; template inline constexpr bool is_array_v = __is_array(_Tp); # 3408 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_pointer_v = __is_pointer(_Tp); # 3423 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_lvalue_reference_v = false; template inline constexpr bool is_lvalue_reference_v<_Tp&> = true; template inline constexpr bool is_rvalue_reference_v = false; template inline constexpr bool is_rvalue_reference_v<_Tp&&> = true; template inline constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Tp); template inline constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Tp); template inline constexpr bool is_enum_v = __is_enum(_Tp); template inline constexpr bool is_union_v = __is_union(_Tp); template inline constexpr bool is_class_v = __is_class(_Tp); template inline constexpr bool is_reference_v = __is_reference(_Tp); # 3472 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value; template inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value; template inline constexpr bool is_object_v = __is_object(_Tp); template inline constexpr bool is_scalar_v = is_scalar<_Tp>::value; template inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>; template inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp); template inline constexpr bool is_const_v = __is_const(_Tp); # 3509 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_function_v = __is_function(_Tp); # 3521 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_volatile_v = __is_volatile(_Tp); template inline constexpr bool is_trivial_v = __is_trivial(_Tp); template inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp); template inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp); template __attribute__ ((__deprecated__ ("use '" "is_standard_layout_v && is_trivial_v" "' instead"))) inline constexpr bool is_pod_v = __is_pod(_Tp); template [[__deprecated__]] inline constexpr bool is_literal_type_v = __is_literal_type(_Tp); template inline constexpr bool is_empty_v = __is_empty(_Tp); template inline constexpr bool is_polymorphic_v = __is_polymorphic(_Tp); template inline constexpr bool is_abstract_v = __is_abstract(_Tp); template inline constexpr bool is_final_v = __is_final(_Tp); template inline constexpr bool is_signed_v = is_signed<_Tp>::value; template inline constexpr bool is_unsigned_v = is_unsigned<_Tp>::value; template inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...); template inline constexpr bool is_default_constructible_v = __is_constructible(_Tp); template inline constexpr bool is_copy_constructible_v = __is_constructible(_Tp, __add_lval_ref_t); template inline constexpr bool is_move_constructible_v = __is_constructible(_Tp, __add_rval_ref_t<_Tp>); template inline constexpr bool is_assignable_v = __is_assignable(_Tp, _Up); template inline constexpr bool is_copy_assignable_v = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t); template inline constexpr bool is_move_assignable_v = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>); template inline constexpr bool is_destructible_v = is_destructible<_Tp>::value; template inline constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Tp, _Args...); template inline constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Tp); template inline constexpr bool is_trivially_copy_constructible_v = __is_trivially_constructible(_Tp, __add_lval_ref_t); template inline constexpr bool is_trivially_move_constructible_v = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>); template inline constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_Tp, _Up); template inline constexpr bool is_trivially_copy_assignable_v = __is_trivially_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t); template inline constexpr bool is_trivially_move_assignable_v = __is_trivially_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>); template inline constexpr bool is_trivially_destructible_v = false; template requires (!is_reference_v<_Tp>) && requires (_Tp& __t) { __t.~_Tp(); } inline constexpr bool is_trivially_destructible_v<_Tp> = __has_trivial_destructor(_Tp); template inline constexpr bool is_trivially_destructible_v<_Tp&> = true; template inline constexpr bool is_trivially_destructible_v<_Tp&&> = true; template inline constexpr bool is_trivially_destructible_v<_Tp[_Nm]> = is_trivially_destructible_v<_Tp>; template inline constexpr bool is_nothrow_constructible_v = __is_nothrow_constructible(_Tp, _Args...); template inline constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Tp); template inline constexpr bool is_nothrow_copy_constructible_v = __is_nothrow_constructible(_Tp, __add_lval_ref_t); template inline constexpr bool is_nothrow_move_constructible_v = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>); template inline constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_Tp, _Up); template inline constexpr bool is_nothrow_copy_assignable_v = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t); template inline constexpr bool is_nothrow_move_assignable_v = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>); template inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value; template inline constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Tp); template inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value; template inline constexpr size_t rank_v = __array_rank(_Tp); # 3674 "/usr/include/c++/15/type_traits" 3 template inline constexpr size_t extent_v = 0; template inline constexpr size_t extent_v<_Tp[_Size], 0> = _Size; template inline constexpr size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>; template inline constexpr size_t extent_v<_Tp[], 0> = 0; template inline constexpr size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>; template inline constexpr bool is_same_v = __is_same(_Tp, _Up); template inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived); template inline constexpr bool is_convertible_v = __is_convertible(_From, _To); template inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value; template inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value; template inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value; template inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value; template struct has_unique_object_representations : bool_constant<__has_unique_object_representations( remove_cv_t> )> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template inline constexpr bool has_unique_object_representations_v = has_unique_object_representations<_Tp>::value; template struct is_aggregate : bool_constant<__is_aggregate(remove_cv_t<_Tp>)> { }; template inline constexpr bool is_aggregate_v = __is_aggregate(remove_cv_t<_Tp>); # 3766 "/usr/include/c++/15/type_traits" 3 template struct remove_cvref { using type = __remove_cvref(_Tp); }; # 3783 "/usr/include/c++/15/type_traits" 3 template using remove_cvref_t = typename remove_cvref<_Tp>::type; # 3793 "/usr/include/c++/15/type_traits" 3 template struct type_identity { using type = _Tp; }; template using type_identity_t = typename type_identity<_Tp>::type; # 3806 "/usr/include/c++/15/type_traits" 3 template struct unwrap_reference { using type = _Tp; }; template struct unwrap_reference> { using type = _Tp&; }; template using unwrap_reference_t = typename unwrap_reference<_Tp>::type; template struct unwrap_ref_decay { using type = unwrap_reference_t>; }; template using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type; # 3833 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp); # 3847 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp); # 3859 "/usr/include/c++/15/type_traits" 3 template struct is_bounded_array : public bool_constant> { }; template struct is_unbounded_array : public bool_constant> { }; template struct is_layout_compatible : bool_constant<__is_layout_compatible(_Tp, _Up)> { }; template constexpr bool is_layout_compatible_v = __is_layout_compatible(_Tp, _Up); template constexpr bool is_corresponding_member(_M1 _S1::*__m1, _M2 _S2::*__m2) noexcept { return __builtin_is_corresponding_member(__m1, __m2); } template struct is_pointer_interconvertible_base_of : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)> { }; template constexpr bool is_pointer_interconvertible_base_of_v = __is_pointer_interconvertible_base_of(_Base, _Derived); # 3922 "/usr/include/c++/15/type_traits" 3 template constexpr bool is_pointer_interconvertible_with_class(_Mem _Tp::*__mp) noexcept { return __builtin_is_pointer_interconvertible_with_class(__mp); } # 3934 "/usr/include/c++/15/type_traits" 3 template struct is_scoped_enum : bool_constant<__is_scoped_enum(_Tp)> { }; # 3955 "/usr/include/c++/15/type_traits" 3 template inline constexpr bool is_scoped_enum_v = __is_scoped_enum(_Tp); # 3968 "/usr/include/c++/15/type_traits" 3 template struct reference_constructs_from_temporary : public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}) && std::__is_complete_or_unbounded(__type_identity<_Up>{}), "template argument must be a complete class or an unbounded array"); }; template struct reference_converts_from_temporary : public bool_constant<__reference_converts_from_temporary(_Tp, _Up)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}) && std::__is_complete_or_unbounded(__type_identity<_Up>{}), "template argument must be a complete class or an unbounded array"); }; template inline constexpr bool reference_constructs_from_temporary_v = reference_constructs_from_temporary<_Tp, _Up>::value; template inline constexpr bool reference_converts_from_temporary_v = reference_converts_from_temporary<_Tp, _Up>::value; constexpr inline bool is_constant_evaluated() noexcept { if consteval { return true; } else { return false; } } template using __copy_cv = typename __match_cv_qualifiers<_From, _To>::__type; template using __cond_res = decltype(false ? declval<_Xp(&)()>()() : declval<_Yp(&)()>()()); template struct __common_ref_impl { }; template using __common_ref = typename __common_ref_impl<_Ap, _Bp>::type; template using __condres_cvref = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>; template struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>> : enable_if>, __condres_cvref<_Xp, _Yp>> { }; template using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&; template struct __common_ref_impl<_Xp&&, _Yp&&, _Require>, is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>> { using type = __common_ref_C<_Xp, _Yp>; }; template using __common_ref_D = __common_ref; template struct __common_ref_impl<_Xp&&, _Yp&, _Require>>> { using type = __common_ref_D<_Xp, _Yp>; }; template struct __common_ref_impl<_Xp&, _Yp&&> : __common_ref_impl<_Yp&&, _Xp&> { }; template class _TQual, template class _UQual> struct basic_common_reference { }; template struct __xref { template using __type = __copy_cv<_Tp, _Up>; }; template struct __xref<_Tp&> { template using __type = __copy_cv<_Tp, _Up>&; }; template struct __xref<_Tp&&> { template using __type = __copy_cv<_Tp, _Up>&&; }; template using __basic_common_ref = typename basic_common_reference, remove_cvref_t<_Tp2>, __xref<_Tp1>::template __type, __xref<_Tp2>::template __type>::type; template struct common_reference; template using common_reference_t = typename common_reference<_Tp...>::type; template<> struct common_reference<> { }; template struct common_reference<_Tp0> { using type = _Tp0; }; template struct __common_reference_impl : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1> { }; template struct common_reference<_Tp1, _Tp2> : __common_reference_impl<_Tp1, _Tp2> { }; template requires is_reference_v<_Tp1> && is_reference_v<_Tp2> && requires { typename __common_ref<_Tp1, _Tp2>; } && is_convertible_v, add_pointer_t<__common_ref<_Tp1, _Tp2>>> && is_convertible_v, add_pointer_t<__common_ref<_Tp1, _Tp2>>> struct __common_reference_impl<_Tp1, _Tp2, 1> { using type = __common_ref<_Tp1, _Tp2>; }; template requires requires { typename __basic_common_ref<_Tp1, _Tp2>; } struct __common_reference_impl<_Tp1, _Tp2, 2> { using type = __basic_common_ref<_Tp1, _Tp2>; }; template requires requires { typename __cond_res<_Tp1, _Tp2>; } struct __common_reference_impl<_Tp1, _Tp2, 3> { using type = __cond_res<_Tp1, _Tp2>; }; template requires requires { typename common_type_t<_Tp1, _Tp2>; } struct __common_reference_impl<_Tp1, _Tp2, 4> { using type = common_type_t<_Tp1, _Tp2>; }; template struct __common_reference_impl<_Tp1, _Tp2, 5> { }; template struct common_reference<_Tp1, _Tp2, _Rest...> : __common_type_fold, __common_type_pack<_Rest...>> { }; template struct __common_type_fold, __common_type_pack<_Rest...>, void_t>> : public common_reference, _Rest...> { }; } } # 61 "/usr/include/c++/15/bits/stl_pair.h" 2 3 # 1 "/usr/include/c++/15/bits/move.h" 1 3 # 40 "/usr/include/c++/15/bits/move.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template __attribute__((__always_inline__)) inline constexpr _Tp* __addressof(_Tp& __r) noexcept { return __builtin_addressof(__r); } # 69 "/usr/include/c++/15/bits/move.h" 3 template [[__nodiscard__,__gnu__::__always_inline__]] constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type& __t) noexcept { return static_cast<_Tp&&>(__t); } # 82 "/usr/include/c++/15/bits/move.h" 3 template [[__nodiscard__,__gnu__::__always_inline__]] constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type&& __t) noexcept { static_assert(!std::is_lvalue_reference<_Tp>::value, "std::forward must not be used to convert an rvalue to an lvalue"); return static_cast<_Tp&&>(__t); } template struct __like_impl; template struct __like_impl<_Tp&, _Up&> { using type = _Up&; }; template struct __like_impl { using type = const _Up&; }; template struct __like_impl<_Tp&&, _Up&> { using type = _Up&&; }; template struct __like_impl { using type = const _Up&&; }; template using __like_t = typename __like_impl<_Tp&&, _Up&>::type; # 122 "/usr/include/c++/15/bits/move.h" 3 template [[nodiscard,__gnu__::__always_inline__]] constexpr __like_t<_Tp, _Up> forward_like(_Up&& __x) noexcept { return static_cast<__like_t<_Tp, _Up>>(__x); } # 135 "/usr/include/c++/15/bits/move.h" 3 template [[__nodiscard__,__gnu__::__always_inline__]] constexpr typename std::remove_reference<_Tp>::type&& move(_Tp&& __t) noexcept { return static_cast::type&&>(__t); } template struct __move_if_noexcept_cond : public __and_<__not_>, is_copy_constructible<_Tp>>::type { }; # 156 "/usr/include/c++/15/bits/move.h" 3 template [[__nodiscard__,__gnu__::__always_inline__]] constexpr __conditional_t<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&> move_if_noexcept(_Tp& __x) noexcept { return std::move(__x); } # 173 "/usr/include/c++/15/bits/move.h" 3 template [[__nodiscard__,__gnu__::__always_inline__]] inline constexpr _Tp* addressof(_Tp& __r) noexcept { return std::__addressof(__r); } template const _Tp* addressof(const _Tp&&) = delete; template constexpr inline _Tp __exchange(_Tp& __obj, _Up&& __new_val) { _Tp __old_val = std::move(__obj); __obj = std::forward<_Up>(__new_val); return __old_val; } # 217 "/usr/include/c++/15/bits/move.h" 3 template constexpr inline typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>, is_move_constructible<_Tp>, is_move_assignable<_Tp>>::value>::type swap(_Tp& __a, _Tp& __b) noexcept(__and_, is_nothrow_move_assignable<_Tp>>::value) { _Tp __tmp = std::move(__a); __a = std::move(__b); __b = std::move(__tmp); } template constexpr inline typename enable_if<__is_swappable<_Tp>::value>::type swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) noexcept(__is_nothrow_swappable<_Tp>::value) { for (size_t __n = 0; __n < _Nm; ++__n) swap(__a[__n], __b[__n]); } } # 62 "/usr/include/c++/15/bits/stl_pair.h" 2 3 # 1 "/usr/include/c++/15/bits/utility.h" 1 3 # 45 "/usr/include/c++/15/bits/utility.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template struct tuple_size; template::type, typename = typename enable_if::value>::type, size_t = tuple_size<_Tp>::value> using __enable_if_has_tuple_size = _Tp; template struct tuple_size> : public tuple_size<_Tp> { }; template struct tuple_size> : public tuple_size<_Tp> { }; template struct tuple_size> : public tuple_size<_Tp> { }; template inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value; template struct tuple_element; template using __tuple_element_t = typename tuple_element<__i, _Tp>::type; template struct tuple_element<__i, const _Tp> { using type = const __tuple_element_t<__i, _Tp>; }; template struct tuple_element<__i, volatile _Tp> { using type = volatile __tuple_element_t<__i, _Tp>; }; template struct tuple_element<__i, const volatile _Tp> { using type = const volatile __tuple_element_t<__i, _Tp>; }; template constexpr size_t __find_uniq_type_in_pack() { constexpr size_t __sz = sizeof...(_Types); constexpr bool __found[__sz] = { __is_same(_Tp, _Types) ... }; size_t __n = __sz; for (size_t __i = 0; __i < __sz; ++__i) { if (__found[__i]) { if (__n < __sz) return __sz; __n = __i; } } return __n; } # 136 "/usr/include/c++/15/bits/utility.h" 3 template using tuple_element_t = typename tuple_element<__i, _Tp>::type; template struct _Index_tuple { }; template struct _Build_index_tuple { # 156 "/usr/include/c++/15/bits/utility.h" 3 using __type = _Index_tuple<__integer_pack(_Num)...>; }; template struct integer_sequence { static_assert(is_integral_v<_Tp>); typedef _Tp value_type; static constexpr size_t size() noexcept { return sizeof...(_Idx); } }; template using make_integer_sequence = integer_sequence<_Tp, __integer_pack(_Num)...>; template using index_sequence = integer_sequence; template using make_index_sequence = make_integer_sequence; template using index_sequence_for = make_index_sequence; struct in_place_t { explicit in_place_t() = default; }; inline constexpr in_place_t in_place{}; template struct in_place_type_t { explicit in_place_type_t() = default; }; template inline constexpr in_place_type_t<_Tp> in_place_type{}; template struct in_place_index_t { explicit in_place_index_t() = default; }; template inline constexpr in_place_index_t<_Idx> in_place_index{}; template inline constexpr bool __is_in_place_type_v = false; template inline constexpr bool __is_in_place_type_v> = true; template inline constexpr bool __is_in_place_index_v = false; template inline constexpr bool __is_in_place_index_v> = true; template struct _Nth_type { using type = __type_pack_element<_Np, _Types...>; }; # 275 "/usr/include/c++/15/bits/utility.h" 3 namespace ranges::__detail { template inline constexpr bool __is_subrange = false; } struct _Swallow_assign { template constexpr const _Swallow_assign& operator=(const _Tp&) const noexcept { return *this; } }; # 309 "/usr/include/c++/15/bits/utility.h" 3 inline constexpr _Swallow_assign ignore{}; struct sorted_unique_t { explicit sorted_unique_t() = default; }; inline constexpr sorted_unique_t sorted_unique{}; struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; }; inline constexpr sorted_equivalent_t sorted_equivalent{}; } # 63 "/usr/include/c++/15/bits/stl_pair.h" 2 3 # 1 "/usr/include/c++/15/compare" 1 3 # 38 "/usr/include/c++/15/compare" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 39 "/usr/include/c++/15/compare" 2 3 # 1 "/usr/include/c++/15/concepts" 1 3 # 38 "/usr/include/c++/15/concepts" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 39 "/usr/include/c++/15/concepts" 2 3 # 50 "/usr/include/c++/15/concepts" 3 namespace std __attribute__ ((__visibility__ ("default"))) { namespace __detail { template concept __same_as = std::is_same_v<_Tp, _Up>; } template concept same_as = __detail::__same_as<_Tp, _Up> && __detail::__same_as<_Up, _Tp>; namespace __detail { template concept __different_from = !same_as, remove_cvref_t<_Up>>; } template concept derived_from = __is_base_of(_Base, _Derived) && is_convertible_v; template concept convertible_to = is_convertible_v<_From, _To> && requires { static_cast<_To>(std::declval<_From>()); }; template concept common_reference_with = same_as, common_reference_t<_Up, _Tp>> && convertible_to<_Tp, common_reference_t<_Tp, _Up>> && convertible_to<_Up, common_reference_t<_Tp, _Up>>; template concept common_with = same_as, common_type_t<_Up, _Tp>> && requires { static_cast>(std::declval<_Tp>()); static_cast>(std::declval<_Up>()); } && common_reference_with, add_lvalue_reference_t> && common_reference_with>, common_reference_t< add_lvalue_reference_t, add_lvalue_reference_t>>; template concept integral = is_integral_v<_Tp>; template concept signed_integral = integral<_Tp> && is_signed_v<_Tp>; template concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>; template concept floating_point = is_floating_point_v<_Tp>; namespace __detail { template using __cref = const remove_reference_t<_Tp>&; template concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>; template constexpr bool __destructible_impl = false; template requires requires(_Tp& __t) { { __t.~_Tp() } noexcept; } constexpr bool __destructible_impl<_Tp> = true; template constexpr bool __destructible = __destructible_impl<_Tp>; template constexpr bool __destructible<_Tp&> = true; template constexpr bool __destructible<_Tp&&> = true; template constexpr bool __destructible<_Tp[_Nm]> = __destructible<_Tp>; } template concept assignable_from = is_lvalue_reference_v<_Lhs> && common_reference_with<__detail::__cref<_Lhs>, __detail::__cref<_Rhs>> && requires(_Lhs __lhs, _Rhs&& __rhs) { { __lhs = static_cast<_Rhs&&>(__rhs) } -> same_as<_Lhs>; }; template concept destructible = __detail::__destructible<_Tp>; template concept constructible_from = destructible<_Tp> && is_constructible_v<_Tp, _Args...>; template concept default_initializable = constructible_from<_Tp> && requires { _Tp{}; (void) ::new _Tp; }; template concept move_constructible = constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>; template concept copy_constructible = move_constructible<_Tp> && constructible_from<_Tp, _Tp&> && convertible_to<_Tp&, _Tp> && constructible_from<_Tp, const _Tp&> && convertible_to && constructible_from<_Tp, const _Tp> && convertible_to; namespace ranges { namespace __swap { template void swap(_Tp&, _Tp&) = delete; template concept __adl_swap = (std::__detail::__class_or_enum> || std::__detail::__class_or_enum>) && requires(_Tp&& __t, _Up&& __u) { swap(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)); }; struct _Swap { private: template static constexpr bool _S_noexcept() { if constexpr (__adl_swap<_Tp, _Up>) return noexcept(swap(std::declval<_Tp>(), std::declval<_Up>())); else return is_nothrow_move_constructible_v> && is_nothrow_move_assignable_v>; } public: template requires __adl_swap<_Tp, _Up> || (same_as<_Tp, _Up> && is_lvalue_reference_v<_Tp> && move_constructible> && assignable_from<_Tp, remove_reference_t<_Tp>>) constexpr void operator()(_Tp&& __t, _Up&& __u) const noexcept(_S_noexcept<_Tp, _Up>()) { if constexpr (__adl_swap<_Tp, _Up>) swap(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)); else { auto __tmp = static_cast&&>(__t); __t = static_cast&&>(__u); __u = static_cast&&>(__tmp); } } template requires requires(const _Swap& __swap, _Tp& __e1, _Up& __e2) { __swap(__e1, __e2); } constexpr void operator()(_Tp (&__e1)[_Num], _Up (&__e2)[_Num]) const noexcept(noexcept(std::declval()(*__e1, *__e2))) { for (size_t __n = 0; __n < _Num; ++__n) (*this)(__e1[__n], __e2[__n]); } }; } inline namespace _Cpo { inline constexpr __swap::_Swap swap{}; } } template concept swappable = requires(_Tp& __a, _Tp& __b) { ranges::swap(__a, __b); }; template concept swappable_with = common_reference_with<_Tp, _Up> && requires(_Tp&& __t, _Up&& __u) { ranges::swap(static_cast<_Tp&&>(__t), static_cast<_Tp&&>(__t)); ranges::swap(static_cast<_Up&&>(__u), static_cast<_Up&&>(__u)); ranges::swap(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)); ranges::swap(static_cast<_Up&&>(__u), static_cast<_Tp&&>(__t)); }; template concept movable = is_object_v<_Tp> && move_constructible<_Tp> && assignable_from<_Tp&, _Tp> && swappable<_Tp>; template concept copyable = copy_constructible<_Tp> && movable<_Tp> && assignable_from<_Tp&, _Tp&> && assignable_from<_Tp&, const _Tp&> && assignable_from<_Tp&, const _Tp>; template concept semiregular = copyable<_Tp> && default_initializable<_Tp>; namespace __detail { template concept __boolean_testable_impl = convertible_to<_Tp, bool>; template concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t) { { !static_cast<_Tp&&>(__t) } -> __boolean_testable_impl; }; } namespace __detail { template concept __weakly_eq_cmp_with = requires(__detail::__cref<_Tp> __t, __detail::__cref<_Up> __u) { { __t == __u } -> __boolean_testable; { __t != __u } -> __boolean_testable; { __u == __t } -> __boolean_testable; { __u != __t } -> __boolean_testable; }; } template concept equality_comparable = __detail::__weakly_eq_cmp_with<_Tp, _Tp>; template concept equality_comparable_with = equality_comparable<_Tp> && equality_comparable<_Up> && common_reference_with<__detail::__cref<_Tp>, __detail::__cref<_Up>> && equality_comparable, __detail::__cref<_Up>>> && __detail::__weakly_eq_cmp_with<_Tp, _Up>; namespace __detail { template concept __partially_ordered_with = requires(const remove_reference_t<_Tp>& __t, const remove_reference_t<_Up>& __u) { { __t < __u } -> __boolean_testable; { __t > __u } -> __boolean_testable; { __t <= __u } -> __boolean_testable; { __t >= __u } -> __boolean_testable; { __u < __t } -> __boolean_testable; { __u > __t } -> __boolean_testable; { __u <= __t } -> __boolean_testable; { __u >= __t } -> __boolean_testable; }; } template concept totally_ordered = equality_comparable<_Tp> && __detail::__partially_ordered_with<_Tp, _Tp>; template concept totally_ordered_with = totally_ordered<_Tp> && totally_ordered<_Up> && equality_comparable_with<_Tp, _Up> && totally_ordered, __detail::__cref<_Up>>> && __detail::__partially_ordered_with<_Tp, _Up>; template concept regular = semiregular<_Tp> && equality_comparable<_Tp>; template concept invocable = is_invocable_v<_Fn, _Args...>; template concept regular_invocable = invocable<_Fn, _Args...>; template concept predicate = regular_invocable<_Fn, _Args...> && __detail::__boolean_testable>; template concept relation = predicate<_Rel, _Tp, _Tp> && predicate<_Rel, _Up, _Up> && predicate<_Rel, _Tp, _Up> && predicate<_Rel, _Up, _Tp>; template concept equivalence_relation = relation<_Rel, _Tp, _Up>; template concept strict_weak_order = relation<_Rel, _Tp, _Up>; namespace __detail { template concept __not_overloaded_spaceship = ! requires(_Tp&& __t, _Up&& __u) { operator<=>(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)); } && ! requires(_Tp&& __t, _Up&& __u) { static_cast<_Tp&&>(__t).operator<=>(static_cast<_Up&&>(__u)); } && (is_same_v<_Tp, _Up> || (! requires(_Tp&& __t, _Up&& __u) { operator<=>(static_cast<_Up&&>(__u), static_cast<_Tp&&>(__t)); } && ! requires(_Tp&& __t, _Up&& __u) { static_cast<_Up&&>(__u).operator<=>(static_cast<_Tp&&>(__t)); })); } } # 43 "/usr/include/c++/15/compare" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" namespace std __attribute__ ((__visibility__ ("default"))) { namespace __cmp_cat { using type = signed char; enum class _Ord : type { equivalent = 0, less = -1, greater = 1 }; enum class _Ncmp : type { _Unordered = 2 }; struct __unspec { consteval __unspec(__unspec*) noexcept { } }; } class partial_ordering { __cmp_cat::type _M_value; constexpr explicit partial_ordering(__cmp_cat::_Ord __v) noexcept : _M_value(__cmp_cat::type(__v)) { } constexpr explicit partial_ordering(__cmp_cat::_Ncmp __v) noexcept : _M_value(__cmp_cat::type(__v)) { } friend class weak_ordering; friend class strong_ordering; public: static const partial_ordering less; static const partial_ordering equivalent; static const partial_ordering greater; static const partial_ordering unordered; [[nodiscard]] friend constexpr bool operator==(partial_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value == 0; } [[nodiscard]] friend constexpr bool operator==(partial_ordering, partial_ordering) noexcept = default; [[nodiscard]] friend constexpr bool operator< (partial_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value == -1; } [[nodiscard]] friend constexpr bool operator> (partial_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value == 1; } [[nodiscard]] friend constexpr bool operator<=(partial_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value <= 0; } [[nodiscard]] friend constexpr bool operator>=(partial_ordering __v, __cmp_cat::__unspec) noexcept { return __cmp_cat::type(__v._M_value & 1) == __v._M_value; } [[nodiscard]] friend constexpr bool operator< (__cmp_cat::__unspec, partial_ordering __v) noexcept { return __v._M_value == 1; } [[nodiscard]] friend constexpr bool operator> (__cmp_cat::__unspec, partial_ordering __v) noexcept { return __v._M_value == -1; } [[nodiscard]] friend constexpr bool operator<=(__cmp_cat::__unspec, partial_ordering __v) noexcept { return __cmp_cat::type(__v._M_value & 1) == __v._M_value; } [[nodiscard]] friend constexpr bool operator>=(__cmp_cat::__unspec, partial_ordering __v) noexcept { return 0 >= __v._M_value; } [[nodiscard]] friend constexpr partial_ordering operator<=>(partial_ordering __v, __cmp_cat::__unspec) noexcept { return __v; } [[nodiscard]] friend constexpr partial_ordering operator<=>(__cmp_cat::__unspec, partial_ordering __v) noexcept { if (__v._M_value & 1) return partial_ordering(__cmp_cat::_Ord(-__v._M_value)); else return __v; } }; inline constexpr partial_ordering partial_ordering::less(__cmp_cat::_Ord::less); inline constexpr partial_ordering partial_ordering::equivalent(__cmp_cat::_Ord::equivalent); inline constexpr partial_ordering partial_ordering::greater(__cmp_cat::_Ord::greater); inline constexpr partial_ordering partial_ordering::unordered(__cmp_cat::_Ncmp::_Unordered); class weak_ordering { __cmp_cat::type _M_value; constexpr explicit weak_ordering(__cmp_cat::_Ord __v) noexcept : _M_value(__cmp_cat::type(__v)) { } friend class strong_ordering; public: static const weak_ordering less; static const weak_ordering equivalent; static const weak_ordering greater; [[nodiscard]] constexpr operator partial_ordering() const noexcept { return partial_ordering(__cmp_cat::_Ord(_M_value)); } [[nodiscard]] friend constexpr bool operator==(weak_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value == 0; } [[nodiscard]] friend constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default; [[nodiscard]] friend constexpr bool operator< (weak_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value < 0; } [[nodiscard]] friend constexpr bool operator> (weak_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value > 0; } [[nodiscard]] friend constexpr bool operator<=(weak_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value <= 0; } [[nodiscard]] friend constexpr bool operator>=(weak_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value >= 0; } [[nodiscard]] friend constexpr bool operator< (__cmp_cat::__unspec, weak_ordering __v) noexcept { return 0 < __v._M_value; } [[nodiscard]] friend constexpr bool operator> (__cmp_cat::__unspec, weak_ordering __v) noexcept { return 0 > __v._M_value; } [[nodiscard]] friend constexpr bool operator<=(__cmp_cat::__unspec, weak_ordering __v) noexcept { return 0 <= __v._M_value; } [[nodiscard]] friend constexpr bool operator>=(__cmp_cat::__unspec, weak_ordering __v) noexcept { return 0 >= __v._M_value; } [[nodiscard]] friend constexpr weak_ordering operator<=>(weak_ordering __v, __cmp_cat::__unspec) noexcept { return __v; } [[nodiscard]] friend constexpr weak_ordering operator<=>(__cmp_cat::__unspec, weak_ordering __v) noexcept { return weak_ordering(__cmp_cat::_Ord(-__v._M_value)); } }; inline constexpr weak_ordering weak_ordering::less(__cmp_cat::_Ord::less); inline constexpr weak_ordering weak_ordering::equivalent(__cmp_cat::_Ord::equivalent); inline constexpr weak_ordering weak_ordering::greater(__cmp_cat::_Ord::greater); class strong_ordering { __cmp_cat::type _M_value; constexpr explicit strong_ordering(__cmp_cat::_Ord __v) noexcept : _M_value(__cmp_cat::type(__v)) { } public: static const strong_ordering less; static const strong_ordering equal; static const strong_ordering equivalent; static const strong_ordering greater; [[nodiscard]] constexpr operator partial_ordering() const noexcept { return partial_ordering(__cmp_cat::_Ord(_M_value)); } [[nodiscard]] constexpr operator weak_ordering() const noexcept { return weak_ordering(__cmp_cat::_Ord(_M_value)); } [[nodiscard]] friend constexpr bool operator==(strong_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value == 0; } [[nodiscard]] friend constexpr bool operator==(strong_ordering, strong_ordering) noexcept = default; [[nodiscard]] friend constexpr bool operator< (strong_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value < 0; } [[nodiscard]] friend constexpr bool operator> (strong_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value > 0; } [[nodiscard]] friend constexpr bool operator<=(strong_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value <= 0; } [[nodiscard]] friend constexpr bool operator>=(strong_ordering __v, __cmp_cat::__unspec) noexcept { return __v._M_value >= 0; } [[nodiscard]] friend constexpr bool operator< (__cmp_cat::__unspec, strong_ordering __v) noexcept { return 0 < __v._M_value; } [[nodiscard]] friend constexpr bool operator> (__cmp_cat::__unspec, strong_ordering __v) noexcept { return 0 > __v._M_value; } [[nodiscard]] friend constexpr bool operator<=(__cmp_cat::__unspec, strong_ordering __v) noexcept { return 0 <= __v._M_value; } [[nodiscard]] friend constexpr bool operator>=(__cmp_cat::__unspec, strong_ordering __v) noexcept { return 0 >= __v._M_value; } [[nodiscard]] friend constexpr strong_ordering operator<=>(strong_ordering __v, __cmp_cat::__unspec) noexcept { return __v; } [[nodiscard]] friend constexpr strong_ordering operator<=>(__cmp_cat::__unspec, strong_ordering __v) noexcept { return strong_ordering(__cmp_cat::_Ord(-__v._M_value)); } }; inline constexpr strong_ordering strong_ordering::less(__cmp_cat::_Ord::less); inline constexpr strong_ordering strong_ordering::equal(__cmp_cat::_Ord::equivalent); inline constexpr strong_ordering strong_ordering::equivalent(__cmp_cat::_Ord::equivalent); inline constexpr strong_ordering strong_ordering::greater(__cmp_cat::_Ord::greater); [[nodiscard]] constexpr bool is_eq(partial_ordering __cmp) noexcept { return __cmp == 0; } [[nodiscard]] constexpr bool is_neq(partial_ordering __cmp) noexcept { return __cmp != 0; } [[nodiscard]] constexpr bool is_lt (partial_ordering __cmp) noexcept { return __cmp < 0; } [[nodiscard]] constexpr bool is_lteq(partial_ordering __cmp) noexcept { return __cmp <= 0; } [[nodiscard]] constexpr bool is_gt (partial_ordering __cmp) noexcept { return __cmp > 0; } [[nodiscard]] constexpr bool is_gteq(partial_ordering __cmp) noexcept { return __cmp >= 0; } namespace __detail { template inline constexpr unsigned __cmp_cat_id = 1; template<> inline constexpr unsigned __cmp_cat_id = 2; template<> inline constexpr unsigned __cmp_cat_id = 4; template<> inline constexpr unsigned __cmp_cat_id = 8; template constexpr auto __common_cmp_cat() { constexpr unsigned __cats = (__cmp_cat_id<_Ts> | ...); if constexpr (__cats & 1) return; else if constexpr (bool(__cats & __cmp_cat_id)) return partial_ordering::equivalent; else if constexpr (bool(__cats & __cmp_cat_id)) return weak_ordering::equivalent; else return strong_ordering::equivalent; } } template struct common_comparison_category { using type = decltype(__detail::__common_cmp_cat<_Ts...>()); }; template struct common_comparison_category<_Tp> { using type = void; }; template<> struct common_comparison_category { using type = partial_ordering; }; template<> struct common_comparison_category { using type = weak_ordering; }; template<> struct common_comparison_category { using type = strong_ordering; }; template<> struct common_comparison_category<> { using type = strong_ordering; }; template using common_comparison_category_t = typename common_comparison_category<_Ts...>::type; namespace __detail { template concept __compares_as = same_as, _Cat>; } template concept three_way_comparable = __detail::__weakly_eq_cmp_with<_Tp, _Tp> && __detail::__partially_ordered_with<_Tp, _Tp> && requires(const remove_reference_t<_Tp>& __a, const remove_reference_t<_Tp>& __b) { { __a <=> __b } -> __detail::__compares_as<_Cat>; }; template concept three_way_comparable_with = three_way_comparable<_Tp, _Cat> && three_way_comparable<_Up, _Cat> && common_reference_with&, const remove_reference_t<_Up>&> && three_way_comparable< common_reference_t&, const remove_reference_t<_Up>&>, _Cat> && __detail::__weakly_eq_cmp_with<_Tp, _Up> && __detail::__partially_ordered_with<_Tp, _Up> && requires(const remove_reference_t<_Tp>& __t, const remove_reference_t<_Up>& __u) { { __t <=> __u } -> __detail::__compares_as<_Cat>; { __u <=> __t } -> __detail::__compares_as<_Cat>; }; namespace __detail { template using __cmp3way_res_t = decltype(std::declval<_Tp>() <=> std::declval<_Up>()); template struct __cmp3way_res_impl { }; template requires requires { typename __cmp3way_res_t<__cref<_Tp>, __cref<_Up>>; } struct __cmp3way_res_impl<_Tp, _Up> { using type = __cmp3way_res_t<__cref<_Tp>, __cref<_Up>>; }; } template struct compare_three_way_result : __detail::__cmp3way_res_impl<_Tp, _Up> { }; template using compare_three_way_result_t = typename __detail::__cmp3way_res_impl<_Tp, _Up>::type; namespace __detail { template concept __3way_builtin_ptr_cmp = requires(_Tp&& __t, _Up&& __u) { static_cast<_Tp&&>(__t) <=> static_cast<_Up&&>(__u); } && convertible_to<_Tp, const volatile void*> && convertible_to<_Up, const volatile void*> && __not_overloaded_spaceship<_Tp, _Up>; } struct compare_three_way { template requires three_way_comparable_with<_Tp, _Up> constexpr auto operator() [[nodiscard]] (_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::declval<_Tp>() <=> std::declval<_Up>())) { if constexpr (__detail::__3way_builtin_ptr_cmp<_Tp, _Up>) { auto __pt = static_cast(__t); auto __pu = static_cast(__u); if (std::__is_constant_evaluated()) return __pt <=> __pu; auto __it = reinterpret_cast(__pt); auto __iu = reinterpret_cast(__pu); return __it <=> __iu; } else return static_cast<_Tp&&>(__t) <=> static_cast<_Up&&>(__u); } using is_transparent = void; }; namespace __compare { template constexpr weak_ordering __fp_weak_ordering(_Tp __e, _Tp __f) { auto __cat = [](_Tp __fp) -> int { const int __sign = __builtin_signbit(__fp) ? -1 : 1; if (__builtin_isnormal(__fp)) return (__fp == 0 ? 1 : 3) * __sign; if (__builtin_isnan(__fp)) return 5 * __sign; if (int __inf = __builtin_isinf_sign(__fp)) return 4 * __inf; return 2 * __sign; }; auto __po = __e <=> __f; if (is_lt(__po)) return weak_ordering::less; else if (is_gt(__po)) return weak_ordering::greater; else if (__po == partial_ordering::equivalent) return weak_ordering::equivalent; else { auto __isnan_sign = [](_Tp __fp) -> int { return __builtin_isnan(__fp) ? __builtin_signbit(__fp) ? -1 : 1 : 0; }; auto __ord = __isnan_sign(__e) <=> __isnan_sign(__f); if (is_eq(__ord)) return weak_ordering::equivalent; else if (is_lt(__ord)) return weak_ordering::less; else return weak_ordering::greater; } } void strong_order() = delete; template concept __adl_strong = requires(_Tp&& __t, _Up&& __u) { strong_ordering(strong_order(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u))); }; void weak_order() = delete; template concept __adl_weak = requires(_Tp&& __t, _Up&& __u) { weak_ordering(weak_order(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u))); }; void partial_order() = delete; template concept __adl_partial = requires(_Tp&& __t, _Up&& __u) { partial_ordering(partial_order(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u))); }; template concept __cmp3way = requires(_Tp&& __t, _Up&& __u, compare_three_way __c) { _Ord(__c(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u))); }; template concept __strongly_ordered = __adl_strong<_Tp, _Up> || floating_point> || __cmp3way; template concept __decayed_same_as = same_as, decay_t<_Up>>; class _Strong_order { template static constexpr bool _S_noexcept() { if constexpr (floating_point>) return true; else if constexpr (__adl_strong<_Tp, _Up>) return noexcept(strong_ordering(strong_order(std::declval<_Tp>(), std::declval<_Up>()))); else if constexpr (__cmp3way) return noexcept(compare_three_way()(std::declval<_Tp>(), std::declval<_Up>())); } friend class _Weak_order; friend class _Strong_fallback; enum class _Fp_fmt { _Binary16, _Binary32, _Binary64, _Binary128, _X86_80bit, _M68k_80bit, _Dbldbl, _Bfloat16, }; # 702 "/usr/include/c++/15/compare" 3 template static consteval _Fp_fmt _S_fp_fmt() noexcept { using enum _Fp_fmt; # 722 "/usr/include/c++/15/compare" 3 if constexpr (__is_same(_Tp, long double)) return (-16381) == -16381 ? _X86_80bit : _M68k_80bit; if constexpr (__is_same(_Tp, __float80)) return _X86_80bit; if constexpr (__is_same(_Tp, decltype(0.0bf16))) return _Bfloat16; constexpr int __width = sizeof(_Tp) * 8; if constexpr (__width == 16) return _Binary16; else if constexpr (__width == 32) return _Binary32; else if constexpr (__width == 64) return _Binary64; else if constexpr (__width == 128) return _Binary128; } using int64_t = long int; using int32_t = int; using int16_t = short int; using uint64_t = long unsigned int; using uint16_t = short unsigned int; template struct _Int { uint64_t _M_lo; _Tp _M_hi; constexpr explicit _Int(_Tp __hi, uint64_t __lo) noexcept : _M_hi(__hi) { _M_lo = __lo; } constexpr explicit _Int(uint64_t __lo) noexcept : _M_hi(0) { _M_lo = __lo; } constexpr bool operator==(const _Int&) const = default; # 784 "/usr/include/c++/15/compare" 3 constexpr _Int& operator^=(const _Int& __rhs) noexcept { _M_hi ^= __rhs._M_hi; _M_lo ^= __rhs._M_lo; return *this; } constexpr strong_ordering operator<=>(const _Int& __rhs) const noexcept { strong_ordering __cmp = _M_hi <=> __rhs._M_hi; if (__cmp != strong_ordering::equal) return __cmp; return _M_lo <=> __rhs._M_lo; } }; template static constexpr _Tp _S_compl(_Tp __t) noexcept { constexpr int __width = sizeof(_Tp) * 8; make_unsigned_t<_Tp> __sign = __t >> (__width - 1); return __t ^ (__sign >> 1); } template static constexpr _Int<_Tp> _S_compl(_Int<_Tp> __t) noexcept { constexpr int __width = sizeof(_Tp) * 8; make_unsigned_t<_Tp> __sign = __t._M_hi >> (__width - 1); __t._M_hi ^= (__sign >> 1 ); uint64_t __sign64 = (_Tp)__sign; __t._M_lo ^= __sign64; return __t; } template constexpr static auto _S_fp_bits(_Tp __val) noexcept { if constexpr (sizeof(_Tp) == sizeof(int64_t)) return __builtin_bit_cast(int64_t, __val); else if constexpr (sizeof(_Tp) == sizeof(int32_t)) return __builtin_bit_cast(int32_t, __val); else if constexpr (sizeof(_Tp) == sizeof(int16_t)) return __builtin_bit_cast(int16_t, __val); else { using enum _Fp_fmt; constexpr auto __fmt = _S_fp_fmt<_Tp>(); if constexpr (__fmt == _X86_80bit) { if constexpr (sizeof(_Tp) == 3 * sizeof(int32_t)) { auto __ival = __builtin_bit_cast(_Int, __val); return _Int(__ival._M_hi, __ival._M_lo); } else { auto __ival = __builtin_bit_cast(_Int, __val); return _Int(__ival._M_hi, __ival._M_lo); } } else if constexpr (__fmt == _M68k_80bit) { auto __ival = __builtin_bit_cast(_Int, __val); return _Int(__ival._M_hi >> 16, __ival._M_lo); } else if constexpr (sizeof(_Tp) == 2 * sizeof(int64_t)) { return __builtin_bit_cast(__int128, __val); } else static_assert(sizeof(_Tp) == sizeof(int64_t), "unsupported floating-point type"); } } template static constexpr strong_ordering _S_fp_cmp(_Tp __x, _Tp __y) noexcept { # 893 "/usr/include/c++/15/compare" 3 auto __ix = _S_fp_bits(__x); auto __iy = _S_fp_bits(__y); if (__ix == __iy) return strong_ordering::equal; using enum _Fp_fmt; constexpr auto __fmt = _S_fp_fmt<_Tp>(); if constexpr (__fmt == _Dbldbl) { struct _Unpacked { double _M_hi; int64_t _M_lo; }; auto __x2 = __builtin_bit_cast(_Unpacked, __x); auto __y2 = __builtin_bit_cast(_Unpacked, __y); auto __cmp = _S_fp_cmp(__x2._M_hi, __y2._M_hi); if (__cmp != strong_ordering::equal) return __cmp; if (__builtin_isnan(__x2._M_hi)) return strong_ordering::equal; if (((__x2._M_lo | __y2._M_lo) & 0x7fffffffffffffffULL) == 0) return strong_ordering::equal; return _S_compl(__x2._M_lo) <=> _S_compl(__y2._M_lo); } else { if constexpr (__fmt == _M68k_80bit) { constexpr uint16_t __maxexp = 0x7fff; if ((__ix._M_hi & __maxexp) == __maxexp) __ix._M_lo |= 1ull << 63; if ((__iy._M_hi & __maxexp) == __maxexp) __iy._M_lo |= 1ull << 63; } else { # 960 "/usr/include/c++/15/compare" 3 } return _S_compl(__ix) <=> _S_compl(__iy); } } public: template _Up> requires __strongly_ordered<_Tp, _Up> constexpr strong_ordering operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { if constexpr (floating_point>) return _S_fp_cmp(__e, __f); else if constexpr (__adl_strong<_Tp, _Up>) return strong_ordering(strong_order(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f))); else if constexpr (__cmp3way) return compare_three_way()(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); } }; template concept __weakly_ordered = floating_point> || __adl_weak<_Tp, _Up> || __cmp3way || __strongly_ordered<_Tp, _Up>; class _Weak_order { template static constexpr bool _S_noexcept() { if constexpr (floating_point>) return true; else if constexpr (__adl_weak<_Tp, _Up>) return noexcept(weak_ordering(weak_order(std::declval<_Tp>(), std::declval<_Up>()))); else if constexpr (__cmp3way) return noexcept(compare_three_way()(std::declval<_Tp>(), std::declval<_Up>())); else if constexpr (__strongly_ordered<_Tp, _Up>) return _Strong_order::_S_noexcept<_Tp, _Up>(); } friend class _Partial_order; friend class _Weak_fallback; public: template _Up> requires __weakly_ordered<_Tp, _Up> constexpr weak_ordering operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { if constexpr (floating_point>) return __compare::__fp_weak_ordering(__e, __f); else if constexpr (__adl_weak<_Tp, _Up>) return weak_ordering(weak_order(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f))); else if constexpr (__cmp3way) return compare_three_way()(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); else if constexpr (__strongly_ordered<_Tp, _Up>) return _Strong_order{}(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); } }; template concept __partially_ordered = __adl_partial<_Tp, _Up> || __cmp3way || __weakly_ordered<_Tp, _Up>; class _Partial_order { template static constexpr bool _S_noexcept() { if constexpr (__adl_partial<_Tp, _Up>) return noexcept(partial_ordering(partial_order(std::declval<_Tp>(), std::declval<_Up>()))); else if constexpr (__cmp3way) return noexcept(compare_three_way()(std::declval<_Tp>(), std::declval<_Up>())); else if constexpr (__weakly_ordered<_Tp, _Up>) return _Weak_order::_S_noexcept<_Tp, _Up>(); } friend class _Partial_fallback; public: template _Up> requires __partially_ordered<_Tp, _Up> constexpr partial_ordering operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { if constexpr (__adl_partial<_Tp, _Up>) return partial_ordering(partial_order(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f))); else if constexpr (__cmp3way) return compare_three_way()(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); else if constexpr (__weakly_ordered<_Tp, _Up>) return _Weak_order{}(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); } }; template concept __op_eq_lt = requires(_Tp&& __t, _Up&& __u) { { static_cast<_Tp&&>(__t) == static_cast<_Up&&>(__u) } -> convertible_to; { static_cast<_Tp&&>(__t) < static_cast<_Up&&>(__u) } -> convertible_to; }; class _Strong_fallback { template static constexpr bool _S_noexcept() { if constexpr (__strongly_ordered<_Tp, _Up>) return _Strong_order::_S_noexcept<_Tp, _Up>(); else return noexcept(bool(std::declval<_Tp>() == std::declval<_Up>())) && noexcept(bool(std::declval<_Tp>() < std::declval<_Up>())); } public: template _Up> requires __strongly_ordered<_Tp, _Up> || __op_eq_lt<_Tp, _Up> constexpr strong_ordering operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { if constexpr (__strongly_ordered<_Tp, _Up>) return _Strong_order{}(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); else return static_cast<_Tp&&>(__e) == static_cast<_Up&&>(__f) ? strong_ordering::equal : static_cast<_Tp&&>(__e) < static_cast<_Up&&>(__f) ? strong_ordering::less : strong_ordering::greater; } }; class _Weak_fallback { template static constexpr bool _S_noexcept() { if constexpr (__weakly_ordered<_Tp, _Up>) return _Weak_order::_S_noexcept<_Tp, _Up>(); else return noexcept(bool(std::declval<_Tp>() == std::declval<_Up>())) && noexcept(bool(std::declval<_Tp>() < std::declval<_Up>())); } public: template _Up> requires __weakly_ordered<_Tp, _Up> || __op_eq_lt<_Tp, _Up> constexpr weak_ordering operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { if constexpr (__weakly_ordered<_Tp, _Up>) return _Weak_order{}(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); else return static_cast<_Tp&&>(__e) == static_cast<_Up&&>(__f) ? weak_ordering::equivalent : static_cast<_Tp&&>(__e) < static_cast<_Up&&>(__f) ? weak_ordering::less : weak_ordering::greater; } }; template concept __op_eq_lt_lt = __op_eq_lt<_Tp, _Up> && requires(_Tp&& __t, _Up&& __u) { { static_cast<_Up&&>(__u) < static_cast<_Tp&&>(__t) } -> convertible_to; }; class _Partial_fallback { template static constexpr bool _S_noexcept() { if constexpr (__partially_ordered<_Tp, _Up>) return _Partial_order::_S_noexcept<_Tp, _Up>(); else return noexcept(bool(std::declval<_Tp>() == std::declval<_Up>())) && noexcept(bool(std::declval<_Tp>() < std::declval<_Up>())); } public: template _Up> requires __partially_ordered<_Tp, _Up> || __op_eq_lt_lt<_Tp, _Up> constexpr partial_ordering operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const noexcept(_S_noexcept<_Tp, _Up>()) { if constexpr (__partially_ordered<_Tp, _Up>) return _Partial_order{}(static_cast<_Tp&&>(__e), static_cast<_Up&&>(__f)); else return static_cast<_Tp&&>(__e) == static_cast<_Up&&>(__f) ? partial_ordering::equivalent : static_cast<_Tp&&>(__e) < static_cast<_Up&&>(__f) ? partial_ordering::less : static_cast<_Up&&>(__f) < static_cast<_Tp&&>(__e) ? partial_ordering::greater : partial_ordering::unordered; } }; } inline namespace _Cpo { inline constexpr __compare::_Strong_order strong_order{}; inline constexpr __compare::_Weak_order weak_order{}; inline constexpr __compare::_Partial_order partial_order{}; inline constexpr __compare::_Strong_fallback compare_strong_order_fallback{}; inline constexpr __compare::_Weak_fallback compare_weak_order_fallback{}; inline constexpr __compare::_Partial_fallback compare_partial_order_fallback{}; } namespace __detail { inline constexpr struct _Synth3way { template static constexpr bool _S_noexcept(const _Tp* __t = nullptr, const _Up* __u = nullptr) { if constexpr (three_way_comparable_with<_Tp, _Up>) return noexcept(*__t <=> *__u); else return noexcept(*__t < *__u) && noexcept(*__u < *__t); } template [[nodiscard]] constexpr auto operator()(const _Tp& __t, const _Up& __u) const noexcept(_S_noexcept<_Tp, _Up>()) requires requires { { __t < __u } -> __boolean_testable; { __u < __t } -> __boolean_testable; } { if constexpr (three_way_comparable_with<_Tp, _Up>) return __t <=> __u; else { if (__t < __u) return weak_ordering::less; else if (__u < __t) return weak_ordering::greater; else return weak_ordering::equivalent; } } } __synth3way = {}; template using __synth3way_t = decltype(__detail::__synth3way(std::declval<_Tp&>(), std::declval<_Up&>())); } } #pragma GCC diagnostic pop # 66 "/usr/include/c++/15/bits/stl_pair.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 79 "/usr/include/c++/15/bits/stl_pair.h" 3 struct piecewise_construct_t { explicit piecewise_construct_t() = default; }; inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); template struct pair; template class tuple; template struct array; template struct _Index_tuple; template class complex; template constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type& get(pair<_Tp1, _Tp2>& __in) noexcept; template constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&& get(pair<_Tp1, _Tp2>&& __in) noexcept; template constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type& get(const pair<_Tp1, _Tp2>& __in) noexcept; template constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&& get(const pair<_Tp1, _Tp2>&& __in) noexcept; template constexpr __tuple_element_t<__i, tuple<_Elements...>>& get(tuple<_Elements...>& __t) noexcept; template constexpr const __tuple_element_t<__i, tuple<_Elements...>>& get(const tuple<_Elements...>& __t) noexcept; template constexpr __tuple_element_t<__i, tuple<_Elements...>>&& get(tuple<_Elements...>&& __t) noexcept; template constexpr const __tuple_element_t<__i, tuple<_Elements...>>&& get(const tuple<_Elements...>&& __t) noexcept; template constexpr _Tp& get(array<_Tp, _Nm>&) noexcept; template constexpr _Tp&& get(array<_Tp, _Nm>&&) noexcept; template constexpr const _Tp& get(const array<_Tp, _Nm>&) noexcept; template constexpr const _Tp&& get(const array<_Tp, _Nm>&&) noexcept; # 239 "/usr/include/c++/15/bits/stl_pair.h" 3 template inline constexpr bool __is_tuple_v = false; template inline constexpr bool __is_tuple_v> = true; template inline constexpr bool __is_tuple_like_v = false; template inline constexpr bool __is_tuple_like_v> = true; template inline constexpr bool __is_tuple_like_v> = true; template inline constexpr bool __is_tuple_like_v> = true; template concept __tuple_like = __is_tuple_like_v>; template concept __pair_like = __tuple_like<_Tp> && tuple_size_v> == 2; template concept __eligible_tuple_like = __detail::__different_from<_Tp, _Tuple> && __tuple_like<_Tp> && (tuple_size_v> == tuple_size_v<_Tuple>) && !ranges::__detail::__is_subrange>; template concept __eligible_pair_like = __detail::__different_from<_Tp, _Pair> && __pair_like<_Tp> && !ranges::__detail::__is_subrange>; template class __pair_base { }; # 301 "/usr/include/c++/15/bits/stl_pair.h" 3 template struct pair : public __pair_base<_T1, _T2> { typedef _T1 first_type; typedef _T2 second_type; _T1 first; _T2 second; constexpr pair(const pair&) = default; constexpr pair(pair&&) = default; template constexpr pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>); constexpr void swap(pair& __p) noexcept(__and_<__is_nothrow_swappable<_T1>, __is_nothrow_swappable<_T2>>::value) { using std::swap; swap(first, __p.first); swap(second, __p.second); } # 337 "/usr/include/c++/15/bits/stl_pair.h" 3 constexpr void swap(const pair& __p) const noexcept(__and_v<__is_nothrow_swappable, __is_nothrow_swappable>) requires is_swappable_v && is_swappable_v { using std::swap; swap(first, __p.first); swap(second, __p.second); } private: template constexpr pair(tuple<_Args1...>&, tuple<_Args2...>&, _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>); public: constexpr explicit(__not_<__and_<__is_implicitly_default_constructible<_T1>, __is_implicitly_default_constructible<_T2>>>()) pair() noexcept(is_nothrow_default_constructible_v<_T1> && is_nothrow_default_constructible_v<_T2>) requires is_default_constructible_v<_T1> && is_default_constructible_v<_T2> : first(), second() { } private: template static constexpr bool _S_constructible() { if constexpr (is_constructible_v<_T1, _U1>) return is_constructible_v<_T2, _U2>; return false; } template static constexpr bool _S_nothrow_constructible() { if constexpr (is_nothrow_constructible_v<_T1, _U1>) return is_nothrow_constructible_v<_T2, _U2>; return false; } template static constexpr bool _S_convertible() { if constexpr (is_convertible_v<_U1, _T1>) return is_convertible_v<_U2, _T2>; return false; } template static constexpr bool _S_dangles() { if constexpr (__reference_constructs_from_temporary(_T1, _U1&&)) return true; else return __reference_constructs_from_temporary(_T2, _U2&&); } template static constexpr bool _S_constructible_from_pair_like() { return _S_constructible(std::declval<_UPair>())), decltype(std::get<1>(std::declval<_UPair>()))>(); } template static constexpr bool _S_convertible_from_pair_like() { return _S_convertible(std::declval<_UPair>())), decltype(std::get<1>(std::declval<_UPair>()))>(); } template static constexpr bool _S_dangles_from_pair_like() { return _S_dangles(std::declval<_UPair>())), decltype(std::get<1>(std::declval<_UPair>()))>(); } public: constexpr explicit(!_S_convertible()) pair(const type_identity_t<_T1>& __x, const _T2& __y) noexcept(_S_nothrow_constructible()) requires (_S_constructible()) : first(__x), second(__y) { } template requires (_S_constructible<_U1, _U2>()) && (!_S_dangles<_U1, _U2>()) constexpr explicit(!_S_convertible<_U1, _U2>()) pair(_U1&& __x, _U2&& __y) noexcept(_S_nothrow_constructible<_U1, _U2>()) : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { } template requires (_S_constructible<_U1, _U2>()) && (_S_dangles<_U1, _U2>()) constexpr explicit(!_S_convertible<_U1, _U2>()) pair(_U1&&, _U2&&) = delete; template requires (_S_constructible()) && (!_S_dangles<_U1, _U2>()) constexpr explicit(!_S_convertible()) pair(const pair<_U1, _U2>& __p) noexcept(_S_nothrow_constructible()) : first(__p.first), second(__p.second) { } template requires (_S_constructible()) && (_S_dangles()) constexpr explicit(!_S_convertible()) pair(const pair<_U1, _U2>&) = delete; template requires (_S_constructible<_U1, _U2>()) && (!_S_dangles<_U1, _U2>()) constexpr explicit(!_S_convertible<_U1, _U2>()) pair(pair<_U1, _U2>&& __p) noexcept(_S_nothrow_constructible<_U1, _U2>()) : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) { } template requires (_S_constructible<_U1, _U2>()) && (_S_dangles<_U1, _U2>()) constexpr explicit(!_S_convertible<_U1, _U2>()) pair(pair<_U1, _U2>&&) = delete; template requires (_S_constructible<_U1&, _U2&>()) && (!_S_dangles<_U1&, _U2&>()) constexpr explicit(!_S_convertible<_U1&, _U2&>()) pair(pair<_U1, _U2>& __p) noexcept(_S_nothrow_constructible<_U1&, _U2&>()) : first(__p.first), second(__p.second) { } template requires (_S_constructible<_U1&, _U2&>()) && (_S_dangles<_U1&, _U2&>()) constexpr explicit(!_S_convertible<_U1&, _U2&>()) pair(pair<_U1, _U2>&) = delete; template requires (_S_constructible()) && (!_S_dangles()) constexpr explicit(!_S_convertible()) pair(const pair<_U1, _U2>&& __p) noexcept(_S_nothrow_constructible()) : first(std::forward(__p.first)), second(std::forward(__p.second)) { } template requires (_S_constructible()) && (_S_dangles()) constexpr explicit(!_S_convertible()) pair(const pair<_U1, _U2>&&) = delete; template<__eligible_pair_like _UPair> requires (_S_constructible_from_pair_like<_UPair>()) && (!_S_dangles_from_pair_like<_UPair>()) constexpr explicit(!_S_convertible_from_pair_like<_UPair>()) pair(_UPair&& __p) : first(std::get<0>(std::forward<_UPair>(__p))), second(std::get<1>(std::forward<_UPair>(__p))) { } template<__eligible_pair_like _UPair> requires (_S_constructible_from_pair_like<_UPair>()) && (_S_dangles_from_pair_like<_UPair>()) constexpr explicit(!_S_convertible_from_pair_like<_UPair>()) pair(_UPair&&) = delete; private: template static constexpr bool _S_assignable() { if constexpr (is_assignable_v<_T1&, _U1>) return is_assignable_v<_T2&, _U2>; return false; } template static constexpr bool _S_const_assignable() { if constexpr (is_assignable_v) return is_assignable_v; return false; } template static constexpr bool _S_nothrow_assignable() { if constexpr (is_nothrow_assignable_v<_T1&, _U1>) return is_nothrow_assignable_v<_T2&, _U2>; return false; } template static constexpr bool _S_assignable_from_tuple_like() { return _S_assignable(std::declval<_UPair>())), decltype(std::get<1>(std::declval<_UPair>()))>(); } template static constexpr bool _S_const_assignable_from_tuple_like() { return _S_const_assignable(std::declval<_UPair>())), decltype(std::get<1>(std::declval<_UPair>()))>(); } public: pair& operator=(const pair&) = delete; constexpr pair& operator=(const pair& __p) noexcept(_S_nothrow_assignable()) requires (_S_assignable()) { first = __p.first; second = __p.second; return *this; } constexpr pair& operator=(pair&& __p) noexcept(_S_nothrow_assignable<_T1, _T2>()) requires (_S_assignable<_T1, _T2>()) { first = std::forward(__p.first); second = std::forward(__p.second); return *this; } template constexpr pair& operator=(const pair<_U1, _U2>& __p) noexcept(_S_nothrow_assignable()) requires (_S_assignable()) { first = __p.first; second = __p.second; return *this; } template constexpr pair& operator=(pair<_U1, _U2>&& __p) noexcept(_S_nothrow_assignable<_U1, _U2>()) requires (_S_assignable<_U1, _U2>()) { first = std::forward<_U1>(__p.first); second = std::forward<_U2>(__p.second); return *this; } constexpr const pair& operator=(const pair& __p) const requires (_S_const_assignable()) { first = __p.first; second = __p.second; return *this; } constexpr const pair& operator=(pair&& __p) const requires (_S_const_assignable()) { first = std::forward(__p.first); second = std::forward(__p.second); return *this; } template constexpr const pair& operator=(const pair<_U1, _U2>& __p) const requires (_S_const_assignable()) { first = __p.first; second = __p.second; return *this; } template constexpr const pair& operator=(pair<_U1, _U2>&& __p) const requires (_S_const_assignable<_U1, _U2>()) { first = std::forward<_U1>(__p.first); second = std::forward<_U2>(__p.second); return *this; } template<__eligible_pair_like _UPair> requires (_S_assignable_from_tuple_like<_UPair>()) constexpr pair& operator=(_UPair&& __p) { first = std::get<0>(std::forward<_UPair>(__p)); second = std::get<1>(std::forward<_UPair>(__p)); return *this; } template<__eligible_pair_like _UPair> requires (_S_const_assignable_from_tuple_like<_UPair>()) constexpr const pair& operator=(_UPair&& __p) const { first = std::get<0>(std::forward<_UPair>(__p)); second = std::get<1>(std::forward<_UPair>(__p)); return *this; } # 1015 "/usr/include/c++/15/bits/stl_pair.h" 3 }; template pair(_T1, _T2) -> pair<_T1, _T2>; template [[nodiscard]] constexpr bool operator==(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) requires requires { { __x.first == __y.first } -> __detail::__boolean_testable; { __x.second == __y.second } -> __detail::__boolean_testable; } { return __x.first == __y.first && __x.second == __y.second; } # 1045 "/usr/include/c++/15/bits/stl_pair.h" 3 template [[nodiscard]] constexpr common_comparison_category_t<__detail::__synth3way_t<_T1, _U1>, __detail::__synth3way_t<_T2, _U2>> operator<=>(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) { if (auto __c = __detail::__synth3way(__x.first, __y.first); __c != 0) return __c; return __detail::__synth3way(__x.second, __y.second); } # 1112 "/usr/include/c++/15/bits/stl_pair.h" 3 template constexpr inline typename enable_if<__and_<__is_swappable<_T1>, __is_swappable<_T2>>::value>::type swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template requires is_swappable_v && is_swappable_v constexpr void swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template typename enable_if, __is_swappable<_T2>>::value>::type swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; # 1161 "/usr/include/c++/15/bits/stl_pair.h" 3 template constexpr pair::__type, typename __decay_and_strip<_T2>::__type> make_pair(_T1&& __x, _T2&& __y) { typedef typename __decay_and_strip<_T1>::__type __ds_type1; typedef typename __decay_and_strip<_T2>::__type __ds_type2; typedef pair<__ds_type1, __ds_type2> __pair_type; return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y)); } # 1184 "/usr/include/c++/15/bits/stl_pair.h" 3 template struct __is_tuple_like_impl> : true_type { }; template struct tuple_size> : public integral_constant { }; template struct tuple_element<0, pair<_Tp1, _Tp2>> { typedef _Tp1 type; }; template struct tuple_element<1, pair<_Tp1, _Tp2>> { typedef _Tp2 type; }; template inline constexpr size_t tuple_size_v> = 2; template inline constexpr size_t tuple_size_v> = 2; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++14-extensions" #pragma GCC diagnostic ignored "-Wc++17-extensions" template inline constexpr bool __is_pair = false; template inline constexpr bool __is_pair> = true; #pragma GCC diagnostic pop template struct __pair_get; template<> struct __pair_get<0> { template static constexpr _Tp1& __get(pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.first; } template static constexpr _Tp1&& __move_get(pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<_Tp1>(__pair.first); } template static constexpr const _Tp1& __const_get(const pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.first; } template static constexpr const _Tp1&& __const_move_get(const pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward(__pair.first); } }; template<> struct __pair_get<1> { template static constexpr _Tp2& __get(pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.second; } template static constexpr _Tp2&& __move_get(pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<_Tp2>(__pair.second); } template static constexpr const _Tp2& __const_get(const pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.second; } template static constexpr const _Tp2&& __const_move_get(const pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward(__pair.second); } }; template constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type& get(pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__get(__in); } template constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&& get(pair<_Tp1, _Tp2>&& __in) noexcept { return __pair_get<_Int>::__move_get(std::move(__in)); } template constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type& get(const pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__const_get(__in); } template constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&& get(const pair<_Tp1, _Tp2>&& __in) noexcept { return __pair_get<_Int>::__const_move_get(std::move(__in)); } template constexpr _Tp& get(pair<_Tp, _Up>& __p) noexcept { return __p.first; } template constexpr const _Tp& get(const pair<_Tp, _Up>& __p) noexcept { return __p.first; } template constexpr _Tp&& get(pair<_Tp, _Up>&& __p) noexcept { return std::forward<_Tp>(__p.first); } template constexpr const _Tp&& get(const pair<_Tp, _Up>&& __p) noexcept { return std::forward(__p.first); } template constexpr _Tp& get(pair<_Up, _Tp>& __p) noexcept { return __p.second; } template constexpr const _Tp& get(const pair<_Up, _Tp>& __p) noexcept { return __p.second; } template constexpr _Tp&& get(pair<_Up, _Tp>&& __p) noexcept { return std::forward<_Tp>(__p.second); } template constexpr const _Tp&& get(const pair<_Up, _Tp>&& __p) noexcept { return std::forward(__p.second); } template class _TQual, template class _UQual> requires requires { typename pair, _UQual<_U1>>, common_reference_t<_TQual<_T2>, _UQual<_U2>>>; } struct basic_common_reference, pair<_U1, _U2>, _TQual, _UQual> { using type = pair, _UQual<_U1>>, common_reference_t<_TQual<_T2>, _UQual<_U2>>>; }; template requires requires { typename pair, common_type_t<_T2, _U2>>; } struct common_type, pair<_U1, _U2>> { using type = pair, common_type_t<_T2, _U2>>; }; } # 41 "/usr/include/c++/15/tuple" 2 3 # 1 "/usr/include/c++/15/bits/uses_allocator.h" 1 3 # 40 "/usr/include/c++/15/bits/uses_allocator.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { struct __erased_type { }; template using __is_erased_or_convertible = __or_, is_same<_Tp, __erased_type>>; struct allocator_arg_t { explicit allocator_arg_t() = default; }; inline constexpr allocator_arg_t allocator_arg = allocator_arg_t(); template> struct __uses_allocator_helper : false_type { }; template struct __uses_allocator_helper<_Tp, _Alloc, __void_t> : __is_erased_or_convertible<_Alloc, typename _Tp::allocator_type>::type { }; template struct uses_allocator : __uses_allocator_helper<_Tp, _Alloc>::type { }; struct __uses_alloc_base { }; struct __uses_alloc0 : __uses_alloc_base { struct _Sink { void constexpr operator=(const void*) { } } _M_a; }; template struct __uses_alloc1 : __uses_alloc_base { const _Alloc* _M_a; }; template struct __uses_alloc2 : __uses_alloc_base { const _Alloc* _M_a; }; template struct __uses_alloc; template struct __uses_alloc : __conditional_t< is_constructible<_Tp, allocator_arg_t, const _Alloc&, _Args...>::value, __uses_alloc1<_Alloc>, __uses_alloc2<_Alloc>> { static_assert(__or_< is_constructible<_Tp, allocator_arg_t, const _Alloc&, _Args...>, is_constructible<_Tp, _Args..., const _Alloc&>>::value, "construction with an allocator must be possible" " if uses_allocator is true"); }; template struct __uses_alloc : __uses_alloc0 { }; template using __uses_alloc_t = __uses_alloc::value, _Tp, _Alloc, _Args...>; template constexpr inline __uses_alloc_t<_Tp, _Alloc, _Args...> __use_alloc(const _Alloc& __a) { __uses_alloc_t<_Tp, _Alloc, _Args...> __ret; __ret._M_a = std::__addressof(__a); return __ret; } template void __use_alloc(const _Alloc&&) = delete; template inline constexpr bool uses_allocator_v = uses_allocator<_Tp, _Alloc>::value; template concept __allocator_for = (uses_allocator_v<_Ts, _Alloc> && ...); template class _Predicate, typename _Tp, typename _Alloc, typename... _Args> struct __is_uses_allocator_predicate : __conditional_t::value, __or_<_Predicate<_Tp, allocator_arg_t, _Alloc, _Args...>, _Predicate<_Tp, _Args..., _Alloc>>, _Predicate<_Tp, _Args...>> { }; template struct __is_uses_allocator_constructible : __is_uses_allocator_predicate { }; template inline constexpr bool __is_uses_allocator_constructible_v = __is_uses_allocator_constructible<_Tp, _Alloc, _Args...>::value; template struct __is_nothrow_uses_allocator_constructible : __is_uses_allocator_predicate { }; template inline constexpr bool __is_nothrow_uses_allocator_constructible_v = __is_nothrow_uses_allocator_constructible<_Tp, _Alloc, _Args...>::value; template void __uses_allocator_construct_impl(__uses_alloc0, _Tp* __ptr, _Args&&... __args) { ::new ((void*)__ptr) _Tp(std::forward<_Args>(__args)...); } template void __uses_allocator_construct_impl(__uses_alloc1<_Alloc> __a, _Tp* __ptr, _Args&&... __args) { ::new ((void*)__ptr) _Tp(allocator_arg, *__a._M_a, std::forward<_Args>(__args)...); } template void __uses_allocator_construct_impl(__uses_alloc2<_Alloc> __a, _Tp* __ptr, _Args&&... __args) { ::new ((void*)__ptr) _Tp(std::forward<_Args>(__args)..., *__a._M_a); } template void __uses_allocator_construct(const _Alloc& __a, _Tp* __ptr, _Args&&... __args) { std::__uses_allocator_construct_impl( std::__use_alloc<_Tp, _Alloc, _Args...>(__a), __ptr, std::forward<_Args>(__args)...); } } # 42 "/usr/include/c++/15/tuple" 2 3 # 1 "/usr/include/c++/15/bits/invoke.h" 1 3 # 44 "/usr/include/c++/15/bits/invoke.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 55 "/usr/include/c++/15/bits/invoke.h" 3 template::type> constexpr _Up&& __invfwd(typename remove_reference<_Tp>::type& __t) noexcept { return static_cast<_Up&&>(__t); } template constexpr _Res __invoke_impl(__invoke_other, _Fn&& __f, _Args&&... __args) { return std::forward<_Fn>(__f)(std::forward<_Args>(__args)...); } template constexpr _Res __invoke_impl(__invoke_memfun_ref, _MemFun&& __f, _Tp&& __t, _Args&&... __args) { return (__invfwd<_Tp>(__t).*__f)(std::forward<_Args>(__args)...); } template constexpr _Res __invoke_impl(__invoke_memfun_deref, _MemFun&& __f, _Tp&& __t, _Args&&... __args) { return ((*std::forward<_Tp>(__t)).*__f)(std::forward<_Args>(__args)...); } template constexpr _Res __invoke_impl(__invoke_memobj_ref, _MemPtr&& __f, _Tp&& __t) { return __invfwd<_Tp>(__t).*__f; } template constexpr _Res __invoke_impl(__invoke_memobj_deref, _MemPtr&& __f, _Tp&& __t) { return (*std::forward<_Tp>(__t)).*__f; } template constexpr typename __invoke_result<_Callable, _Args...>::type __invoke(_Callable&& __fn, _Args&&... __args) noexcept(__is_nothrow_invocable<_Callable, _Args...>::value) { using __result = __invoke_result<_Callable, _Args...>; using __type = typename __result::type; using __tag = typename __result::__invoke_type; return std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn), std::forward<_Args>(__args)...); } template constexpr enable_if_t, _Res> __invoke_r(_Callable&& __fn, _Args&&... __args) noexcept(is_nothrow_invocable_r_v<_Res, _Callable, _Args...>) { using __result = __invoke_result<_Callable, _Args...>; using __type = typename __result::type; using __tag = typename __result::__invoke_type; if constexpr (is_void_v<_Res>) std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn), std::forward<_Args>(__args)...); else return std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn), std::forward<_Args>(__args)...); } # 157 "/usr/include/c++/15/bits/invoke.h" 3 } # 44 "/usr/include/c++/15/tuple" 2 3 # 1 "/usr/include/c++/15/bits/ranges_util.h" 1 3 # 34 "/usr/include/c++/15/bits/ranges_util.h" 3 # 1 "/usr/include/c++/15/bits/ranges_base.h" 1 3 # 38 "/usr/include/c++/15/bits/ranges_base.h" 3 # 1 "/usr/include/c++/15/initializer_list" 1 3 # 43 "/usr/include/c++/15/initializer_list" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template class initializer_list { public: typedef _E value_type; typedef const _E& reference; typedef const _E& const_reference; typedef size_t size_type; typedef const _E* iterator; typedef const _E* const_iterator; private: iterator _M_array; size_type _M_len; constexpr initializer_list(const_iterator __a, size_type __l) : _M_array(__a), _M_len(__l) { } public: constexpr initializer_list() noexcept : _M_array(0), _M_len(0) { } constexpr size_type size() const noexcept { return _M_len; } constexpr const_iterator begin() const noexcept { return _M_array; } constexpr const_iterator end() const noexcept { return begin() + size(); } }; template constexpr const _Tp* begin(initializer_list<_Tp> __ils) noexcept { return __ils.begin(); } template constexpr const _Tp* end(initializer_list<_Tp> __ils) noexcept { return __ils.end(); } } # 39 "/usr/include/c++/15/bits/ranges_base.h" 2 3 # 1 "/usr/include/c++/15/bits/stl_iterator.h" 1 3 # 63 "/usr/include/c++/15/bits/stl_iterator.h" 3 # 1 "/usr/include/c++/15/bits/cpp_type_traits.h" 1 3 # 40 "/usr/include/c++/15/bits/cpp_type_traits.h" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 41 "/usr/include/c++/15/bits/cpp_type_traits.h" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wlong-long" # 76 "/usr/include/c++/15/bits/cpp_type_traits.h" 3 extern "C++" { namespace std __attribute__ ((__visibility__ ("default"))) { struct __true_type { }; struct __false_type { }; template struct __truth_type { typedef __false_type __type; }; template<> struct __truth_type { typedef __true_type __type; }; template struct __traitor { enum { __value = bool(_Sp::__value) || bool(_Tp::__value) }; typedef typename __truth_type<__value>::__type __type; }; template struct __are_same { enum { __value = 0 }; typedef __false_type __type; }; template struct __are_same<_Tp, _Tp> { enum { __value = 1 }; typedef __true_type __type; }; template struct __is_integer { enum { __value = 0 }; typedef __false_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; # 264 "/usr/include/c++/15/bits/cpp_type_traits.h" 3 __extension__ template<> struct __is_integer<__int128> { enum { __value = 1 }; typedef __true_type __type; }; __extension__ template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; # 281 "/usr/include/c++/15/bits/cpp_type_traits.h" 3 template struct __is_floating { enum { __value = 0 }; typedef __false_type __type; }; template<> struct __is_floating { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating<_Float16> { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating<_Float32> { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating<_Float64> { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating<_Float128> { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating<__gnu_cxx::__bfloat16_t> { enum { __value = 1 }; typedef __true_type __type; }; template struct __is_arithmetic : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> > { }; template struct __is_char { enum { __value = 0 }; typedef __false_type __type; }; template<> struct __is_char { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_char { enum { __value = 1 }; typedef __true_type __type; }; template struct __is_byte { enum { __value = 0 }; typedef __false_type __type; }; template<> struct __is_byte { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_byte { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_byte { enum { __value = 1 }; typedef __true_type __type; }; enum class byte : unsigned char; template<> struct __is_byte { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_byte { enum { __value = 1 }; typedef __true_type __type; }; template struct __is_nonvolatile_trivially_copyable { enum { __value = __is_trivially_copyable(_Tp) }; }; template struct __is_nonvolatile_trivially_copyable { enum { __value = 0 }; }; template struct __memcpyable { enum { __value = 0 }; }; template struct __memcpyable<_Tp*, _Tp*> : __is_nonvolatile_trivially_copyable<_Tp> { }; template struct __memcpyable<_Tp*, const _Tp*> : __is_nonvolatile_trivially_copyable<_Tp> { }; template struct __memcpyable_integer; template struct __memcpyable<_Tp*, _Up*> { enum { __value = __memcpyable_integer<_Tp>::__width != 0 && ((int)__memcpyable_integer<_Tp>::__width == (int)__memcpyable_integer<_Up>::__width) }; }; template struct __memcpyable<_Tp*, const _Up*> : __memcpyable<_Tp*, _Up*> { }; template struct __memcpyable_integer { enum { __width = __is_integer<_Tp>::__value ? (sizeof(_Tp) * 8) : 0 }; }; template struct __memcpyable_integer { enum { __width = 0 }; }; template<> struct __memcpyable_integer { enum { __width = 0 }; }; # 574 "/usr/include/c++/15/bits/cpp_type_traits.h" 3 template<> struct __memcpyable<_Float32*, float*> { enum { __value = true }; }; template<> struct __memcpyable { enum { __value = true }; }; template<> struct __memcpyable<_Float64*, double*> { enum { __value = true }; }; template<> struct __memcpyable { enum { __value = true }; }; # 599 "/usr/include/c++/15/bits/cpp_type_traits.h" 3 template struct __memcmpable { enum { __value = 0 }; }; template struct __memcmpable<_Tp*, _Tp*> : __is_nonvolatile_trivially_copyable<_Tp> { }; template struct __memcmpable : __is_nonvolatile_trivially_copyable<_Tp> { }; template struct __memcmpable<_Tp*, const _Tp*> : __is_nonvolatile_trivially_copyable<_Tp> { }; template::__value > struct __is_memcmp_ordered { static const bool __value = _Tp(-1) > _Tp(1); }; template struct __is_memcmp_ordered<_Tp, false> { static const bool __value = false; }; template struct __is_memcmp_ordered_with { static const bool __value = __is_memcmp_ordered<_Tp>::__value && __is_memcmp_ordered<_Up>::__value; }; template struct __is_memcmp_ordered_with<_Tp, _Up, false> { static const bool __value = false; }; # 668 "/usr/include/c++/15/bits/cpp_type_traits.h" 3 template<> struct __is_memcmp_ordered_with { static constexpr bool __value = true; }; template struct __is_memcmp_ordered_with<_Tp, std::byte, _SameSize> { static constexpr bool __value = false; }; template struct __is_memcmp_ordered_with { static constexpr bool __value = false; }; template constexpr bool __can_use_memchr_for_find = __is_byte<_ValT>::__value && (is_same_v<_Tp, _ValT> || is_integral_v<_Tp>); template struct __is_move_iterator { enum { __value = 0 }; typedef __false_type __type; }; template constexpr inline _Iterator __miter_base(_Iterator __it) { return __it; } } } #pragma GCC diagnostic pop # 64 "/usr/include/c++/15/bits/stl_iterator.h" 2 3 # 1 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 1 3 # 73 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 3 # 1 "/usr/include/c++/15/bits/iterator_concepts.h" 1 3 # 39 "/usr/include/c++/15/bits/iterator_concepts.h" 3 # 1 "/usr/include/c++/15/bits/ptr_traits.h" 1 3 # 39 "/usr/include/c++/15/bits/ptr_traits.h" 3 namespace __gnu_debug { struct _Safe_iterator_base; } namespace std __attribute__ ((__visibility__ ("default"))) { class __undefined; template struct __get_first_arg { using type = __undefined; }; template class _SomeTemplate, typename _Tp, typename... _Types> struct __get_first_arg<_SomeTemplate<_Tp, _Types...>> { using type = _Tp; }; template struct __replace_first_arg { }; template class _SomeTemplate, typename _Up, typename _Tp, typename... _Types> struct __replace_first_arg<_SomeTemplate<_Tp, _Types...>, _Up> { using type = _SomeTemplate<_Up, _Types...>; }; template struct __ptr_traits_elem : __get_first_arg<_Ptr> { }; template requires requires { typename _Ptr::element_type; } struct __ptr_traits_elem<_Ptr, void> { using type = typename _Ptr::element_type; }; template using __ptr_traits_elem_t = typename __ptr_traits_elem<_Ptr>::type; template::value> struct __ptr_traits_ptr_to { using pointer = _Ptr; using element_type = _Elt; static pointer pointer_to(element_type& __r) requires requires { { pointer::pointer_to(__r) } -> convertible_to; } { return pointer::pointer_to(__r); } }; template struct __ptr_traits_ptr_to<_Ptr, _Elt, true> { }; template struct __ptr_traits_ptr_to<_Tp*, _Tp, false> { using pointer = _Tp*; using element_type = _Tp; static constexpr pointer pointer_to(element_type& __r) noexcept { return std::addressof(__r); } }; template struct __ptr_traits_impl : __ptr_traits_ptr_to<_Ptr, _Elt> { private: template using __diff_t = typename _Tp::difference_type; template using __rebind = __type_identity>; public: using pointer = _Ptr; using element_type = _Elt; using difference_type = __detected_or_t; template using rebind = typename __detected_or_t<__replace_first_arg<_Ptr, _Up>, __rebind, _Ptr, _Up>::type; }; template struct __ptr_traits_impl<_Ptr, __undefined> { }; template struct pointer_traits : __ptr_traits_impl<_Ptr, __ptr_traits_elem_t<_Ptr>> { }; template struct pointer_traits<_Tp*> : __ptr_traits_ptr_to<_Tp*, _Tp> { typedef _Tp* pointer; typedef _Tp element_type; typedef ptrdiff_t difference_type; template using rebind = _Up*; }; template using __ptr_rebind = typename pointer_traits<_Ptr>::template rebind<_Tp>; # 229 "/usr/include/c++/15/bits/ptr_traits.h" 3 template [[__gnu__::__always_inline__]] constexpr _Tp* to_address(_Tp* __ptr) noexcept { static_assert(!is_function_v<_Tp>, "std::to_address argument " "must not be a function pointer"); return __ptr; } # 246 "/usr/include/c++/15/bits/ptr_traits.h" 3 template constexpr auto to_address(const _Ptr& __ptr) noexcept { if constexpr (requires { pointer_traits<_Ptr>::to_address(__ptr); }) return pointer_traits<_Ptr>::to_address(__ptr); else if constexpr (is_base_of_v<__gnu_debug::_Safe_iterator_base, _Ptr>) return std::to_address(__ptr.base().operator->()); else return std::to_address(__ptr.operator->()); } template [[__gnu__::__always_inline__]] constexpr auto __to_address(const _Ptr& __ptr) noexcept { return std::to_address(__ptr); } } # 40 "/usr/include/c++/15/bits/iterator_concepts.h" 2 3 # 1 "/usr/include/c++/15/bits/ranges_cmp.h" 1 3 # 37 "/usr/include/c++/15/bits/ranges_cmp.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { struct __is_transparent; struct identity { template [[nodiscard]] constexpr _Tp&& operator()(_Tp&& __t) const noexcept { return std::forward<_Tp>(__t); } using is_transparent = __is_transparent; }; namespace ranges { namespace __detail { template concept __less_builtin_ptr_cmp = requires (_Tp&& __t, _Up&& __u) { { __t < __u } -> same_as; } && convertible_to<_Tp, const volatile void*> && convertible_to<_Up, const volatile void*> && ! requires(_Tp&& __t, _Up&& __u) { operator<(std::forward<_Tp>(__t), std::forward<_Up>(__u)); } && ! requires(_Tp&& __t, _Up&& __u) { std::forward<_Tp>(__t).operator<(std::forward<_Up>(__u)); } && std::__detail::__not_overloaded_spaceship<_Tp, _Up>; } struct equal_to { template requires equality_comparable_with<_Tp, _Up> constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::declval<_Tp>() == std::declval<_Up>())) { return std::forward<_Tp>(__t) == std::forward<_Up>(__u); } using is_transparent = __is_transparent; }; struct not_equal_to { template requires equality_comparable_with<_Tp, _Up> constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::declval<_Tp>() == std::declval<_Up>())) { return !equal_to{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); } using is_transparent = __is_transparent; }; struct less { template requires totally_ordered_with<_Tp, _Up> constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::declval<_Tp>() < std::declval<_Up>())) { if constexpr (__detail::__less_builtin_ptr_cmp<_Tp, _Up>) { if (std::__is_constant_evaluated()) return __t < __u; auto __x = reinterpret_cast( static_cast(std::forward<_Tp>(__t))); auto __y = reinterpret_cast( static_cast(std::forward<_Up>(__u))); return __x < __y; } else return std::forward<_Tp>(__t) < std::forward<_Up>(__u); } using is_transparent = __is_transparent; }; struct greater { template requires totally_ordered_with<_Tp, _Up> constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::declval<_Up>() < std::declval<_Tp>())) { return less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); } using is_transparent = __is_transparent; }; struct greater_equal { template requires totally_ordered_with<_Tp, _Up> constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::declval<_Tp>() < std::declval<_Up>())) { return !less{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); } using is_transparent = __is_transparent; }; struct less_equal { template requires totally_ordered_with<_Tp, _Up> constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::declval<_Up>() < std::declval<_Tp>())) { return !less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); } using is_transparent = __is_transparent; }; } } # 41 "/usr/include/c++/15/bits/iterator_concepts.h" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" namespace std __attribute__ ((__visibility__ ("default"))) { # 63 "/usr/include/c++/15/bits/iterator_concepts.h" 3 struct default_sentinel_t { }; inline constexpr default_sentinel_t default_sentinel{}; struct input_iterator_tag; struct output_iterator_tag; struct forward_iterator_tag; struct bidirectional_iterator_tag; struct random_access_iterator_tag; struct contiguous_iterator_tag; template struct iterator_traits; template requires is_object_v<_Tp> struct iterator_traits<_Tp*>; template struct __iterator_traits; namespace __detail { template using __with_ref = _Tp&; template concept __can_reference = requires { typename __with_ref<_Tp>; }; template concept __dereferenceable = requires(_Tp& __t) { { *__t } -> __can_reference; }; } template<__detail::__dereferenceable _Tp> using iter_reference_t = decltype(*std::declval<_Tp&>()); namespace ranges { namespace __imove { void iter_move() = delete; template concept __adl_imove = (std::__detail::__class_or_enum>) && requires(_Tp&& __t) { iter_move(static_cast<_Tp&&>(__t)); }; struct _IterMove { private: template using __iter_ref_t = decltype(*std::declval<_Tp>()); template struct __result { using type = __iter_ref_t<_Tp>; }; template requires __adl_imove<_Tp> struct __result<_Tp> { using type = decltype(iter_move(std::declval<_Tp>())); }; template requires (!__adl_imove<_Tp>) && is_lvalue_reference_v<__iter_ref_t<_Tp>> struct __result<_Tp> { using type = decltype(std::declval>>()); }; template static constexpr bool _S_noexcept() { if constexpr (__adl_imove<_Tp>) return noexcept(iter_move(std::declval<_Tp>())); else return noexcept(*std::declval<_Tp>()); } public: template using __type = typename __result<_Tp>::type; template requires __adl_imove<_Tp> || requires { typename __iter_ref_t<_Tp>; } [[nodiscard]] constexpr __type<_Tp> operator()(_Tp&& __e) const noexcept(_S_noexcept<_Tp>()) { if constexpr (__adl_imove<_Tp>) return iter_move(static_cast<_Tp&&>(__e)); else if constexpr (is_lvalue_reference_v<__iter_ref_t<_Tp>>) return std::move(*static_cast<_Tp&&>(__e)); else return *static_cast<_Tp&&>(__e); } }; } inline namespace _Cpo { inline constexpr __imove::_IterMove iter_move{}; } } template<__detail::__dereferenceable _Tp> requires __detail::__can_reference> using iter_rvalue_reference_t = ranges::__imove::_IterMove::__type<_Tp&>; template struct incrementable_traits { }; template requires is_object_v<_Tp> struct incrementable_traits<_Tp*> { using difference_type = ptrdiff_t; }; template struct incrementable_traits : incrementable_traits<_Iter> { }; template requires requires { typename _Tp::difference_type; } struct incrementable_traits<_Tp> { using difference_type = typename _Tp::difference_type; }; template requires (!requires { typename _Tp::difference_type; } && requires(const _Tp& __a, const _Tp& __b) { { __a - __b } -> integral; }) struct incrementable_traits<_Tp> { using difference_type = make_signed_t() - std::declval<_Tp>())>; }; # 228 "/usr/include/c++/15/bits/iterator_concepts.h" 3 namespace __detail { template concept __primary_traits_iter = __is_base_of(__iterator_traits<_Iter, void>, iterator_traits<_Iter>); template struct __iter_traits_impl { using type = iterator_traits<_Iter>; }; template requires __primary_traits_iter<_Iter> struct __iter_traits_impl<_Iter, _Tp> { using type = _Tp; }; template using __iter_traits = typename __iter_traits_impl<_Iter, _Tp>::type; template using __iter_diff_t = typename __iter_traits<_Tp, incrementable_traits<_Tp>>::difference_type; } template using iter_difference_t = __detail::__iter_diff_t>; namespace __detail { template struct __cond_value_type { }; template requires is_object_v<_Tp> struct __cond_value_type<_Tp> { using value_type = remove_cv_t<_Tp>; }; template concept __has_member_value_type = requires { typename _Tp::value_type; }; template concept __has_member_element_type = requires { typename _Tp::element_type; }; } template struct indirectly_readable_traits { }; template struct indirectly_readable_traits<_Tp*> : __detail::__cond_value_type<_Tp> { }; template requires is_array_v<_Iter> struct indirectly_readable_traits<_Iter> { using value_type = remove_cv_t>; }; template struct indirectly_readable_traits : indirectly_readable_traits<_Iter> { }; template<__detail::__has_member_value_type _Tp> struct indirectly_readable_traits<_Tp> : __detail::__cond_value_type { }; template<__detail::__has_member_element_type _Tp> struct indirectly_readable_traits<_Tp> : __detail::__cond_value_type { }; template<__detail::__has_member_value_type _Tp> requires __detail::__has_member_element_type<_Tp> && same_as, remove_cv_t> struct indirectly_readable_traits<_Tp> : __detail::__cond_value_type { }; template<__detail::__has_member_value_type _Tp> requires __detail::__has_member_element_type<_Tp> struct indirectly_readable_traits<_Tp> { }; namespace __detail { template using __iter_value_t = typename __iter_traits<_Tp, indirectly_readable_traits<_Tp>>::value_type; } template using iter_value_t = __detail::__iter_value_t>; namespace __detail { template concept __cpp17_iterator = requires(_Iter __it) { { *__it } -> __can_reference; { ++__it } -> same_as<_Iter&>; { *__it++ } -> __can_reference; } && copyable<_Iter>; template concept __cpp17_input_iterator = __cpp17_iterator<_Iter> && equality_comparable<_Iter> && requires(_Iter __it) { typename incrementable_traits<_Iter>::difference_type; typename indirectly_readable_traits<_Iter>::value_type; typename common_reference_t&&, typename indirectly_readable_traits<_Iter>::value_type&>; typename common_reference_t::value_type&>; requires signed_integral< typename incrementable_traits<_Iter>::difference_type>; }; template concept __cpp17_fwd_iterator = __cpp17_input_iterator<_Iter> && constructible_from<_Iter> && is_reference_v> && same_as>, typename indirectly_readable_traits<_Iter>::value_type> && requires(_Iter __it) { { __it++ } -> convertible_to; { *__it++ } -> same_as>; }; template concept __cpp17_bidi_iterator = __cpp17_fwd_iterator<_Iter> && requires(_Iter __it) { { --__it } -> same_as<_Iter&>; { __it-- } -> convertible_to; { *__it-- } -> same_as>; }; template concept __cpp17_randacc_iterator = __cpp17_bidi_iterator<_Iter> && totally_ordered<_Iter> && requires(_Iter __it, typename incrementable_traits<_Iter>::difference_type __n) { { __it += __n } -> same_as<_Iter&>; { __it -= __n } -> same_as<_Iter&>; { __it + __n } -> same_as<_Iter>; { __n + __it } -> same_as<_Iter>; { __it - __n } -> same_as<_Iter>; { __it - __it } -> same_as; { __it[__n] } -> convertible_to>; }; template concept __iter_with_nested_types = requires { typename _Iter::iterator_category; typename _Iter::value_type; typename _Iter::difference_type; typename _Iter::reference; }; template concept __iter_without_nested_types = !__iter_with_nested_types<_Iter>; template concept __iter_without_category = !requires { typename _Iter::iterator_category; }; } template requires __detail::__iter_with_nested_types<_Iterator> struct __iterator_traits<_Iterator, void> { private: template struct __ptr { using type = void; }; template requires requires { typename _Iter::pointer; } struct __ptr<_Iter> { using type = typename _Iter::pointer; }; public: using iterator_category = typename _Iterator::iterator_category; using value_type = typename _Iterator::value_type; using difference_type = typename _Iterator::difference_type; using pointer = typename __ptr<_Iterator>::type; using reference = typename _Iterator::reference; }; template requires __detail::__iter_without_nested_types<_Iterator> && __detail::__cpp17_input_iterator<_Iterator> struct __iterator_traits<_Iterator, void> { private: template struct __cat { using type = input_iterator_tag; }; template requires requires { typename _Iter::iterator_category; } struct __cat<_Iter> { using type = typename _Iter::iterator_category; }; template requires __detail::__iter_without_category<_Iter> && __detail::__cpp17_randacc_iterator<_Iter> struct __cat<_Iter> { using type = random_access_iterator_tag; }; template requires __detail::__iter_without_category<_Iter> && __detail::__cpp17_bidi_iterator<_Iter> struct __cat<_Iter> { using type = bidirectional_iterator_tag; }; template requires __detail::__iter_without_category<_Iter> && __detail::__cpp17_fwd_iterator<_Iter> struct __cat<_Iter> { using type = forward_iterator_tag; }; template struct __ptr { using type = void; }; template requires requires { typename _Iter::pointer; } struct __ptr<_Iter> { using type = typename _Iter::pointer; }; template requires (!requires { typename _Iter::pointer; } && requires(_Iter& __it) { __it.operator->(); }) struct __ptr<_Iter> { using type = decltype(std::declval<_Iter&>().operator->()); }; template struct __ref { using type = iter_reference_t<_Iter>; }; template requires requires { typename _Iter::reference; } struct __ref<_Iter> { using type = typename _Iter::reference; }; public: using iterator_category = typename __cat<_Iterator>::type; using value_type = typename indirectly_readable_traits<_Iterator>::value_type; using difference_type = typename incrementable_traits<_Iterator>::difference_type; using pointer = typename __ptr<_Iterator>::type; using reference = typename __ref<_Iterator>::type; }; template requires __detail::__iter_without_nested_types<_Iterator> && __detail::__cpp17_iterator<_Iterator> struct __iterator_traits<_Iterator, void> { private: template struct __diff { using type = void; }; template requires requires { typename incrementable_traits<_Iter>::difference_type; } struct __diff<_Iter> { using type = typename incrementable_traits<_Iter>::difference_type; }; public: using iterator_category = output_iterator_tag; using value_type = void; using difference_type = typename __diff<_Iterator>::type; using pointer = void; using reference = void; }; namespace __detail { template struct __iter_concept_impl; template requires requires { typename __iter_traits<_Iter>::iterator_concept; } struct __iter_concept_impl<_Iter> { using type = typename __iter_traits<_Iter>::iterator_concept; }; template requires (!requires { typename __iter_traits<_Iter>::iterator_concept; } && requires { typename __iter_traits<_Iter>::iterator_category; }) struct __iter_concept_impl<_Iter> { using type = typename __iter_traits<_Iter>::iterator_category; }; template requires (!requires { typename __iter_traits<_Iter>::iterator_concept; } && !requires { typename __iter_traits<_Iter>::iterator_category; } && __primary_traits_iter<_Iter>) struct __iter_concept_impl<_Iter> { using type = random_access_iterator_tag; }; template struct __iter_concept_impl { }; template using __iter_concept = typename __iter_concept_impl<_Iter>::type; template concept __indirectly_readable_impl = requires { typename iter_value_t<_In>; typename iter_reference_t<_In>; typename iter_rvalue_reference_t<_In>; requires same_as, iter_reference_t<_In>>; requires same_as, iter_rvalue_reference_t<_In>>; } && common_reference_with&&, iter_value_t<_In>&> && common_reference_with&&, iter_rvalue_reference_t<_In>&&> && common_reference_with&&, const iter_value_t<_In>&>; } template concept indirectly_readable = __detail::__indirectly_readable_impl>; namespace __detail { template struct __indirect_value { using type = iter_value_t<_Tp>&; }; } template using __indirect_value_t = typename __detail::__indirect_value<_Tp>::type; template using iter_common_reference_t = common_reference_t, __indirect_value_t<_Tp>>; template concept indirectly_writable = requires(_Out&& __o, _Tp&& __t) { *__o = std::forward<_Tp>(__t); *std::forward<_Out>(__o) = std::forward<_Tp>(__t); const_cast&&>(*__o) = std::forward<_Tp>(__t); const_cast&&>(*std::forward<_Out>(__o)) = std::forward<_Tp>(__t); }; namespace ranges::__detail { class __max_diff_type; class __max_size_type; __extension__ template concept __is_signed_int128 = same_as<_Tp, __int128>; __extension__ template concept __is_unsigned_int128 = same_as<_Tp, unsigned __int128>; template concept __cv_bool = same_as; template concept __integral_nonbool = integral<_Tp> && !__cv_bool<_Tp>; template concept __is_int128 = __is_signed_int128<_Tp> || __is_unsigned_int128<_Tp>; template concept __is_integer_like = __integral_nonbool<_Tp> || __is_int128<_Tp> || same_as<_Tp, __max_diff_type> || same_as<_Tp, __max_size_type>; template concept __is_signed_integer_like = signed_integral<_Tp> || __is_signed_int128<_Tp> || same_as<_Tp, __max_diff_type>; } namespace __detail { using ranges::__detail::__is_signed_integer_like; } template concept weakly_incrementable = movable<_Iter> && requires(_Iter __i) { typename iter_difference_t<_Iter>; requires __detail::__is_signed_integer_like>; { ++__i } -> same_as<_Iter&>; __i++; }; template concept incrementable = regular<_Iter> && weakly_incrementable<_Iter> && requires(_Iter __i) { { __i++ } -> same_as<_Iter>; }; template concept input_or_output_iterator = requires(_Iter __i) { { *__i } -> __detail::__can_reference; } && weakly_incrementable<_Iter>; template concept sentinel_for = semiregular<_Sent> && input_or_output_iterator<_Iter> && __detail::__weakly_eq_cmp_with<_Sent, _Iter>; template inline constexpr bool disable_sized_sentinel_for = false; template concept sized_sentinel_for = sentinel_for<_Sent, _Iter> && !disable_sized_sentinel_for, remove_cv_t<_Iter>> && requires(const _Iter& __i, const _Sent& __s) { { __s - __i } -> same_as>; { __i - __s } -> same_as>; }; template concept input_iterator = input_or_output_iterator<_Iter> && indirectly_readable<_Iter> && requires { typename __detail::__iter_concept<_Iter>; } && derived_from<__detail::__iter_concept<_Iter>, input_iterator_tag>; template concept output_iterator = input_or_output_iterator<_Iter> && indirectly_writable<_Iter, _Tp> && requires(_Iter __i, _Tp&& __t) { *__i++ = std::forward<_Tp>(__t); }; template concept forward_iterator = input_iterator<_Iter> && derived_from<__detail::__iter_concept<_Iter>, forward_iterator_tag> && incrementable<_Iter> && sentinel_for<_Iter, _Iter>; template concept bidirectional_iterator = forward_iterator<_Iter> && derived_from<__detail::__iter_concept<_Iter>, bidirectional_iterator_tag> && requires(_Iter __i) { { --__i } -> same_as<_Iter&>; { __i-- } -> same_as<_Iter>; }; template concept random_access_iterator = bidirectional_iterator<_Iter> && derived_from<__detail::__iter_concept<_Iter>, random_access_iterator_tag> && totally_ordered<_Iter> && sized_sentinel_for<_Iter, _Iter> && requires(_Iter __i, const _Iter __j, const iter_difference_t<_Iter> __n) { { __i += __n } -> same_as<_Iter&>; { __j + __n } -> same_as<_Iter>; { __n + __j } -> same_as<_Iter>; { __i -= __n } -> same_as<_Iter&>; { __j - __n } -> same_as<_Iter>; { __j[__n] } -> same_as>; }; template concept contiguous_iterator = random_access_iterator<_Iter> && derived_from<__detail::__iter_concept<_Iter>, contiguous_iterator_tag> && is_lvalue_reference_v> && same_as, remove_cvref_t>> && requires(const _Iter& __i) { { std::to_address(__i) } -> same_as>>; }; template concept indirectly_unary_invocable = indirectly_readable<_Iter> && copy_constructible<_Fn> && invocable<_Fn&, __indirect_value_t<_Iter>> && invocable<_Fn&, iter_reference_t<_Iter>> && common_reference_with>, invoke_result_t<_Fn&, iter_reference_t<_Iter>>>; template concept indirectly_regular_unary_invocable = indirectly_readable<_Iter> && copy_constructible<_Fn> && regular_invocable<_Fn&, __indirect_value_t<_Iter>> && regular_invocable<_Fn&, iter_reference_t<_Iter>> && common_reference_with>, invoke_result_t<_Fn&, iter_reference_t<_Iter>>>; template concept indirect_unary_predicate = indirectly_readable<_Iter> && copy_constructible<_Fn> && predicate<_Fn&, __indirect_value_t<_Iter>> && predicate<_Fn&, iter_reference_t<_Iter>>; template concept indirect_binary_predicate = indirectly_readable<_I1> && indirectly_readable<_I2> && copy_constructible<_Fn> && predicate<_Fn&, __indirect_value_t<_I1>, __indirect_value_t<_I2>> && predicate<_Fn&, __indirect_value_t<_I1>, iter_reference_t<_I2>> && predicate<_Fn&, iter_reference_t<_I1>, __indirect_value_t<_I2>> && predicate<_Fn&, iter_reference_t<_I1>, iter_reference_t<_I2>>; template concept indirect_equivalence_relation = indirectly_readable<_I1> && indirectly_readable<_I2> && copy_constructible<_Fn> && equivalence_relation<_Fn&, __indirect_value_t<_I1>, __indirect_value_t<_I2>> && equivalence_relation<_Fn&, __indirect_value_t<_I1>, iter_reference_t<_I2>> && equivalence_relation<_Fn&, iter_reference_t<_I1>, __indirect_value_t<_I2>> && equivalence_relation<_Fn&, iter_reference_t<_I1>, iter_reference_t<_I2>>; template concept indirect_strict_weak_order = indirectly_readable<_I1> && indirectly_readable<_I2> && copy_constructible<_Fn> && strict_weak_order<_Fn&, __indirect_value_t<_I1>, __indirect_value_t<_I2>> && strict_weak_order<_Fn&, __indirect_value_t<_I1>, iter_reference_t<_I2>> && strict_weak_order<_Fn&, iter_reference_t<_I1>, __indirect_value_t<_I2>> && strict_weak_order<_Fn&, iter_reference_t<_I1>, iter_reference_t<_I2>>; template requires (indirectly_readable<_Is> && ...) && invocable<_Fn, iter_reference_t<_Is>...> using indirect_result_t = invoke_result_t<_Fn, iter_reference_t<_Is>...>; namespace __detail { template struct __projected { struct __type { using value_type = remove_cvref_t>; indirect_result_t<_Proj&, _Iter> operator*() const; using __projected_Iter = _Iter; using __projected_Proj = _Proj; }; }; template struct __projected<_Iter, _Proj> { struct __type { using value_type = remove_cvref_t>; using difference_type = iter_difference_t<_Iter>; indirect_result_t<_Proj&, _Iter> operator*() const; using __projected_Iter = _Iter; using __projected_Proj = _Proj; }; }; } template _Proj> using projected = typename __detail::__projected<_Iter, _Proj>::__type; template requires same_as<_Tp, projected> struct __detail::__indirect_value<_Tp> { using _Iter = typename _Tp::__projected_Iter; using _Proj = typename _Tp::__projected_Proj; using type = invoke_result_t<_Proj&, __indirect_value_t<_Iter>>; }; # 861 "/usr/include/c++/15/bits/iterator_concepts.h" 3 template concept indirectly_movable = indirectly_readable<_In> && indirectly_writable<_Out, iter_rvalue_reference_t<_In>>; template concept indirectly_movable_storable = indirectly_movable<_In, _Out> && indirectly_writable<_Out, iter_value_t<_In>> && movable> && constructible_from, iter_rvalue_reference_t<_In>> && assignable_from&, iter_rvalue_reference_t<_In>>; template concept indirectly_copyable = indirectly_readable<_In> && indirectly_writable<_Out, iter_reference_t<_In>>; template concept indirectly_copyable_storable = indirectly_copyable<_In, _Out> && indirectly_writable<_Out, iter_value_t<_In>&> && indirectly_writable<_Out, const iter_value_t<_In>&> && indirectly_writable<_Out, iter_value_t<_In>&&> && indirectly_writable<_Out, const iter_value_t<_In>&&> && copyable> && constructible_from, iter_reference_t<_In>> && assignable_from&, iter_reference_t<_In>>; namespace ranges { namespace __iswap { template void iter_swap(_It1, _It2) = delete; template concept __adl_iswap = (std::__detail::__class_or_enum> || std::__detail::__class_or_enum>) && requires(_Tp&& __t, _Up&& __u) { iter_swap(static_cast<_Tp&&>(__t), static_cast<_Up&&>(__u)); }; template constexpr iter_value_t<_Xp> __iter_exchange_move(_Xp&& __x, _Yp&& __y) noexcept(noexcept(iter_value_t<_Xp>(iter_move(__x))) && noexcept(*__x = iter_move(__y))) { iter_value_t<_Xp> __old_value(iter_move(__x)); *__x = iter_move(__y); return __old_value; } struct _IterSwap { private: template static constexpr bool _S_noexcept() { if constexpr (__adl_iswap<_Tp, _Up>) return noexcept(iter_swap(std::declval<_Tp>(), std::declval<_Up>())); else if constexpr (indirectly_readable<_Tp> && indirectly_readable<_Up> && swappable_with, iter_reference_t<_Up>>) return noexcept(ranges::swap(*std::declval<_Tp>(), *std::declval<_Up>())); else return noexcept(*std::declval<_Tp>() = __iswap::__iter_exchange_move(std::declval<_Up>(), std::declval<_Tp>())); } public: template requires __adl_iswap<_Tp, _Up> || (indirectly_readable> && indirectly_readable> && swappable_with, iter_reference_t<_Up>>) || (indirectly_movable_storable<_Tp, _Up> && indirectly_movable_storable<_Up, _Tp>) constexpr void operator()(_Tp&& __e1, _Up&& __e2) const noexcept(_S_noexcept<_Tp, _Up>()) { if constexpr (__adl_iswap<_Tp, _Up>) iter_swap(static_cast<_Tp&&>(__e1), static_cast<_Up&&>(__e2)); else if constexpr (indirectly_readable<_Tp> && indirectly_readable<_Up> && swappable_with, iter_reference_t<_Up>>) ranges::swap(*__e1, *__e2); else *__e1 = __iswap::__iter_exchange_move(__e2, __e1); } }; } inline namespace _Cpo { inline constexpr __iswap::_IterSwap iter_swap{}; } } template concept indirectly_swappable = indirectly_readable<_I1> && indirectly_readable<_I2> && requires(const _I1 __i1, const _I2 __i2) { ranges::iter_swap(__i1, __i1); ranges::iter_swap(__i2, __i2); ranges::iter_swap(__i1, __i2); ranges::iter_swap(__i2, __i1); }; template concept indirectly_comparable = indirect_binary_predicate<_Rel, projected<_I1, _P1>, projected<_I2, _P2>>; template concept permutable = forward_iterator<_Iter> && indirectly_movable_storable<_Iter, _Iter> && indirectly_swappable<_Iter, _Iter>; template concept mergeable = input_iterator<_I1> && input_iterator<_I2> && weakly_incrementable<_Out> && indirectly_copyable<_I1, _Out> && indirectly_copyable<_I2, _Out> && indirect_strict_weak_order<_Rel, projected<_I1, _P1>, projected<_I2, _P2>>; template concept sortable = permutable<_Iter> && indirect_strict_weak_order<_Rel, projected<_Iter, _Proj>>; struct unreachable_sentinel_t { template friend constexpr bool operator==(unreachable_sentinel_t, const _It&) noexcept { return false; } }; inline constexpr unreachable_sentinel_t unreachable_sentinel{}; namespace ranges::__access { using std::__detail::__class_or_enum; struct _Decay_copy final { template constexpr decay_t<_Tp> operator()(_Tp&& __t) const noexcept(is_nothrow_convertible_v<_Tp, decay_t<_Tp>>) { return std::forward<_Tp>(__t); } } inline constexpr __decay_copy{}; template concept __member_begin = requires(_Tp& __t) { { __decay_copy(__t.begin()) } -> input_or_output_iterator; }; void begin() = delete; template concept __adl_begin = __class_or_enum> && requires(_Tp& __t) { { __decay_copy(begin(__t)) } -> input_or_output_iterator; }; template requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&> auto __begin(_Tp& __t) { if constexpr (is_array_v<_Tp>) return __t + 0; else if constexpr (__member_begin<_Tp&>) return __t.begin(); else return begin(__t); } } namespace __detail { template using __range_iter_t = decltype(ranges::__access::__begin(std::declval<_Tp&>())); } } #pragma GCC diagnostic pop # 74 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 95 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 3 struct input_iterator_tag { }; struct output_iterator_tag { }; struct forward_iterator_tag : public input_iterator_tag { }; struct bidirectional_iterator_tag : public forward_iterator_tag { }; struct random_access_iterator_tag : public bidirectional_iterator_tag { }; struct contiguous_iterator_tag : public random_access_iterator_tag { }; # 127 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 3 template struct [[__deprecated__]] iterator { typedef _Category iterator_category; typedef _Tp value_type; typedef _Distance difference_type; typedef _Pointer pointer; typedef _Reference reference; }; # 151 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 3 template struct iterator_traits; template> struct __iterator_traits { }; # 178 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 3 template struct iterator_traits : public __iterator_traits<_Iterator> { }; # 196 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 3 template requires is_object_v<_Tp> struct iterator_traits<_Tp*> { using iterator_concept = contiguous_iterator_tag; using iterator_category = random_access_iterator_tag; using value_type = remove_cv_t<_Tp>; using difference_type = ptrdiff_t; using pointer = _Tp*; using reference = _Tp&; }; # 237 "/usr/include/c++/15/bits/stl_iterator_base_types.h" 3 template __attribute__((__always_inline__)) inline constexpr typename iterator_traits<_Iter>::iterator_category __iterator_category(const _Iter&) { return typename iterator_traits<_Iter>::iterator_category(); } template using __iter_category_t = typename iterator_traits<_Iter>::iterator_category; template using _RequireInputIter = __enable_if_t, input_iterator_tag>::value>; template concept __has_input_iter_cat = is_convertible_v<__iter_category_t<_InIter>, input_iterator_tag>; template> struct __is_random_access_iter : is_base_of { typedef is_base_of _Base; enum { __value = _Base::value }; }; } # 65 "/usr/include/c++/15/bits/stl_iterator.h" 2 3 # 1 "/usr/include/c++/15/ext/type_traits.h" 1 3 # 39 "/usr/include/c++/15/ext/type_traits.h" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wlong-long" extern "C++" { namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { template struct __enable_if { }; template struct __enable_if { typedef _Tp __type; }; template struct __conditional_type { typedef _Iftrue __type; }; template struct __conditional_type { typedef _Iffalse __type; }; template struct __add_unsigned { private: typedef __enable_if::__value, _Tp> __if_type; public: typedef typename __if_type::__type __type; }; template<> struct __add_unsigned { typedef unsigned char __type; }; template<> struct __add_unsigned { typedef unsigned char __type; }; template<> struct __add_unsigned { typedef unsigned short __type; }; template<> struct __add_unsigned { typedef unsigned int __type; }; template<> struct __add_unsigned { typedef unsigned long __type; }; template<> struct __add_unsigned { typedef unsigned long long __type; }; template<> struct __add_unsigned; template<> struct __add_unsigned; template struct __remove_unsigned { private: typedef __enable_if::__value, _Tp> __if_type; public: typedef typename __if_type::__type __type; }; template<> struct __remove_unsigned { typedef signed char __type; }; template<> struct __remove_unsigned { typedef signed char __type; }; template<> struct __remove_unsigned { typedef short __type; }; template<> struct __remove_unsigned { typedef int __type; }; template<> struct __remove_unsigned { typedef long __type; }; template<> struct __remove_unsigned { typedef long long __type; }; template<> struct __remove_unsigned; template<> struct __remove_unsigned; template constexpr inline bool __is_null_pointer(_Type* __ptr) { return __ptr == 0; } template constexpr inline bool __is_null_pointer(_Type) { return false; } constexpr bool __is_null_pointer(std::nullptr_t) { return true; } template::__value> struct __promote { typedef double __type; }; template struct __promote<_Tp, false> { }; template<> struct __promote { typedef long double __type; }; template<> struct __promote { typedef double __type; }; template<> struct __promote { typedef float __type; }; template<> struct __promote<_Float16> { typedef _Float16 __type; }; template<> struct __promote<_Float32> { typedef _Float32 __type; }; template<> struct __promote<_Float64> { typedef _Float64 __type; }; template<> struct __promote<_Float128> { typedef _Float128 __type; }; template<> struct __promote<__gnu_cxx::__bfloat16_t> { typedef __gnu_cxx::__bfloat16_t __type; }; template using __promoted_t = decltype((typename __promote<_Tp>::__type(0) + ...)); template using __promote_2 = __promote<__promoted_t<_Tp, _Up>>; template using __promote_3 = __promote<__promoted_t<_Tp, _Up, _Vp>>; template using __promote_4 = __promote<__promoted_t<_Tp, _Up, _Vp, _Wp>>; # 274 "/usr/include/c++/15/ext/type_traits.h" 3 } } #pragma GCC diagnostic pop # 66 "/usr/include/c++/15/bits/stl_iterator.h" 2 3 # 75 "/usr/include/c++/15/bits/stl_iterator.h" 3 # 1 "/usr/include/c++/15/new" 1 3 # 43 "/usr/include/c++/15/new" 3 # 1 "/usr/include/c++/15/bits/exception.h" 1 3 # 40 "/usr/include/c++/15/bits/exception.h" 3 extern "C++" { namespace std __attribute__ ((__visibility__ ("default"))) { # 61 "/usr/include/c++/15/bits/exception.h" 3 class exception { public: exception() noexcept { } virtual ~exception() noexcept; exception(const exception&) = default; exception& operator=(const exception&) = default; exception(exception&&) = default; exception& operator=(exception&&) = default; virtual const char* what() const noexcept; }; } } # 44 "/usr/include/c++/15/new" 2 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 50 "/usr/include/c++/15/new" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++11-extensions" #pragma GCC visibility push(default) extern "C++" { namespace std { class bad_alloc : public exception { public: bad_alloc() throw() { } bad_alloc(const bad_alloc&) = default; bad_alloc& operator=(const bad_alloc&) = default; virtual ~bad_alloc() throw(); virtual const char* what() const throw(); }; class bad_array_new_length : public bad_alloc { public: bad_array_new_length() throw() { } virtual ~bad_array_new_length() throw(); virtual const char* what() const throw(); }; enum class align_val_t: size_t {}; struct nothrow_t { explicit nothrow_t() = default; }; extern const nothrow_t nothrow; typedef void (*new_handler)(); new_handler set_new_handler(new_handler) throw(); new_handler get_new_handler() noexcept; } # 137 "/usr/include/c++/15/new" 3 [[__nodiscard__]] void* operator new(std::size_t) __attribute__((__externally_visible__, __malloc__)); [[__nodiscard__]] void* operator new[](std::size_t) __attribute__((__externally_visible__, __malloc__)); void operator delete(void*) noexcept __attribute__((__externally_visible__)); void operator delete[](void*) noexcept __attribute__((__externally_visible__)); void operator delete(void*, std::size_t) noexcept __attribute__((__externally_visible__)); void operator delete[](void*, std::size_t) noexcept __attribute__((__externally_visible__)); [[__nodiscard__]] void* operator new(std::size_t, const std::nothrow_t&) noexcept __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); [[__nodiscard__]] void* operator new[](std::size_t, const std::nothrow_t&) noexcept __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); void operator delete(void*, const std::nothrow_t&) noexcept __attribute__((__externally_visible__)); void operator delete[](void*, const std::nothrow_t&) noexcept __attribute__((__externally_visible__)); [[__nodiscard__]] void* operator new(std::size_t, std::align_val_t) __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__)); [[__nodiscard__]] void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) noexcept __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__)); void operator delete(void*, std::align_val_t) noexcept __attribute__((__externally_visible__)); void operator delete(void*, std::align_val_t, const std::nothrow_t&) noexcept __attribute__((__externally_visible__)); [[__nodiscard__]] void* operator new[](std::size_t, std::align_val_t) __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__)); [[__nodiscard__]] void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) noexcept __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__)); void operator delete[](void*, std::align_val_t) noexcept __attribute__((__externally_visible__)); void operator delete[](void*, std::align_val_t, const std::nothrow_t&) noexcept __attribute__((__externally_visible__)); void operator delete(void*, std::size_t, std::align_val_t) noexcept __attribute__((__externally_visible__)); void operator delete[](void*, std::size_t, std::align_val_t) noexcept __attribute__((__externally_visible__)); # 205 "/usr/include/c++/15/new" 3 [[__nodiscard__]] inline void* operator new(std::size_t, void* __p) noexcept { return __p; } [[__nodiscard__]] inline void* operator new[](std::size_t, void* __p) noexcept { return __p; } inline void operator delete (void*, void*) noexcept { } inline void operator delete[](void*, void*) noexcept { } } namespace std { template [[nodiscard]] constexpr _Tp* launder(_Tp* __p) noexcept { if constexpr (__is_same(const volatile _Tp, const volatile void)) static_assert(!__is_same(const volatile _Tp, const volatile void), "std::launder argument must not be a void pointer"); else if constexpr (__is_function(_Tp)) static_assert(!__is_function(_Tp), "std::launder argument must not be a function pointer"); else return __builtin_launder(__p); return nullptr; } inline constexpr size_t hardware_destructive_interference_size = 64; inline constexpr size_t hardware_constructive_interference_size = 64; struct destroying_delete_t { explicit destroying_delete_t() = default; }; inline constexpr destroying_delete_t destroying_delete{}; } #pragma GCC visibility pop #pragma GCC diagnostic pop # 76 "/usr/include/c++/15/bits/stl_iterator.h" 2 3 # 1 "/usr/include/c++/15/bits/exception_defines.h" 1 3 # 77 "/usr/include/c++/15/bits/stl_iterator.h" 2 3 # 1 "/usr/include/c++/15/bits/stl_construct.h" 1 3 # 62 "/usr/include/c++/15/bits/stl_construct.h" 3 # 1 "/usr/include/c++/15/bits/stl_iterator_base_funcs.h" 1 3 # 66 "/usr/include/c++/15/bits/stl_iterator_base_funcs.h" 3 # 1 "/usr/include/c++/15/bits/concept_check.h" 1 3 # 39 "/usr/include/c++/15/bits/concept_check.h" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvariadic-macros" # 86 "/usr/include/c++/15/bits/concept_check.h" 3 #pragma GCC diagnostic pop # 67 "/usr/include/c++/15/bits/stl_iterator_base_funcs.h" 2 3 # 1 "/usr/include/c++/15/debug/assertions.h" 1 3 # 68 "/usr/include/c++/15/bits/stl_iterator_base_funcs.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template struct _List_iterator; template struct _List_const_iterator; template inline constexpr typename iterator_traits<_InputIterator>::difference_type __distance(_InputIterator __first, _InputIterator __last, input_iterator_tag) { typename iterator_traits<_InputIterator>::difference_type __n = 0; while (__first != __last) { ++__first; ++__n; } return __n; } template __attribute__((__always_inline__)) inline constexpr typename iterator_traits<_RandomAccessIterator>::difference_type __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag) { return __last - __first; } template ptrdiff_t __distance(std::_List_iterator<_Tp>, std::_List_iterator<_Tp>, input_iterator_tag); template ptrdiff_t __distance(std::_List_const_iterator<_Tp>, std::_List_const_iterator<_Tp>, input_iterator_tag); template void __distance(_OutputIterator, _OutputIterator, output_iterator_tag) = delete; # 146 "/usr/include/c++/15/bits/stl_iterator_base_funcs.h" 3 template [[__nodiscard__]] __attribute__((__always_inline__)) inline constexpr typename iterator_traits<_InputIterator>::difference_type distance(_InputIterator __first, _InputIterator __last) { return std::__distance(__first, __last, std::__iterator_category(__first)); } template inline constexpr void __advance(_InputIterator& __i, _Distance __n, input_iterator_tag) { do { if (std::__is_constant_evaluated() && !bool(__n >= 0)) std::__glibcxx_assert_fail(); } while (false); while (__n--) ++__i; } template inline constexpr void __advance(_BidirectionalIterator& __i, _Distance __n, bidirectional_iterator_tag) { if (__n > 0) while (__n--) ++__i; else while (__n++) --__i; } template inline constexpr void __advance(_RandomAccessIterator& __i, _Distance __n, random_access_iterator_tag) { if (__builtin_constant_p(__n) && __n == 1) ++__i; else if (__builtin_constant_p(__n) && __n == -1) --__i; else __i += __n; } template void __advance(_OutputIterator&, _Distance, output_iterator_tag) = delete; # 219 "/usr/include/c++/15/bits/stl_iterator_base_funcs.h" 3 template __attribute__((__always_inline__)) inline constexpr void advance(_InputIterator& __i, _Distance __n) { typename iterator_traits<_InputIterator>::difference_type __d = __n; std::__advance(__i, __d, std::__iterator_category(__i)); } template [[__nodiscard__]] [[__gnu__::__always_inline__]] inline constexpr _InputIterator next(_InputIterator __x, typename iterator_traits<_InputIterator>::difference_type __n = 1) { std::advance(__x, __n); return __x; } template [[__nodiscard__]] [[__gnu__::__always_inline__]] inline constexpr _BidirectionalIterator prev(_BidirectionalIterator __x, typename iterator_traits<_BidirectionalIterator>::difference_type __n = 1) { std::advance(__x, -__n); return __x; } } # 63 "/usr/include/c++/15/bits/stl_construct.h" 2 3 # 73 "/usr/include/c++/15/bits/stl_construct.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template constexpr inline void destroy_at(_Tp* __location) { if constexpr (202302L > 201703L && is_array_v<_Tp>) { for (auto& __x : *__location) std::destroy_at(std::__addressof(__x)); } else __location->~_Tp(); } template requires (!is_unbounded_array_v<_Tp>) && requires { ::new((void*)0) _Tp(std::declval<_Args>()...); } constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) noexcept(noexcept(::new((void*)0) _Tp(std::declval<_Args>()...))) { void* __loc = __location; if constexpr (is_array_v<_Tp>) { static_assert(sizeof...(_Args) == 0, "std::construct_at for array " "types must not use any arguments to initialize the " "array"); return ::new(__loc) _Tp[1](); } else return ::new(__loc) _Tp(std::forward<_Args>(__args)...); } # 120 "/usr/include/c++/15/bits/stl_construct.h" 3 template constexpr inline void _Construct(_Tp* __p, _Args&&... __args) { if (std::__is_constant_evaluated()) { std::construct_at(__p, std::forward<_Args>(__args)...); return; } ::new(static_cast(__p)) _Tp(std::forward<_Args>(__args)...); } # 146 "/usr/include/c++/15/bits/stl_construct.h" 3 template inline void _Construct_novalue(_T1* __p) { ::new(static_cast(__p)) _T1; } template constexpr void _Destroy(_ForwardIterator __first, _ForwardIterator __last); template constexpr inline void _Destroy(_Tp* __pointer) { std::destroy_at(__pointer); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" # 217 "/usr/include/c++/15/bits/stl_construct.h" 3 template constexpr inline void _Destroy(_ForwardIterator __first, _ForwardIterator __last) { typedef typename iterator_traits<_ForwardIterator>::value_type _Value_type; if constexpr (!is_trivially_destructible<_Value_type>::value) for (; __first != __last; ++__first) std::_Destroy(std::__addressof(*__first)); else if (std::__is_constant_evaluated()) for (; __first != __last; ++__first) std::destroy_at(std::__addressof(*__first)); } template constexpr inline _ForwardIterator _Destroy_n(_ForwardIterator __first, _Size __count) { typedef typename iterator_traits<_ForwardIterator>::value_type _Value_type; if constexpr (!is_trivially_destructible<_Value_type>::value) for (; __count > 0; (void)++__first, --__count) std::_Destroy(std::__addressof(*__first)); else if (std::__is_constant_evaluated()) for (; __count > 0; (void)++__first, --__count) std::destroy_at(std::__addressof(*__first)); else std::advance(__first, __count); return __first; } #pragma GCC diagnostic pop template constexpr inline void destroy(_ForwardIterator __first, _ForwardIterator __last) { std::_Destroy(__first, __last); } template constexpr inline _ForwardIterator destroy_n(_ForwardIterator __first, _Size __count) { return std::_Destroy_n(__first, __count); } } # 79 "/usr/include/c++/15/bits/stl_iterator.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 96 "/usr/include/c++/15/bits/stl_iterator.h" 3 namespace __detail { template using __clamp_iter_cat = __conditional_t, _Limit, _Otherwise>; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" # 130 "/usr/include/c++/15/bits/stl_iterator.h" 3 template class reverse_iterator : public iterator::iterator_category, typename iterator_traits<_Iterator>::value_type, typename iterator_traits<_Iterator>::difference_type, typename iterator_traits<_Iterator>::pointer, typename iterator_traits<_Iterator>::reference> { template friend class reverse_iterator; template static constexpr bool __convertible = !is_same_v<_Iter, _Iterator> && convertible_to; protected: _Iterator current; typedef iterator_traits<_Iterator> __traits_type; public: typedef _Iterator iterator_type; typedef typename __traits_type::pointer pointer; using iterator_concept = __conditional_t, random_access_iterator_tag, bidirectional_iterator_tag>; using iterator_category = __detail::__clamp_iter_cat; using value_type = iter_value_t<_Iterator>; using difference_type = iter_difference_t<_Iterator>; using reference = iter_reference_t<_Iterator>; # 180 "/usr/include/c++/15/bits/stl_iterator.h" 3 constexpr reverse_iterator() noexcept(noexcept(_Iterator())) : current() { } explicit constexpr reverse_iterator(iterator_type __x) noexcept(noexcept(_Iterator(__x))) : current(__x) { } constexpr reverse_iterator(const reverse_iterator& __x) noexcept(noexcept(_Iterator(__x.current))) : current(__x.current) { } reverse_iterator& operator=(const reverse_iterator&) = default; template requires __convertible<_Iter> constexpr reverse_iterator(const reverse_iterator<_Iter>& __x) noexcept(noexcept(_Iterator(__x.current))) : current(__x.current) { } template requires __convertible<_Iter> && assignable_from<_Iterator&, const _Iter&> constexpr reverse_iterator& operator=(const reverse_iterator<_Iter>& __x) noexcept(noexcept(current = __x.current)) { current = __x.current; return *this; } [[__nodiscard__]] constexpr iterator_type base() const noexcept(noexcept(_Iterator(current))) { return current; } # 257 "/usr/include/c++/15/bits/stl_iterator.h" 3 [[__nodiscard__]] constexpr reference operator*() const { _Iterator __tmp = current; return *--__tmp; } [[__nodiscard__]] constexpr pointer operator->() const requires is_pointer_v<_Iterator> || requires(const _Iterator __i) { __i.operator->(); } { _Iterator __tmp = current; --__tmp; return _S_to_pointer(__tmp); } constexpr reverse_iterator& operator++() { --current; return *this; } constexpr reverse_iterator operator++(int) { reverse_iterator __tmp = *this; --current; return __tmp; } constexpr reverse_iterator& operator--() { ++current; return *this; } constexpr reverse_iterator operator--(int) { reverse_iterator __tmp = *this; ++current; return __tmp; } [[__nodiscard__]] constexpr reverse_iterator operator+(difference_type __n) const { return reverse_iterator(current - __n); } constexpr reverse_iterator& operator+=(difference_type __n) { current -= __n; return *this; } [[__nodiscard__]] constexpr reverse_iterator operator-(difference_type __n) const { return reverse_iterator(current + __n); } constexpr reverse_iterator& operator-=(difference_type __n) { current += __n; return *this; } [[__nodiscard__]] constexpr reference operator[](difference_type __n) const { return *(*this + __n); } [[nodiscard]] friend constexpr iter_rvalue_reference_t<_Iterator> iter_move(const reverse_iterator& __i) noexcept(is_nothrow_copy_constructible_v<_Iterator> && noexcept(ranges::iter_move(--std::declval<_Iterator&>()))) { auto __tmp = __i.base(); return ranges::iter_move(--__tmp); } template _Iter2> friend constexpr void iter_swap(const reverse_iterator& __x, const reverse_iterator<_Iter2>& __y) noexcept(is_nothrow_copy_constructible_v<_Iterator> && is_nothrow_copy_constructible_v<_Iter2> && noexcept(ranges::iter_swap(--std::declval<_Iterator&>(), --std::declval<_Iter2&>()))) { auto __xtmp = __x.base(); auto __ytmp = __y.base(); ranges::iter_swap(--__xtmp, --__ytmp); } private: template static constexpr _Tp* _S_to_pointer(_Tp* __p) { return __p; } template static constexpr pointer _S_to_pointer(_Tp __t) { return __t.operator->(); } }; # 526 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[nodiscard]] constexpr bool operator==(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) requires requires { { __x.base() == __y.base() } -> convertible_to; } { return __x.base() == __y.base(); } template [[nodiscard]] constexpr bool operator!=(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) requires requires { { __x.base() != __y.base() } -> convertible_to; } { return __x.base() != __y.base(); } template [[nodiscard]] constexpr bool operator<(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) requires requires { { __x.base() > __y.base() } -> convertible_to; } { return __x.base() > __y.base(); } template [[nodiscard]] constexpr bool operator>(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) requires requires { { __x.base() < __y.base() } -> convertible_to; } { return __x.base() < __y.base(); } template [[nodiscard]] constexpr bool operator<=(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) requires requires { { __x.base() >= __y.base() } -> convertible_to; } { return __x.base() >= __y.base(); } template [[nodiscard]] constexpr bool operator>=(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) requires requires { { __x.base() <= __y.base() } -> convertible_to; } { return __x.base() <= __y.base(); } template _IteratorR> [[nodiscard]] constexpr compare_three_way_result_t<_IteratorL, _IteratorR> operator<=>(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return __y.base() <=> __x.base(); } template [[nodiscard]] constexpr bool operator==(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) requires requires { { __x.base() == __y.base() } -> convertible_to; } { return __x.base() == __y.base(); } template [[nodiscard]] constexpr compare_three_way_result_t<_Iterator, _Iterator> operator<=>(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __y.base() <=> __x.base(); } # 617 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[__nodiscard__]] inline constexpr auto operator-(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) -> decltype(__y.base() - __x.base()) { return __y.base() - __x.base(); } template [[__nodiscard__]] inline constexpr reverse_iterator<_Iterator> operator+(typename reverse_iterator<_Iterator>::difference_type __n, const reverse_iterator<_Iterator>& __x) { return reverse_iterator<_Iterator>(__x.base() - __n); } template inline constexpr reverse_iterator<_Iterator> __make_reverse_iterator(_Iterator __i) { return reverse_iterator<_Iterator>(__i); } template [[__nodiscard__]] inline constexpr reverse_iterator<_Iterator> make_reverse_iterator(_Iterator __i) { return reverse_iterator<_Iterator>(__i); } template requires (!sized_sentinel_for<_Iterator1, _Iterator2>) inline constexpr bool disable_sized_sentinel_for, reverse_iterator<_Iterator2>> = true; template struct __is_move_iterator > : __is_move_iterator<_Iterator> { }; # 676 "/usr/include/c++/15/bits/stl_iterator.h" 3 template class back_insert_iterator : public iterator { protected: _Container* container; public: typedef _Container container_type; using difference_type = ptrdiff_t; explicit constexpr back_insert_iterator(_Container& __x) : container(std::__addressof(__x)) { } # 714 "/usr/include/c++/15/bits/stl_iterator.h" 3 constexpr back_insert_iterator& operator=(const typename _Container::value_type& __value) { container->push_back(__value); return *this; } constexpr back_insert_iterator& operator=(typename _Container::value_type&& __value) { container->push_back(std::move(__value)); return *this; } [[__nodiscard__]] constexpr back_insert_iterator& operator*() { return *this; } constexpr back_insert_iterator& operator++() { return *this; } constexpr back_insert_iterator operator++(int) { return *this; } }; # 761 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[__nodiscard__]] constexpr inline back_insert_iterator<_Container> back_inserter(_Container& __x) { return back_insert_iterator<_Container>(__x); } # 777 "/usr/include/c++/15/bits/stl_iterator.h" 3 template class front_insert_iterator : public iterator { protected: _Container* container; public: typedef _Container container_type; using difference_type = ptrdiff_t; explicit constexpr front_insert_iterator(_Container& __x) : container(std::__addressof(__x)) { } # 815 "/usr/include/c++/15/bits/stl_iterator.h" 3 constexpr front_insert_iterator& operator=(const typename _Container::value_type& __value) { container->push_front(__value); return *this; } constexpr front_insert_iterator& operator=(typename _Container::value_type&& __value) { container->push_front(std::move(__value)); return *this; } [[__nodiscard__]] constexpr front_insert_iterator& operator*() { return *this; } constexpr front_insert_iterator& operator++() { return *this; } constexpr front_insert_iterator operator++(int) { return *this; } }; # 862 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[__nodiscard__]] constexpr inline front_insert_iterator<_Container> front_inserter(_Container& __x) { return front_insert_iterator<_Container>(__x); } # 882 "/usr/include/c++/15/bits/stl_iterator.h" 3 template class insert_iterator : public iterator { using _Iter = std::__detail::__range_iter_t<_Container>; protected: _Container* container; _Iter iter; public: typedef _Container container_type; using difference_type = ptrdiff_t; constexpr insert_iterator(_Container& __x, _Iter __i) : container(std::__addressof(__x)), iter(__i) {} # 943 "/usr/include/c++/15/bits/stl_iterator.h" 3 constexpr insert_iterator& operator=(const typename _Container::value_type& __value) { iter = container->insert(iter, __value); ++iter; return *this; } constexpr insert_iterator& operator=(typename _Container::value_type&& __value) { iter = container->insert(iter, std::move(__value)); ++iter; return *this; } [[__nodiscard__]] constexpr insert_iterator& operator*() { return *this; } constexpr insert_iterator& operator++() { return *this; } constexpr insert_iterator& operator++(int) { return *this; } }; #pragma GCC diagnostic pop # 996 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[nodiscard]] constexpr insert_iterator<_Container> inserter(_Container& __x, std::__detail::__range_iter_t<_Container> __i) { return insert_iterator<_Container>(__x, __i); } # 1011 "/usr/include/c++/15/bits/stl_iterator.h" 3 } namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { # 1025 "/usr/include/c++/15/bits/stl_iterator.h" 3 template class __normal_iterator { protected: _Iterator _M_current; typedef std::iterator_traits<_Iterator> __traits_type; public: typedef _Iterator iterator_type; typedef typename __traits_type::iterator_category iterator_category; typedef typename __traits_type::value_type value_type; typedef typename __traits_type::difference_type difference_type; typedef typename __traits_type::reference reference; typedef typename __traits_type::pointer pointer; using iterator_concept = std::__detail::__iter_concept<_Iterator>; __attribute__((__always_inline__)) constexpr __normal_iterator() noexcept : _M_current() { } __attribute__((__always_inline__)) explicit constexpr __normal_iterator(const _Iterator& __i) noexcept : _M_current(__i) { } template requires std::is_convertible_v<_Iter, _Iterator> [[__gnu__::__always_inline__]] constexpr __normal_iterator(const __normal_iterator<_Iter, _Container>& __i) noexcept # 1082 "/usr/include/c++/15/bits/stl_iterator.h" 3 : _M_current(__i.base()) { } [[__nodiscard__]] __attribute__((__always_inline__)) constexpr reference operator*() const noexcept { return *_M_current; } [[__nodiscard__]] __attribute__((__always_inline__)) constexpr pointer operator->() const noexcept { return _M_current; } __attribute__((__always_inline__)) constexpr __normal_iterator& operator++() noexcept { ++_M_current; return *this; } __attribute__((__always_inline__)) constexpr __normal_iterator operator++(int) noexcept { return __normal_iterator(_M_current++); } __attribute__((__always_inline__)) constexpr __normal_iterator& operator--() noexcept { --_M_current; return *this; } __attribute__((__always_inline__)) constexpr __normal_iterator operator--(int) noexcept { return __normal_iterator(_M_current--); } [[__nodiscard__]] __attribute__((__always_inline__)) constexpr reference operator[](difference_type __n) const noexcept { return _M_current[__n]; } __attribute__((__always_inline__)) constexpr __normal_iterator& operator+=(difference_type __n) noexcept { _M_current += __n; return *this; } [[__nodiscard__]] __attribute__((__always_inline__)) constexpr __normal_iterator operator+(difference_type __n) const noexcept { return __normal_iterator(_M_current + __n); } __attribute__((__always_inline__)) constexpr __normal_iterator& operator-=(difference_type __n) noexcept { _M_current -= __n; return *this; } [[__nodiscard__]] __attribute__((__always_inline__)) constexpr __normal_iterator operator-(difference_type __n) const noexcept { return __normal_iterator(_M_current - __n); } [[__nodiscard__]] __attribute__((__always_inline__)) constexpr const _Iterator& base() const noexcept { return _M_current; } }; # 1178 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[nodiscard, __gnu__::__always_inline__]] constexpr bool operator==(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) noexcept(noexcept(__lhs.base() == __rhs.base())) requires requires { { __lhs.base() == __rhs.base() } -> std::convertible_to; } { return __lhs.base() == __rhs.base(); } template [[nodiscard, __gnu__::__always_inline__]] constexpr std::__detail::__synth3way_t<_IteratorR, _IteratorL> operator<=>(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) noexcept(noexcept(std::__detail::__synth3way(__lhs.base(), __rhs.base()))) { return std::__detail::__synth3way(__lhs.base(), __rhs.base()); } template [[nodiscard, __gnu__::__always_inline__]] constexpr bool operator==(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) noexcept(noexcept(__lhs.base() == __rhs.base())) requires requires { { __lhs.base() == __rhs.base() } -> std::convertible_to; } { return __lhs.base() == __rhs.base(); } template [[nodiscard, __gnu__::__always_inline__]] constexpr std::__detail::__synth3way_t<_Iterator> operator<=>(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) noexcept(noexcept(std::__detail::__synth3way(__lhs.base(), __rhs.base()))) { return std::__detail::__synth3way(__lhs.base(), __rhs.base()); } # 1319 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[__nodiscard__, __gnu__::__always_inline__]] constexpr auto operator-(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) noexcept -> decltype(__lhs.base() - __rhs.base()) { return __lhs.base() - __rhs.base(); } template [[__nodiscard__]] __attribute__((__always_inline__)) constexpr inline typename __normal_iterator<_Iterator, _Container>::difference_type operator-(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) noexcept { return __lhs.base() - __rhs.base(); } template [[__nodiscard__]] __attribute__((__always_inline__)) constexpr inline __normal_iterator<_Iterator, _Container> operator+(typename __normal_iterator<_Iterator, _Container>::difference_type __n, const __normal_iterator<_Iterator, _Container>& __i) noexcept { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); } } namespace std __attribute__ ((__visibility__ ("default"))) { # 1365 "/usr/include/c++/15/bits/stl_iterator.h" 3 template class move_sentinel { public: constexpr move_sentinel() noexcept(is_nothrow_default_constructible_v<_Sent>) : _M_last() { } constexpr explicit move_sentinel(_Sent __s) noexcept(is_nothrow_move_constructible_v<_Sent>) : _M_last(std::move(__s)) { } template requires convertible_to constexpr move_sentinel(const move_sentinel<_S2>& __s) noexcept(is_nothrow_constructible_v<_Sent, const _S2&>) : _M_last(__s.base()) { } template requires assignable_from<_Sent&, const _S2&> constexpr move_sentinel& operator=(const move_sentinel<_S2>& __s) noexcept(is_nothrow_assignable_v<_Sent, const _S2&>) { _M_last = __s.base(); return *this; } [[nodiscard]] constexpr _Sent base() const noexcept(is_nothrow_copy_constructible_v<_Sent>) { return _M_last; } private: _Sent _M_last; }; namespace __detail { template struct __move_iter_cat { }; template requires requires { typename __iter_category_t<_Iterator>; } struct __move_iter_cat<_Iterator> { using iterator_category = __clamp_iter_cat<__iter_category_t<_Iterator>, random_access_iterator_tag>; }; } # 1434 "/usr/include/c++/15/bits/stl_iterator.h" 3 template class move_iterator : public __detail::__move_iter_cat<_Iterator> { _Iterator _M_current; using __traits_type = iterator_traits<_Iterator>; template friend class move_iterator; template static constexpr bool __convertible = !is_same_v<_Iter2, _Iterator> && convertible_to; static auto _S_iter_concept() { if constexpr (random_access_iterator<_Iterator>) return random_access_iterator_tag{}; else if constexpr (bidirectional_iterator<_Iterator>) return bidirectional_iterator_tag{}; else if constexpr (forward_iterator<_Iterator>) return forward_iterator_tag{}; else return input_iterator_tag{}; } public: using iterator_type = _Iterator; using iterator_concept = decltype(_S_iter_concept()); using value_type = iter_value_t<_Iterator>; using difference_type = iter_difference_t<_Iterator>; using pointer = _Iterator; using reference = iter_rvalue_reference_t<_Iterator>; # 1498 "/usr/include/c++/15/bits/stl_iterator.h" 3 constexpr move_iterator() : _M_current() { } explicit constexpr move_iterator(iterator_type __i) : _M_current(std::move(__i)) { } template requires __convertible<_Iter> constexpr move_iterator(const move_iterator<_Iter>& __i) : _M_current(__i._M_current) { } template requires __convertible<_Iter> && assignable_from<_Iterator&, const _Iter&> constexpr move_iterator& operator=(const move_iterator<_Iter>& __i) { _M_current = __i._M_current; return *this; } [[nodiscard]] constexpr const iterator_type& base() const & noexcept { return _M_current; } [[nodiscard]] constexpr iterator_type base() && { return std::move(_M_current); } [[__nodiscard__]] constexpr reference operator*() const { return ranges::iter_move(_M_current); } [[__nodiscard__]] constexpr pointer operator->() const { return _M_current; } constexpr move_iterator& operator++() { ++_M_current; return *this; } constexpr move_iterator operator++(int) { move_iterator __tmp = *this; ++_M_current; return __tmp; } constexpr void operator++(int) requires (!forward_iterator<_Iterator>) { ++_M_current; } constexpr move_iterator& operator--() { --_M_current; return *this; } constexpr move_iterator operator--(int) { move_iterator __tmp = *this; --_M_current; return __tmp; } [[__nodiscard__]] constexpr move_iterator operator+(difference_type __n) const { return move_iterator(_M_current + __n); } constexpr move_iterator& operator+=(difference_type __n) { _M_current += __n; return *this; } [[__nodiscard__]] constexpr move_iterator operator-(difference_type __n) const { return move_iterator(_M_current - __n); } constexpr move_iterator& operator-=(difference_type __n) { _M_current -= __n; return *this; } [[__nodiscard__]] constexpr reference operator[](difference_type __n) const { return ranges::iter_move(_M_current + __n); } template _Sent> [[nodiscard]] friend constexpr bool operator==(const move_iterator& __x, const move_sentinel<_Sent>& __y) { return __x.base() == __y.base(); } template _Sent> [[nodiscard]] friend constexpr iter_difference_t<_Iterator> operator-(const move_sentinel<_Sent>& __x, const move_iterator& __y) { return __x.base() - __y.base(); } template _Sent> [[nodiscard]] friend constexpr iter_difference_t<_Iterator> operator-(const move_iterator& __x, const move_sentinel<_Sent>& __y) { return __x.base() - __y.base(); } [[nodiscard]] friend constexpr iter_rvalue_reference_t<_Iterator> iter_move(const move_iterator& __i) noexcept(noexcept(ranges::iter_move(__i._M_current))) { return ranges::iter_move(__i._M_current); } template _Iter2> friend constexpr void iter_swap(const move_iterator& __x, const move_iterator<_Iter2>& __y) noexcept(noexcept(ranges::iter_swap(__x._M_current, __y._M_current))) { return ranges::iter_swap(__x._M_current, __y._M_current); } }; template [[__nodiscard__]] inline constexpr bool operator==(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) requires requires { { __x.base() == __y.base() } -> convertible_to; } { return __x.base() == __y.base(); } template _IteratorR> [[__nodiscard__]] constexpr compare_three_way_result_t<_IteratorL, _IteratorR> operator<=>(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) { return __x.base() <=> __y.base(); } # 1686 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[__nodiscard__]] inline constexpr bool operator<(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) requires requires { { __x.base() < __y.base() } -> convertible_to; } { return __x.base() < __y.base(); } template [[__nodiscard__]] inline constexpr bool operator<=(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) requires requires { { __y.base() < __x.base() } -> convertible_to; } { return !(__y < __x); } template [[__nodiscard__]] inline constexpr bool operator>(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) requires requires { { __y.base() < __x.base() } -> convertible_to; } { return __y < __x; } template [[__nodiscard__]] inline constexpr bool operator>=(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) requires requires { { __x.base() < __y.base() } -> convertible_to; } { return !(__x < __y); } template [[__nodiscard__]] inline constexpr bool operator==(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) { return __x.base() == __y.base(); } template [[__nodiscard__]] constexpr compare_three_way_result_t<_Iterator> operator<=>(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) { return __x.base() <=> __y.base(); } # 1782 "/usr/include/c++/15/bits/stl_iterator.h" 3 template [[__nodiscard__]] inline constexpr auto operator-(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) -> decltype(__x.base() - __y.base()) { return __x.base() - __y.base(); } template [[__nodiscard__]] inline constexpr move_iterator<_Iterator> operator+(typename move_iterator<_Iterator>::difference_type __n, const move_iterator<_Iterator>& __x) requires requires { { __x.base() + __n } -> same_as<_Iterator>; } { return __x + __n; } template [[__nodiscard__]] inline constexpr move_iterator<_Iterator> make_move_iterator(_Iterator __i) { return move_iterator<_Iterator>(std::move(__i)); } template::value_type>::value, _Iterator, move_iterator<_Iterator>>> [[__nodiscard__]] constexpr _ReturnType __make_move_if_noexcept_iterator(_Iterator __i) { return _ReturnType(__i); } template::value, const _Tp*, move_iterator<_Tp*>>> [[__nodiscard__]] constexpr _ReturnType __make_move_if_noexcept_iterator(_Tp* __i) { return _ReturnType(__i); } template struct __is_move_iterator > { enum { __value = 1 }; typedef __true_type __type; }; # 1843 "/usr/include/c++/15/bits/stl_iterator.h" 3 template requires (!sized_sentinel_for<_Iterator1, _Iterator2>) inline constexpr bool disable_sized_sentinel_for, move_iterator<_Iterator2>> = true; namespace __detail { template concept __common_iter_has_arrow = indirectly_readable && (requires(const _It& __it) { __it.operator->(); } || is_reference_v> || constructible_from, iter_reference_t<_It>>); template concept __common_iter_use_postfix_proxy = (!requires (_It& __i) { { *__i++ } -> __can_reference; }) && constructible_from, iter_reference_t<_It>> && move_constructible>; } template _Sent> requires (!same_as<_It, _Sent>) && copyable<_It> class common_iterator { template static constexpr bool _S_noexcept1() { if constexpr (is_trivially_default_constructible_v<_Tp>) return is_nothrow_assignable_v<_Tp&, _Up>; else return is_nothrow_constructible_v<_Tp, _Up>; } template static constexpr bool _S_noexcept() { return _S_noexcept1<_It, _It2>() && _S_noexcept1<_Sent, _Sent2>(); } class __arrow_proxy { iter_value_t<_It> _M_keep; constexpr __arrow_proxy(iter_reference_t<_It>&& __x) : _M_keep(std::move(__x)) { } friend class common_iterator; public: constexpr const iter_value_t<_It>* operator->() const noexcept { return std::__addressof(_M_keep); } }; class __postfix_proxy { iter_value_t<_It> _M_keep; constexpr __postfix_proxy(iter_reference_t<_It>&& __x) : _M_keep(std::forward>(__x)) { } friend class common_iterator; public: constexpr const iter_value_t<_It>& operator*() const noexcept { return _M_keep; } }; public: constexpr common_iterator() noexcept(is_nothrow_default_constructible_v<_It>) requires default_initializable<_It> : _M_it(), _M_index(0) { } constexpr common_iterator(_It __i) noexcept(is_nothrow_move_constructible_v<_It>) : _M_it(std::move(__i)), _M_index(0) { } constexpr common_iterator(_Sent __s) noexcept(is_nothrow_move_constructible_v<_Sent>) : _M_sent(std::move(__s)), _M_index(1) { } template requires convertible_to && convertible_to constexpr common_iterator(const common_iterator<_It2, _Sent2>& __x) noexcept(_S_noexcept()) : _M_valueless(), _M_index(__x._M_index) { do { if (std::__is_constant_evaluated() && !bool(__x._M_has_value())) std::__glibcxx_assert_fail(); } while (false); if (_M_index == 0) { if constexpr (is_trivially_default_constructible_v<_It>) _M_it = std::move(__x._M_it); else std::construct_at(std::__addressof(_M_it), __x._M_it); } else if (_M_index == 1) { if constexpr (is_trivially_default_constructible_v<_Sent>) _M_sent = std::move(__x._M_sent); else std::construct_at(std::__addressof(_M_sent), __x._M_sent); } } common_iterator(const common_iterator&) = default; constexpr common_iterator(const common_iterator& __x) noexcept(_S_noexcept()) requires (!is_trivially_copyable_v<_It> || !is_trivially_copyable_v<_Sent>) : _M_valueless(), _M_index(__x._M_index) { if (_M_index == 0) { if constexpr (is_trivially_default_constructible_v<_It>) _M_it = __x._M_it; else std::construct_at(std::__addressof(_M_it), __x._M_it); } else if (_M_index == 1) { if constexpr (is_trivially_default_constructible_v<_Sent>) _M_sent = __x._M_sent; else std::construct_at(std::__addressof(_M_sent), __x._M_sent); } } common_iterator(common_iterator&&) = default; constexpr common_iterator(common_iterator&& __x) noexcept(_S_noexcept<_It, _Sent>()) requires (!is_trivially_copyable_v<_It> || !is_trivially_copyable_v<_Sent>) : _M_valueless(), _M_index(__x._M_index) { if (_M_index == 0) { if constexpr (is_trivially_default_constructible_v<_It>) _M_it = std::move(__x._M_it); else std::construct_at(std::__addressof(_M_it), std::move(__x._M_it)); } else if (_M_index == 1) { if constexpr (is_trivially_default_constructible_v<_Sent>) _M_sent = std::move(__x._M_sent); else std::construct_at(std::__addressof(_M_sent), std::move(__x._M_sent)); } } constexpr common_iterator& operator=(const common_iterator&) = default; constexpr common_iterator& operator=(const common_iterator& __x) noexcept(is_nothrow_copy_assignable_v<_It> && is_nothrow_copy_assignable_v<_Sent> && is_nothrow_copy_constructible_v<_It> && is_nothrow_copy_constructible_v<_Sent>) requires (!is_trivially_copy_assignable_v<_It> || !is_trivially_copy_assignable_v<_Sent>) { _M_assign(__x); return *this; } constexpr common_iterator& operator=(common_iterator&&) = default; constexpr common_iterator& operator=(common_iterator&& __x) noexcept(is_nothrow_move_assignable_v<_It> && is_nothrow_move_assignable_v<_Sent> && is_nothrow_move_constructible_v<_It> && is_nothrow_move_constructible_v<_Sent>) requires (!is_trivially_move_assignable_v<_It> || !is_trivially_move_assignable_v<_Sent>) { _M_assign(std::move(__x)); return *this; } template requires convertible_to && convertible_to && assignable_from<_It&, const _It2&> && assignable_from<_Sent&, const _Sent2&> constexpr common_iterator& operator=(const common_iterator<_It2, _Sent2>& __x) noexcept(is_nothrow_constructible_v<_It, const _It2&> && is_nothrow_constructible_v<_Sent, const _Sent2&> && is_nothrow_assignable_v<_It&, const _It2&> && is_nothrow_assignable_v<_Sent&, const _Sent2&>) { do { if (std::__is_constant_evaluated() && !bool(__x._M_has_value())) std::__glibcxx_assert_fail(); } while (false); _M_assign(__x); return *this; } ~common_iterator() = default; constexpr ~common_iterator() requires (!is_trivially_destructible_v<_It> || !is_trivially_destructible_v<_Sent>) { if (_M_index == 0) _M_it.~_It(); else if (_M_index == 1) _M_sent.~_Sent(); } [[nodiscard]] constexpr decltype(auto) operator*() { do { if (std::__is_constant_evaluated() && !bool(_M_index == 0)) std::__glibcxx_assert_fail(); } while (false); return *_M_it; } [[nodiscard]] constexpr decltype(auto) operator*() const requires __detail::__dereferenceable { do { if (std::__is_constant_evaluated() && !bool(_M_index == 0)) std::__glibcxx_assert_fail(); } while (false); return *_M_it; } [[nodiscard]] constexpr auto operator->() const requires __detail::__common_iter_has_arrow<_It> { do { if (std::__is_constant_evaluated() && !bool(_M_index == 0)) std::__glibcxx_assert_fail(); } while (false); if constexpr (is_pointer_v<_It> || requires { _M_it.operator->(); }) return _M_it; else if constexpr (is_reference_v>) { auto&& __tmp = *_M_it; return std::__addressof(__tmp); } else return __arrow_proxy{*_M_it}; } constexpr common_iterator& operator++() { do { if (std::__is_constant_evaluated() && !bool(_M_index == 0)) std::__glibcxx_assert_fail(); } while (false); ++_M_it; return *this; } constexpr decltype(auto) operator++(int) { do { if (std::__is_constant_evaluated() && !bool(_M_index == 0)) std::__glibcxx_assert_fail(); } while (false); if constexpr (forward_iterator<_It>) { common_iterator __tmp = *this; ++*this; return __tmp; } else if constexpr (!__detail::__common_iter_use_postfix_proxy<_It>) return _M_it++; else { __postfix_proxy __p(**this); ++*this; return __p; } } template _Sent2> requires sentinel_for<_Sent, _It2> friend constexpr bool operator== [[nodiscard]] (const common_iterator& __x, const common_iterator<_It2, _Sent2>& __y) { switch(__x._M_index << 2 | __y._M_index) { case 0b0000: case 0b0101: return true; case 0b0001: return __x._M_it == __y._M_sent; case 0b0100: return __x._M_sent == __y._M_it; default: do { if (std::__is_constant_evaluated() && !bool(__x._M_has_value())) std::__glibcxx_assert_fail(); } while (false); do { if (std::__is_constant_evaluated() && !bool(__y._M_has_value())) std::__glibcxx_assert_fail(); } while (false); __builtin_unreachable(); } } template _Sent2> requires sentinel_for<_Sent, _It2> && equality_comparable_with<_It, _It2> friend constexpr bool operator== [[nodiscard]] (const common_iterator& __x, const common_iterator<_It2, _Sent2>& __y) { switch(__x._M_index << 2 | __y._M_index) { case 0b0101: return true; case 0b0000: return __x._M_it == __y._M_it; case 0b0001: return __x._M_it == __y._M_sent; case 0b0100: return __x._M_sent == __y._M_it; default: do { if (std::__is_constant_evaluated() && !bool(__x._M_has_value())) std::__glibcxx_assert_fail(); } while (false); do { if (std::__is_constant_evaluated() && !bool(__y._M_has_value())) std::__glibcxx_assert_fail(); } while (false); __builtin_unreachable(); } } template _It2, sized_sentinel_for<_It> _Sent2> requires sized_sentinel_for<_Sent, _It2> friend constexpr iter_difference_t<_It2> operator- [[nodiscard]] (const common_iterator& __x, const common_iterator<_It2, _Sent2>& __y) { switch(__x._M_index << 2 | __y._M_index) { case 0b0101: return 0; case 0b0000: return __x._M_it - __y._M_it; case 0b0001: return __x._M_it - __y._M_sent; case 0b0100: return __x._M_sent - __y._M_it; default: do { if (std::__is_constant_evaluated() && !bool(__x._M_has_value())) std::__glibcxx_assert_fail(); } while (false); do { if (std::__is_constant_evaluated() && !bool(__y._M_has_value())) std::__glibcxx_assert_fail(); } while (false); __builtin_unreachable(); } } [[nodiscard]] friend constexpr iter_rvalue_reference_t<_It> iter_move(const common_iterator& __i) noexcept(noexcept(ranges::iter_move(std::declval()))) requires input_iterator<_It> { do { if (std::__is_constant_evaluated() && !bool(__i._M_index == 0)) std::__glibcxx_assert_fail(); } while (false); return ranges::iter_move(__i._M_it); } template _It2, typename _Sent2> friend constexpr void iter_swap(const common_iterator& __x, const common_iterator<_It2, _Sent2>& __y) noexcept(noexcept(ranges::iter_swap(std::declval(), std::declval()))) { do { if (std::__is_constant_evaluated() && !bool(__x._M_index == 0)) std::__glibcxx_assert_fail(); } while (false); do { if (std::__is_constant_evaluated() && !bool(__y._M_index == 0)) std::__glibcxx_assert_fail(); } while (false); return ranges::iter_swap(__x._M_it, __y._M_it); } private: template _Sent2> requires (!same_as<_It2, _Sent2>) && copyable<_It2> friend class common_iterator; constexpr bool _M_has_value() const noexcept { return _M_index != _S_valueless; } template constexpr void _M_assign(_CIt&& __x) { if (_M_index == __x._M_index) { if (_M_index == 0) _M_it = std::forward<_CIt>(__x)._M_it; else if (_M_index == 1) _M_sent = std::forward<_CIt>(__x)._M_sent; } else { if (_M_index == 0) _M_it.~_It(); else if (_M_index == 1) _M_sent.~_Sent(); _M_index = _S_valueless; if (__x._M_index == 0) std::construct_at(std::__addressof(_M_it), std::forward<_CIt>(__x)._M_it); else if (__x._M_index == 1) std::construct_at(std::__addressof(_M_sent), std::forward<_CIt>(__x)._M_sent); _M_index = __x._M_index; } } union { _It _M_it; _Sent _M_sent; unsigned char _M_valueless; }; unsigned char _M_index; static constexpr unsigned char _S_valueless{2}; }; template struct incrementable_traits> { using difference_type = iter_difference_t<_It>; }; template struct iterator_traits> { private: template struct __ptr { using type = void; }; template requires __detail::__common_iter_has_arrow<_Iter> struct __ptr<_Iter> { using _CIter = common_iterator<_Iter, _Sent>; using type = decltype(std::declval().operator->()); }; static auto _S_iter_cat() { if constexpr (requires { requires derived_from<__iter_category_t<_It>, forward_iterator_tag>; }) return forward_iterator_tag{}; else return input_iterator_tag{}; } public: using iterator_concept = __conditional_t, forward_iterator_tag, input_iterator_tag>; using iterator_category = decltype(_S_iter_cat()); using value_type = iter_value_t<_It>; using difference_type = iter_difference_t<_It>; using pointer = typename __ptr<_It>::type; using reference = iter_reference_t<_It>; }; namespace __detail { template struct __counted_iter_value_type { }; template struct __counted_iter_value_type<_It> { using value_type = iter_value_t<_It>; }; template struct __counted_iter_concept { }; template requires requires { typename _It::iterator_concept; } struct __counted_iter_concept<_It> { using iterator_concept = typename _It::iterator_concept; }; template struct __counted_iter_cat { }; template requires requires { typename _It::iterator_category; } struct __counted_iter_cat<_It> { using iterator_category = typename _It::iterator_category; }; } template class counted_iterator : public __detail::__counted_iter_value_type<_It>, public __detail::__counted_iter_concept<_It>, public __detail::__counted_iter_cat<_It> { public: using iterator_type = _It; using difference_type = iter_difference_t<_It>; constexpr counted_iterator() requires default_initializable<_It> = default; constexpr counted_iterator(_It __i, iter_difference_t<_It> __n) : _M_current(std::move(__i)), _M_length(__n) { do { if (std::__is_constant_evaluated() && !bool(__n >= 0)) std::__glibcxx_assert_fail(); } while (false); } template requires convertible_to constexpr counted_iterator(const counted_iterator<_It2>& __x) : _M_current(__x._M_current), _M_length(__x._M_length) { } template requires assignable_from<_It&, const _It2&> constexpr counted_iterator& operator=(const counted_iterator<_It2>& __x) { _M_current = __x._M_current; _M_length = __x._M_length; return *this; } [[nodiscard]] constexpr const _It& base() const & noexcept { return _M_current; } [[nodiscard]] constexpr _It base() && noexcept(is_nothrow_move_constructible_v<_It>) { return std::move(_M_current); } [[nodiscard]] constexpr iter_difference_t<_It> count() const noexcept { return _M_length; } [[nodiscard]] constexpr decltype(auto) operator*() noexcept(noexcept(*_M_current)) { do { if (std::__is_constant_evaluated() && !bool(_M_length > 0)) std::__glibcxx_assert_fail(); } while (false); return *_M_current; } [[nodiscard]] constexpr decltype(auto) operator*() const noexcept(noexcept(*_M_current)) requires __detail::__dereferenceable { do { if (std::__is_constant_evaluated() && !bool(_M_length > 0)) std::__glibcxx_assert_fail(); } while (false); return *_M_current; } [[nodiscard]] constexpr auto operator->() const noexcept requires contiguous_iterator<_It> { return std::to_address(_M_current); } constexpr counted_iterator& operator++() { do { if (std::__is_constant_evaluated() && !bool(_M_length > 0)) std::__glibcxx_assert_fail(); } while (false); ++_M_current; --_M_length; return *this; } constexpr decltype(auto) operator++(int) { do { if (std::__is_constant_evaluated() && !bool(_M_length > 0)) std::__glibcxx_assert_fail(); } while (false); --_M_length; try { return _M_current++; } catch(...) { ++_M_length; throw; } } constexpr counted_iterator operator++(int) requires forward_iterator<_It> { auto __tmp = *this; ++*this; return __tmp; } constexpr counted_iterator& operator--() requires bidirectional_iterator<_It> { --_M_current; ++_M_length; return *this; } constexpr counted_iterator operator--(int) requires bidirectional_iterator<_It> { auto __tmp = *this; --*this; return __tmp; } [[nodiscard]] constexpr counted_iterator operator+(iter_difference_t<_It> __n) const requires random_access_iterator<_It> { return counted_iterator(_M_current + __n, _M_length - __n); } [[nodiscard]] friend constexpr counted_iterator operator+(iter_difference_t<_It> __n, const counted_iterator& __x) requires random_access_iterator<_It> { return __x + __n; } constexpr counted_iterator& operator+=(iter_difference_t<_It> __n) requires random_access_iterator<_It> { do { if (std::__is_constant_evaluated() && !bool(__n <= _M_length)) std::__glibcxx_assert_fail(); } while (false); _M_current += __n; _M_length -= __n; return *this; } [[nodiscard]] constexpr counted_iterator operator-(iter_difference_t<_It> __n) const requires random_access_iterator<_It> { return counted_iterator(_M_current - __n, _M_length + __n); } template _It2> [[nodiscard]] friend constexpr iter_difference_t<_It2> operator-(const counted_iterator& __x, const counted_iterator<_It2>& __y) { return __y._M_length - __x._M_length; } [[nodiscard]] friend constexpr iter_difference_t<_It> operator-(const counted_iterator& __x, default_sentinel_t) { return -__x._M_length; } [[nodiscard]] friend constexpr iter_difference_t<_It> operator-(default_sentinel_t, const counted_iterator& __y) { return __y._M_length; } constexpr counted_iterator& operator-=(iter_difference_t<_It> __n) requires random_access_iterator<_It> { do { if (std::__is_constant_evaluated() && !bool(-__n <= _M_length)) std::__glibcxx_assert_fail(); } while (false); _M_current -= __n; _M_length += __n; return *this; } [[nodiscard]] constexpr decltype(auto) operator[](iter_difference_t<_It> __n) const noexcept(noexcept(_M_current[__n])) requires random_access_iterator<_It> { do { if (std::__is_constant_evaluated() && !bool(__n < _M_length)) std::__glibcxx_assert_fail(); } while (false); return _M_current[__n]; } template _It2> [[nodiscard]] friend constexpr bool operator==(const counted_iterator& __x, const counted_iterator<_It2>& __y) { return __x._M_length == __y._M_length; } [[nodiscard]] friend constexpr bool operator==(const counted_iterator& __x, default_sentinel_t) { return __x._M_length == 0; } template _It2> [[nodiscard]] friend constexpr strong_ordering operator<=>(const counted_iterator& __x, const counted_iterator<_It2>& __y) { return __y._M_length <=> __x._M_length; } [[nodiscard]] friend constexpr iter_rvalue_reference_t<_It> iter_move(const counted_iterator& __i) noexcept(noexcept(ranges::iter_move(__i._M_current))) requires input_iterator<_It> { do { if (std::__is_constant_evaluated() && !bool(__i._M_length > 0)) std::__glibcxx_assert_fail(); } while (false); return ranges::iter_move(__i._M_current); } template _It2> friend constexpr void iter_swap(const counted_iterator& __x, const counted_iterator<_It2>& __y) noexcept(noexcept(ranges::iter_swap(__x._M_current, __y._M_current))) { do { if (std::__is_constant_evaluated() && !bool(__x._M_length > 0 && __y._M_length > 0)) std::__glibcxx_assert_fail(); } while (false); ranges::iter_swap(__x._M_current, __y._M_current); } private: template friend class counted_iterator; _It _M_current = _It(); iter_difference_t<_It> _M_length = 0; }; template requires same_as<__detail::__iter_traits<_It>, iterator_traits<_It>> struct iterator_traits> : iterator_traits<_It> { using pointer = __conditional_t, add_pointer_t>, void>; }; template using iter_const_reference_t = common_reference_t&&, iter_reference_t<_It>>; template class basic_const_iterator; namespace __detail { template concept __constant_iterator = input_iterator<_It> && same_as, iter_reference_t<_It>>; template inline constexpr bool __is_const_iterator = false; template inline constexpr bool __is_const_iterator> = true; template concept __not_a_const_iterator = !__is_const_iterator<_Tp>; template using __iter_const_rvalue_reference_t = common_reference_t&&, iter_rvalue_reference_t<_It>>; template struct __basic_const_iterator_iter_cat { }; template struct __basic_const_iterator_iter_cat<_It> { using iterator_category = __iter_category_t<_It>; }; } template using const_iterator = __conditional_t<__detail::__constant_iterator<_It>, _It, basic_const_iterator<_It>>; namespace __detail { template struct __const_sentinel { using type = _Sent; }; template struct __const_sentinel<_Sent> { using type = const_iterator<_Sent>; }; } template using const_sentinel = typename __detail::__const_sentinel<_Sent>::type; template class basic_const_iterator : public __detail::__basic_const_iterator_iter_cat<_It> { _It _M_current = _It(); using __reference = iter_const_reference_t<_It>; using __rvalue_reference = __detail::__iter_const_rvalue_reference_t<_It>; static auto _S_iter_concept() { if constexpr (contiguous_iterator<_It>) return contiguous_iterator_tag{}; else if constexpr (random_access_iterator<_It>) return random_access_iterator_tag{}; else if constexpr (bidirectional_iterator<_It>) return bidirectional_iterator_tag{}; else if constexpr (forward_iterator<_It>) return forward_iterator_tag{}; else return input_iterator_tag{}; } template friend class basic_const_iterator; public: using iterator_concept = decltype(_S_iter_concept()); using value_type = iter_value_t<_It>; using difference_type = iter_difference_t<_It>; basic_const_iterator() requires default_initializable<_It> = default; constexpr basic_const_iterator(_It __current) noexcept(is_nothrow_move_constructible_v<_It>) : _M_current(std::move(__current)) { } template _It2> constexpr basic_const_iterator(basic_const_iterator<_It2> __current) noexcept(is_nothrow_constructible_v<_It, _It2>) : _M_current(std::move(__current._M_current)) { } template<__detail::__different_from _Tp> requires convertible_to<_Tp, _It> constexpr basic_const_iterator(_Tp&& __current) noexcept(is_nothrow_constructible_v<_It, _Tp>) : _M_current(std::forward<_Tp>(__current)) { } constexpr const _It& base() const & noexcept { return _M_current; } constexpr _It base() && noexcept(is_nothrow_move_constructible_v<_It>) { return std::move(_M_current); } constexpr __reference operator*() const noexcept(noexcept(static_cast<__reference>(*_M_current))) { return static_cast<__reference>(*_M_current); } constexpr const auto* operator->() const noexcept(contiguous_iterator<_It> || noexcept(*_M_current)) requires is_lvalue_reference_v> && same_as>, value_type> { if constexpr (contiguous_iterator<_It>) return std::to_address(_M_current); else return std::__addressof(*_M_current); } constexpr basic_const_iterator& operator++() noexcept(noexcept(++_M_current)) { ++_M_current; return *this; } constexpr void operator++(int) noexcept(noexcept(++_M_current)) { ++_M_current; } constexpr basic_const_iterator operator++(int) noexcept(noexcept(++*this) && is_nothrow_copy_constructible_v) requires forward_iterator<_It> { auto __tmp = *this; ++*this; return __tmp; } constexpr basic_const_iterator& operator--() noexcept(noexcept(--_M_current)) requires bidirectional_iterator<_It> { --_M_current; return *this; } constexpr basic_const_iterator operator--(int) noexcept(noexcept(--*this) && is_nothrow_copy_constructible_v) requires bidirectional_iterator<_It> { auto __tmp = *this; --*this; return __tmp; } constexpr basic_const_iterator& operator+=(difference_type __n) noexcept(noexcept(_M_current += __n)) requires random_access_iterator<_It> { _M_current += __n; return *this; } constexpr basic_const_iterator& operator-=(difference_type __n) noexcept(noexcept(_M_current -= __n)) requires random_access_iterator<_It> { _M_current -= __n; return *this; } constexpr __reference operator[](difference_type __n) const noexcept(noexcept(static_cast<__reference>(_M_current[__n]))) requires random_access_iterator<_It> { return static_cast<__reference>(_M_current[__n]); } template _Sent> constexpr bool operator==(const _Sent& __s) const noexcept(noexcept(_M_current == __s)) { return _M_current == __s; } template<__detail::__not_a_const_iterator _CIt> requires __detail::__constant_iterator<_CIt> && convertible_to<_It, _CIt> constexpr operator _CIt() const& { return _M_current; } template<__detail::__not_a_const_iterator _CIt> requires __detail::__constant_iterator<_CIt> && convertible_to<_It, _CIt> constexpr operator _CIt() && { return std::move(_M_current); } constexpr bool operator<(const basic_const_iterator& __y) const noexcept(noexcept(_M_current < __y._M_current)) requires random_access_iterator<_It> { return _M_current < __y._M_current; } constexpr bool operator>(const basic_const_iterator& __y) const noexcept(noexcept(_M_current > __y._M_current)) requires random_access_iterator<_It> { return _M_current > __y._M_current; } constexpr bool operator<=(const basic_const_iterator& __y) const noexcept(noexcept(_M_current <= __y._M_current)) requires random_access_iterator<_It> { return _M_current <= __y._M_current; } constexpr bool operator>=(const basic_const_iterator& __y) const noexcept(noexcept(_M_current >= __y._M_current)) requires random_access_iterator<_It> { return _M_current >= __y._M_current; } constexpr auto operator<=>(const basic_const_iterator& __y) const noexcept(noexcept(_M_current <=> __y._M_current)) requires random_access_iterator<_It> && three_way_comparable<_It> { return _M_current <=> __y._M_current; } template<__detail::__different_from _It2> constexpr bool operator<(const _It2& __y) const noexcept(noexcept(_M_current < __y)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> { return _M_current < __y; } template<__detail::__different_from _It2> constexpr bool operator>(const _It2& __y) const noexcept(noexcept(_M_current > __y)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> { return _M_current > __y; } template<__detail::__different_from _It2> constexpr bool operator<=(const _It2& __y) const noexcept(noexcept(_M_current <= __y)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> { return _M_current <= __y; } template<__detail::__different_from _It2> constexpr bool operator>=(const _It2& __y) const noexcept(noexcept(_M_current >= __y)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> { return _M_current >= __y; } template<__detail::__different_from _It2> constexpr auto operator<=>(const _It2& __y) const noexcept(noexcept(_M_current <=> __y)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> && three_way_comparable_with<_It, _It2> { return _M_current <=> __y; } template<__detail::__not_a_const_iterator _It2, same_as<_It> _It3> friend constexpr bool operator<(const _It2& __x, const basic_const_iterator<_It3>& __y) noexcept(noexcept(__x < __y._M_current)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> { return __x < __y._M_current; } template<__detail::__not_a_const_iterator _It2, same_as<_It> _It3> friend constexpr bool operator>(const _It2& __x, const basic_const_iterator<_It3>& __y) noexcept(noexcept(__x > __y._M_current)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> { return __x > __y._M_current; } template<__detail::__not_a_const_iterator _It2, same_as<_It> _It3> friend constexpr bool operator<=(const _It2& __x, const basic_const_iterator<_It3>& __y) noexcept(noexcept(__x <= __y._M_current)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> { return __x <= __y._M_current; } template<__detail::__not_a_const_iterator _It2, same_as<_It> _It3> friend constexpr bool operator>=(const _It2& __x, const basic_const_iterator<_It3>& __y) noexcept(noexcept(__x >= __y._M_current)) requires random_access_iterator<_It> && totally_ordered_with<_It, _It2> { return __x >= __y._M_current; } friend constexpr basic_const_iterator operator+(const basic_const_iterator& __i, difference_type __n) noexcept(noexcept(basic_const_iterator(__i._M_current + __n))) requires random_access_iterator<_It> { return basic_const_iterator(__i._M_current + __n); } friend constexpr basic_const_iterator operator+(difference_type __n, const basic_const_iterator& __i) noexcept(noexcept(basic_const_iterator(__i._M_current + __n))) requires random_access_iterator<_It> { return basic_const_iterator(__i._M_current + __n); } friend constexpr basic_const_iterator operator-(const basic_const_iterator& __i, difference_type __n) noexcept(noexcept(basic_const_iterator(__i._M_current - __n))) requires random_access_iterator<_It> { return basic_const_iterator(__i._M_current - __n); } template _Sent> constexpr difference_type operator-(const _Sent& __y) const noexcept(noexcept(_M_current - __y)) { return _M_current - __y; } template<__detail::__not_a_const_iterator _Sent, same_as<_It> _It2> requires sized_sentinel_for<_Sent, _It> friend constexpr difference_type operator-(const _Sent& __x, const basic_const_iterator<_It2>& __y) noexcept(noexcept(__x - __y._M_current)) { return __x - __y._M_current; } friend constexpr __rvalue_reference iter_move(const basic_const_iterator& __i) noexcept(noexcept(static_cast<__rvalue_reference>(ranges::iter_move(__i._M_current)))) { return static_cast<__rvalue_reference>(ranges::iter_move(__i._M_current)); } }; template _Up> requires input_iterator> struct common_type, _Up> { using type = basic_const_iterator>; }; template _Up> requires input_iterator> struct common_type<_Up, basic_const_iterator<_Tp>> { using type = basic_const_iterator>; }; template _Up> requires input_iterator> struct common_type, basic_const_iterator<_Up>> { using type = basic_const_iterator>; }; template constexpr const_iterator<_It> make_const_iterator(_It __it) noexcept(is_nothrow_convertible_v<_It, const_iterator<_It>>) { return __it; } template constexpr const_sentinel<_Sent> make_const_sentinel(_Sent __s) noexcept(is_nothrow_convertible_v<_Sent, const_sentinel<_Sent>>) { return __s; } } namespace __gnu_debug { template class _Safe_iterator; } namespace std __attribute__ ((__visibility__ ("default"))) { template [[__nodiscard__]] __attribute__((__always_inline__)) constexpr inline _Iterator __niter_base(__gnu_cxx::__normal_iterator<_Iterator, _Container> __it) noexcept(std::is_nothrow_copy_constructible<_Iterator>::value) { return __it.base(); } template [[__nodiscard__]] __attribute__((__always_inline__)) constexpr inline _Iterator __niter_base(_Iterator __it) noexcept(std::is_nothrow_copy_constructible<_Iterator>::value) { return __it; } # 3027 "/usr/include/c++/15/bits/stl_iterator.h" 3 template constexpr decltype(std::__niter_base(std::declval<_Ite>())) __niter_base(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, std::random_access_iterator_tag>&) noexcept(std::is_nothrow_copy_constructible<_Ite>::value); template constexpr inline auto __niter_base(reverse_iterator<_Iterator> __it) -> decltype(__make_reverse_iterator(__niter_base(__it.base()))) { return __make_reverse_iterator(__niter_base(__it.base())); } template constexpr inline auto __niter_base(move_iterator<_Iterator> __it) -> decltype(make_move_iterator(__niter_base(__it.base()))) { return make_move_iterator(__niter_base(__it.base())); } template constexpr inline auto __miter_base(reverse_iterator<_Iterator> __it) -> decltype(__make_reverse_iterator(__miter_base(__it.base()))) { return __make_reverse_iterator(__miter_base(__it.base())); } template constexpr inline auto __miter_base(move_iterator<_Iterator> __it) -> decltype(__miter_base(__it.base())) { return __miter_base(__it.base()); } template [[__nodiscard__]] constexpr inline _From __niter_wrap(_From __from, _To __res) { return __from + (std::__niter_base(__res) - std::__niter_base(__from)); } template [[__nodiscard__]] __attribute__((__always_inline__)) constexpr inline _Iterator __niter_wrap(const _Iterator&, _Iterator __res) { return __res; } template using __iter_key_t = remove_const_t< tuple_element_t<0, typename iterator_traits<_InputIterator>::value_type>>; template using __iter_val_t = tuple_element_t<1, typename iterator_traits<_InputIterator>::value_type>; template struct pair; template using __iter_to_alloc_t = pair, __iter_val_t<_InputIterator>>; } # 40 "/usr/include/c++/15/bits/ranges_base.h" 2 3 # 1 "/usr/include/c++/15/ext/numeric_traits.h" 1 3 # 39 "/usr/include/c++/15/ext/numeric_traits.h" 3 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { # 52 "/usr/include/c++/15/ext/numeric_traits.h" 3 template struct __is_integer_nonstrict : public std::__is_integer<_Tp> { using std::__is_integer<_Tp>::__value; enum { __width = __value ? sizeof(_Tp) * 8 : 0 }; }; template struct __numeric_traits_integer { static_assert(__is_integer_nonstrict<_Value>::__value, "invalid specialization"); static const bool __is_signed = (_Value)(-1) < 0; static const int __digits = __is_integer_nonstrict<_Value>::__width - __is_signed; static const _Value __max = __is_signed ? (((((_Value)1 << (__digits - 1)) - 1) << 1) + 1) : ~(_Value)0; static const _Value __min = __is_signed ? -__max - 1 : (_Value)0; }; template const _Value __numeric_traits_integer<_Value>::__min; template const _Value __numeric_traits_integer<_Value>::__max; template const bool __numeric_traits_integer<_Value>::__is_signed; template const int __numeric_traits_integer<_Value>::__digits; # 139 "/usr/include/c++/15/ext/numeric_traits.h" 3 template using __int_traits = __numeric_traits_integer<_Tp>; # 159 "/usr/include/c++/15/ext/numeric_traits.h" 3 template struct __numeric_traits_floating { static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 64) * 643L / 2136); static const bool __is_signed = true; static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 18); static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 4932); }; template const int __numeric_traits_floating<_Value>::__max_digits10; template const bool __numeric_traits_floating<_Value>::__is_signed; template const int __numeric_traits_floating<_Value>::__digits10; template const int __numeric_traits_floating<_Value>::__max_exponent10; template struct __numeric_traits : public __numeric_traits_integer<_Value> { }; template<> struct __numeric_traits : public __numeric_traits_floating { }; template<> struct __numeric_traits : public __numeric_traits_floating { }; template<> struct __numeric_traits : public __numeric_traits_floating { }; # 240 "/usr/include/c++/15/ext/numeric_traits.h" 3 } # 41 "/usr/include/c++/15/bits/ranges_base.h" 2 3 # 1 "/usr/include/c++/15/bits/max_size_type.h" 1 3 # 39 "/usr/include/c++/15/bits/max_size_type.h" 3 # 1 "/usr/include/c++/15/numbers" 1 3 # 37 "/usr/include/c++/15/numbers" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 38 "/usr/include/c++/15/numbers" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" namespace std __attribute__ ((__visibility__ ("default"))) { namespace numbers { template using _Enable_if_floating = enable_if_t, _Tp>; template inline constexpr _Tp e_v = _Enable_if_floating<_Tp>(2.718281828459045235360287471352662498L); template inline constexpr _Tp log2e_v = _Enable_if_floating<_Tp>(1.442695040888963407359924681001892137L); template inline constexpr _Tp log10e_v = _Enable_if_floating<_Tp>(0.434294481903251827651128918916605082L); template inline constexpr _Tp pi_v = _Enable_if_floating<_Tp>(3.141592653589793238462643383279502884L); template inline constexpr _Tp inv_pi_v = _Enable_if_floating<_Tp>(0.318309886183790671537767526745028724L); template inline constexpr _Tp inv_sqrtpi_v = _Enable_if_floating<_Tp>(0.564189583547756286948079451560772586L); template inline constexpr _Tp ln2_v = _Enable_if_floating<_Tp>(0.693147180559945309417232121458176568L); template inline constexpr _Tp ln10_v = _Enable_if_floating<_Tp>(2.302585092994045684017991454684364208L); template inline constexpr _Tp sqrt2_v = _Enable_if_floating<_Tp>(1.414213562373095048801688724209698079L); template inline constexpr _Tp sqrt3_v = _Enable_if_floating<_Tp>(1.732050807568877293527446341505872367L); template inline constexpr _Tp inv_sqrt3_v = _Enable_if_floating<_Tp>(0.577350269189625764509148780501957456L); template inline constexpr _Tp egamma_v = _Enable_if_floating<_Tp>(0.577215664901532860606512090082402431L); template inline constexpr _Tp phi_v = _Enable_if_floating<_Tp>(1.618033988749894848204586834365638118L); inline constexpr double e = e_v; inline constexpr double log2e = log2e_v; inline constexpr double log10e = log10e_v; inline constexpr double pi = pi_v; inline constexpr double inv_pi = inv_pi_v; inline constexpr double inv_sqrtpi = inv_sqrtpi_v; inline constexpr double ln2 = ln2_v; inline constexpr double ln10 = ln10_v; inline constexpr double sqrt2 = sqrt2_v; inline constexpr double sqrt3 = sqrt3_v; inline constexpr double inv_sqrt3 = inv_sqrt3_v; inline constexpr double egamma = egamma_v; inline constexpr double phi = phi_v; # 210 "/usr/include/c++/15/numbers" 3 template<> inline constexpr _Float16 e_v<_Float16> = 2.718281828459045235360287471352662498F16; template<> inline constexpr _Float16 log2e_v<_Float16> = 1.442695040888963407359924681001892137F16; template<> inline constexpr _Float16 log10e_v<_Float16> = 0.434294481903251827651128918916605082F16; template<> inline constexpr _Float16 pi_v<_Float16> = 3.141592653589793238462643383279502884F16; template<> inline constexpr _Float16 inv_pi_v<_Float16> = 0.318309886183790671537767526745028724F16; template<> inline constexpr _Float16 inv_sqrtpi_v<_Float16> = 0.564189583547756286948079451560772586F16; template<> inline constexpr _Float16 ln2_v<_Float16> = 0.693147180559945309417232121458176568F16; template<> inline constexpr _Float16 ln10_v<_Float16> = 2.302585092994045684017991454684364208F16; template<> inline constexpr _Float16 sqrt2_v<_Float16> = 1.414213562373095048801688724209698079F16; template<> inline constexpr _Float16 sqrt3_v<_Float16> = 1.732050807568877293527446341505872367F16; template<> inline constexpr _Float16 inv_sqrt3_v<_Float16> = 0.577350269189625764509148780501957456F16; template<> inline constexpr _Float16 egamma_v<_Float16> = 0.577215664901532860606512090082402431F16; template<> inline constexpr _Float16 phi_v<_Float16> = 1.618033988749894848204586834365638118F16; template<> inline constexpr _Float32 e_v<_Float32> = 2.718281828459045235360287471352662498F32; template<> inline constexpr _Float32 log2e_v<_Float32> = 1.442695040888963407359924681001892137F32; template<> inline constexpr _Float32 log10e_v<_Float32> = 0.434294481903251827651128918916605082F32; template<> inline constexpr _Float32 pi_v<_Float32> = 3.141592653589793238462643383279502884F32; template<> inline constexpr _Float32 inv_pi_v<_Float32> = 0.318309886183790671537767526745028724F32; template<> inline constexpr _Float32 inv_sqrtpi_v<_Float32> = 0.564189583547756286948079451560772586F32; template<> inline constexpr _Float32 ln2_v<_Float32> = 0.693147180559945309417232121458176568F32; template<> inline constexpr _Float32 ln10_v<_Float32> = 2.302585092994045684017991454684364208F32; template<> inline constexpr _Float32 sqrt2_v<_Float32> = 1.414213562373095048801688724209698079F32; template<> inline constexpr _Float32 sqrt3_v<_Float32> = 1.732050807568877293527446341505872367F32; template<> inline constexpr _Float32 inv_sqrt3_v<_Float32> = 0.577350269189625764509148780501957456F32; template<> inline constexpr _Float32 egamma_v<_Float32> = 0.577215664901532860606512090082402431F32; template<> inline constexpr _Float32 phi_v<_Float32> = 1.618033988749894848204586834365638118F32; template<> inline constexpr _Float64 e_v<_Float64> = 2.718281828459045235360287471352662498F64; template<> inline constexpr _Float64 log2e_v<_Float64> = 1.442695040888963407359924681001892137F64; template<> inline constexpr _Float64 log10e_v<_Float64> = 0.434294481903251827651128918916605082F64; template<> inline constexpr _Float64 pi_v<_Float64> = 3.141592653589793238462643383279502884F64; template<> inline constexpr _Float64 inv_pi_v<_Float64> = 0.318309886183790671537767526745028724F64; template<> inline constexpr _Float64 inv_sqrtpi_v<_Float64> = 0.564189583547756286948079451560772586F64; template<> inline constexpr _Float64 ln2_v<_Float64> = 0.693147180559945309417232121458176568F64; template<> inline constexpr _Float64 ln10_v<_Float64> = 2.302585092994045684017991454684364208F64; template<> inline constexpr _Float64 sqrt2_v<_Float64> = 1.414213562373095048801688724209698079F64; template<> inline constexpr _Float64 sqrt3_v<_Float64> = 1.732050807568877293527446341505872367F64; template<> inline constexpr _Float64 inv_sqrt3_v<_Float64> = 0.577350269189625764509148780501957456F64; template<> inline constexpr _Float64 egamma_v<_Float64> = 0.577215664901532860606512090082402431F64; template<> inline constexpr _Float64 phi_v<_Float64> = 1.618033988749894848204586834365638118F64; template<> inline constexpr _Float128 e_v<_Float128> = 2.718281828459045235360287471352662498F128; template<> inline constexpr _Float128 log2e_v<_Float128> = 1.442695040888963407359924681001892137F128; template<> inline constexpr _Float128 log10e_v<_Float128> = 0.434294481903251827651128918916605082F128; template<> inline constexpr _Float128 pi_v<_Float128> = 3.141592653589793238462643383279502884F128; template<> inline constexpr _Float128 inv_pi_v<_Float128> = 0.318309886183790671537767526745028724F128; template<> inline constexpr _Float128 inv_sqrtpi_v<_Float128> = 0.564189583547756286948079451560772586F128; template<> inline constexpr _Float128 ln2_v<_Float128> = 0.693147180559945309417232121458176568F128; template<> inline constexpr _Float128 ln10_v<_Float128> = 2.302585092994045684017991454684364208F128; template<> inline constexpr _Float128 sqrt2_v<_Float128> = 1.414213562373095048801688724209698079F128; template<> inline constexpr _Float128 sqrt3_v<_Float128> = 1.732050807568877293527446341505872367F128; template<> inline constexpr _Float128 inv_sqrt3_v<_Float128> = 0.577350269189625764509148780501957456F128; template<> inline constexpr _Float128 egamma_v<_Float128> = 0.577215664901532860606512090082402431F128; template<> inline constexpr _Float128 phi_v<_Float128> = 1.618033988749894848204586834365638118F128; template<> inline constexpr __float128 e_v<__float128> = 2.718281828459045235360287471352662498Q; template<> inline constexpr __float128 log2e_v<__float128> = 1.442695040888963407359924681001892137Q; template<> inline constexpr __float128 log10e_v<__float128> = 0.434294481903251827651128918916605082Q; template<> inline constexpr __float128 pi_v<__float128> = 3.141592653589793238462643383279502884Q; template<> inline constexpr __float128 inv_pi_v<__float128> = 0.318309886183790671537767526745028724Q; template<> inline constexpr __float128 inv_sqrtpi_v<__float128> = 0.564189583547756286948079451560772586Q; template<> inline constexpr __float128 ln2_v<__float128> = 0.693147180559945309417232121458176568Q; template<> inline constexpr __float128 ln10_v<__float128> = 2.302585092994045684017991454684364208Q; template<> inline constexpr __float128 sqrt2_v<__float128> = 1.414213562373095048801688724209698079Q; template<> inline constexpr __float128 sqrt3_v<__float128> = 1.732050807568877293527446341505872367Q; template<> inline constexpr __float128 inv_sqrt3_v<__float128> = 0.577350269189625764509148780501957456Q; template<> inline constexpr __float128 egamma_v<__float128> = 0.577215664901532860606512090082402431Q; template<> inline constexpr __float128 phi_v<__float128> = 1.618033988749894848204586834365638118Q; } } #pragma GCC diagnostic pop # 40 "/usr/include/c++/15/bits/max_size_type.h" 2 3 # 50 "/usr/include/c++/15/bits/max_size_type.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template struct numeric_limits; namespace ranges { namespace __detail { class __max_size_type { public: __max_size_type() = default; template requires integral<_Tp> || __is_int128<_Tp> constexpr __max_size_type(_Tp __i) noexcept : _M_val(__i), _M_msb(__i < 0) { } constexpr explicit __max_size_type(const __max_diff_type& __d) noexcept; template requires integral<_Tp> || __is_int128<_Tp> constexpr explicit operator _Tp() const noexcept { return _M_val; } constexpr explicit operator bool() const noexcept { return _M_val != 0 || _M_msb != 0; } constexpr __max_size_type operator+() const noexcept { return *this; } constexpr __max_size_type operator~() const noexcept { return __max_size_type{~_M_val, !_M_msb}; } constexpr __max_size_type operator-() const noexcept { return operator~() + 1; } constexpr __max_size_type& operator++() noexcept { return *this += 1; } constexpr __max_size_type operator++(int) noexcept { auto __tmp = *this; ++*this; return __tmp; } constexpr __max_size_type& operator--() noexcept { return *this -= 1; } constexpr __max_size_type operator--(int) noexcept { auto __tmp = *this; --*this; return __tmp; } constexpr __max_size_type& operator+=(const __max_size_type& __r) noexcept { const auto __sum = _M_val + __r._M_val; const bool __overflow = (__sum < _M_val); _M_msb = _M_msb ^ __r._M_msb ^ __overflow; _M_val = __sum; return *this; } constexpr __max_size_type& operator-=(const __max_size_type& __r) noexcept { return *this += -__r; } constexpr __max_size_type& operator*=(__max_size_type __r) noexcept { constexpr __max_size_type __threshold = __rep(1) << (_S_rep_bits / 2 - 1); if (_M_val < __threshold && __r < __threshold) _M_val = _M_val * __r._M_val; else { const bool __lsb = _M_val & 1; const bool __rlsb = __r._M_val & 1; *this >>= 1; __r >>= 1; _M_val = (2 * _M_val * __r._M_val + _M_val * __rlsb + __r._M_val * __lsb); *this <<= 1; *this += __rlsb * __lsb; } return *this; } constexpr __max_size_type& operator/=(const __max_size_type& __r) noexcept { do { if (std::__is_constant_evaluated() && !bool(__r != 0)) std::__glibcxx_assert_fail(); } while (false); if (!_M_msb && !__r._M_msb) [[likely]] _M_val /= __r._M_val; else if (_M_msb && __r._M_msb) { _M_val = (_M_val >= __r._M_val); _M_msb = 0; } else if (!_M_msb && __r._M_msb) _M_val = 0; else if (_M_msb && !__r._M_msb) { const auto __orig = *this; *this >>= 1; _M_val /= __r._M_val; *this <<= 1; if (__orig - *this * __r >= __r) ++_M_val; } return *this; } constexpr __max_size_type& operator%=(const __max_size_type& __r) noexcept { if (!_M_msb && !__r._M_msb) [[likely]] _M_val %= __r._M_val; else *this -= (*this / __r) * __r; return *this; } constexpr __max_size_type& operator<<=(const __max_size_type& __r) noexcept { do { if (std::__is_constant_evaluated() && !bool(__r <= _S_rep_bits)) std::__glibcxx_assert_fail(); } while (false); if (__r != 0) { _M_msb = (_M_val >> (_S_rep_bits - __r._M_val)) & 1; if (__r._M_val == _S_rep_bits) [[unlikely]] _M_val = 0; else _M_val <<= __r._M_val; } return *this; } constexpr __max_size_type& operator>>=(const __max_size_type& __r) noexcept { do { if (std::__is_constant_evaluated() && !bool(__r <= _S_rep_bits)) std::__glibcxx_assert_fail(); } while (false); if (__r != 0) { if (__r._M_val == _S_rep_bits) [[unlikely]] _M_val = 0; else _M_val >>= __r._M_val; if (_M_msb) [[unlikely]] { _M_val |= __rep(1) << (_S_rep_bits - __r._M_val); _M_msb = 0; } } return *this; } constexpr __max_size_type& operator&=(const __max_size_type& __r) noexcept { _M_val &= __r._M_val; _M_msb &= __r._M_msb; return *this; } constexpr __max_size_type& operator|=(const __max_size_type& __r) noexcept { _M_val |= __r._M_val; _M_msb |= __r._M_msb; return *this; } constexpr __max_size_type& operator^=(const __max_size_type& __r) noexcept { _M_val ^= __r._M_val; _M_msb ^= __r._M_msb; return *this; } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator+=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a + __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator-=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a - __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator*=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a * __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator/=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a / __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator%=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a % __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator&=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a & __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator|=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a | __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator^=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a ^ __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator<<=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a << __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator>>=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a >> __b)); } friend constexpr __max_size_type operator+(__max_size_type __l, const __max_size_type& __r) noexcept { __l += __r; return __l; } friend constexpr __max_size_type operator-(__max_size_type __l, const __max_size_type& __r) noexcept { __l -= __r; return __l; } friend constexpr __max_size_type operator*(__max_size_type __l, const __max_size_type& __r) noexcept { __l *= __r; return __l; } friend constexpr __max_size_type operator/(__max_size_type __l, const __max_size_type& __r) noexcept { __l /= __r; return __l; } friend constexpr __max_size_type operator%(__max_size_type __l, const __max_size_type& __r) noexcept { __l %= __r; return __l; } friend constexpr __max_size_type operator<<(__max_size_type __l, const __max_size_type& __r) noexcept { __l <<= __r; return __l; } friend constexpr __max_size_type operator>>(__max_size_type __l, const __max_size_type& __r) noexcept { __l >>= __r; return __l; } friend constexpr __max_size_type operator&(__max_size_type __l, const __max_size_type& __r) noexcept { __l &= __r; return __l; } friend constexpr __max_size_type operator|(__max_size_type __l, const __max_size_type& __r) noexcept { __l |= __r; return __l; } friend constexpr __max_size_type operator^(__max_size_type __l, const __max_size_type& __r) noexcept { __l ^= __r; return __l; } friend constexpr bool operator==(const __max_size_type& __l, const __max_size_type& __r) noexcept { return __l._M_val == __r._M_val && __l._M_msb == __r._M_msb; } friend constexpr strong_ordering operator<=>(const __max_size_type& __l, const __max_size_type& __r) noexcept { if (__l._M_msb ^ __r._M_msb) return __l._M_msb ? strong_ordering::greater : strong_ordering::less; else return __l._M_val <=> __r._M_val; } # 422 "/usr/include/c++/15/bits/max_size_type.h" 3 __extension__ using __rep = unsigned __int128; static constexpr size_t _S_rep_bits = sizeof(__rep) * 8; private: __rep _M_val = 0; unsigned _M_msb:1 = 0; constexpr explicit __max_size_type(__rep __val, int __msb) noexcept : _M_val(__val), _M_msb(__msb) { } friend __max_diff_type; friend std::numeric_limits<__max_size_type>; friend std::numeric_limits<__max_diff_type>; }; class __max_diff_type { public: __max_diff_type() = default; template requires integral<_Tp> || __is_int128<_Tp> constexpr __max_diff_type(_Tp __i) noexcept : _M_rep(__i) { } constexpr explicit __max_diff_type(const __max_size_type& __d) noexcept : _M_rep(__d) { } template requires integral<_Tp> || __is_int128<_Tp> constexpr explicit operator _Tp() const noexcept { return static_cast<_Tp>(_M_rep); } constexpr explicit operator bool() const noexcept { return _M_rep != 0; } constexpr __max_diff_type operator+() const noexcept { return *this; } constexpr __max_diff_type operator-() const noexcept { return __max_diff_type(-_M_rep); } constexpr __max_diff_type operator~() const noexcept { return __max_diff_type(~_M_rep); } constexpr __max_diff_type& operator++() noexcept { return *this += 1; } constexpr __max_diff_type operator++(int) noexcept { auto __tmp = *this; ++*this; return __tmp; } constexpr __max_diff_type& operator--() noexcept { return *this -= 1; } constexpr __max_diff_type operator--(int) noexcept { auto __tmp = *this; --*this; return __tmp; } constexpr __max_diff_type& operator+=(const __max_diff_type& __r) noexcept { _M_rep += __r._M_rep; return *this; } constexpr __max_diff_type& operator-=(const __max_diff_type& __r) noexcept { _M_rep -= __r._M_rep; return *this; } constexpr __max_diff_type& operator*=(const __max_diff_type& __r) noexcept { _M_rep *= __r._M_rep; return *this; } constexpr __max_diff_type& operator/=(const __max_diff_type& __r) noexcept { do { if (std::__is_constant_evaluated() && !bool(__r != 0)) std::__glibcxx_assert_fail(); } while (false); const bool __neg = *this < 0; const bool __rneg = __r < 0; if (!__neg && !__rneg) _M_rep = _M_rep / __r._M_rep; else if (__neg && __rneg) _M_rep = -_M_rep / -__r._M_rep; else if (__neg && !__rneg) _M_rep = -(-_M_rep / __r._M_rep); else _M_rep = -(_M_rep / -__r._M_rep); return *this ; } constexpr __max_diff_type& operator%=(const __max_diff_type& __r) noexcept { do { if (std::__is_constant_evaluated() && !bool(__r != 0)) std::__glibcxx_assert_fail(); } while (false); if (*this >= 0 && __r > 0) _M_rep %= __r._M_rep; else *this -= (*this / __r) * __r; return *this; } constexpr __max_diff_type& operator<<=(const __max_diff_type& __r) noexcept { _M_rep.operator<<=(__r._M_rep); return *this; } constexpr __max_diff_type& operator>>=(const __max_diff_type& __r) noexcept { const auto __msb = _M_rep._M_msb; _M_rep >>= __r._M_rep; if (__msb) _M_rep |= ~(__max_size_type(-1) >> __r._M_rep); return *this; } constexpr __max_diff_type& operator&=(const __max_diff_type& __r) noexcept { _M_rep &= __r._M_rep; return *this; } constexpr __max_diff_type& operator|=(const __max_diff_type& __r) noexcept { _M_rep |= __r._M_rep; return *this; } constexpr __max_diff_type& operator^=(const __max_diff_type& __r) noexcept { _M_rep ^= __r._M_rep; return *this; } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator+=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a + __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator-=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a - __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator*=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a * __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator/=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a / __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator%=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a % __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator&=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a & __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator|=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a | __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator^=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a ^ __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator<<=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a << __b)); } template requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator>>=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a >> __b)); } friend constexpr __max_diff_type operator+(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l += __r; return __l; } friend constexpr __max_diff_type operator-(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l -= __r; return __l; } friend constexpr __max_diff_type operator*(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l *= __r; return __l; } friend constexpr __max_diff_type operator/(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l /= __r; return __l; } friend constexpr __max_diff_type operator%(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l %= __r; return __l; } friend constexpr __max_diff_type operator<<(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l <<= __r; return __l; } friend constexpr __max_diff_type operator>>(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l >>= __r; return __l; } friend constexpr __max_diff_type operator&(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l &= __r; return __l; } friend constexpr __max_diff_type operator|(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l |= __r; return __l; } friend constexpr __max_diff_type operator^(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l ^= __r; return __l; } friend constexpr bool operator==(const __max_diff_type& __l, const __max_diff_type& __r) noexcept { return __l._M_rep == __r._M_rep; } constexpr strong_ordering operator<=>(const __max_diff_type& __r) const noexcept { const auto __lsign = _M_rep._M_msb; const auto __rsign = __r._M_rep._M_msb; if (__lsign ^ __rsign) return __lsign ? strong_ordering::less : strong_ordering::greater; else return _M_rep <=> __r._M_rep; } # 755 "/usr/include/c++/15/bits/max_size_type.h" 3 private: __max_size_type _M_rep = 0; friend class __max_size_type; }; constexpr __max_size_type::__max_size_type(const __max_diff_type& __d) noexcept : __max_size_type(__d._M_rep) { } } } template<> struct numeric_limits { using _Sp = ranges::__detail::__max_size_type; static constexpr bool is_specialized = true; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int digits = __gnu_cxx::__int_traits<_Sp::__rep>::__digits + 1; static constexpr int digits10 = static_cast(digits * numbers::ln2 / numbers::ln10); static constexpr _Sp min() noexcept { return 0; } static constexpr _Sp max() noexcept { return _Sp(static_cast<_Sp::__rep>(-1), 1); } static constexpr _Sp lowest() noexcept { return min(); } }; template<> struct numeric_limits { using _Dp = ranges::__detail::__max_diff_type; using _Sp = ranges::__detail::__max_size_type; static constexpr bool is_specialized = true; static constexpr bool is_signed = true; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int digits = numeric_limits<_Sp>::digits - 1; static constexpr int digits10 = static_cast(digits * numbers::ln2 / numbers::ln10); static constexpr _Dp min() noexcept { return _Dp(_Sp(0, 1)); } static constexpr _Dp max() noexcept { return _Dp(_Sp(static_cast<_Sp::__rep>(-1), 0)); } static constexpr _Dp lowest() noexcept { return min(); } }; } # 42 "/usr/include/c++/15/bits/ranges_base.h" 2 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 43 "/usr/include/c++/15/bits/ranges_base.h" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" # 58 "/usr/include/c++/15/bits/ranges_base.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { namespace ranges { template inline constexpr bool disable_sized_range = false; template inline constexpr bool enable_borrowed_range = false; namespace __detail { constexpr __max_size_type __to_unsigned_like(__max_size_type __t) noexcept { return __t; } constexpr __max_size_type __to_unsigned_like(__max_diff_type __t) noexcept { return __max_size_type(__t); } template constexpr auto __to_unsigned_like(_Tp __t) noexcept { return static_cast>(__t); } # 94 "/usr/include/c++/15/bits/ranges_base.h" 3 template using __make_unsigned_like_t = decltype(__detail::__to_unsigned_like(std::declval<_Tp>())); template concept __maybe_borrowed_range = is_lvalue_reference_v<_Tp> || enable_borrowed_range>; } namespace __access { using std::ranges::__detail::__maybe_borrowed_range; using std::__detail::__range_iter_t; struct _Begin { private: template static constexpr bool _S_noexcept() { if constexpr (is_array_v>) return true; else if constexpr (__member_begin<_Tp>) return noexcept(__decay_copy(std::declval<_Tp&>().begin())); else return noexcept(__decay_copy(begin(std::declval<_Tp&>()))); } public: template<__maybe_borrowed_range _Tp> requires is_array_v> || __member_begin<_Tp> || __adl_begin<_Tp> constexpr auto operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>()) { if constexpr (is_array_v>) { static_assert(is_lvalue_reference_v<_Tp>); return __t + 0; } else if constexpr (__member_begin<_Tp>) return __t.begin(); else return begin(__t); } }; template concept __member_end = requires(_Tp& __t) { { __decay_copy(__t.end()) } -> sentinel_for<__range_iter_t<_Tp>>; }; void end() = delete; template concept __adl_end = __class_or_enum> && requires(_Tp& __t) { { __decay_copy(end(__t)) } -> sentinel_for<__range_iter_t<_Tp>>; }; struct _End { private: template static constexpr bool _S_noexcept() { if constexpr (is_bounded_array_v>) return true; else if constexpr (__member_end<_Tp>) return noexcept(__decay_copy(std::declval<_Tp&>().end())); else return noexcept(__decay_copy(end(std::declval<_Tp&>()))); } public: template<__maybe_borrowed_range _Tp> requires is_bounded_array_v> || __member_end<_Tp> || __adl_end<_Tp> constexpr auto operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>()) { if constexpr (is_bounded_array_v>) { static_assert(is_lvalue_reference_v<_Tp>); return __t + extent_v>; } else if constexpr (__member_end<_Tp>) return __t.end(); else return end(__t); } }; template concept __member_rbegin = requires(_Tp& __t) { { __decay_copy(__t.rbegin()) } -> input_or_output_iterator; }; void rbegin() = delete; template concept __adl_rbegin = __class_or_enum> && requires(_Tp& __t) { { __decay_copy(rbegin(__t)) } -> input_or_output_iterator; }; template concept __reversable = requires(_Tp& __t) { { _Begin{}(__t) } -> bidirectional_iterator; { _End{}(__t) } -> same_as; }; struct _RBegin { private: template static constexpr bool _S_noexcept() { if constexpr (__member_rbegin<_Tp>) return noexcept(__decay_copy(std::declval<_Tp&>().rbegin())); else if constexpr (__adl_rbegin<_Tp>) return noexcept(__decay_copy(rbegin(std::declval<_Tp&>()))); else { if constexpr (noexcept(_End{}(std::declval<_Tp&>()))) { using _It = decltype(_End{}(std::declval<_Tp&>())); return is_nothrow_copy_constructible_v<_It>; } else return false; } } public: template<__maybe_borrowed_range _Tp> requires __member_rbegin<_Tp> || __adl_rbegin<_Tp> || __reversable<_Tp> constexpr auto operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>()) { if constexpr (__member_rbegin<_Tp>) return __t.rbegin(); else if constexpr (__adl_rbegin<_Tp>) return rbegin(__t); else return std::make_reverse_iterator(_End{}(__t)); } }; template concept __member_rend = requires(_Tp& __t) { { __decay_copy(__t.rend()) } -> sentinel_for(__t)))>; }; void rend() = delete; template concept __adl_rend = __class_or_enum> && requires(_Tp& __t) { { __decay_copy(rend(__t)) } -> sentinel_for(__t)))>; }; struct _REnd { private: template static constexpr bool _S_noexcept() { if constexpr (__member_rend<_Tp>) return noexcept(__decay_copy(std::declval<_Tp&>().rend())); else if constexpr (__adl_rend<_Tp>) return noexcept(__decay_copy(rend(std::declval<_Tp&>()))); else { if constexpr (noexcept(_Begin{}(std::declval<_Tp&>()))) { using _It = decltype(_Begin{}(std::declval<_Tp&>())); return is_nothrow_copy_constructible_v<_It>; } else return false; } } public: template<__maybe_borrowed_range _Tp> requires __member_rend<_Tp> || __adl_rend<_Tp> || __reversable<_Tp> constexpr auto operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>()) { if constexpr (__member_rend<_Tp>) return __t.rend(); else if constexpr (__adl_rend<_Tp>) return rend(__t); else return std::make_reverse_iterator(_Begin{}(__t)); } }; template concept __member_size = !disable_sized_range> && requires(_Tp& __t) { { __decay_copy(__t.size()) } -> __detail::__is_integer_like; }; void size() = delete; template concept __adl_size = __class_or_enum> && !disable_sized_range> && requires(_Tp& __t) { { __decay_copy(size(__t)) } -> __detail::__is_integer_like; }; template concept __sentinel_size = requires(_Tp& __t) { requires (!is_unbounded_array_v>); { _Begin{}(__t) } -> forward_iterator; { _End{}(__t) } -> sized_sentinel_for; __detail::__to_unsigned_like(_End{}(__t) - _Begin{}(__t)); }; struct _Size { private: template static constexpr bool _S_noexcept() { if constexpr (is_bounded_array_v>) return true; else if constexpr (__member_size<_Tp>) return noexcept(__decay_copy(std::declval<_Tp&>().size())); else if constexpr (__adl_size<_Tp>) return noexcept(__decay_copy(size(std::declval<_Tp&>()))); else if constexpr (__sentinel_size<_Tp>) return noexcept(_End{}(std::declval<_Tp&>()) - _Begin{}(std::declval<_Tp&>())); } public: template requires is_bounded_array_v> || __member_size<_Tp> || __adl_size<_Tp> || __sentinel_size<_Tp> constexpr auto operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>()) { if constexpr (is_bounded_array_v>) return extent_v>; else if constexpr (__member_size<_Tp>) return __t.size(); else if constexpr (__adl_size<_Tp>) return size(__t); else if constexpr (__sentinel_size<_Tp>) return __detail::__to_unsigned_like(_End{}(__t) - _Begin{}(__t)); } }; struct _SSize { template requires requires (_Tp& __t) { _Size{}(__t); } constexpr auto operator()[[nodiscard]](_Tp&& __t) const noexcept(noexcept(_Size{}(__t))) { auto __size = _Size{}(__t); using __size_type = decltype(__size); if constexpr (integral<__size_type>) { using __gnu_cxx::__int_traits; if constexpr (__int_traits<__size_type>::__digits < __int_traits::__digits) return static_cast(__size); else return static_cast>(__size); } else return __detail::__max_diff_type(__size); } }; template concept __member_empty = requires(_Tp& __t) { bool(__t.empty()); }; template concept __size0_empty = requires(_Tp& __t) { _Size{}(__t) == 0; }; template concept __eq_iter_empty = requires(_Tp& __t) { requires (!is_unbounded_array_v>); { _Begin{}(__t) } -> forward_iterator; bool(_Begin{}(__t) == _End{}(__t)); }; struct _Empty { private: template static constexpr bool _S_noexcept() { if constexpr (__member_empty<_Tp>) return noexcept(bool(std::declval<_Tp&>().empty())); else if constexpr (__size0_empty<_Tp>) return noexcept(_Size{}(std::declval<_Tp&>()) == 0); else return noexcept(bool(_Begin{}(std::declval<_Tp&>()) == _End{}(std::declval<_Tp&>()))); } public: template requires __member_empty<_Tp> || __size0_empty<_Tp> || __eq_iter_empty<_Tp> constexpr bool operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>()) { if constexpr (__member_empty<_Tp>) return bool(__t.empty()); else if constexpr (__size0_empty<_Tp>) return _Size{}(__t) == 0; else return bool(_Begin{}(__t) == _End{}(__t)); } }; template concept __pointer_to_object = is_pointer_v<_Tp> && is_object_v>; template concept __member_data = requires(_Tp& __t) { { __decay_copy(__t.data()) } -> __pointer_to_object; }; template concept __begin_data = contiguous_iterator<__range_iter_t<_Tp>>; struct _Data { private: template static constexpr bool _S_noexcept() { if constexpr (__member_data<_Tp>) return noexcept(__decay_copy(std::declval<_Tp&>().data())); else return noexcept(_Begin{}(std::declval<_Tp&>())); } public: template<__maybe_borrowed_range _Tp> requires __member_data<_Tp> || __begin_data<_Tp> constexpr auto operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp>()) { if constexpr (__member_data<_Tp>) return __t.data(); else return std::to_address(_Begin{}(__t)); } }; } inline namespace _Cpo { inline constexpr ranges::__access::_Begin begin{}; inline constexpr ranges::__access::_End end{}; inline constexpr ranges::__access::_RBegin rbegin{}; inline constexpr ranges::__access::_REnd rend{}; inline constexpr ranges::__access::_Size size{}; inline constexpr ranges::__access::_SSize ssize{}; inline constexpr ranges::__access::_Empty empty{}; inline constexpr ranges::__access::_Data data{}; } template concept range = requires(_Tp& __t) { ranges::begin(__t); ranges::end(__t); }; template concept borrowed_range = range<_Tp> && __detail::__maybe_borrowed_range<_Tp>; template using iterator_t = std::__detail::__range_iter_t<_Tp>; template using sentinel_t = decltype(ranges::end(std::declval<_Range&>())); template using range_const_reference_t = iter_const_reference_t>; template using range_difference_t = iter_difference_t>; template using range_value_t = iter_value_t>; template using range_reference_t = iter_reference_t>; template using range_rvalue_reference_t = iter_rvalue_reference_t>; template using range_common_reference_t = iter_common_reference_t>; template concept sized_range = range<_Tp> && requires(_Tp& __t) { ranges::size(__t); }; template using range_size_t = decltype(ranges::size(std::declval<_Range&>())); template requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>> class view_interface; namespace __detail { template requires (!same_as<_Tp, view_interface<_Up>>) void __is_derived_from_view_interface_fn(const _Tp&, const view_interface<_Up>&); template concept __is_derived_from_view_interface = requires (_Tp __t) { __is_derived_from_view_interface_fn(__t, __t); }; } struct view_base { }; template inline constexpr bool enable_view = derived_from<_Tp, view_base> || __detail::__is_derived_from_view_interface<_Tp>; template concept view = range<_Tp> && movable<_Tp> && enable_view<_Tp>; template concept output_range = range<_Range> && output_iterator, _Tp>; template concept input_range = range<_Tp> && input_iterator>; template concept forward_range = input_range<_Tp> && forward_iterator>; template concept bidirectional_range = forward_range<_Tp> && bidirectional_iterator>; template concept random_access_range = bidirectional_range<_Tp> && random_access_iterator>; template concept contiguous_range = random_access_range<_Tp> && contiguous_iterator> && requires(_Tp& __t) { { ranges::data(__t) } -> same_as>>; }; template concept common_range = range<_Tp> && same_as, sentinel_t<_Tp>>; template concept constant_range = input_range<_Tp> && std::__detail::__constant_iterator>; namespace __access { template constexpr auto& __possibly_const_range(_Range& __r) noexcept { if constexpr (input_range) return const_cast(__r); else return __r; } # 671 "/usr/include/c++/15/bits/ranges_base.h" 3 struct _CBegin { template<__maybe_borrowed_range _Tp> [[nodiscard]] constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(std::make_const_iterator (ranges::begin(__access::__possibly_const_range(__t))))) requires requires { std::make_const_iterator (ranges::begin(__access::__possibly_const_range(__t))); } { auto& __r = __access::__possibly_const_range(__t); return const_iterator(ranges::begin(__r)); } # 697 "/usr/include/c++/15/bits/ranges_base.h" 3 }; struct _CEnd final { template<__maybe_borrowed_range _Tp> [[nodiscard]] constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(std::make_const_sentinel (ranges::end(__access::__possibly_const_range(__t))))) requires requires { std::make_const_sentinel (ranges::end(__access::__possibly_const_range(__t))); } { auto& __r = __access::__possibly_const_range(__t); return const_sentinel(ranges::end(__r)); } # 725 "/usr/include/c++/15/bits/ranges_base.h" 3 }; struct _CRBegin { template<__maybe_borrowed_range _Tp> [[nodiscard]] constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(std::make_const_iterator (ranges::rbegin(__access::__possibly_const_range(__t))))) requires requires { std::make_const_iterator (ranges::rbegin(__access::__possibly_const_range(__t))); } { auto& __r = __access::__possibly_const_range(__t); return const_iterator(ranges::rbegin(__r)); } # 753 "/usr/include/c++/15/bits/ranges_base.h" 3 }; struct _CREnd { template<__maybe_borrowed_range _Tp> [[nodiscard]] constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(std::make_const_sentinel (ranges::rend(__access::__possibly_const_range(__t))))) requires requires { std::make_const_sentinel (ranges::rend(__access::__possibly_const_range(__t))); } { auto& __r = __access::__possibly_const_range(__t); return const_sentinel(ranges::rend(__r)); } # 781 "/usr/include/c++/15/bits/ranges_base.h" 3 }; struct _CData { template<__maybe_borrowed_range _Tp> [[nodiscard]] constexpr const auto* operator()(_Tp&& __t) const noexcept(noexcept(ranges::data(__access::__possibly_const_range(__t)))) requires requires { ranges::data(__access::__possibly_const_range(__t)); } { return ranges::data(__access::__possibly_const_range(__t)); } # 804 "/usr/include/c++/15/bits/ranges_base.h" 3 }; } inline namespace _Cpo { inline constexpr ranges::__access::_CBegin cbegin{}; inline constexpr ranges::__access::_CEnd cend{}; inline constexpr ranges::__access::_CRBegin crbegin{}; inline constexpr ranges::__access::_CREnd crend{}; inline constexpr ranges::__access::_CData cdata{}; } template using const_iterator_t = decltype(ranges::cbegin(std::declval<_Range&>())); template using const_sentinel_t = decltype(ranges::cend(std::declval<_Range&>())); namespace __detail { template inline constexpr bool __is_initializer_list = false; template inline constexpr bool __is_initializer_list> = true; } template concept viewable_range = range<_Tp> && ((view> && constructible_from, _Tp>) || (!view> && (is_lvalue_reference_v<_Tp> || (movable> && !__detail::__is_initializer_list>)))); struct __advance_fn final { template constexpr void operator()(_It& __it, iter_difference_t<_It> __n) const { if constexpr (random_access_iterator<_It>) __it += __n; else if constexpr (bidirectional_iterator<_It>) { if (__n > 0) { do { ++__it; } while (--__n); } else if (__n < 0) { do { --__it; } while (++__n); } } else { do { if (std::__is_constant_evaluated() && !bool(__n >= 0)) std::__glibcxx_assert_fail(); } while (false); while (__n-- > 0) ++__it; } } template _Sent> constexpr void operator()(_It& __it, _Sent __bound) const { if constexpr (assignable_from<_It&, _Sent>) __it = std::move(__bound); else if constexpr (sized_sentinel_for<_Sent, _It>) (*this)(__it, __bound - __it); else { while (__it != __bound) ++__it; } } template _Sent> constexpr iter_difference_t<_It> operator()(_It& __it, iter_difference_t<_It> __n, _Sent __bound) const { if constexpr (sized_sentinel_for<_Sent, _It>) { const auto __diff = __bound - __it; if (__diff == 0) return __n; else if (__diff > 0 ? __n >= __diff : __n <= __diff) { (*this)(__it, __bound); return __n - __diff; } else if (__n != 0) [[likely]] { do { if (std::__is_constant_evaluated() && !bool((__n < 0) == (__diff < 0))) std::__glibcxx_assert_fail(); } while (false); (*this)(__it, __n); return 0; } else return 0; } else if (__it == __bound || __n == 0) return __n; else if (__n > 0) { iter_difference_t<_It> __m = 0; do { ++__it; ++__m; } while (__m != __n && __it != __bound); return __n - __m; } else if constexpr (bidirectional_iterator<_It> && same_as<_It, _Sent>) { iter_difference_t<_It> __m = 0; do { --__it; --__m; } while (__m != __n && __it != __bound); return __n - __m; } else { do { if (std::__is_constant_evaluated() && !bool(__n >= 0)) std::__glibcxx_assert_fail(); } while (false); return __n; } } void operator&() const = delete; }; inline constexpr __advance_fn advance{}; struct __distance_fn final { template _Sent> requires (!sized_sentinel_for<_Sent, _It>) constexpr iter_difference_t<_It> operator()[[nodiscard]](_It __first, _Sent __last) const { iter_difference_t<_It> __n = 0; while (__first != __last) { ++__first; ++__n; } return __n; } template> _Sent> [[nodiscard]] constexpr iter_difference_t> operator()(_It&& __first, _Sent __last) const { return __last - static_cast&>(__first); } template [[nodiscard]] constexpr range_difference_t<_Range> operator()(_Range&& __r) const { if constexpr (sized_range<_Range>) return static_cast>(ranges::size(__r)); else return (*this)(ranges::begin(__r), ranges::end(__r)); } void operator&() const = delete; }; inline constexpr __distance_fn distance{}; struct __next_fn final { template [[nodiscard]] constexpr _It operator()(_It __x) const { ++__x; return __x; } template [[nodiscard]] constexpr _It operator()(_It __x, iter_difference_t<_It> __n) const { ranges::advance(__x, __n); return __x; } template _Sent> [[nodiscard]] constexpr _It operator()(_It __x, _Sent __bound) const { ranges::advance(__x, __bound); return __x; } template _Sent> [[nodiscard]] constexpr _It operator()(_It __x, iter_difference_t<_It> __n, _Sent __bound) const { ranges::advance(__x, __n, __bound); return __x; } void operator&() const = delete; }; inline constexpr __next_fn next{}; struct __prev_fn final { template [[nodiscard]] constexpr _It operator()(_It __x) const { --__x; return __x; } template [[nodiscard]] constexpr _It operator()(_It __x, iter_difference_t<_It> __n) const { ranges::advance(__x, -__n); return __x; } template [[nodiscard]] constexpr _It operator()(_It __x, iter_difference_t<_It> __n, _It __bound) const { ranges::advance(__x, -__n, __bound); return __x; } void operator&() const = delete; }; inline constexpr __prev_fn prev{}; struct dangling { constexpr dangling() noexcept = default; template constexpr dangling(_Args&&...) noexcept { } }; template using borrowed_iterator_t = __conditional_t, iterator_t<_Range>, dangling>; } struct from_range_t { explicit from_range_t() = default; }; inline constexpr from_range_t from_range{}; template struct pair; namespace __detail { template concept __container_compatible_range = ranges::input_range<_Rg> && convertible_to, _Tp>; template using __range_key_type = remove_const_t>>; template using __range_mapped_type = tuple_element_t<1, ranges::range_value_t<_Range>>; template using __range_to_alloc_type = pair, __range_mapped_type<_Range>>; } } #pragma GCC diagnostic pop # 35 "/usr/include/c++/15/bits/ranges_util.h" 2 3 # 43 "/usr/include/c++/15/bits/ranges_util.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { namespace ranges { namespace __detail { template concept __simple_view = view<_Range> && range && same_as, iterator_t> && same_as, sentinel_t>; template concept __has_arrow = input_iterator<_It> && (is_pointer_v<_It> || requires(const _It __it) { __it.operator->(); }); using std::__detail::__different_from; } template requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>> class view_interface { private: constexpr _Derived& _M_derived() noexcept { static_assert(derived_from<_Derived, view_interface<_Derived>>); static_assert(view<_Derived>); return static_cast<_Derived&>(*this); } constexpr const _Derived& _M_derived() const noexcept { static_assert(derived_from<_Derived, view_interface<_Derived>>); static_assert(view<_Derived>); return static_cast(*this); } static constexpr bool _S_bool(bool) noexcept; template static constexpr bool _S_empty(_Tp& __t) noexcept(noexcept(_S_bool(ranges::begin(__t) == ranges::end(__t)))) { return ranges::begin(__t) == ranges::end(__t); } template static constexpr auto _S_size(_Tp& __t) noexcept(noexcept(ranges::end(__t) - ranges::begin(__t))) { return ranges::end(__t) - ranges::begin(__t); } public: constexpr bool empty() noexcept(noexcept(_S_empty(_M_derived()))) requires forward_range<_Derived> && (!sized_range<_Derived>) { return _S_empty(_M_derived()); } constexpr bool empty() noexcept(noexcept(ranges::size(_M_derived()) == 0)) requires sized_range<_Derived> { return ranges::size(_M_derived()) == 0; } constexpr bool empty() const noexcept(noexcept(_S_empty(_M_derived()))) requires forward_range && (!sized_range) { return _S_empty(_M_derived()); } constexpr bool empty() const noexcept(noexcept(ranges::size(_M_derived()) == 0)) requires sized_range { return ranges::size(_M_derived()) == 0; } constexpr explicit operator bool() noexcept(noexcept(ranges::empty(_M_derived()))) requires requires { ranges::empty(_M_derived()); } { return !ranges::empty(_M_derived()); } constexpr explicit operator bool() const noexcept(noexcept(ranges::empty(_M_derived()))) requires requires { ranges::empty(_M_derived()); } { return !ranges::empty(_M_derived()); } constexpr auto data() noexcept(noexcept(ranges::begin(_M_derived()))) requires contiguous_iterator> { return std::to_address(ranges::begin(_M_derived())); } constexpr auto data() const noexcept(noexcept(ranges::begin(_M_derived()))) requires range && contiguous_iterator> { return std::to_address(ranges::begin(_M_derived())); } constexpr auto size() noexcept(noexcept(_S_size(_M_derived()))) requires forward_range<_Derived> && sized_sentinel_for, iterator_t<_Derived>> { return _S_size(_M_derived()); } constexpr auto size() const noexcept(noexcept(_S_size(_M_derived()))) requires forward_range && sized_sentinel_for, iterator_t> { return _S_size(_M_derived()); } constexpr decltype(auto) front() requires forward_range<_Derived> { do { if (std::__is_constant_evaluated() && !bool(!empty())) std::__glibcxx_assert_fail(); } while (false); return *ranges::begin(_M_derived()); } constexpr decltype(auto) front() const requires forward_range { do { if (std::__is_constant_evaluated() && !bool(!empty())) std::__glibcxx_assert_fail(); } while (false); return *ranges::begin(_M_derived()); } constexpr decltype(auto) back() requires bidirectional_range<_Derived> && common_range<_Derived> { do { if (std::__is_constant_evaluated() && !bool(!empty())) std::__glibcxx_assert_fail(); } while (false); return *ranges::prev(ranges::end(_M_derived())); } constexpr decltype(auto) back() const requires bidirectional_range && common_range { do { if (std::__is_constant_evaluated() && !bool(!empty())) std::__glibcxx_assert_fail(); } while (false); return *ranges::prev(ranges::end(_M_derived())); } template constexpr decltype(auto) operator[](range_difference_t<_Range> __n) { return ranges::begin(_M_derived())[__n]; } template constexpr decltype(auto) operator[](range_difference_t<_Range> __n) const { return ranges::begin(_M_derived())[__n]; } constexpr auto cbegin() requires input_range<_Derived> { return ranges::cbegin(_M_derived()); } constexpr auto cbegin() const requires input_range { return ranges::cbegin(_M_derived()); } constexpr auto cend() requires input_range<_Derived> { return ranges::cend(_M_derived()); } constexpr auto cend() const requires input_range { return ranges::cend(_M_derived()); } }; namespace __detail { template concept __uses_nonqualification_pointer_conversion = is_pointer_v<_From> && is_pointer_v<_To> && !convertible_to(*)[], remove_pointer_t<_To>(*)[]>; template concept __convertible_to_non_slicing = convertible_to<_From, _To> && !__uses_nonqualification_pointer_conversion, decay_t<_To>>; # 251 "/usr/include/c++/15/bits/ranges_util.h" 3 template concept __pair_like_convertible_from = !range<_Tp> && !is_reference_v<_Tp> && __pair_like<_Tp> && constructible_from<_Tp, _Up, _Vp> && __convertible_to_non_slicing<_Up, tuple_element_t<0, _Tp>> && convertible_to<_Vp, tuple_element_t<1, _Tp>>; } namespace views { struct _Drop; } enum class subrange_kind : bool { unsized, sized }; template _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized> requires (_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _It>) class subrange : public view_interface> { private: static constexpr bool _S_store_size = _Kind == subrange_kind::sized && !sized_sentinel_for<_Sent, _It>; friend struct views::_Drop; _It _M_begin = _It(); [[no_unique_address]] _Sent _M_end = _Sent(); using __size_type = __detail::__make_unsigned_like_t>; template struct _Size { [[__gnu__::__always_inline__]] constexpr _Size(_Tp = {}) { } }; template struct _Size<_Tp, true> { [[__gnu__::__always_inline__]] constexpr _Size(_Tp __s = {}) : _M_size(__s) { } _Tp _M_size; }; [[no_unique_address]] _Size<__size_type> _M_size = {}; public: subrange() requires default_initializable<_It> = default; constexpr subrange(__detail::__convertible_to_non_slicing<_It> auto __i, _Sent __s) noexcept(is_nothrow_constructible_v<_It, decltype(__i)> && is_nothrow_constructible_v<_Sent, _Sent&>) requires (!_S_store_size) : _M_begin(std::move(__i)), _M_end(__s) { } constexpr subrange(__detail::__convertible_to_non_slicing<_It> auto __i, _Sent __s, __size_type __n) noexcept(is_nothrow_constructible_v<_It, decltype(__i)> && is_nothrow_constructible_v<_Sent, _Sent&>) requires (_Kind == subrange_kind::sized) : _M_begin(std::move(__i)), _M_end(__s), _M_size(__n) { } template<__detail::__different_from _Rng> requires borrowed_range<_Rng> && __detail::__convertible_to_non_slicing, _It> && convertible_to, _Sent> constexpr subrange(_Rng&& __r) noexcept(noexcept(subrange(__r, ranges::size(__r)))) requires _S_store_size && sized_range<_Rng> : subrange(__r, ranges::size(__r)) { } template<__detail::__different_from _Rng> requires borrowed_range<_Rng> && __detail::__convertible_to_non_slicing, _It> && convertible_to, _Sent> constexpr subrange(_Rng&& __r) noexcept(noexcept(subrange(ranges::begin(__r), ranges::end(__r)))) requires (!_S_store_size) : subrange(ranges::begin(__r), ranges::end(__r)) { } template requires __detail::__convertible_to_non_slicing, _It> && convertible_to, _Sent> constexpr subrange(_Rng&& __r, __size_type __n) noexcept(noexcept(subrange(ranges::begin(__r), ranges::end(__r), __n))) requires (_Kind == subrange_kind::sized) : subrange{ranges::begin(__r), ranges::end(__r), __n} { } template<__detail::__different_from _PairLike> requires __detail::__pair_like_convertible_from<_PairLike, const _It&, const _Sent&> constexpr operator _PairLike() const { return _PairLike(_M_begin, _M_end); } constexpr _It begin() const requires copyable<_It> { return _M_begin; } [[nodiscard]] constexpr _It begin() requires (!copyable<_It>) { return std::move(_M_begin); } constexpr _Sent end() const { return _M_end; } constexpr bool empty() const { return _M_begin == _M_end; } constexpr __size_type size() const requires (_Kind == subrange_kind::sized) { if constexpr (_S_store_size) return _M_size._M_size; else return __detail::__to_unsigned_like(_M_end - _M_begin); } [[nodiscard]] constexpr subrange next(iter_difference_t<_It> __n = 1) const & requires forward_iterator<_It> { auto __tmp = *this; __tmp.advance(__n); return __tmp; } [[nodiscard]] constexpr subrange next(iter_difference_t<_It> __n = 1) && { advance(__n); return std::move(*this); } [[nodiscard]] constexpr subrange prev(iter_difference_t<_It> __n = 1) const requires bidirectional_iterator<_It> { auto __tmp = *this; __tmp.advance(-__n); return __tmp; } constexpr subrange& advance(iter_difference_t<_It> __n) { if constexpr (bidirectional_iterator<_It>) if (__n < 0) { ranges::advance(_M_begin, __n); if constexpr (_S_store_size) _M_size._M_size += __detail::__to_unsigned_like(-__n); return *this; } do { if (std::__is_constant_evaluated() && !bool(__n >= 0)) std::__glibcxx_assert_fail(); } while (false); auto __d = __n - ranges::advance(_M_begin, __n, _M_end); if constexpr (_S_store_size) _M_size._M_size -= __detail::__to_unsigned_like(__d); return *this; } }; template _Sent> subrange(_It, _Sent) -> subrange<_It, _Sent>; template _Sent> subrange(_It, _Sent, __detail::__make_unsigned_like_t>) -> subrange<_It, _Sent, subrange_kind::sized>; template subrange(_Rng&&) -> subrange, sentinel_t<_Rng>, (sized_range<_Rng> || sized_sentinel_for, iterator_t<_Rng>>) ? subrange_kind::sized : subrange_kind::unsized>; template subrange(_Rng&&, __detail::__make_unsigned_like_t>) -> subrange, sentinel_t<_Rng>, subrange_kind::sized>; template requires ((_Num == 0 && copyable<_It>) || _Num == 1) constexpr auto get(const subrange<_It, _Sent, _Kind>& __r) { if constexpr (_Num == 0) return __r.begin(); else return __r.end(); } template requires (_Num < 2) constexpr auto get(subrange<_It, _Sent, _Kind>&& __r) { if constexpr (_Num == 0) return __r.begin(); else return __r.end(); } template inline constexpr bool enable_borrowed_range> = true; template using borrowed_subrange_t = __conditional_t, subrange>, dangling>; template inline constexpr bool __detail::__is_subrange> = true; } template inline constexpr bool __is_tuple_like_v> = true; namespace ranges { struct __find_fn { template _Sent, typename _Proj = identity, typename _Tp > requires indirect_binary_predicate, const _Tp*> constexpr _Iter operator()(_Iter __first, _Sent __last, const _Tp& __value, _Proj __proj = {}) const { if constexpr (is_same_v<_Proj, identity>) if constexpr(__can_use_memchr_for_find, _Tp>) if constexpr (sized_sentinel_for<_Sent, _Iter>) if constexpr (contiguous_iterator<_Iter>) if (!is_constant_evaluated()) { using _Vt = iter_value_t<_Iter>; auto __n = __last - __first; if (static_cast<_Vt>(__value) == __value) [[likely]] if (__n > 0) { const size_t __nu = static_cast(__n); const int __ival = static_cast(__value); const void* __p0 = std::to_address(__first); if (auto __p1 = __builtin_memchr(__p0, __ival, __nu)) __n = (const char*)__p1 - (const char*)__p0; } return __first + __n; } while (__first != __last && !(std::__invoke(__proj, *__first) == __value)) ++__first; return __first; } template requires indirect_binary_predicate, _Proj>, const _Tp*> constexpr borrowed_iterator_t<_Range> operator()(_Range&& __r, const _Tp& __value, _Proj __proj = {}) const { return (*this)(ranges::begin(__r), ranges::end(__r), __value, std::move(__proj)); } }; inline constexpr __find_fn find{}; struct __find_if_fn { template _Sent, typename _Proj = identity, indirect_unary_predicate> _Pred> constexpr _Iter operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const { while (__first != __last && !(bool)std::__invoke(__pred, std::__invoke(__proj, *__first))) ++__first; return __first; } template, _Proj>> _Pred> constexpr borrowed_iterator_t<_Range> operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const { return (*this)(ranges::begin(__r), ranges::end(__r), std::move(__pred), std::move(__proj)); } }; inline constexpr __find_if_fn find_if{}; struct __find_if_not_fn { template _Sent, typename _Proj = identity, indirect_unary_predicate> _Pred> constexpr _Iter operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const { while (__first != __last && (bool)std::__invoke(__pred, std::__invoke(__proj, *__first))) ++__first; return __first; } template, _Proj>> _Pred> constexpr borrowed_iterator_t<_Range> operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const { return (*this)(ranges::begin(__r), ranges::end(__r), std::move(__pred), std::move(__proj)); } }; inline constexpr __find_if_not_fn find_if_not{}; template struct in_in_result { [[no_unique_address]] _Iter1 in1; [[no_unique_address]] _Iter2 in2; template requires convertible_to && convertible_to constexpr operator in_in_result<_IIter1, _IIter2>() const & { return {in1, in2}; } template requires convertible_to<_Iter1, _IIter1> && convertible_to<_Iter2, _IIter2> constexpr operator in_in_result<_IIter1, _IIter2>() && { return {std::move(in1), std::move(in2)}; } }; template using mismatch_result = in_in_result<_Iter1, _Iter2>; struct __mismatch_fn { template _Sent1, input_iterator _Iter2, sentinel_for<_Iter2> _Sent2, typename _Pred = ranges::equal_to, typename _Proj1 = identity, typename _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> constexpr mismatch_result<_Iter1, _Iter2> operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { while (__first1 != __last1 && __first2 != __last2 && (bool)std::__invoke(__pred, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2))) { ++__first1; ++__first2; } return { std::move(__first1), std::move(__first2) }; } template requires indirectly_comparable, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> constexpr mismatch_result, iterator_t<_Range2>> operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { return (*this)(ranges::begin(__r1), ranges::end(__r1), ranges::begin(__r2), ranges::end(__r2), std::move(__pred), std::move(__proj1), std::move(__proj2)); } }; inline constexpr __mismatch_fn mismatch{}; struct __search_fn { template _Sent1, forward_iterator _Iter2, sentinel_for<_Iter2> _Sent2, typename _Pred = ranges::equal_to, typename _Proj1 = identity, typename _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> constexpr subrange<_Iter1> operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { if (__first1 == __last1 || __first2 == __last2) return {__first1, __first1}; for (;;) { for (;;) { if (__first1 == __last1) return {__first1, __first1}; if (std::__invoke(__pred, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2))) break; ++__first1; } auto __cur1 = __first1; auto __cur2 = __first2; for (;;) { if (++__cur2 == __last2) return {__first1, ++__cur1}; if (++__cur1 == __last1) return {__cur1, __cur1}; if (!(bool)std::__invoke(__pred, std::__invoke(__proj1, *__cur1), std::__invoke(__proj2, *__cur2))) { ++__first1; break; } } } } template requires indirectly_comparable, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> constexpr borrowed_subrange_t<_Range1> operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { return (*this)(ranges::begin(__r1), ranges::end(__r1), ranges::begin(__r2), ranges::end(__r2), std::move(__pred), std::move(__proj1), std::move(__proj2)); } }; inline constexpr __search_fn search{}; struct __min_fn { template> _Comp = ranges::less> constexpr const _Tp& operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const { if (std::__invoke(__comp, std::__invoke(__proj, __b), std::__invoke(__proj, __a))) return __b; else return __a; } template, _Proj>> _Comp = ranges::less> requires indirectly_copyable_storable, range_value_t<_Range>*> constexpr range_value_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const { auto __first = ranges::begin(__r); auto __last = ranges::end(__r); do { if (std::__is_constant_evaluated() && !bool(__first != __last)) std::__glibcxx_assert_fail(); } while (false); auto __result = *__first; while (++__first != __last) { auto&& __tmp = *__first; if (std::__invoke(__comp, std::__invoke(__proj, __tmp), std::__invoke(__proj, __result))) __result = std::forward(__tmp); } return __result; } template> _Comp = ranges::less> constexpr _Tp operator()(initializer_list<_Tp> __r, _Comp __comp = {}, _Proj __proj = {}) const { return (*this)(ranges::subrange(__r), std::move(__comp), std::move(__proj)); } }; inline constexpr __min_fn min{}; struct __adjacent_find_fn { template _Sent, typename _Proj = identity, indirect_binary_predicate, projected<_Iter, _Proj>> _Pred = ranges::equal_to> constexpr _Iter operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const { if (__first == __last) return __first; auto __next = __first; for (; ++__next != __last; __first = __next) { if (std::__invoke(__pred, std::__invoke(__proj, *__first), std::__invoke(__proj, *__next))) return __first; } return __next; } template, _Proj>, projected, _Proj>> _Pred = ranges::equal_to> constexpr borrowed_iterator_t<_Range> operator()(_Range&& __r, _Pred __pred = {}, _Proj __proj = {}) const { return (*this)(ranges::begin(__r), ranges::end(__r), std::move(__pred), std::move(__proj)); } }; inline constexpr __adjacent_find_fn adjacent_find{}; } using ranges::get; template struct tuple_size> : integral_constant { }; template struct tuple_element<0, ranges::subrange<_Iter, _Sent, _Kind>> { using type = _Iter; }; template struct tuple_element<1, ranges::subrange<_Iter, _Sent, _Kind>> { using type = _Sent; }; template struct tuple_element<0, const ranges::subrange<_Iter, _Sent, _Kind>> { using type = _Iter; }; template struct tuple_element<1, const ranges::subrange<_Iter, _Sent, _Kind>> { using type = _Sent; }; } # 47 "/usr/include/c++/15/tuple" 2 3 # 57 "/usr/include/c++/15/tuple" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 58 "/usr/include/c++/15/tuple" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template class tuple; template struct __is_empty_non_tuple : is_empty<_Tp> { }; template struct __is_empty_non_tuple> : false_type { }; template using __empty_not_final = __conditional_t<__is_final(_Tp), false_type, __is_empty_non_tuple<_Tp>>; template::value> struct _Head_base; template struct _Head_base<_Idx, _Head, true> { constexpr _Head_base() : _M_head_impl() { } constexpr _Head_base(const _Head& __h) : _M_head_impl(__h) { } constexpr _Head_base(const _Head_base&) = default; constexpr _Head_base(_Head_base&&) = default; template constexpr _Head_base(_UHead&& __h) : _M_head_impl(std::forward<_UHead>(__h)) { } constexpr _Head_base(allocator_arg_t, __uses_alloc0) : _M_head_impl() { } template constexpr _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a) : _M_head_impl(allocator_arg, *__a._M_a) { } template constexpr _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a) : _M_head_impl(*__a._M_a) { } template constexpr _Head_base(__uses_alloc0, _UHead&& __uhead) : _M_head_impl(std::forward<_UHead>(__uhead)) { } template constexpr _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead) : _M_head_impl(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead)) { } template constexpr _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead) : _M_head_impl(std::forward<_UHead>(__uhead), *__a._M_a) { } static constexpr _Head& _M_head(_Head_base& __b) noexcept { return __b._M_head_impl; } static constexpr const _Head& _M_head(const _Head_base& __b) noexcept { return __b._M_head_impl; } [[__no_unique_address__]] _Head _M_head_impl; }; # 199 "/usr/include/c++/15/tuple" 3 template struct _Head_base<_Idx, _Head, false> { constexpr _Head_base() : _M_head_impl() { } constexpr _Head_base(const _Head& __h) : _M_head_impl(__h) { } constexpr _Head_base(const _Head_base&) = default; constexpr _Head_base(_Head_base&&) = default; template constexpr _Head_base(_UHead&& __h) : _M_head_impl(std::forward<_UHead>(__h)) { } constexpr _Head_base(allocator_arg_t, __uses_alloc0) : _M_head_impl() { } template constexpr _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a) : _M_head_impl(allocator_arg, *__a._M_a) { } template constexpr _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a) : _M_head_impl(*__a._M_a) { } template constexpr _Head_base(__uses_alloc0, _UHead&& __uhead) : _M_head_impl(std::forward<_UHead>(__uhead)) { } template constexpr _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead) : _M_head_impl(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead)) { } template constexpr _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead) : _M_head_impl(std::forward<_UHead>(__uhead), *__a._M_a) { } static constexpr _Head& _M_head(_Head_base& __b) noexcept { return __b._M_head_impl; } static constexpr const _Head& _M_head(const _Head_base& __b) noexcept { return __b._M_head_impl; } _Head _M_head_impl; }; struct __tuple_like_tag_t { explicit __tuple_like_tag_t() = default; }; template constexpr _Cat __tuple_cmp(const _Tp& __t, const _Up& __u, _IndexSeq); # 272 "/usr/include/c++/15/tuple" 3 template struct _Tuple_impl; template struct _Tuple_impl<_Idx, _Head, _Tail...> : public _Tuple_impl<_Idx + 1, _Tail...>, private _Head_base<_Idx, _Head> { template friend struct _Tuple_impl; typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited; typedef _Head_base<_Idx, _Head> _Base; static constexpr _Head& _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } static constexpr const _Head& _M_head(const _Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } static constexpr _Inherited& _M_tail(_Tuple_impl& __t) noexcept { return __t; } static constexpr const _Inherited& _M_tail(const _Tuple_impl& __t) noexcept { return __t; } constexpr _Tuple_impl() : _Inherited(), _Base() { } explicit constexpr _Tuple_impl(const _Head& __head, const _Tail&... __tail) : _Inherited(__tail...), _Base(__head) { } template> explicit constexpr _Tuple_impl(_UHead&& __head, _UTail&&... __tail) : _Inherited(std::forward<_UTail>(__tail)...), _Base(std::forward<_UHead>(__head)) { } constexpr _Tuple_impl(const _Tuple_impl&) = default; _Tuple_impl& operator=(const _Tuple_impl&) = delete; _Tuple_impl(_Tuple_impl&&) = default; template constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in) : _Inherited(_Tuple_impl<_Idx, _UElements...>::_M_tail(__in)), _Base(_Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { } template constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) : _Inherited(std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))), _Base(std::forward<_UHead> (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } template constexpr _Tuple_impl(_Tuple_impl<_Idx, _UElements...>& __in) : _Inherited(_Tuple_impl<_Idx, _UElements...>::_M_tail(__in)), _Base(_Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { } template constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UHead, _UTails...>&& __in) : _Inherited(std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))), _Base(std::forward (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } template constexpr _Tuple_impl(__tuple_like_tag_t, _UTuple&& __u, index_sequence<_Is...>) : _Tuple_impl(std::get<_Is>(std::forward<_UTuple>(__u))...) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a), _Base(__tag, __use_alloc<_Head>(__a)) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Head& __head, const _Tail&... __tail) : _Inherited(__tag, __a, __tail...), _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) { } template> constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _UHead&& __head, _UTail&&... __tail) : _Inherited(__tag, __a, std::forward<_UTail>(__tail)...), _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), std::forward<_UHead>(__head)) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Tuple_impl& __in) : _Inherited(__tag, __a, _M_tail(__in)), _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _Tuple_impl&& __in) : _Inherited(__tag, __a, std::move(_M_tail(__in))), _Base(__use_alloc<_Head, _Alloc, _Head>(__a), std::forward<_Head>(_M_head(__in))) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Tuple_impl<_Idx, _UHead, _UTails...>& __in) : _Inherited(__tag, __a, _Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in)), _Base(__use_alloc<_Head, _Alloc, const _UHead&>(__a), _Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _Tuple_impl<_Idx, _UHead, _UTails...>&& __in) : _Inherited(__tag, __a, std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))), _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), std::forward<_UHead> (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _Tuple_impl<_Idx, _UHead, _UTails...>& __in) : _Inherited(__tag, __a, _Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in)), _Base(__use_alloc<_Head, _Alloc, _UHead&>(__a), _Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Tuple_impl<_Idx, _UHead, _UTails...>&& __in) : _Inherited(__tag, __a, std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))), _Base(__use_alloc<_Head, _Alloc, const _UHead>(__a), std::forward (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } template constexpr _Tuple_impl(__tuple_like_tag_t, allocator_arg_t __tag, const _Alloc& __a, _UTuple&& __u, index_sequence<_Is...>) : _Tuple_impl(__tag, __a, std::get<_Is>(std::forward<_UTuple>(__u))...) { } template constexpr void _M_assign(const _Tuple_impl<_Idx, _UElements...>& __in) { _M_head(*this) = _Tuple_impl<_Idx, _UElements...>::_M_head(__in); _M_tail(*this)._M_assign( _Tuple_impl<_Idx, _UElements...>::_M_tail(__in)); } template constexpr void _M_assign(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) { _M_head(*this) = std::forward<_UHead> (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)); _M_tail(*this)._M_assign( std::move(_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))); } template constexpr void _M_assign(const _Tuple_impl<_Idx, _UElements...>& __in) const { _M_head(*this) = _Tuple_impl<_Idx, _UElements...>::_M_head(__in); _M_tail(*this)._M_assign( _Tuple_impl<_Idx, _UElements...>::_M_tail(__in)); } template constexpr void _M_assign(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) const { _M_head(*this) = std::forward<_UHead> (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)); _M_tail(*this)._M_assign( std::move(_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))); } template constexpr void _M_assign(__tuple_like_tag_t __tag, _UTuple&& __u) { _M_head(*this) = std::get<_Idx>(std::forward<_UTuple>(__u)); _M_tail(*this)._M_assign(__tag, std::forward<_UTuple>(__u)); } template constexpr void _M_assign(__tuple_like_tag_t __tag, _UTuple&& __u) const { _M_head(*this) = std::get<_Idx>(std::forward<_UTuple>(__u)); _M_tail(*this)._M_assign(__tag, std::forward<_UTuple>(__u)); } protected: constexpr void _M_swap(_Tuple_impl& __in) { using std::swap; swap(_M_head(*this), _M_head(__in)); _Inherited::_M_swap(_M_tail(__in)); } constexpr void _M_swap(const _Tuple_impl& __in) const { using std::swap; swap(_M_head(*this), _M_head(__in)); _Inherited::_M_swap(_M_tail(__in)); } }; template struct _Tuple_impl<_Idx, _Head> : private _Head_base<_Idx, _Head> { template friend struct _Tuple_impl; typedef _Head_base<_Idx, _Head> _Base; static constexpr _Head& _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } static constexpr const _Head& _M_head(const _Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } constexpr _Tuple_impl() : _Base() { } explicit constexpr _Tuple_impl(const _Head& __head) : _Base(__head) { } template explicit constexpr _Tuple_impl(_UHead&& __head) : _Base(std::forward<_UHead>(__head)) { } constexpr _Tuple_impl(const _Tuple_impl&) = default; _Tuple_impl& operator=(const _Tuple_impl&) = delete; constexpr _Tuple_impl(_Tuple_impl&& __in) noexcept(is_nothrow_move_constructible<_Head>::value) : _Base(static_cast<_Base&&>(__in)) { } template constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UHead>& __in) : _Base(_Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } template constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead>&& __in) : _Base(std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } template constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead>& __in) : _Base(_Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } template constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UHead>&& __in) : _Base(std::forward(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } template constexpr _Tuple_impl(__tuple_like_tag_t, _UTuple&& __u, index_sequence<0>) : _Tuple_impl(std::get<0>(std::forward<_UTuple>(__u))) { } template constexpr _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) : _Base(__tag, __use_alloc<_Head>(__a)) { } template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, const _Head& __head) : _Base(__use_alloc<_Head, _Alloc, const _Head&>(__a), __head) { } template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, _UHead&& __head) : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), std::forward<_UHead>(__head)) { } template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, const _Tuple_impl& __in) : _Base(__use_alloc<_Head, _Alloc, const _Head&>(__a), _M_head(__in)) { } template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple_impl&& __in) : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), std::forward<_Head>(_M_head(__in))) { } template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, const _Tuple_impl<_Idx, _UHead>& __in) : _Base(__use_alloc<_Head, _Alloc, const _UHead&>(__a), _Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple_impl<_Idx, _UHead>&& __in) : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple_impl<_Idx, _UHead>& __in) : _Base(__use_alloc<_Head, _Alloc, _UHead&>(__a), _Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } template constexpr _Tuple_impl(allocator_arg_t, const _Alloc& __a, const _Tuple_impl<_Idx, _UHead>&& __in) : _Base(__use_alloc<_Head, _Alloc, const _UHead>(__a), std::forward(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } template constexpr _Tuple_impl(__tuple_like_tag_t, allocator_arg_t __tag, const _Alloc& __a, _UTuple&& __u, index_sequence<0>) : _Tuple_impl(__tag, __a, std::get<0>(std::forward<_UTuple>(__u))) { } template constexpr void _M_assign(const _Tuple_impl<_Idx, _UHead>& __in) { _M_head(*this) = _Tuple_impl<_Idx, _UHead>::_M_head(__in); } template constexpr void _M_assign(_Tuple_impl<_Idx, _UHead>&& __in) { _M_head(*this) = std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)); } template constexpr void _M_assign(const _Tuple_impl<_Idx, _UHead>& __in) const { _M_head(*this) = _Tuple_impl<_Idx, _UHead>::_M_head(__in); } template constexpr void _M_assign(_Tuple_impl<_Idx, _UHead>&& __in) const { _M_head(*this) = std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)); } template constexpr void _M_assign(__tuple_like_tag_t, _UTuple&& __u) { _M_head(*this) = std::get<_Idx>(std::forward<_UTuple>(__u)); } template constexpr void _M_assign(__tuple_like_tag_t, _UTuple&& __u) const { _M_head(*this) = std::get<_Idx>(std::forward<_UTuple>(__u)); } protected: constexpr void _M_swap(_Tuple_impl& __in) { using std::swap; swap(_M_head(*this), _M_head(__in)); } constexpr void _M_swap(const _Tuple_impl& __in) const { using std::swap; swap(_M_head(*this), _M_head(__in)); } }; template struct _TupleConstraints { template using __constructible = __and_...>; template using __convertible = __and_...>; template static constexpr bool __is_implicitly_constructible() { return __and_<__constructible<_UTypes...>, __convertible<_UTypes...> >::value; } template static constexpr bool __is_explicitly_constructible() { return __and_<__constructible<_UTypes...>, __not_<__convertible<_UTypes...>> >::value; } static constexpr bool __is_implicitly_default_constructible() { return __and_... >::value; } static constexpr bool __is_explicitly_default_constructible() { return __and_..., __not_<__and_< std::__is_implicitly_default_constructible<_Types>...> >>::value; } }; template struct _TupleConstraints { template static constexpr bool __is_implicitly_constructible() { return false; } template static constexpr bool __is_explicitly_constructible() { return false; } }; template class tuple : public _Tuple_impl<0, _Elements...> { using _Inherited = _Tuple_impl<0, _Elements...>; template static consteval bool __constructible() { if constexpr (sizeof...(_UTypes) == sizeof...(_Elements)) return __and_v...>; else return false; } template static consteval bool __nothrow_constructible() { if constexpr (sizeof...(_UTypes) == sizeof...(_Elements)) return __and_v...>; else return false; } template static consteval bool __convertible() { if constexpr (sizeof...(_UTypes) == sizeof...(_Elements)) return __and_v...>; else return false; } template static consteval bool __disambiguating_constraint() { if constexpr (sizeof...(_Elements) != sizeof...(_UTypes)) return false; else if constexpr (sizeof...(_Elements) == 1) { using _U0 = typename _Nth_type<0, _UTypes...>::type; return !is_same_v, tuple>; } else if constexpr (sizeof...(_Elements) < 4) { using _U0 = typename _Nth_type<0, _UTypes...>::type; if constexpr (!is_same_v, allocator_arg_t>) return true; else { using _T0 = typename _Nth_type<0, _Elements...>::type; return is_same_v, allocator_arg_t>; } } return true; } template static consteval bool __use_other_ctor() { if constexpr (sizeof...(_Elements) != 1) return false; else if constexpr (is_same_v, tuple>) return true; else { using _Tp = typename _Nth_type<0, _Elements...>::type; if constexpr (is_convertible_v<_Tuple, _Tp>) return true; else if constexpr (is_constructible_v<_Tp, _Tuple>) return true; } return false; } template static consteval bool __dangles() { return (__reference_constructs_from_temporary(_Elements, _Up&&) || ...); } template static consteval bool __dangles_from_tuple_like() { return [](index_sequence<_Is...>) { return __dangles(std::declval<_UTuple>()))...>(); }(index_sequence_for<_Elements...>{}); } template static consteval bool __constructible_from_tuple_like() { return [](index_sequence<_Is...>) { return __constructible(std::declval<_UTuple>()))...>(); }(index_sequence_for<_Elements...>{}); } template static consteval bool __convertible_from_tuple_like() { return [](index_sequence<_Is...>) { return __convertible(std::declval<_UTuple>()))...>(); }(index_sequence_for<_Elements...>{}); } public: constexpr explicit(!(__is_implicitly_default_constructible_v<_Elements> && ...)) tuple() noexcept((is_nothrow_default_constructible_v<_Elements> && ...)) requires (is_default_constructible_v<_Elements> && ...) : _Inherited() { } template constexpr explicit(!__convertible()) tuple(const type_identity_t<_Elements>&... __elements) noexcept(__nothrow_constructible()) requires (__constructible()) : _Inherited(__elements...) { } template requires (__disambiguating_constraint<_UTypes...>()) && (__constructible<_UTypes...>()) && (!__dangles<_UTypes...>()) constexpr explicit(!__convertible<_UTypes...>()) tuple(_UTypes&&... __u) noexcept(__nothrow_constructible<_UTypes...>()) : _Inherited(std::forward<_UTypes>(__u)...) { } template requires (__disambiguating_constraint<_UTypes...>()) && (__constructible<_UTypes...>()) && (__dangles<_UTypes...>()) tuple(_UTypes&&...) = delete; constexpr tuple(const tuple&) = default; constexpr tuple(tuple&&) = default; template requires (__constructible()) && (!__use_other_ctor&>()) && (!__dangles()) constexpr explicit(!__convertible()) tuple(const tuple<_UTypes...>& __u) noexcept(__nothrow_constructible()) : _Inherited(static_cast&>(__u)) { } template requires (__constructible()) && (!__use_other_ctor&>()) && (__dangles()) tuple(const tuple<_UTypes...>&) = delete; template requires (__constructible<_UTypes...>()) && (!__use_other_ctor>()) && (!__dangles<_UTypes...>()) constexpr explicit(!__convertible<_UTypes...>()) tuple(tuple<_UTypes...>&& __u) noexcept(__nothrow_constructible<_UTypes...>()) : _Inherited(static_cast<_Tuple_impl<0, _UTypes...>&&>(__u)) { } template requires (__constructible<_UTypes...>()) && (!__use_other_ctor>()) && (__dangles<_UTypes...>()) tuple(tuple<_UTypes...>&&) = delete; template requires (__constructible<_UTypes&...>()) && (!__use_other_ctor&>()) && (!__dangles<_UTypes&...>()) constexpr explicit(!__convertible<_UTypes&...>()) tuple(tuple<_UTypes...>& __u) noexcept(__nothrow_constructible<_UTypes&...>()) : _Inherited(static_cast<_Tuple_impl<0, _UTypes...>&>(__u)) { } template requires (__constructible<_UTypes&...>()) && (!__use_other_ctor&>()) && (__dangles<_UTypes&...>()) tuple(tuple<_UTypes...>&) = delete; template requires (__constructible()) && (!__use_other_ctor>()) && (!__dangles()) constexpr explicit(!__convertible()) tuple(const tuple<_UTypes...>&& __u) noexcept(__nothrow_constructible()) : _Inherited(static_cast&&>(__u)) { } template requires (__constructible()) && (!__use_other_ctor>()) && (__dangles()) tuple(const tuple<_UTypes...>&&) = delete; template requires (sizeof...(_Elements) == 2) && (__constructible()) && (!__dangles()) constexpr explicit(!__convertible()) tuple(const pair<_U1, _U2>& __u) noexcept(__nothrow_constructible()) : _Inherited(__u.first, __u.second) { } template requires (sizeof...(_Elements) == 2) && (__constructible()) && (__dangles()) tuple(const pair<_U1, _U2>&) = delete; template requires (sizeof...(_Elements) == 2) && (__constructible<_U1, _U2>()) && (!__dangles<_U1, _U2>()) constexpr explicit(!__convertible<_U1, _U2>()) tuple(pair<_U1, _U2>&& __u) noexcept(__nothrow_constructible<_U1, _U2>()) : _Inherited(std::forward<_U1>(__u.first), std::forward<_U2>(__u.second)) { } template requires (sizeof...(_Elements) == 2) && (__constructible<_U1, _U2>()) && (__dangles<_U1, _U2>()) tuple(pair<_U1, _U2>&&) = delete; template requires (sizeof...(_Elements) == 2) && (__constructible<_U1&, _U2&>()) && (!__dangles<_U1&, _U2&>()) constexpr explicit(!__convertible<_U1&, _U2&>()) tuple(pair<_U1, _U2>& __u) noexcept(__nothrow_constructible<_U1&, _U2&>()) : _Inherited(__u.first, __u.second) { } template requires (sizeof...(_Elements) == 2) && (__constructible<_U1&, _U2&>()) && (__dangles<_U1&, _U2&>()) tuple(pair<_U1, _U2>&) = delete; template requires (sizeof...(_Elements) == 2) && (__constructible()) && (!__dangles()) constexpr explicit(!__convertible()) tuple(const pair<_U1, _U2>&& __u) noexcept(__nothrow_constructible()) : _Inherited(std::forward(__u.first), std::forward(__u.second)) { } template requires (sizeof...(_Elements) == 2) && (__constructible()) && (__dangles()) tuple(const pair<_U1, _U2>&&) = delete; template<__eligible_tuple_like _UTuple> requires (__constructible_from_tuple_like<_UTuple>()) && (!__use_other_ctor<_UTuple>()) && (!__dangles_from_tuple_like<_UTuple>()) constexpr explicit(!__convertible_from_tuple_like<_UTuple>()) tuple(_UTuple&& __u) : _Inherited(__tuple_like_tag_t{}, std::forward<_UTuple>(__u), index_sequence_for<_Elements...>{}) { } template<__eligible_tuple_like _UTuple> requires (__constructible_from_tuple_like<_UTuple>()) && (!__use_other_ctor<_UTuple>()) && (__dangles_from_tuple_like<_UTuple>()) tuple(_UTuple&&) = delete; template constexpr explicit(!(__is_implicitly_default_constructible_v<_Elements> && ...)) tuple(allocator_arg_t __tag, const _Alloc& __a) requires (is_default_constructible_v<_Elements> && ...) : _Inherited(__tag, __a) { } template constexpr explicit(!__convertible()) tuple(allocator_arg_t __tag, const _Alloc& __a, const type_identity_t<_Elements>&... __elements) requires (__constructible()) : _Inherited(__tag, __a, __elements...) { } template requires (__disambiguating_constraint<_UTypes...>()) && (__constructible<_UTypes...>()) && (!__dangles<_UTypes...>()) constexpr explicit(!__convertible<_UTypes...>()) tuple(allocator_arg_t __tag, const _Alloc& __a, _UTypes&&... __u) : _Inherited(__tag, __a, std::forward<_UTypes>(__u)...) { } template requires (__disambiguating_constraint<_UTypes...>()) && (__constructible<_UTypes...>()) && (__dangles<_UTypes...>()) tuple(allocator_arg_t, const _Alloc&, _UTypes&&...) = delete; template constexpr tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple& __u) : _Inherited(__tag, __a, static_cast(__u)) { } template requires (__constructible<_Elements...>()) constexpr tuple(allocator_arg_t __tag, const _Alloc& __a, tuple&& __u) : _Inherited(__tag, __a, static_cast<_Inherited&&>(__u)) { } template requires (__constructible()) && (!__use_other_ctor&>()) && (!__dangles()) constexpr explicit(!__convertible()) tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple<_UTypes...>& __u) : _Inherited(__tag, __a, static_cast&>(__u)) { } template requires (__constructible()) && (!__use_other_ctor&>()) && (__dangles()) tuple(allocator_arg_t, const _Alloc&, const tuple<_UTypes...>&) = delete; template requires (__constructible<_UTypes...>()) && (!__use_other_ctor>()) && (!__dangles<_UTypes...>()) constexpr explicit(!__use_other_ctor>()) tuple(allocator_arg_t __tag, const _Alloc& __a, tuple<_UTypes...>&& __u) : _Inherited(__tag, __a, static_cast<_Tuple_impl<0, _UTypes...>&&>(__u)) { } template requires (__constructible<_UTypes...>()) && (!__use_other_ctor>()) && (__dangles<_UTypes...>()) tuple(allocator_arg_t, const _Alloc&, tuple<_UTypes...>&&) = delete; template requires (__constructible<_UTypes&...>()) && (!__use_other_ctor&>()) && (!__dangles<_UTypes&...>()) constexpr explicit(!__convertible<_UTypes&...>()) tuple(allocator_arg_t __tag, const _Alloc& __a, tuple<_UTypes...>& __u) : _Inherited(__tag, __a, static_cast<_Tuple_impl<0, _UTypes...>&>(__u)) { } template requires (__constructible<_UTypes&...>()) && (!__use_other_ctor&>()) && (__dangles<_UTypes&...>()) tuple(allocator_arg_t, const _Alloc&, tuple<_UTypes...>&) = delete; template requires (__constructible()) && (!__use_other_ctor>()) && (!__dangles()) constexpr explicit(!__convertible()) tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple<_UTypes...>&& __u) : _Inherited(__tag, __a, static_cast&&>(__u)) { } template requires (__constructible()) && (!__use_other_ctor>()) && (__dangles()) tuple(allocator_arg_t, const _Alloc&, const tuple<_UTypes...>&&) = delete; template requires (sizeof...(_Elements) == 2) && (__constructible()) && (!__dangles()) constexpr explicit(!__convertible()) tuple(allocator_arg_t __tag, const _Alloc& __a, const pair<_U1, _U2>& __u) noexcept(__nothrow_constructible()) : _Inherited(__tag, __a, __u.first, __u.second) { } template requires (sizeof...(_Elements) == 2) && (__constructible()) && (__dangles()) tuple(allocator_arg_t, const _Alloc&, const pair<_U1, _U2>&) = delete; template requires (sizeof...(_Elements) == 2) && (__constructible<_U1, _U2>()) && (!__dangles<_U1, _U2>()) constexpr explicit(!__convertible<_U1, _U2>()) tuple(allocator_arg_t __tag, const _Alloc& __a, pair<_U1, _U2>&& __u) noexcept(__nothrow_constructible<_U1, _U2>()) : _Inherited(__tag, __a, std::move(__u.first), std::move(__u.second)) { } template requires (sizeof...(_Elements) == 2) && (__constructible<_U1, _U2>()) && (__dangles<_U1, _U2>()) tuple(allocator_arg_t, const _Alloc&, pair<_U1, _U2>&&) = delete; template requires (sizeof...(_Elements) == 2) && (__constructible<_U1&, _U2&>()) && (!__dangles<_U1&, _U2&>()) constexpr explicit(!__convertible<_U1&, _U2&>()) tuple(allocator_arg_t __tag, const _Alloc& __a, pair<_U1, _U2>& __u) noexcept(__nothrow_constructible<_U1&, _U2&>()) : _Inherited(__tag, __a, __u.first, __u.second) { } template requires (sizeof...(_Elements) == 2) && (__constructible<_U1&, _U2&>()) && (__dangles<_U1&, _U2&>()) tuple(allocator_arg_t, const _Alloc&, pair<_U1, _U2>&) = delete; template requires (sizeof...(_Elements) == 2) && (__constructible()) && (!__dangles()) constexpr explicit(!__convertible()) tuple(allocator_arg_t __tag, const _Alloc& __a, const pair<_U1, _U2>&& __u) noexcept(__nothrow_constructible()) : _Inherited(__tag, __a, std::move(__u.first), std::move(__u.second)) { } template requires (sizeof...(_Elements) == 2) && (__constructible()) && (__dangles()) tuple(allocator_arg_t, const _Alloc&, const pair<_U1, _U2>&&) = delete; template _UTuple> requires (__constructible_from_tuple_like<_UTuple>()) && (!__use_other_ctor<_UTuple>()) && (!__dangles_from_tuple_like<_UTuple>()) constexpr explicit(!__convertible_from_tuple_like<_UTuple>()) tuple(allocator_arg_t __tag, const _Alloc& __a, _UTuple&& __u) : _Inherited(__tuple_like_tag_t{}, __tag, __a, std::forward<_UTuple>(__u), index_sequence_for<_Elements...>{}) { } template _UTuple> requires (__constructible_from_tuple_like<_UTuple>()) && (!__use_other_ctor<_UTuple>()) && (__dangles_from_tuple_like<_UTuple>()) tuple(allocator_arg_t, const _Alloc&, _UTuple&&) = delete; # 1655 "/usr/include/c++/15/tuple" 3 private: template static consteval bool __assignable() { if constexpr (sizeof...(_UTypes) == sizeof...(_Elements)) return __and_v...>; else return false; } template static consteval bool __nothrow_assignable() { if constexpr (sizeof...(_UTypes) == sizeof...(_Elements)) return __and_v...>; else return false; } template static consteval bool __const_assignable() { if constexpr (sizeof...(_UTypes) == sizeof...(_Elements)) return __and_v...>; else return false; } template static consteval bool __assignable_from_tuple_like() { return [](index_sequence<_Is...>) { return __assignable(std::declval<_UTuple>()))...>(); }(index_sequence_for<_Elements...>{}); } template static consteval bool __const_assignable_from_tuple_like() { return [](index_sequence<_Is...>) { return __const_assignable(std::declval<_UTuple>()))...>(); }(index_sequence_for<_Elements...>{}); } public: tuple& operator=(const tuple& __u) = delete; constexpr tuple& operator=(const tuple& __u) noexcept(__nothrow_assignable()) requires (__assignable()) { this->_M_assign(__u); return *this; } constexpr tuple& operator=(tuple&& __u) noexcept(__nothrow_assignable<_Elements...>()) requires (__assignable<_Elements...>()) { this->_M_assign(std::move(__u)); return *this; } template requires (__assignable()) constexpr tuple& operator=(const tuple<_UTypes...>& __u) noexcept(__nothrow_assignable()) { this->_M_assign(__u); return *this; } template requires (__assignable<_UTypes...>()) constexpr tuple& operator=(tuple<_UTypes...>&& __u) noexcept(__nothrow_assignable<_UTypes...>()) { this->_M_assign(std::move(__u)); return *this; } constexpr const tuple& operator=(const tuple& __u) const requires (__const_assignable()) { this->_M_assign(__u); return *this; } constexpr const tuple& operator=(tuple&& __u) const requires (__const_assignable<_Elements...>()) { this->_M_assign(std::move(__u)); return *this; } template constexpr const tuple& operator=(const tuple<_UTypes...>& __u) const requires (__const_assignable()) { this->_M_assign(__u); return *this; } template constexpr const tuple& operator=(tuple<_UTypes...>&& __u) const requires (__const_assignable<_UTypes...>()) { this->_M_assign(std::move(__u)); return *this; } template requires (__assignable()) constexpr tuple& operator=(const pair<_U1, _U2>& __u) noexcept(__nothrow_assignable()) { this->_M_head(*this) = __u.first; this->_M_tail(*this)._M_head(*this) = __u.second; return *this; } template requires (__assignable<_U1, _U2>()) constexpr tuple& operator=(pair<_U1, _U2>&& __u) noexcept(__nothrow_assignable<_U1, _U2>()) { this->_M_head(*this) = std::forward<_U1>(__u.first); this->_M_tail(*this)._M_head(*this) = std::forward<_U2>(__u.second); return *this; } template requires (__const_assignable()) constexpr const tuple& operator=(const pair<_U1, _U2>& __u) const { this->_M_head(*this) = __u.first; this->_M_tail(*this)._M_head(*this) = __u.second; return *this; } template requires (__const_assignable<_U1, _U2>()) constexpr const tuple& operator=(pair<_U1, _U2>&& __u) const { this->_M_head(*this) = std::forward<_U1>(__u.first); this->_M_tail(*this)._M_head(*this) = std::forward<_U2>(__u.second); return *this; } template<__eligible_tuple_like _UTuple> requires (__assignable_from_tuple_like<_UTuple>()) constexpr tuple& operator=(_UTuple&& __u) { this->_M_assign(__tuple_like_tag_t{}, std::forward<_UTuple>(__u)); return *this; } template<__eligible_tuple_like _UTuple> requires (__const_assignable_from_tuple_like<_UTuple>()) constexpr const tuple& operator=(_UTuple&& __u) const { this->_M_assign(__tuple_like_tag_t{}, std::forward<_UTuple>(__u)); return *this; } template<__tuple_like _UTuple> requires (!__is_tuple_v<_UTuple>) friend constexpr bool operator== [[nodiscard]] (const tuple& __t, const _UTuple& __u) { static_assert(sizeof...(_Elements) == tuple_size_v<_UTuple>, "tuple objects can only be compared if they have equal sizes."); return [&](index_sequence<_Is...>) { return (bool(std::get<_Is>(__t) == std::get<_Is>(__u)) && ...); }(index_sequence_for<_Elements...>{}); } template<__tuple_like _UTuple, typename = make_index_sequence>> struct __tuple_like_common_comparison_category; template<__tuple_like _UTuple, size_t... _Is> requires requires { typename void_t<__detail::__synth3way_t<_Elements, tuple_element_t<_Is, _UTuple>>...>; } struct __tuple_like_common_comparison_category<_UTuple, index_sequence<_Is...>> { using type = common_comparison_category_t <__detail::__synth3way_t<_Elements, tuple_element_t<_Is, _UTuple>>...>; }; template<__tuple_like _UTuple> requires (!__is_tuple_v<_UTuple>) friend constexpr typename __tuple_like_common_comparison_category<_UTuple>::type operator<=>(const tuple& __t, const _UTuple& __u) { using _Cat = typename __tuple_like_common_comparison_category<_UTuple>::type; return std::__tuple_cmp<_Cat>(__t, __u, index_sequence_for<_Elements...>()); } # 1948 "/usr/include/c++/15/tuple" 3 constexpr void swap(tuple& __in) noexcept(__and_<__is_nothrow_swappable<_Elements>...>::value) { _Inherited::_M_swap(__in); } # 1961 "/usr/include/c++/15/tuple" 3 constexpr void swap(const tuple& __in) const noexcept(__and_v<__is_nothrow_swappable...>) requires (is_swappable_v && ...) { _Inherited::_M_swap(__in); } }; template tuple(_UTypes...) -> tuple<_UTypes...>; template tuple(pair<_T1, _T2>) -> tuple<_T1, _T2>; template tuple(allocator_arg_t, _Alloc, _UTypes...) -> tuple<_UTypes...>; template tuple(allocator_arg_t, _Alloc, pair<_T1, _T2>) -> tuple<_T1, _T2>; template tuple(allocator_arg_t, _Alloc, tuple<_UTypes...>) -> tuple<_UTypes...>; template<> class tuple<> { public: constexpr void swap(tuple&) noexcept { } constexpr void swap(const tuple&) const noexcept { } tuple() = default; template constexpr tuple(allocator_arg_t, const _Alloc&) noexcept { } template constexpr tuple(allocator_arg_t, const _Alloc&, const tuple&) noexcept { } }; # 2403 "/usr/include/c++/15/tuple" 3 template struct tuple_size> : public integral_constant { }; template inline constexpr size_t tuple_size_v> = sizeof...(_Types); template inline constexpr size_t tuple_size_v> = sizeof...(_Types); template struct tuple_element<__i, tuple<_Types...>> { static_assert(__i < sizeof...(_Types), "tuple index must be in range"); using type = typename _Nth_type<__i, _Types...>::type; }; template constexpr _Head& __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); } template constexpr const _Head& __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t) noexcept { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); } template __enable_if_t<(__i >= sizeof...(_Types))> __get_helper(const tuple<_Types...>&) = delete; template constexpr __tuple_element_t<__i, tuple<_Elements...>>& get(tuple<_Elements...>& __t) noexcept { return std::__get_helper<__i>(__t); } template constexpr const __tuple_element_t<__i, tuple<_Elements...>>& get(const tuple<_Elements...>& __t) noexcept { return std::__get_helper<__i>(__t); } template constexpr __tuple_element_t<__i, tuple<_Elements...>>&& get(tuple<_Elements...>&& __t) noexcept { typedef __tuple_element_t<__i, tuple<_Elements...>> __element_type; return std::forward<__element_type>(std::__get_helper<__i>(__t)); } template constexpr const __tuple_element_t<__i, tuple<_Elements...>>&& get(const tuple<_Elements...>&& __t) noexcept { typedef __tuple_element_t<__i, tuple<_Elements...>> __element_type; return std::forward(std::__get_helper<__i>(__t)); } template constexpr __enable_if_t<(__i >= sizeof...(_Elements))> get(const tuple<_Elements...>&) = delete; template constexpr _Tp& get(tuple<_Types...>& __t) noexcept { constexpr size_t __idx = __find_uniq_type_in_pack<_Tp, _Types...>(); static_assert(__idx < sizeof...(_Types), "the type T in std::get must occur exactly once in the tuple"); return std::__get_helper<__idx>(__t); } template constexpr _Tp&& get(tuple<_Types...>&& __t) noexcept { constexpr size_t __idx = __find_uniq_type_in_pack<_Tp, _Types...>(); static_assert(__idx < sizeof...(_Types), "the type T in std::get must occur exactly once in the tuple"); return std::forward<_Tp>(std::__get_helper<__idx>(__t)); } template constexpr const _Tp& get(const tuple<_Types...>& __t) noexcept { constexpr size_t __idx = __find_uniq_type_in_pack<_Tp, _Types...>(); static_assert(__idx < sizeof...(_Types), "the type T in std::get must occur exactly once in the tuple"); return std::__get_helper<__idx>(__t); } template constexpr const _Tp&& get(const tuple<_Types...>&& __t) noexcept { constexpr size_t __idx = __find_uniq_type_in_pack<_Tp, _Types...>(); static_assert(__idx < sizeof...(_Types), "the type T in std::get must occur exactly once in the tuple"); return std::forward(std::__get_helper<__idx>(__t)); } template requires (sizeof...(_Tps) == sizeof...(_Ups)) && (requires (const _Tps& __t, const _Ups& __u) { { __t == __u } -> __detail::__boolean_testable; } && ...) constexpr bool operator== [[nodiscard]] (const tuple<_Tps...>& __t, const tuple<_Ups...>& __u) { return [&](index_sequence<_Inds...>) { return (bool(std::get<_Inds>(__t) == std::get<_Inds>(__u)) && ...); }(index_sequence_for<_Tps...>{}); } template [[nodiscard]] constexpr _Cat __tuple_cmp(const _Tp& __t, const _Up& __u, _IndexSeq __indices) { _Cat __c = _Cat::equivalent; auto __cmp = [&](integral_constant) { __c = __detail::__synth3way(std::get<_Ind>(__t), std::get<_Ind>(__u)); return __c == 0; }; [&](index_sequence<_Inds...>) { (void)(__cmp(integral_constant{}) && ...); }(__indices); return __c; } template requires (sizeof...(_Tps) == sizeof...(_Ups)) && (requires { typename __detail::__synth3way_t<_Tps, _Ups>; } && ...) constexpr common_comparison_category_t<__detail::__synth3way_t<_Tps, _Ups>...> operator<=> [[nodiscard]] (const tuple<_Tps...>& __t, const tuple<_Ups...>& __u) { using _Cat = common_comparison_category_t<__detail::__synth3way_t<_Tps, _Ups>...>; return std::__tuple_cmp<_Cat>(__t, __u, index_sequence_for<_Tps...>()); } # 2666 "/usr/include/c++/15/tuple" 3 template constexpr tuple::__type...> make_tuple(_Elements&&... __args) { typedef tuple::__type...> __result_type; return __result_type(std::forward<_Elements>(__args)...); } template constexpr tuple<_Elements&&...> forward_as_tuple(_Elements&&... __args) noexcept { return tuple<_Elements&&...>(std::forward<_Elements>(__args)...); } template struct __make_tuple_impl; template struct __make_tuple_impl<_Idx, tuple<_Tp...>, _Tuple, _Nm> : __make_tuple_impl<_Idx + 1, tuple<_Tp..., __tuple_element_t<_Idx, _Tuple>>, _Tuple, _Nm> { }; template struct __make_tuple_impl<_Nm, tuple<_Tp...>, _Tuple, _Nm> { typedef tuple<_Tp...> __type; }; template struct __do_make_tuple : __make_tuple_impl<0, tuple<>, _Tuple, tuple_size<_Tuple>::value> { }; template struct __make_tuple : public __do_make_tuple<__remove_cvref_t<_Tuple>> { }; template struct __combine_tuples; template<> struct __combine_tuples<> { typedef tuple<> __type; }; template struct __combine_tuples> { typedef tuple<_Ts...> __type; }; template struct __combine_tuples, tuple<_T2s...>, _Rem...> { typedef typename __combine_tuples, _Rem...>::__type __type; }; template struct __tuple_cat_result { typedef typename __combine_tuples ::__type...>::__type __type; }; template struct __make_1st_indices; template<> struct __make_1st_indices<> { typedef _Index_tuple<> __type; }; template struct __make_1st_indices<_Tp, _Tpls...> { typedef typename _Build_index_tuple::type>::value>::__type __type; }; template struct __tuple_concater; template struct __tuple_concater<_Ret, _Index_tuple<_Is...>, _Tp, _Tpls...> { template static constexpr _Ret _S_do(_Tp&& __tp, _Tpls&&... __tps, _Us&&... __us) { typedef typename __make_1st_indices<_Tpls...>::__type __idx; typedef __tuple_concater<_Ret, __idx, _Tpls...> __next; return __next::_S_do(std::forward<_Tpls>(__tps)..., std::forward<_Us>(__us)..., std::get<_Is>(std::forward<_Tp>(__tp))...); } }; template struct __tuple_concater<_Ret, _Index_tuple<>> { template static constexpr _Ret _S_do(_Us&&... __us) { return _Ret(std::forward<_Us>(__us)...); } }; template struct __is_tuple_like_impl> : true_type { }; template<__tuple_like... _Tpls> constexpr auto tuple_cat(_Tpls&&... __tpls) -> typename __tuple_cat_result<_Tpls...>::__type { typedef typename __tuple_cat_result<_Tpls...>::__type __ret; typedef typename __make_1st_indices<_Tpls...>::__type __idx; typedef __tuple_concater<__ret, __idx, _Tpls...> __concater; return __concater::_S_do(std::forward<_Tpls>(__tpls)...); } template constexpr tuple<_Elements&...> tie(_Elements&... __args) noexcept { return tuple<_Elements&...>(__args...); } template constexpr inline typename enable_if<__and_<__is_swappable<_Elements>...>::value >::type swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template requires (is_swappable_v && ...) constexpr void swap(const tuple<_Elements...>& __x, const tuple<_Elements...>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template constexpr typename enable_if...>::value>::type swap(tuple<_Elements...>&, tuple<_Elements...>&) = delete; template struct uses_allocator, _Alloc> : true_type { }; # 2867 "/usr/include/c++/15/tuple" 3 template template constexpr inline pair<_T1, _T2>:: pair(piecewise_construct_t, tuple<_Args1...> __first, tuple<_Args2...> __second) : pair(__first, __second, typename _Build_index_tuple::__type(), typename _Build_index_tuple::__type()) { } template template constexpr inline pair<_T1, _T2>:: pair(tuple<_Args1...>& __tuple1, tuple<_Args2...>& __tuple2, _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>) : first(std::forward<_Args1>(std::get<_Indexes1>(__tuple1))...), second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...) { } template class _Trait, typename _Tp, typename _Tuple> inline constexpr bool __unpack_std_tuple = false; template class _Trait, typename _Tp, typename... _Up> inline constexpr bool __unpack_std_tuple<_Trait, _Tp, tuple<_Up...>> = _Trait<_Tp, _Up...>::value; template class _Trait, typename _Tp, typename... _Up> inline constexpr bool __unpack_std_tuple<_Trait, _Tp, tuple<_Up...>&> = _Trait<_Tp, _Up&...>::value; template class _Trait, typename _Tp, typename... _Up> inline constexpr bool __unpack_std_tuple<_Trait, _Tp, const tuple<_Up...>> = _Trait<_Tp, const _Up...>::value; template class _Trait, typename _Tp, typename... _Up> inline constexpr bool __unpack_std_tuple<_Trait, _Tp, const tuple<_Up...>&> = _Trait<_Tp, const _Up&...>::value; template constexpr decltype(auto) __apply_impl(_Fn&& __f, _Tuple&& __t, index_sequence<_Idx...>) { return std::__invoke(std::forward<_Fn>(__f), std::get<_Idx>(std::forward<_Tuple>(__t))...); } template constexpr decltype(auto) apply(_Fn&& __f, _Tuple&& __t) noexcept(__unpack_std_tuple) { using _Indices = make_index_sequence>>; return std::__apply_impl(std::forward<_Fn>(__f), std::forward<_Tuple>(__t), _Indices{}); } template constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, index_sequence<_Idx...>) { return _Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...); } template constexpr _Tp make_from_tuple(_Tuple&& __t) noexcept(__unpack_std_tuple) { constexpr size_t __n = tuple_size_v>; if constexpr (__n == 1) { using _Elt = decltype(std::get<0>(std::declval<_Tuple>())); static_assert(!__reference_constructs_from_temporary(_Tp, _Elt)); } return __make_from_tuple_impl<_Tp>(std::forward<_Tuple>(__t), make_index_sequence<__n>{}); } template<__tuple_like _TTuple, __tuple_like _UTuple, template class _TQual, template class _UQual, typename = make_index_sequence>> struct __tuple_like_common_reference; template<__tuple_like _TTuple, __tuple_like _UTuple, template class _TQual, template class _UQual, size_t... _Is> requires requires { typename tuple>, _UQual>>...>; } struct __tuple_like_common_reference<_TTuple, _UTuple, _TQual, _UQual, index_sequence<_Is...>> { using type = tuple>, _UQual>>...>; }; template<__tuple_like _TTuple, __tuple_like _UTuple, template class _TQual, template class _UQual> requires (__is_tuple_v<_TTuple> || __is_tuple_v<_UTuple>) && is_same_v<_TTuple, decay_t<_TTuple>> && is_same_v<_UTuple, decay_t<_UTuple>> && (tuple_size_v<_TTuple> == tuple_size_v<_UTuple>) && requires { typename __tuple_like_common_reference<_TTuple, _UTuple, _TQual, _UQual>::type; } struct basic_common_reference<_TTuple, _UTuple, _TQual, _UQual> { using type = typename __tuple_like_common_reference<_TTuple, _UTuple, _TQual, _UQual>::type; }; template<__tuple_like _TTuple, __tuple_like _UTuple, typename = make_index_sequence>> struct __tuple_like_common_type; template<__tuple_like _TTuple, __tuple_like _UTuple, size_t... _Is> requires requires { typename tuple, tuple_element_t<_Is, _UTuple>>...>; } struct __tuple_like_common_type<_TTuple, _UTuple, index_sequence<_Is...>> { using type = tuple, tuple_element_t<_Is, _UTuple>>...>; }; template<__tuple_like _TTuple, __tuple_like _UTuple> requires (__is_tuple_v<_TTuple> || __is_tuple_v<_UTuple>) && is_same_v<_TTuple, decay_t<_TTuple>> && is_same_v<_UTuple, decay_t<_UTuple>> && (tuple_size_v<_TTuple> == tuple_size_v<_UTuple>) && requires { typename __tuple_like_common_type<_TTuple, _UTuple>::type; } struct common_type<_TTuple, _UTuple> { using type = typename __tuple_like_common_type<_TTuple, _UTuple>::type; }; } # 10 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Base.hh" 2 # 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 extern "C" { typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino_t ino_t; typedef __ino64_t ino64_t; typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; typedef __off_t off_t; typedef __off64_t off64_t; typedef __pid_t pid_t; typedef __id_t id_t; typedef __ssize_t ssize_t; typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4 typedef __clock_t clock_t; # 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4 typedef __clockid_t clockid_t; # 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4 # 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4 typedef __time_t time_t; # 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4 typedef __timer_t timer_t; # 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 typedef __useconds_t useconds_t; typedef __suseconds_t suseconds_t; # 1 "/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h" 1 3 4 # 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; typedef __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; typedef int register_t __attribute__ ((__mode__ (__word__))); # 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 # 24 "/usr/include/endian.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4 # 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4 # 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4 # 25 "/usr/include/endian.h" 2 3 4 # 35 "/usr/include/endian.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4 # 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 static __inline __uint16_t __bswap_16 (__uint16_t __bsx) { return __builtin_bswap16 (__bsx); } static __inline __uint32_t __bswap_32 (__uint32_t __bsx) { return __builtin_bswap32 (__bsx); } # 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 __extension__ static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { return __builtin_bswap64 (__bsx); } # 36 "/usr/include/endian.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4 # 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4 static __inline __uint16_t __uint16_identity (__uint16_t __x) { return __x; } static __inline __uint32_t __uint32_identity (__uint32_t __x) { return __x; } static __inline __uint64_t __uint64_identity (__uint64_t __x) { return __x; } # 37 "/usr/include/endian.h" 2 3 4 # 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4 # 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4 # 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4 typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4 typedef __sigset_t sigset_t; # 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4 # 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4 struct timespec { __time_t tv_sec; __syscall_slong_t tv_nsec; # 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4 }; # 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 # 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 typedef long int __fd_mask; # 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 typedef struct { __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 extern "C" { # 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); # 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); # 150 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/select2.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/select2.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/select-decl.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/select-decl.h" 3 4 extern long int __fdelt_chk (long int __d); extern long int __fdelt_warn (long int __d) __attribute__((__warning__ ("bit outside of fd_set selected"))); # 24 "/usr/include/x86_64-linux-gnu/bits/select2.h" 2 3 4 # 151 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 } # 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 typedef __blksize_t blksize_t; typedef __blkcnt_t blkcnt_t; typedef __fsblkcnt_t fsblkcnt_t; typedef __fsfilcnt_t fsfilcnt_t; # 219 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 typedef __blkcnt64_t blkcnt64_t; typedef __fsblkcnt64_t fsblkcnt64_t; typedef __fsfilcnt64_t fsfilcnt64_t; # 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4 # 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4 # 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4 # 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4 # 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4 typedef union { __extension__ unsigned long long int __value64; struct { unsigned int __low; unsigned int __high; } __value32; } __atomic_wide_counter; # 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4 typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; # 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4 struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __unused; __pthread_list_t __list; # 52 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4 }; # 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4 # 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4 struct __pthread_rwlock_arch_t { unsigned int __readers; unsigned int __writers; unsigned int __wrphase_futex; unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; int __cur_writer; int __shared; unsigned long int __pad1; unsigned long int __pad2; unsigned int __flags; # 48 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4 }; # 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4 struct __pthread_cond_s { __atomic_wide_counter __wseq; __atomic_wide_counter __g1_start; unsigned int __g_size[2] ; unsigned int __g1_orig_size; unsigned int __wrefs; unsigned int __g_signals[2]; unsigned int __unused_initialized_1; unsigned int __unused_initialized_2; }; typedef unsigned int __tss_t; typedef unsigned long int __thrd_t; typedef struct { int __data ; } __once_flag; # 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4 typedef unsigned long int pthread_t; typedef union { char __size[4]; int __align; } pthread_mutexattr_t; typedef union { char __size[4]; int __align; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef int pthread_once_t; union pthread_attr_t { char __size[56]; long int __align; }; typedef union pthread_attr_t pthread_attr_t; typedef union { struct __pthread_mutex_s __data; char __size[40]; long int __align; } pthread_mutex_t; typedef union { struct __pthread_cond_s __data; char __size[48]; __extension__ long long int __align; } pthread_cond_t; typedef union { struct __pthread_rwlock_arch_t __data; char __size[56]; long int __align; } pthread_rwlock_t; typedef union { char __size[8]; long int __align; } pthread_rwlockattr_t; typedef volatile int pthread_spinlock_t; typedef union { char __size[32]; long int __align; } pthread_barrier_t; typedef union { char __size[4]; int __align; } pthread_barrierattr_t; # 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 } # 15 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Base.hh" 2 #pragma clang diagnostic ignored "-Wnullability-extension" # 57 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Base.hh" # 57 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Base.hh" using u8 = std::uint8_t; using u16 = std::uint16_t; using u32 = std::uint32_t; using u64 = std::uint64_t; using i8 = std::int8_t; using i16 = std::int16_t; using i32 = std::int32_t; using i64 = std::int64_t; using uint = unsigned int; using usize = std::size_t; using ssize = ssize_t; using f32 = float; using f64 = double; namespace atom { static constexpr u32 WAIT_FOREVER = std::numeric_limits::max(); template using BaseType = std::tuple_element<0, std::tuple>::type; } static_assert(sizeof(u8) == 1, "Bad! Very Not Good!"); static_assert(sizeof(u16) == 2, "Bad! Very Not Good!"); static_assert(sizeof(u32) == 4, "Bad! Very Not Good!"); static_assert(sizeof(u64) == 8, "Bad! Very Not Good!"); static_assert(sizeof(i8) == 1, "Bad! Very Not Good!"); static_assert(sizeof(i16) == 2, "Bad! Very Not Good!"); static_assert(sizeof(i32) == 4, "Bad! Very Not Good!"); static_assert(sizeof(i64) == 8, "Bad! Very Not Good!"); static_assert(sizeof(uint) == 4, "Bad! Very Not Good!"); static_assert(sizeof(usize) == 8, "Bad! Very Not Good!"); static_assert(sizeof(ssize) == 8, "Bad! Very Not Good!"); static_assert(sizeof(f32) == 4, "Bad! Very Not Good!"); static_assert(sizeof(f64) == 8, "Bad! Very Not Good!"); # 7 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Utilities/Hash.hh" 2 # 1 "/usr/include/c++/15/functional" 1 3 # 51 "/usr/include/c++/15/functional" 3 # 1 "/usr/include/c++/15/bits/stl_function.h" 1 3 # 66 "/usr/include/c++/15/bits/stl_function.h" 3 # 66 "/usr/include/c++/15/bits/stl_function.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 119 "/usr/include/c++/15/bits/stl_function.h" 3 template struct unary_function { typedef _Arg argument_type; typedef _Result result_type; } __attribute__ ((__deprecated__)); template struct binary_function { typedef _Arg1 first_argument_type; typedef _Arg2 second_argument_type; typedef _Result result_type; } __attribute__ ((__deprecated__)); # 160 "/usr/include/c++/15/bits/stl_function.h" 3 struct __is_transparent; template struct plus; template struct minus; template struct multiplies; template struct divides; template struct modulus; template struct negate; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" template struct plus : public binary_function<_Tp, _Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; } }; template struct minus : public binary_function<_Tp, _Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; } }; template struct multiplies : public binary_function<_Tp, _Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; } }; template struct divides : public binary_function<_Tp, _Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; } }; template struct modulus : public binary_function<_Tp, _Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; } }; template struct negate : public unary_function<_Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x) const { return -__x; } }; #pragma GCC diagnostic pop template<> struct plus { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) + std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) + std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) + std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct minus { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) - std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) - std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) - std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct multiplies { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) * std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) * std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) * std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct divides { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) / std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) / std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) / std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct modulus { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) % std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) % std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) % std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct negate { template constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(-std::forward<_Tp>(__t))) -> decltype(-std::forward<_Tp>(__t)) { return -std::forward<_Tp>(__t); } typedef __is_transparent is_transparent; }; # 349 "/usr/include/c++/15/bits/stl_function.h" 3 template struct equal_to; template struct not_equal_to; template struct greater; template struct less; template struct greater_equal; template struct less_equal; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" template struct equal_to : public binary_function<_Tp, _Tp, bool> { constexpr bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; } }; template struct not_equal_to : public binary_function<_Tp, _Tp, bool> { constexpr bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; } }; template struct greater : public binary_function<_Tp, _Tp, bool> { constexpr bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; } }; template struct less : public binary_function<_Tp, _Tp, bool> { constexpr bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; } }; template struct greater_equal : public binary_function<_Tp, _Tp, bool> { constexpr bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; } }; template struct less_equal : public binary_function<_Tp, _Tp, bool> { constexpr bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; } }; template struct greater<_Tp*> : public binary_function<_Tp*, _Tp*, bool> { constexpr bool operator()(_Tp* __x, _Tp* __y) const noexcept { if (std::__is_constant_evaluated()) return __x > __y; return (long unsigned int)__x > (long unsigned int)__y; } }; template struct less<_Tp*> : public binary_function<_Tp*, _Tp*, bool> { constexpr bool operator()(_Tp* __x, _Tp* __y) const noexcept { if (std::__is_constant_evaluated()) return __x < __y; return (long unsigned int)__x < (long unsigned int)__y; } }; template struct greater_equal<_Tp*> : public binary_function<_Tp*, _Tp*, bool> { constexpr bool operator()(_Tp* __x, _Tp* __y) const noexcept { if (std::__is_constant_evaluated()) return __x >= __y; return (long unsigned int)__x >= (long unsigned int)__y; } }; template struct less_equal<_Tp*> : public binary_function<_Tp*, _Tp*, bool> { constexpr bool operator()(_Tp* __x, _Tp* __y) const noexcept { if (std::__is_constant_evaluated()) return __x <= __y; return (long unsigned int)__x <= (long unsigned int)__y; } }; #pragma GCC diagnostic pop template<> struct equal_to { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) == std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) == std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) == std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct not_equal_to { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) != std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) != std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) != std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct greater { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) > std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) > std::forward<_Up>(__u)) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" if constexpr (__ptr_cmp<_Tp, _Up>) return greater{}( static_cast(std::forward<_Tp>(__t)), static_cast(std::forward<_Up>(__u))); else return std::forward<_Tp>(__t) > std::forward<_Up>(__u); #pragma GCC diagnostic pop } template constexpr bool operator()(_Tp* __t, _Up* __u) const noexcept { return greater>{}(__t, __u); } typedef __is_transparent is_transparent; private: template static constexpr bool __ptr_cmp = requires { requires ! requires { operator>(std::declval<_Tp>(), std::declval<_Up>()); } && ! requires { std::declval<_Tp>().operator>(std::declval<_Up>()); } && __detail::__not_overloaded_spaceship<_Tp, _Up> && is_convertible_v<_Tp, const volatile void*> && is_convertible_v<_Up, const volatile void*>; }; # 590 "/usr/include/c++/15/bits/stl_function.h" 3 }; template<> struct less { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) < std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" if constexpr (__ptr_cmp<_Tp, _Up>) return less{}( static_cast(std::forward<_Tp>(__t)), static_cast(std::forward<_Up>(__u))); else return std::forward<_Tp>(__t) < std::forward<_Up>(__u); #pragma GCC diagnostic pop } template constexpr bool operator()(_Tp* __t, _Up* __u) const noexcept { return less>{}(__t, __u); } typedef __is_transparent is_transparent; private: template static constexpr bool __ptr_cmp = requires { requires ! requires { operator<(std::declval<_Tp>(), std::declval<_Up>()); } && ! requires { std::declval<_Tp>().operator<(std::declval<_Up>()); } && __detail::__not_overloaded_spaceship<_Tp, _Up> && is_convertible_v<_Tp, const volatile void*> && is_convertible_v<_Up, const volatile void*>; }; # 661 "/usr/include/c++/15/bits/stl_function.h" 3 }; template<> struct greater_equal { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) >= std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) >= std::forward<_Up>(__u)) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" if constexpr (__ptr_cmp<_Tp, _Up>) return greater_equal{}( static_cast(std::forward<_Tp>(__t)), static_cast(std::forward<_Up>(__u))); else return std::forward<_Tp>(__t) >= std::forward<_Up>(__u); #pragma GCC diagnostic pop } template constexpr bool operator()(_Tp* __t, _Up* __u) const noexcept { return greater_equal>{}(__t, __u); } typedef __is_transparent is_transparent; private: template static constexpr bool __ptr_cmp = requires { requires ! requires { operator>=(std::declval<_Tp>(), std::declval<_Up>()); } && ! requires { std::declval<_Tp>().operator>=(std::declval<_Up>()); } && __detail::__not_overloaded_spaceship<_Tp, _Up> && is_convertible_v<_Tp, const volatile void*> && is_convertible_v<_Up, const volatile void*>; }; # 732 "/usr/include/c++/15/bits/stl_function.h" 3 }; template<> struct less_equal { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) <= std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) <= std::forward<_Up>(__u)) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" if constexpr (__ptr_cmp<_Tp, _Up>) return less_equal{}( static_cast(std::forward<_Tp>(__t)), static_cast(std::forward<_Up>(__u))); else return std::forward<_Tp>(__t) <= std::forward<_Up>(__u); #pragma GCC diagnostic pop } template constexpr bool operator()(_Tp* __t, _Up* __u) const noexcept { return less_equal>{}(__t, __u); } typedef __is_transparent is_transparent; private: template static constexpr bool __ptr_cmp = requires { requires ! requires { operator<=(std::declval<_Tp>(), std::declval<_Up>()); } && ! requires { std::declval<_Tp>().operator<=(std::declval<_Up>()); } && __detail::__not_overloaded_spaceship<_Tp, _Up> && is_convertible_v<_Tp, const volatile void*> && is_convertible_v<_Up, const volatile void*>; }; # 803 "/usr/include/c++/15/bits/stl_function.h" 3 }; # 817 "/usr/include/c++/15/bits/stl_function.h" 3 template struct logical_and; template struct logical_or; template struct logical_not; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" template struct logical_and : public binary_function<_Tp, _Tp, bool> { constexpr bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; } }; template struct logical_or : public binary_function<_Tp, _Tp, bool> { constexpr bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; } }; template struct logical_not : public unary_function<_Tp, bool> { constexpr bool operator()(const _Tp& __x) const { return !__x; } }; #pragma GCC diagnostic pop template<> struct logical_and { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) && std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) && std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) && std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct logical_or { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) || std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) || std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) || std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template<> struct logical_not { template constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(!std::forward<_Tp>(__t))) -> decltype(!std::forward<_Tp>(__t)) { return !std::forward<_Tp>(__t); } typedef __is_transparent is_transparent; }; template struct bit_and; template struct bit_or; template struct bit_xor; template struct bit_not; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" template struct bit_and : public binary_function<_Tp, _Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x & __y; } }; template struct bit_or : public binary_function<_Tp, _Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x | __y; } }; template struct bit_xor : public binary_function<_Tp, _Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x ^ __y; } }; template struct bit_not : public unary_function<_Tp, _Tp> { constexpr _Tp operator()(const _Tp& __x) const { return ~__x; } }; #pragma GCC diagnostic pop template <> struct bit_and { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) & std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) & std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) & std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template <> struct bit_or { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) | std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) | std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) | std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template <> struct bit_xor { template constexpr auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) ^ std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template <> struct bit_not { template constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(~std::forward<_Tp>(__t))) -> decltype(~std::forward<_Tp>(__t)) { return ~std::forward<_Tp>(__t); } typedef __is_transparent is_transparent; }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" # 1059 "/usr/include/c++/15/bits/stl_function.h" 3 template class [[__deprecated__]] unary_negate : public unary_function { protected: _Predicate _M_pred; public: constexpr explicit unary_negate(const _Predicate& __x) : _M_pred(__x) { } constexpr bool operator()(const typename _Predicate::argument_type& __x) const { return !_M_pred(__x); } }; template __attribute__ ((__deprecated__ ("use '" "std::not_fn" "' instead"))) constexpr inline unary_negate<_Predicate> not1(const _Predicate& __pred) { return unary_negate<_Predicate>(__pred); } template class [[__deprecated__]] binary_negate : public binary_function { protected: _Predicate _M_pred; public: constexpr explicit binary_negate(const _Predicate& __x) : _M_pred(__x) { } constexpr bool operator()(const typename _Predicate::first_argument_type& __x, const typename _Predicate::second_argument_type& __y) const { return !_M_pred(__x, __y); } }; template __attribute__ ((__deprecated__ ("use '" "std::not_fn" "' instead"))) constexpr inline binary_negate<_Predicate> not2(const _Predicate& __pred) { return binary_negate<_Predicate>(__pred); } # 1140 "/usr/include/c++/15/bits/stl_function.h" 3 template class pointer_to_unary_function : public unary_function<_Arg, _Result> { protected: _Result (*_M_ptr)(_Arg); public: pointer_to_unary_function() { } explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) { } _Result operator()(_Arg __x) const { return _M_ptr(__x); } } __attribute__ ((__deprecated__)); template __attribute__ ((__deprecated__ ("use '" "std::function" "' instead"))) inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg)) { return pointer_to_unary_function<_Arg, _Result>(__x); } template class pointer_to_binary_function : public binary_function<_Arg1, _Arg2, _Result> { protected: _Result (*_M_ptr)(_Arg1, _Arg2); public: pointer_to_binary_function() { } explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) : _M_ptr(__x) { } _Result operator()(_Arg1 __x, _Arg2 __y) const { return _M_ptr(__x, __y); } } __attribute__ ((__deprecated__)); template __attribute__ ((__deprecated__ ("use '" "std::function" "' instead"))) inline pointer_to_binary_function<_Arg1, _Arg2, _Result> ptr_fun(_Result (*__x)(_Arg1, _Arg2)) { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); } template struct _Identity : public unary_function<_Tp, _Tp> { _Tp& operator()(_Tp& __x) const { return __x; } const _Tp& operator()(const _Tp& __x) const { return __x; } }; template struct _Identity : _Identity<_Tp> { }; template struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> { typename _Pair::first_type& operator()(_Pair& __x) const { return __x.first; } const typename _Pair::first_type& operator()(const _Pair& __x) const { return __x.first; } template typename _Pair2::first_type& operator()(_Pair2& __x) const { return __x.first; } template const typename _Pair2::first_type& operator()(const _Pair2& __x) const { return __x.first; } }; template struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type> { typename _Pair::second_type& operator()(_Pair& __x) const { return __x.second; } const typename _Pair::second_type& operator()(const _Pair& __x) const { return __x.second; } }; # 1267 "/usr/include/c++/15/bits/stl_function.h" 3 template class mem_fun_t : public unary_function<_Tp*, _Ret> { public: explicit mem_fun_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) { } _Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); } private: _Ret (_Tp::*_M_f)(); } __attribute__ ((__deprecated__)); template class const_mem_fun_t : public unary_function { public: explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) { } _Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); } private: _Ret (_Tp::*_M_f)() const; } __attribute__ ((__deprecated__)); template class mem_fun_ref_t : public unary_function<_Tp, _Ret> { public: explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) { } _Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); } private: _Ret (_Tp::*_M_f)(); } __attribute__ ((__deprecated__)); template class const_mem_fun_ref_t : public unary_function<_Tp, _Ret> { public: explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) { } _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); } private: _Ret (_Tp::*_M_f)() const; } __attribute__ ((__deprecated__)); template class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret> { public: explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) { } _Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg); } __attribute__ ((__deprecated__)); template class const_mem_fun1_t : public binary_function { public: explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) { } _Ret operator()(const _Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg) const; } __attribute__ ((__deprecated__)); template class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> { public: explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) { } _Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg); } __attribute__ ((__deprecated__)); template class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> { public: explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) { } _Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg) const; } __attribute__ ((__deprecated__)); template __attribute__ ((__deprecated__ ("use '" "std::mem_fn" "' instead"))) inline mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)()) { return mem_fun_t<_Ret, _Tp>(__f); } template __attribute__ ((__deprecated__ ("use '" "std::mem_fn" "' instead"))) inline const_mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)() const) { return const_mem_fun_t<_Ret, _Tp>(__f); } template __attribute__ ((__deprecated__ ("use '" "std::mem_fn" "' instead"))) inline mem_fun_ref_t<_Ret, _Tp> mem_fun_ref(_Ret (_Tp::*__f)()) { return mem_fun_ref_t<_Ret, _Tp>(__f); } template __attribute__ ((__deprecated__ ("use '" "std::mem_fn" "' instead"))) inline const_mem_fun_ref_t<_Ret, _Tp> mem_fun_ref(_Ret (_Tp::*__f)() const) { return const_mem_fun_ref_t<_Ret, _Tp>(__f); } template __attribute__ ((__deprecated__ ("use '" "std::mem_fn" "' instead"))) inline mem_fun1_t<_Ret, _Tp, _Arg> mem_fun(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); } template __attribute__ ((__deprecated__ ("use '" "std::mem_fn" "' instead"))) inline const_mem_fun1_t<_Ret, _Tp, _Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); } template __attribute__ ((__deprecated__ ("use '" "std::mem_fn" "' instead"))) inline mem_fun1_ref_t<_Ret, _Tp, _Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } template __attribute__ ((__deprecated__ ("use '" "std::mem_fn" "' instead"))) inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } #pragma GCC diagnostic pop template> struct __has_is_transparent { }; template struct __has_is_transparent<_Func, _SfinaeType, __void_t> { typedef void type; }; template using __has_is_transparent_t = typename __has_is_transparent<_Func, _SfinaeType>::type; template concept __transparent_comparator = requires { typename _Func::is_transparent; }; } # 1 "/usr/include/c++/15/backward/binders.h" 1 3 # 60 "/usr/include/c++/15/backward/binders.h" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" namespace std __attribute__ ((__visibility__ ("default"))) { # 107 "/usr/include/c++/15/backward/binders.h" 3 template class binder1st : public unary_function { protected: _Operation op; typename _Operation::first_argument_type value; public: binder1st(const _Operation& __x, const typename _Operation::first_argument_type& __y) : op(__x), value(__y) { } typename _Operation::result_type operator()(const typename _Operation::second_argument_type& __x) const { return op(value, __x); } typename _Operation::result_type operator()(typename _Operation::second_argument_type& __x) const { return op(value, __x); } } __attribute__ ((__deprecated__ ("use '" "std::bind" "' instead"))); template __attribute__ ((__deprecated__ ("use '" "std::bind" "' instead"))) inline binder1st<_Operation> bind1st(const _Operation& __fn, const _Tp& __x) { typedef typename _Operation::first_argument_type _Arg1_type; return binder1st<_Operation>(__fn, _Arg1_type(__x)); } template class binder2nd : public unary_function { protected: _Operation op; typename _Operation::second_argument_type value; public: binder2nd(const _Operation& __x, const typename _Operation::second_argument_type& __y) : op(__x), value(__y) { } typename _Operation::result_type operator()(const typename _Operation::first_argument_type& __x) const { return op(__x, value); } typename _Operation::result_type operator()(typename _Operation::first_argument_type& __x) const { return op(__x, value); } } __attribute__ ((__deprecated__ ("use '" "std::bind" "' instead"))); template __attribute__ ((__deprecated__ ("use '" "std::bind" "' instead"))) inline binder2nd<_Operation> bind2nd(const _Operation& __fn, const _Tp& __x) { typedef typename _Operation::second_argument_type _Arg2_type; return binder2nd<_Operation>(__fn, _Arg2_type(__x)); } } #pragma GCC diagnostic pop # 1481 "/usr/include/c++/15/bits/stl_function.h" 2 3 # 52 "/usr/include/c++/15/functional" 2 3 # 1 "/usr/include/c++/15/bits/functional_hash.h" 1 3 # 38 "/usr/include/c++/15/bits/functional_hash.h" 3 # 1 "/usr/include/c++/15/bits/hash_bytes.h" 1 3 # 39 "/usr/include/c++/15/bits/hash_bytes.h" 3 namespace std { size_t _Hash_bytes(const void* __ptr, size_t __len, size_t __seed); size_t _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed); } # 39 "/usr/include/c++/15/bits/functional_hash.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 52 "/usr/include/c++/15/bits/functional_hash.h" 3 template struct __hash_base { }; template struct __hash_empty_base { }; template struct hash; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++14-extensions" template constexpr bool __is_hash_enabled_for = false; template constexpr bool __is_hash_enabled_for<_Tp, __void_t()(declval<_Tp>()))>> = true; #pragma GCC diagnostic pop template struct __hash_not_enabled { __hash_not_enabled(__hash_not_enabled&&) = delete; ~__hash_not_enabled() = delete; }; template struct __hash_enum : public __hash_base { size_t operator()(_Tp __val) const noexcept { using __type = typename underlying_type<_Tp>::type; return hash<__type>{}(static_cast<__type>(__val)); } }; template struct hash : __conditional_t<__is_enum(_Tp), __hash_enum<_Tp>, __hash_not_enabled<_Tp>> { }; template struct hash<_Tp*> : public __hash_base { size_t operator()(_Tp* __p) const noexcept { return reinterpret_cast(__p); } }; # 128 "/usr/include/c++/15/bits/functional_hash.h" 3 template<> struct hash : public __hash_base { size_t operator()(bool __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(char __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(signed char __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(unsigned char __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(wchar_t __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(char8_t __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(char16_t __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(char32_t __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(short __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(int __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(long __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(long long __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(unsigned short __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(unsigned int __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(unsigned long __val) const noexcept { return static_cast(__val); } }; template<> struct hash : public __hash_base { size_t operator()(unsigned long long __val) const noexcept { return static_cast(__val); } }; __extension__ template<> struct hash<__int128> : public __hash_base { size_t operator()(__int128 __val) const noexcept { return static_cast(__val); } }; __extension__ template<> struct hash<__int128 unsigned> : public __hash_base { size_t operator()(__int128 unsigned __val) const noexcept { return static_cast(__val); } }; # 204 "/usr/include/c++/15/bits/functional_hash.h" 3 struct _Hash_impl { static size_t hash(const void* __ptr, size_t __clength, size_t __seed = static_cast(0xc70f6907UL)) { return _Hash_bytes(__ptr, __clength, __seed); } template static size_t hash(const _Tp& __val) { return hash(&__val, sizeof(__val)); } template static size_t __hash_combine(const _Tp& __val, size_t __hash) { return hash(&__val, sizeof(__val), __hash); } }; struct _Fnv_hash_impl { static size_t hash(const void* __ptr, size_t __clength, size_t __seed = static_cast(2166136261UL)) { return _Fnv_hash_bytes(__ptr, __clength, __seed); } template static size_t hash(const _Tp& __val) { return hash(&__val, sizeof(__val)); } template static size_t __hash_combine(const _Tp& __val, size_t __hash) { return hash(&__val, sizeof(__val), __hash); } }; template<> struct hash : public __hash_base { size_t operator()(float __val) const noexcept { return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0; } }; template<> struct hash : public __hash_base { size_t operator()(double __val) const noexcept { return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0; } }; template<> struct hash : public __hash_base { __attribute__ ((__pure__)) size_t operator()(long double __val) const noexcept; }; template<> struct hash : public __hash_base { size_t operator()(nullptr_t) const noexcept { return 0; } }; # 297 "/usr/include/c++/15/bits/functional_hash.h" 3 template struct __is_fast_hash : public std::true_type { }; template<> struct __is_fast_hash> : public std::false_type { }; } # 58 "/usr/include/c++/15/functional" 2 3 # 1 "/usr/include/c++/15/bits/refwrap.h" 1 3 # 47 "/usr/include/c++/15/bits/refwrap.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 58 "/usr/include/c++/15/bits/refwrap.h" 3 template struct _Maybe_unary_or_binary_function { }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" template struct _Maybe_unary_or_binary_function<_Res, _T1> : std::unary_function<_T1, _Res> { }; template struct _Maybe_unary_or_binary_function<_Res, _T1, _T2> : std::binary_function<_T1, _T2, _Res> { }; #pragma GCC diagnostic pop template struct _Mem_fn_traits; template struct _Mem_fn_traits_base { using __result_type = _Res; using __maybe_type = _Maybe_unary_or_binary_function<_Res, _Class*, _ArgTypes...>; using __arity = integral_constant; }; # 109 "/usr/include/c++/15/bits/refwrap.h" 3 template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) > : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) > : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const > : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const > : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile > : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) volatile > : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile > : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const volatile > : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) &> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) &> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const &> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const &> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile &> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) volatile &> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile &> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const volatile &> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) &&> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) &&> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const &&> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const &&> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile &&> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) volatile &&> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile &&> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const volatile &&> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) noexcept> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) noexcept> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const noexcept> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const noexcept> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile noexcept> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) volatile noexcept> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile noexcept> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const volatile noexcept> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) & noexcept> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) & noexcept> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const & noexcept> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const & noexcept> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile & noexcept> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) volatile & noexcept> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile & noexcept> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const volatile & noexcept> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) && noexcept> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) && noexcept> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const && noexcept> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const && noexcept> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile && noexcept> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) volatile && noexcept> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile && noexcept> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes..., ...) const volatile && noexcept> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template> struct _Maybe_get_result_type { }; template struct _Maybe_get_result_type<_Functor, __void_t> { typedef typename _Functor::result_type result_type; }; template struct _Weak_result_type_impl : _Maybe_get_result_type<_Functor> { }; template struct _Weak_result_type_impl<_Res(_ArgTypes...) noexcept (_NE)> { typedef _Res result_type; }; template struct _Weak_result_type_impl<_Res(_ArgTypes..., ...) noexcept (_NE)> { typedef _Res result_type; }; template struct _Weak_result_type_impl<_Res(*)(_ArgTypes...) noexcept (_NE)> { typedef _Res result_type; }; template struct _Weak_result_type_impl<_Res(*)(_ArgTypes..., ...) noexcept (_NE)> { typedef _Res result_type; }; template::value> struct _Weak_result_type_memfun : _Weak_result_type_impl<_Functor> { }; template struct _Weak_result_type_memfun<_MemFunPtr, true> { using result_type = typename _Mem_fn_traits<_MemFunPtr>::__result_type; }; template struct _Weak_result_type_memfun<_Func _Class::*, false> { }; template struct _Weak_result_type : _Weak_result_type_memfun::type> { }; # 309 "/usr/include/c++/15/bits/refwrap.h" 3 template class reference_wrapper { _Tp* _M_data; constexpr static _Tp* _S_fun(_Tp& __r) noexcept { return std::__addressof(__r); } static void _S_fun(_Tp&&) = delete; template> using __not_same = typename enable_if::value>::type; public: typedef _Tp type; template, typename = decltype(reference_wrapper::_S_fun(std::declval<_Up>()))> constexpr reference_wrapper(_Up&& __uref) noexcept(noexcept(reference_wrapper::_S_fun(std::declval<_Up>()))) : _M_data(reference_wrapper::_S_fun(std::forward<_Up>(__uref))) { } reference_wrapper(const reference_wrapper&) = default; reference_wrapper& operator=(const reference_wrapper&) = default; constexpr operator _Tp&() const noexcept { return this->get(); } constexpr _Tp& get() const noexcept { return *_M_data; } template constexpr typename __invoke_result<_Tp&, _Args...>::type operator()(_Args&&... __args) const noexcept(__is_nothrow_invocable<_Tp&, _Args...>::value) { if constexpr (is_object_v) static_assert(sizeof(type), "type must be complete"); return std::__invoke(get(), std::forward<_Args>(__args)...); } # 415 "/usr/include/c++/15/bits/refwrap.h" 3 }; template reference_wrapper(_Tp&) -> reference_wrapper<_Tp>; template constexpr inline reference_wrapper<_Tp> ref(_Tp& __t) noexcept { return reference_wrapper<_Tp>(__t); } template constexpr inline reference_wrapper cref(const _Tp& __t) noexcept { return reference_wrapper(__t); } template void ref(const _Tp&&) = delete; template void cref(const _Tp&&) = delete; template constexpr inline reference_wrapper<_Tp> ref(reference_wrapper<_Tp> __t) noexcept { return __t; } template constexpr inline reference_wrapper cref(reference_wrapper<_Tp> __t) noexcept { return { __t.get() }; } } # 60 "/usr/include/c++/15/functional" 2 3 # 1 "/usr/include/c++/15/bits/std_function.h" 1 3 # 42 "/usr/include/c++/15/bits/std_function.h" 3 # 1 "/usr/include/c++/15/typeinfo" 1 3 # 42 "/usr/include/c++/15/typeinfo" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 43 "/usr/include/c++/15/typeinfo" 2 3 #pragma GCC visibility push(default) extern "C++" { namespace __cxxabiv1 { class __class_type_info; } # 85 "/usr/include/c++/15/typeinfo" 3 namespace std { class type_info { public: virtual ~type_info(); const char* name() const noexcept { return __name[0] == '*' ? __name + 1 : __name; } bool before(const type_info& __arg) const noexcept; constexpr bool operator==(const type_info& __arg) const noexcept; size_t hash_code() const noexcept { return _Hash_bytes(name(), __builtin_strlen(name()), static_cast(0xc70f6907UL)); } virtual bool __is_pointer_p() const; virtual bool __is_function_p() const; virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj, unsigned __outer) const; virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, void **__obj_ptr) const; protected: const char *__name; explicit type_info(const char *__n): __name(__n) { } private: type_info& operator=(const type_info&) = delete; type_info(const type_info&) = delete; # 168 "/usr/include/c++/15/typeinfo" 3 }; inline bool type_info::before(const type_info& __arg) const noexcept { if (__name[0] != '*' || __arg.__name[0] != '*') return __builtin_strcmp (__name, __arg.__name) < 0; # 188 "/usr/include/c++/15/typeinfo" 3 return __name < __arg.__name; } constexpr inline bool type_info::operator==(const type_info& __arg) const noexcept { if (std::__is_constant_evaluated()) return this == &__arg; if (__name == __arg.__name) return true; return __name[0] != '*' && __builtin_strcmp (__name, __arg.name()) == 0; } # 224 "/usr/include/c++/15/typeinfo" 3 class bad_cast : public exception { public: bad_cast() noexcept { } virtual ~bad_cast() noexcept; virtual const char* what() const noexcept; }; class bad_typeid : public exception { public: bad_typeid () noexcept { } virtual ~bad_typeid() noexcept; virtual const char* what() const noexcept; }; } } #pragma GCC visibility pop # 43 "/usr/include/c++/15/bits/std_function.h" 2 3 # 1 "/usr/include/c++/15/bits/functexcept.h" 1 3 # 42 "/usr/include/c++/15/bits/functexcept.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { void __throw_bad_exception(void) __attribute__((__noreturn__)); void __throw_bad_alloc(void) __attribute__((__noreturn__)); void __throw_bad_array_new_length(void) __attribute__((__noreturn__)); void __throw_bad_cast(void) __attribute__((__noreturn__,__cold__)); void __throw_bad_typeid(void) __attribute__((__noreturn__,__cold__)); void __throw_logic_error(const char*) __attribute__((__noreturn__,__cold__)); void __throw_domain_error(const char*) __attribute__((__noreturn__,__cold__)); void __throw_invalid_argument(const char*) __attribute__((__noreturn__,__cold__)); void __throw_length_error(const char*) __attribute__((__noreturn__,__cold__)); void __throw_out_of_range(const char*) __attribute__((__noreturn__,__cold__)); void __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__,__cold__)) __attribute__((__format__(__gnu_printf__, 1, 2))); void __throw_runtime_error(const char*) __attribute__((__noreturn__,__cold__)); void __throw_range_error(const char*) __attribute__((__noreturn__,__cold__)); void __throw_overflow_error(const char*) __attribute__((__noreturn__,__cold__)); void __throw_underflow_error(const char*) __attribute__((__noreturn__,__cold__)); void __throw_ios_failure(const char*) __attribute__((__noreturn__,__cold__)); void __throw_ios_failure(const char*, int) __attribute__((__noreturn__,__cold__)); void __throw_system_error(int) __attribute__((__noreturn__,__cold__)); void __throw_future_error(int) __attribute__((__noreturn__,__cold__)); void __throw_bad_function_call() __attribute__((__noreturn__,__cold__)); # 140 "/usr/include/c++/15/bits/functexcept.h" 3 } # 46 "/usr/include/c++/15/bits/std_function.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { class bad_function_call : public std::exception { public: virtual ~bad_function_call() noexcept; const char* what() const noexcept; }; template struct __is_location_invariant : is_trivially_copyable<_Tp>::type { }; class _Undefined_class; union _Nocopy_types { void* _M_object; const void* _M_const_object; void (*_M_function_pointer)(); void (_Undefined_class::*_M_member_pointer)(); }; union [[gnu::may_alias]] _Any_data { void* _M_access() noexcept { return &_M_pod_data[0]; } const void* _M_access() const noexcept { return &_M_pod_data[0]; } template _Tp& _M_access() noexcept { return *static_cast<_Tp*>(_M_access()); } template const _Tp& _M_access() const noexcept { return *static_cast(_M_access()); } _Nocopy_types _M_unused; char _M_pod_data[sizeof(_Nocopy_types)]; }; enum _Manager_operation { __get_type_info, __get_functor_ptr, __clone_functor, __destroy_functor }; template class function; class _Function_base { public: static const size_t _M_max_size = sizeof(_Nocopy_types); static const size_t _M_max_align = __alignof__(_Nocopy_types); template class _Base_manager { protected: static const bool __stored_locally = (__is_location_invariant<_Functor>::value && sizeof(_Functor) <= _M_max_size && __alignof__(_Functor) <= _M_max_align && (_M_max_align % __alignof__(_Functor) == 0)); using _Local_storage = integral_constant; static _Functor* _M_get_pointer(const _Any_data& __source) noexcept { if constexpr (__stored_locally) { const _Functor& __f = __source._M_access<_Functor>(); return const_cast<_Functor*>(std::__addressof(__f)); } else return __source._M_access<_Functor*>(); } private: template static void _M_create(_Any_data& __dest, _Fn&& __f, true_type) { ::new (__dest._M_access()) _Functor(std::forward<_Fn>(__f)); } template static void _M_create(_Any_data& __dest, _Fn&& __f, false_type) { __dest._M_access<_Functor*>() = new _Functor(std::forward<_Fn>(__f)); } static void _M_destroy(_Any_data& __victim, true_type) { __victim._M_access<_Functor>().~_Functor(); } static void _M_destroy(_Any_data& __victim, false_type) { delete __victim._M_access<_Functor*>(); } public: static bool _M_manager(_Any_data& __dest, const _Any_data& __source, _Manager_operation __op) { switch (__op) { case __get_type_info: __dest._M_access() = nullptr; break; case __get_functor_ptr: __dest._M_access<_Functor*>() = _M_get_pointer(__source); break; case __clone_functor: _M_init_functor(__dest, *const_cast(_M_get_pointer(__source))); break; case __destroy_functor: _M_destroy(__dest, _Local_storage()); break; } return false; } template static void _M_init_functor(_Any_data& __functor, _Fn&& __f) noexcept(__and_<_Local_storage, is_nothrow_constructible<_Functor, _Fn>>::value) { _M_create(__functor, std::forward<_Fn>(__f), _Local_storage()); } template static bool _M_not_empty_function(const function<_Signature>& __f) noexcept { return static_cast(__f); } template static bool _M_not_empty_function(_Tp* __fp) noexcept { return __fp != nullptr; } template static bool _M_not_empty_function(_Tp _Class::* __mp) noexcept { return __mp != nullptr; } template static bool _M_not_empty_function(const _Tp&) noexcept { return true; } }; _Function_base() = default; ~_Function_base() { if (_M_manager) _M_manager(_M_functor, _M_functor, __destroy_functor); } bool _M_empty() const { return !_M_manager; } using _Manager_type = bool (*)(_Any_data&, const _Any_data&, _Manager_operation); _Any_data _M_functor{}; _Manager_type _M_manager{}; }; template class _Function_handler; template class _Function_handler<_Res(_ArgTypes...), _Functor> : public _Function_base::_Base_manager<_Functor> { using _Base = _Function_base::_Base_manager<_Functor>; public: static bool _M_manager(_Any_data& __dest, const _Any_data& __source, _Manager_operation __op) { switch (__op) { case __get_functor_ptr: __dest._M_access<_Functor*>() = _Base::_M_get_pointer(__source); break; default: _Base::_M_manager(__dest, __source, __op); } return false; } static _Res _M_invoke(const _Any_data& __functor, _ArgTypes&&... __args) { return std::__invoke_r<_Res>(*_Base::_M_get_pointer(__functor), std::forward<_ArgTypes>(__args)...); } template static constexpr bool _S_nothrow_init() noexcept { return __and_>::value; } }; template<> class _Function_handler { public: static bool _M_manager(_Any_data&, const _Any_data&, _Manager_operation) { return false; } }; template::value> struct _Target_handler : _Function_handler<_Signature, typename remove_cv<_Functor>::type> { }; template struct _Target_handler<_Signature, _Functor, false> : _Function_handler { }; template class function<_Res(_ArgTypes...)> : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>, private _Function_base { template, function>::value> using _Decay_t = typename __enable_if_t>::type; template, typename _Res2 = __invoke_result<_DFunc&, _ArgTypes...>> struct _Callable : __is_invocable_impl<_Res2, _Res>::type { }; template using _Requires = __enable_if_t<_Cond::value, _Tp>; template using _Handler = _Function_handler<_Res(_ArgTypes...), __decay_t<_Functor>>; public: typedef _Res result_type; function() noexcept : _Function_base() { } function(nullptr_t) noexcept : _Function_base() { } # 388 "/usr/include/c++/15/bits/std_function.h" 3 function(const function& __x) : _Function_base() { if (static_cast(__x)) { __x._M_manager(_M_functor, __x._M_functor, __clone_functor); _M_invoker = __x._M_invoker; _M_manager = __x._M_manager; } } # 406 "/usr/include/c++/15/bits/std_function.h" 3 function(function&& __x) noexcept : _Function_base(), _M_invoker(__x._M_invoker) { if (static_cast(__x)) { _M_functor = __x._M_functor; _M_manager = __x._M_manager; __x._M_manager = nullptr; __x._M_invoker = nullptr; } } # 435 "/usr/include/c++/15/bits/std_function.h" 3 template>> function(_Functor&& __f) noexcept(_Handler<_Functor>::template _S_nothrow_init<_Functor>()) : _Function_base() { static_assert(is_copy_constructible<__decay_t<_Functor>>::value, "std::function target must be copy-constructible"); static_assert(is_constructible<__decay_t<_Functor>, _Functor>::value, "std::function target must be constructible from the " "constructor argument"); using _My_handler = _Handler<_Functor>; if (_My_handler::_M_not_empty_function(__f)) { _My_handler::_M_init_functor(_M_functor, std::forward<_Functor>(__f)); _M_invoker = &_My_handler::_M_invoke; _M_manager = &_My_handler::_M_manager; } } # 470 "/usr/include/c++/15/bits/std_function.h" 3 function& operator=(const function& __x) { function(__x).swap(*this); return *this; } # 488 "/usr/include/c++/15/bits/std_function.h" 3 function& operator=(function&& __x) noexcept { function(std::move(__x)).swap(*this); return *this; } # 502 "/usr/include/c++/15/bits/std_function.h" 3 function& operator=(nullptr_t) noexcept { if (_M_manager) { _M_manager(_M_functor, _M_functor, __destroy_functor); _M_manager = nullptr; _M_invoker = nullptr; } return *this; } # 531 "/usr/include/c++/15/bits/std_function.h" 3 template _Requires<_Callable<_Functor>, function&> operator=(_Functor&& __f) noexcept(_Handler<_Functor>::template _S_nothrow_init<_Functor>()) { function(std::forward<_Functor>(__f)).swap(*this); return *this; } template function& operator=(reference_wrapper<_Functor> __f) noexcept { function(__f).swap(*this); return *this; } # 558 "/usr/include/c++/15/bits/std_function.h" 3 void swap(function& __x) noexcept { std::swap(_M_functor, __x._M_functor); std::swap(_M_manager, __x._M_manager); std::swap(_M_invoker, __x._M_invoker); } # 575 "/usr/include/c++/15/bits/std_function.h" 3 explicit operator bool() const noexcept { return !_M_empty(); } # 588 "/usr/include/c++/15/bits/std_function.h" 3 _Res operator()(_ArgTypes... __args) const { if (_M_empty()) __throw_bad_function_call(); return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...); } # 632 "/usr/include/c++/15/bits/std_function.h" 3 template _Functor* target() noexcept { const function* __const_this = this; const _Functor* __func = __const_this->template target<_Functor>(); return *const_cast<_Functor**>(&__func); } template const _Functor* target() const noexcept { if constexpr (is_object<_Functor>::value) { using _Handler = _Target_handler<_Res(_ArgTypes...), _Functor>; if (_M_manager == &_Handler::_M_manager ) { _Any_data __ptr; _M_manager(__ptr, _M_functor, __get_functor_ptr); return __ptr._M_access(); } } return nullptr; } private: using _Invoker_type = _Res (*)(const _Any_data&, _ArgTypes&&...); _Invoker_type _M_invoker = nullptr; }; template struct __function_guide_helper { }; template struct __function_guide_helper< _Res (_Tp::*) (_Args...) noexcept(_Nx) > { using type = _Res(_Args...); }; template struct __function_guide_helper< _Res (_Tp::*) (_Args...) & noexcept(_Nx) > { using type = _Res(_Args...); }; template struct __function_guide_helper< _Res (_Tp::*) (_Args...) const noexcept(_Nx) > { using type = _Res(_Args...); }; template struct __function_guide_helper< _Res (_Tp::*) (_Args...) const & noexcept(_Nx) > { using type = _Res(_Args...); }; template struct __function_guide_helper<_Res (*) (_Tp, _Args...) noexcept(_Nx)> { using type = _Res(_Args...); }; template struct __function_guide_static_helper { }; template struct __function_guide_static_helper<_Res (*) (_Args...) noexcept(_Nx)> { using type = _Res(_Args...); }; template using __function_guide_t = typename __conditional_t< requires (_Fn& __f) { (void) __f.operator(); }, __function_guide_static_helper<_Op>, __function_guide_helper<_Op>>::type; template function(_Res(*)(_ArgTypes...)) -> function<_Res(_ArgTypes...)>; template> function(_Fn) -> function<_Signature>; # 745 "/usr/include/c++/15/bits/std_function.h" 3 template inline bool operator==(const function<_Res(_Args...)>& __f, nullptr_t) noexcept { return !static_cast(__f); } # 784 "/usr/include/c++/15/bits/std_function.h" 3 template inline void swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y) noexcept { __x.swap(__y); } namespace __detail::__variant { template struct _Never_valueless_alt; template struct _Never_valueless_alt> : std::true_type { }; } } # 62 "/usr/include/c++/15/functional" 2 3 # 1 "/usr/include/c++/15/unordered_map" 1 3 # 36 "/usr/include/c++/15/unordered_map" 3 # 1 "/usr/include/c++/15/bits/requires_hosted.h" 1 3 # 37 "/usr/include/c++/15/unordered_map" 2 3 # 1 "/usr/include/c++/15/bits/unordered_map.h" 1 3 # 33 "/usr/include/c++/15/bits/unordered_map.h" 3 # 1 "/usr/include/c++/15/bits/hashtable.h" 1 3 # 37 "/usr/include/c++/15/bits/hashtable.h" 3 # 1 "/usr/include/c++/15/bits/hashtable_policy.h" 1 3 # 36 "/usr/include/c++/15/bits/hashtable_policy.h" 3 # 1 "/usr/include/c++/15/bits/stl_algobase.h" 1 3 # 69 "/usr/include/c++/15/bits/stl_algobase.h" 3 # 1 "/usr/include/c++/15/debug/debug.h" 1 3 # 48 "/usr/include/c++/15/debug/debug.h" 3 namespace std { namespace __debug { } } namespace __gnu_debug { using namespace std::__debug; template struct _Safe_iterator; } # 70 "/usr/include/c++/15/bits/stl_algobase.h" 2 3 # 1 "/usr/include/c++/15/bits/predefined_ops.h" 1 3 # 35 "/usr/include/c++/15/bits/predefined_ops.h" 3 namespace __gnu_cxx { namespace __ops { struct _Iter_less_iter { template constexpr bool operator()(_Iterator1 __it1, _Iterator2 __it2) const { return *__it1 < *__it2; } }; constexpr inline _Iter_less_iter __iter_less_iter() { return _Iter_less_iter(); } struct _Iter_less_val { constexpr _Iter_less_val() = default; constexpr explicit _Iter_less_val(_Iter_less_iter) { } template constexpr bool operator()(_Iterator __it, _Value& __val) const { return *__it < __val; } }; constexpr inline _Iter_less_val __iter_less_val() { return _Iter_less_val(); } constexpr inline _Iter_less_val __iter_comp_val(_Iter_less_iter) { return _Iter_less_val(); } struct _Val_less_iter { constexpr _Val_less_iter() = default; constexpr explicit _Val_less_iter(_Iter_less_iter) { } template constexpr bool operator()(_Value& __val, _Iterator __it) const { return __val < *__it; } }; constexpr inline _Val_less_iter __val_less_iter() { return _Val_less_iter(); } constexpr inline _Val_less_iter __val_comp_iter(_Iter_less_iter) { return _Val_less_iter(); } struct _Iter_equal_to_iter { template constexpr bool operator()(_Iterator1 __it1, _Iterator2 __it2) const { return *__it1 == *__it2; } }; constexpr inline _Iter_equal_to_iter __iter_equal_to_iter() { return _Iter_equal_to_iter(); } struct _Iter_equal_to_val { template constexpr bool operator()(_Iterator __it, _Value& __val) const { return *__it == __val; } }; constexpr inline _Iter_equal_to_val __iter_equal_to_val() { return _Iter_equal_to_val(); } constexpr inline _Iter_equal_to_val __iter_comp_val(_Iter_equal_to_iter) { return _Iter_equal_to_val(); } template struct _Iter_comp_iter { _Compare _M_comp; explicit constexpr _Iter_comp_iter(_Compare __comp) : _M_comp(std::move(__comp)) { } template constexpr bool operator()(_Iterator1 __it1, _Iterator2 __it2) { return bool(_M_comp(*__it1, *__it2)); } }; template constexpr inline _Iter_comp_iter<_Compare> __iter_comp_iter(_Compare __comp) { return _Iter_comp_iter<_Compare>(std::move(__comp)); } template struct _Iter_comp_val { _Compare _M_comp; constexpr explicit _Iter_comp_val(_Compare __comp) : _M_comp(std::move(__comp)) { } constexpr explicit _Iter_comp_val(const _Iter_comp_iter<_Compare>& __comp) : _M_comp(__comp._M_comp) { } constexpr explicit _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) : _M_comp(std::move(__comp._M_comp)) { } template constexpr bool operator()(_Iterator __it, _Value& __val) { return bool(_M_comp(*__it, __val)); } }; template constexpr inline _Iter_comp_val<_Compare> __iter_comp_val(_Compare __comp) { return _Iter_comp_val<_Compare>(std::move(__comp)); } template constexpr inline _Iter_comp_val<_Compare> __iter_comp_val(_Iter_comp_iter<_Compare> __comp) { return _Iter_comp_val<_Compare>(std::move(__comp)); } template struct _Val_comp_iter { _Compare _M_comp; constexpr explicit _Val_comp_iter(_Compare __comp) : _M_comp(std::move(__comp)) { } constexpr explicit _Val_comp_iter(const _Iter_comp_iter<_Compare>& __comp) : _M_comp(__comp._M_comp) { } constexpr explicit _Val_comp_iter(_Iter_comp_iter<_Compare>&& __comp) : _M_comp(std::move(__comp._M_comp)) { } template constexpr bool operator()(_Value& __val, _Iterator __it) { return bool(_M_comp(__val, *__it)); } }; template constexpr inline _Val_comp_iter<_Compare> __val_comp_iter(_Compare __comp) { return _Val_comp_iter<_Compare>(std::move(__comp)); } template constexpr inline _Val_comp_iter<_Compare> __val_comp_iter(_Iter_comp_iter<_Compare> __comp) { return _Val_comp_iter<_Compare>(std::move(__comp)); } template struct _Iter_equals_val { _Value& _M_value; constexpr explicit _Iter_equals_val(_Value& __value) : _M_value(__value) { } template constexpr bool operator()(_Iterator __it) { return *__it == _M_value; } }; template constexpr inline _Iter_equals_val<_Value> __iter_equals_val(_Value& __val) { return _Iter_equals_val<_Value>(__val); } template struct _Iter_equals_iter { _Iterator1 _M_it1; constexpr explicit _Iter_equals_iter(_Iterator1 __it1) : _M_it1(__it1) { } template constexpr bool operator()(_Iterator2 __it2) { return *__it2 == *_M_it1; } }; template constexpr inline _Iter_equals_iter<_Iterator> __iter_comp_iter(_Iter_equal_to_iter, _Iterator __it) { return _Iter_equals_iter<_Iterator>(__it); } template struct _Iter_pred { _Predicate _M_pred; constexpr explicit _Iter_pred(_Predicate __pred) : _M_pred(std::move(__pred)) { } template constexpr bool operator()(_Iterator __it) { return bool(_M_pred(*__it)); } }; template constexpr inline _Iter_pred<_Predicate> __pred_iter(_Predicate __pred) { return _Iter_pred<_Predicate>(std::move(__pred)); } template struct _Iter_comp_to_val { _Compare _M_comp; _Value& _M_value; constexpr _Iter_comp_to_val(_Compare __comp, _Value& __value) : _M_comp(std::move(__comp)), _M_value(__value) { } template constexpr bool operator()(_Iterator __it) { return bool(_M_comp(*__it, _M_value)); } }; template _Iter_comp_to_val<_Compare, _Value> constexpr __iter_comp_val(_Compare __comp, _Value &__val) { return _Iter_comp_to_val<_Compare, _Value>(std::move(__comp), __val); } template struct _Iter_comp_to_iter { _Compare _M_comp; _Iterator1 _M_it1; constexpr _Iter_comp_to_iter(_Compare __comp, _Iterator1 __it1) : _M_comp(std::move(__comp)), _M_it1(__it1) { } template constexpr bool operator()(_Iterator2 __it2) { return bool(_M_comp(*__it2, *_M_it1)); } }; template constexpr inline _Iter_comp_to_iter<_Compare, _Iterator> __iter_comp_iter(_Iter_comp_iter<_Compare> __comp, _Iterator __it) { return _Iter_comp_to_iter<_Compare, _Iterator>( std::move(__comp._M_comp), __it); } template struct _Iter_negate { _Predicate _M_pred; constexpr explicit _Iter_negate(_Predicate __pred) : _M_pred(std::move(__pred)) { } template constexpr bool operator()(_Iterator __it) { return !bool(_M_pred(*__it)); } }; template constexpr inline _Iter_negate<_Predicate> __negate(_Iter_pred<_Predicate> __pred) { return _Iter_negate<_Predicate>(std::move(__pred._M_pred)); } } } # 72 "/usr/include/c++/15/bits/stl_algobase.h" 2 3 # 1 "/usr/include/c++/15/bit" 1 3 # 63 "/usr/include/c++/15/bit" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 64 "/usr/include/c++/15/bit" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 87 "/usr/include/c++/15/bit" 3 template [[nodiscard]] constexpr _To bit_cast(const _From& __from) noexcept requires (sizeof(_To) == sizeof(_From)) && is_trivially_copyable_v<_To> && is_trivially_copyable_v<_From> { return __builtin_bit_cast(_To, __from); } # 109 "/usr/include/c++/15/bit" 3 template [[nodiscard]] constexpr _Tp byteswap(_Tp __value) noexcept { if constexpr (sizeof(_Tp) == 1) return __value; if !consteval { if constexpr (sizeof(_Tp) == 2) return __builtin_bswap16(__value); if constexpr (sizeof(_Tp) == 4) return __builtin_bswap32(__value); if constexpr (sizeof(_Tp) == 8) return __builtin_bswap64(__value); if constexpr (sizeof(_Tp) == 16) return __builtin_bswap128(__value); } using _Up = typename __make_unsigned<__remove_cv_t<_Tp>>::__type; size_t __diff = 8 * (sizeof(_Tp) - 1); _Up __mask1 = static_cast(~0); _Up __mask2 = __mask1 << __diff; _Up __val = __value; for (size_t __i = 0; __i < sizeof(_Tp) / 2; ++__i) { _Up __byte1 = __val & __mask1; _Up __byte2 = __val & __mask2; __val = (__val ^ __byte1 ^ __byte2 ^ (__byte1 << __diff) ^ (__byte2 >> __diff)); __mask1 <<= 8; __mask2 >>= 8; __diff -= 2 * 8; } return __val; } template constexpr _Tp __rotl(_Tp __x, int __s) noexcept { constexpr auto _Nd = __gnu_cxx::__int_traits<_Tp>::__digits; if constexpr ((_Nd & (_Nd - 1)) == 0) { constexpr unsigned __uNd = _Nd; const unsigned __r = __s; return (__x << (__r % __uNd)) | (__x >> ((-__r) % __uNd)); } const int __r = __s % _Nd; if (__r == 0) return __x; else if (__r > 0) return (__x << __r) | (__x >> ((_Nd - __r) % _Nd)); else return (__x >> -__r) | (__x << ((_Nd + __r) % _Nd)); } template constexpr _Tp __rotr(_Tp __x, int __s) noexcept { constexpr auto _Nd = __gnu_cxx::__int_traits<_Tp>::__digits; if constexpr ((_Nd & (_Nd - 1)) == 0) { constexpr unsigned __uNd = _Nd; const unsigned __r = __s; return (__x >> (__r % __uNd)) | (__x << ((-__r) % __uNd)); } const int __r = __s % _Nd; if (__r == 0) return __x; else if (__r > 0) return (__x >> __r) | (__x << ((_Nd - __r) % _Nd)); else return (__x << -__r) | (__x >> ((_Nd + __r) % _Nd)); } template constexpr int __countl_zero(_Tp __x) noexcept { using __gnu_cxx::__int_traits; constexpr auto _Nd = __int_traits<_Tp>::__digits; return __builtin_clzg(__x, _Nd); # 249 "/usr/include/c++/15/bit" 3 } template constexpr int __countl_one(_Tp __x) noexcept { return std::__countl_zero<_Tp>((_Tp)~__x); } template constexpr int __countr_zero(_Tp __x) noexcept { using __gnu_cxx::__int_traits; constexpr auto _Nd = __int_traits<_Tp>::__digits; return __builtin_ctzg(__x, _Nd); # 294 "/usr/include/c++/15/bit" 3 } template constexpr int __countr_one(_Tp __x) noexcept { return std::__countr_zero((_Tp)~__x); } template constexpr int __popcount(_Tp __x) noexcept { return __builtin_popcountg(__x); # 334 "/usr/include/c++/15/bit" 3 } template constexpr bool __has_single_bit(_Tp __x) noexcept { return std::__popcount(__x) == 1; } template constexpr _Tp __bit_ceil(_Tp __x) noexcept { using __gnu_cxx::__int_traits; constexpr auto _Nd = __int_traits<_Tp>::__digits; if (__x == 0 || __x == 1) return 1; auto __shift_exponent = _Nd - std::__countl_zero((_Tp)(__x - 1u)); if (!std::__is_constant_evaluated()) { do { if (std::__is_constant_evaluated() && !bool(__shift_exponent != __int_traits<_Tp>::__digits)) std::__glibcxx_assert_fail(); } while (false); } using __promoted_type = decltype(__x << 1); if constexpr (!is_same<__promoted_type, _Tp>::value) { const int __extra_exp = sizeof(__promoted_type) / sizeof(_Tp) / 2; __shift_exponent |= (__shift_exponent & _Nd) << __extra_exp; } return (_Tp)1u << __shift_exponent; } template constexpr _Tp __bit_floor(_Tp __x) noexcept { constexpr auto _Nd = __gnu_cxx::__int_traits<_Tp>::__digits; if (__x == 0) return 0; return (_Tp)1u << (_Nd - std::__countl_zero((_Tp)(__x >> 1))); } template constexpr int __bit_width(_Tp __x) noexcept { constexpr auto _Nd = __gnu_cxx::__int_traits<_Tp>::__digits; return _Nd - std::__countl_zero(__x); } template concept __unsigned_integer = __is_unsigned_integer<_Tp>::value; template<__unsigned_integer _Tp> [[nodiscard]] constexpr _Tp rotl(_Tp __x, int __s) noexcept { return std::__rotl(__x, __s); } template<__unsigned_integer _Tp> [[nodiscard]] constexpr _Tp rotr(_Tp __x, int __s) noexcept { return std::__rotr(__x, __s); } template<__unsigned_integer _Tp> constexpr int countl_zero(_Tp __x) noexcept { return std::__countl_zero(__x); } template<__unsigned_integer _Tp> constexpr int countl_one(_Tp __x) noexcept { return std::__countl_one(__x); } template<__unsigned_integer _Tp> constexpr int countr_zero(_Tp __x) noexcept { return std::__countr_zero(__x); } template<__unsigned_integer _Tp> constexpr int countr_one(_Tp __x) noexcept { return std::__countr_one(__x); } template<__unsigned_integer _Tp> constexpr int popcount(_Tp __x) noexcept { return std::__popcount(__x); } template<__unsigned_integer _Tp> constexpr bool has_single_bit(_Tp __x) noexcept { return std::__has_single_bit(__x); } template<__unsigned_integer _Tp> constexpr _Tp bit_ceil(_Tp __x) noexcept { return std::__bit_ceil(__x); } template<__unsigned_integer _Tp> constexpr _Tp bit_floor(_Tp __x) noexcept { return std::__bit_floor(__x); } template<__unsigned_integer _Tp> constexpr int bit_width(_Tp __x) noexcept { return std::__bit_width(__x); } # 486 "/usr/include/c++/15/bit" 3 enum class endian { little = 1234, big = 4321, native = 1234 }; } # 77 "/usr/include/c++/15/bits/stl_algobase.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template constexpr inline int __memcmp(const _Tp* __first1, const _Up* __first2, size_t __num) { static_assert(sizeof(_Tp) == sizeof(_Up), "can be compared with memcmp"); if (std::is_constant_evaluated()) { for(; __num > 0; ++__first1, ++__first2, --__num) if (*__first1 != *__first2) return *__first1 < *__first2 ? -1 : 1; return 0; } else return __builtin_memcmp(__first1, __first2, sizeof(_Tp) * __num); } # 153 "/usr/include/c++/15/bits/stl_algobase.h" 3 template constexpr inline void iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) { # 186 "/usr/include/c++/15/bits/stl_algobase.h" 3 swap(*__a, *__b); } # 202 "/usr/include/c++/15/bits/stl_algobase.h" 3 template constexpr _ForwardIterator2 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { ; for (; __first1 != __last1; ++__first1, (void)++__first2) std::iter_swap(__first1, __first2); return __first2; } # 231 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline const _Tp& min(const _Tp& __a, const _Tp& __b) { if (__b < __a) return __b; return __a; } # 255 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline const _Tp& max(const _Tp& __a, const _Tp& __b) { if (__a < __b) return __b; return __a; } # 279 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) { if (__comp(__b, __a)) return __b; return __a; } # 301 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp) { if (__comp(__a, __b)) return __b; return __a; } template struct _Deque_iterator; struct _Bit_iterator; template struct char_traits; template class istreambuf_iterator; template class ostreambuf_iterator; template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type __copy_move_a2(_CharT*, _CharT*, ostreambuf_iterator<_CharT, char_traits<_CharT> >); template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type __copy_move_a2(const _CharT*, const _CharT*, ostreambuf_iterator<_CharT, char_traits<_CharT> >); template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, _CharT*>::__type __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*); template typename __gnu_cxx::__enable_if< __is_char<_CharT>::__value, std::_Deque_iterator<_CharT, _CharT&, _CharT*> >::__type __copy_move_a2( istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, std::_Deque_iterator<_CharT, _CharT&, _CharT*>); template concept __memcpyable_iterators = contiguous_iterator<_OutIter> && contiguous_iterator<_InIter> && sized_sentinel_for<_Sent, _InIter> && requires (_OutIter __o, _InIter __i) { requires !!__memcpyable::__value; }; # 395 "/usr/include/c++/15/bits/stl_algobase.h" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template __attribute__((__always_inline__)) constexpr inline void __assign_one(_OutIter& __out, _InIter& __in) { if constexpr (_IsMove) *__out = std::move(*__in); else *__out = *__in; } template constexpr inline _OutIter __copy_move_a2(_InIter __first, _Sent __last, _OutIter __result) { typedef __decltype(*__first) _InRef; typedef __decltype(*__result) _OutRef; if constexpr (!__is_trivially_assignable(_OutRef, _InRef)) { } else if (std::__is_constant_evaluated()) { } else if constexpr (__memcpyable<_OutIter, _InIter>::__value) { ptrdiff_t __n = std::distance(__first, __last); if (__builtin_expect(__n > 1, true)) { __builtin_memmove(__result, __first, __n * sizeof(*__first)); __result += __n; } else if (__n == 1) { std::__assign_one<_IsMove>(__result, __first); ++__result; } return __result; } else if constexpr (__memcpyable_iterators<_OutIter, _InIter, _Sent>) { if (auto __n = __last - __first; __n > 1) [[likely]] { void* __dest = std::to_address(__result); const void* __src = std::to_address(__first); size_t __nbytes = __n * sizeof(iter_value_t<_InIter>); (void) std::to_address(__result += __n); (void) std::to_address(__first += __n); __builtin_memmove(__dest, __src, __nbytes); } else if (__n == 1) { std::__assign_one<_IsMove>(__result, __first); ++__result; } return __result; } for (; __first != __last; ++__result, (void)++__first) std::__assign_one<_IsMove>(__result, __first); return __result; } #pragma GCC diagnostic pop template _OI __copy_move_a1(std::_Deque_iterator<_Tp, _Ref, _Ptr>, std::_Deque_iterator<_Tp, _Ref, _Ptr>, _OI); template std::_Deque_iterator<_OTp, _OTp&, _OTp*> __copy_move_a1(std::_Deque_iterator<_ITp, _IRef, _IPtr>, std::_Deque_iterator<_ITp, _IRef, _IPtr>, std::_Deque_iterator<_OTp, _OTp&, _OTp*>); template typename __gnu_cxx::__enable_if< __is_random_access_iter<_II>::__value, std::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type __copy_move_a1(_II, _II, std::_Deque_iterator<_Tp, _Tp&, _Tp*>); template __attribute__((__always_inline__)) constexpr inline _OI __copy_move_a1(_II __first, _II __last, _OI __result) { return std::__copy_move_a2<_IsMove>(__first, __last, __result); } template __attribute__((__always_inline__)) constexpr inline _OI __copy_move_a(_II __first, _II __last, _OI __result) { return std::__niter_wrap(__result, std::__copy_move_a1<_IsMove>(std::__niter_base(__first), std::__niter_base(__last), std::__niter_base(__result))); } template constexpr _OI __copy_move_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&, const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&, _OI); template constexpr __gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat> __copy_move_a(_II, _II, const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&); template constexpr ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat> __copy_move_a(const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&, const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&, const ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat>&); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template constexpr _OutputIterator __copy_n_a(_InputIterator __first, _Size __n, _OutputIterator __result, bool) { typedef __decltype(*__first) _InRef; typedef __decltype(*__result) _OutRef; if constexpr (!__is_trivially_assignable(_OutRef, _InRef)) { } else if (std::is_constant_evaluated()) { } else if constexpr (__memcpyable<_OutputIterator, _InputIterator>::__value) { if (__builtin_expect(__n > 1, true)) { __builtin_memmove(__result, __first, __n * sizeof(*__first)); __result += __n; } else if (__n == 1) *__result++ = *__first; return __result; } else if constexpr (__memcpyable_iterators<_OutputIterator, _InputIterator>) { if (__n > 1) [[likely]] { void* __dest = std::to_address(__result); const void* __src = std::to_address(__first); size_t __nbytes = __n * sizeof(iter_value_t<_InputIterator>); (void) std::to_address(__result += __n); (void) std::to_address(__first += __n); __builtin_memmove(__dest, __src, __nbytes); } else if (__n == 1) *__result++ = *__first; return __result; } if (__n > 0) { while (true) { *__result = *__first; ++__result; if (--__n > 0) ++__first; else break; } } return __result; } #pragma GCC diagnostic pop template typename __gnu_cxx::__enable_if< __is_char<_CharT>::__value, _CharT*>::__type __copy_n_a(istreambuf_iterator<_CharT, char_traits<_CharT> >, _Size, _CharT*, bool); template typename __gnu_cxx::__enable_if< __is_char<_CharT>::__value, std::_Deque_iterator<_CharT, _CharT&, _CharT*> >::__type __copy_n_a(istreambuf_iterator<_CharT, char_traits<_CharT> >, _Size, std::_Deque_iterator<_CharT, _CharT&, _CharT*>, bool); # 630 "/usr/include/c++/15/bits/stl_algobase.h" 3 template constexpr inline _OI copy(_II __first, _II __last, _OI __result) { ; return std::__copy_move_a<__is_move_iterator<_II>::__value> (std::__miter_base(__first), std::__miter_base(__last), __result); } # 663 "/usr/include/c++/15/bits/stl_algobase.h" 3 template constexpr inline _OI move(_II __first, _II __last, _OI __result) { ; return std::__copy_move_a(std::__miter_base(__first), std::__miter_base(__last), __result); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template constexpr inline _BI2 __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result) { typedef __decltype(*__first) _InRef; typedef __decltype(*__result) _OutRef; if constexpr (!__is_trivially_assignable(_OutRef, _InRef)) { } else if (std::is_constant_evaluated()) { } else if constexpr (__memcpyable<_BI2, _BI1>::__value) { ptrdiff_t __n = std::distance(__first, __last); std::advance(__result, -__n); if (__builtin_expect(__n > 1, true)) { __builtin_memmove(__result, __first, __n * sizeof(*__first)); } else if (__n == 1) std::__assign_one<_IsMove>(__result, __first); return __result; } else if constexpr (__memcpyable_iterators<_BI2, _BI1>) { if (auto __n = __last - __first; __n > 1) [[likely]] { const void* __src = std::to_address(__first); (void) std::to_address(__result -= __n); (void) std::to_address(__first += __n); void* __dest = std::to_address(__result); size_t __nbytes = __n * sizeof(iter_value_t<_BI1>); __builtin_memmove(__dest, __src, __nbytes); } else if (__n == 1) { --__result; std::__assign_one<_IsMove>(__result, __first); } return __result; } while (__first != __last) { --__last; --__result; std::__assign_one<_IsMove>(__result, __last); } return __result; } #pragma GCC diagnostic pop template __attribute__((__always_inline__)) constexpr inline _BI2 __copy_move_backward_a1(_BI1 __first, _BI1 __last, _BI2 __result) { return std::__copy_move_backward_a2<_IsMove>(__first, __last, __result); } template _OI __copy_move_backward_a1(std::_Deque_iterator<_Tp, _Ref, _Ptr>, std::_Deque_iterator<_Tp, _Ref, _Ptr>, _OI); template std::_Deque_iterator<_OTp, _OTp&, _OTp*> __copy_move_backward_a1( std::_Deque_iterator<_ITp, _IRef, _IPtr>, std::_Deque_iterator<_ITp, _IRef, _IPtr>, std::_Deque_iterator<_OTp, _OTp&, _OTp*>); template typename __gnu_cxx::__enable_if< __is_random_access_iter<_II>::__value, std::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type __copy_move_backward_a1(_II, _II, std::_Deque_iterator<_Tp, _Tp&, _Tp*>); template __attribute__((__always_inline__)) constexpr inline _OI __copy_move_backward_a(_II __first, _II __last, _OI __result) { return std::__niter_wrap(__result, std::__copy_move_backward_a1<_IsMove> (std::__niter_base(__first), std::__niter_base(__last), std::__niter_base(__result))); } template constexpr _OI __copy_move_backward_a( const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&, const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&, _OI); template constexpr __gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat> __copy_move_backward_a(_II, _II, const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&); template constexpr ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat> __copy_move_backward_a( const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&, const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&, const ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat>&); # 833 "/usr/include/c++/15/bits/stl_algobase.h" 3 template __attribute__((__always_inline__)) constexpr inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) { ; return std::__copy_move_backward_a<__is_move_iterator<_BI1>::__value> (std::__miter_base(__first), std::__miter_base(__last), __result); } # 869 "/usr/include/c++/15/bits/stl_algobase.h" 3 template __attribute__((__always_inline__)) constexpr inline _BI2 move_backward(_BI1 __first, _BI1 __last, _BI2 __result) { ; return std::__copy_move_backward_a(std::__miter_base(__first), std::__miter_base(__last), __result); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template constexpr inline void __fill_a1(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wlong-long" const bool __load_outside_loop = __is_trivially_constructible(_Tp, const _Tp&) && __is_trivially_assignable(__decltype(*__first), const _Tp&) && sizeof(_Tp) <= sizeof(long long); #pragma GCC diagnostic pop typedef typename __gnu_cxx::__conditional_type<__load_outside_loop, const _Tp, const _Tp&>::__type _Up; _Up __val(__value); for (; __first != __last; ++__first) *__first = __val; } #pragma GCC diagnostic pop template constexpr inline typename __gnu_cxx::__enable_if<__is_byte<_Up>::__value && (__are_same<_Up, _Tp>::__value || __memcpyable_integer<_Tp>::__width), void>::__type __fill_a1(_Up* __first, _Up* __last, const _Tp& __x) { const _Up __val = __x; if (std::is_constant_evaluated()) { for (; __first != __last; ++__first) *__first = __val; return; } if (const size_t __len = __last - __first) __builtin_memset(__first, static_cast(__val), __len); } template __attribute__((__always_inline__)) constexpr inline void __fill_a1(::__gnu_cxx::__normal_iterator<_Ite, _Cont> __first, ::__gnu_cxx::__normal_iterator<_Ite, _Cont> __last, const _Tp& __value) { std::__fill_a1(__first.base(), __last.base(), __value); } template void __fill_a1(const std::_Deque_iterator<_Tp, _Tp&, _Tp*>&, const std::_Deque_iterator<_Tp, _Tp&, _Tp*>&, const _VTp&); constexpr void __fill_a1(std::_Bit_iterator, std::_Bit_iterator, const bool&); template __attribute__((__always_inline__)) constexpr inline void __fill_a(_FIte __first, _FIte __last, const _Tp& __value) { std::__fill_a1(__first, __last, __value); } template constexpr void __fill_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&, const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&, const _Tp&); # 1000 "/usr/include/c++/15/bits/stl_algobase.h" 3 template __attribute__((__always_inline__)) constexpr inline void fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { ; std::__fill_a(__first, __last, __value); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wlong-long" inline constexpr int __size_to_integer(int __n) { return __n; } inline constexpr unsigned __size_to_integer(unsigned __n) { return __n; } inline constexpr long __size_to_integer(long __n) { return __n; } inline constexpr unsigned long __size_to_integer(unsigned long __n) { return __n; } inline constexpr long long __size_to_integer(long long __n) { return __n; } inline constexpr unsigned long long __size_to_integer(unsigned long long __n) { return __n; } __extension__ inline constexpr __int128 __size_to_integer(__int128 __n) { return __n; } __extension__ inline constexpr unsigned __int128 __size_to_integer(unsigned __int128 __n) { return __n; } # 1055 "/usr/include/c++/15/bits/stl_algobase.h" 3 inline constexpr long long __size_to_integer(float __n) { return (long long)__n; } inline constexpr long long __size_to_integer(double __n) { return (long long)__n; } inline constexpr long long __size_to_integer(long double __n) { return (long long)__n; } __extension__ inline constexpr long long __size_to_integer(__float128 __n) { return (long long)__n; } #pragma GCC diagnostic pop #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" #pragma GCC diagnostic ignored "-Wlong-long" template constexpr inline _OutputIterator __fill_n_a1(_OutputIterator __first, _Size __n, const _Tp& __value) { const bool __load_outside_loop = __is_trivially_constructible(_Tp, const _Tp&) && __is_trivially_assignable(__decltype(*__first), const _Tp&) && sizeof(_Tp) <= sizeof(long long); typedef typename __gnu_cxx::__conditional_type<__load_outside_loop, const _Tp, const _Tp&>::__type _Up; _Up __val(__value); for (; __n > 0; --__n, (void) ++__first) *__first = __val; return __first; } #pragma GCC diagnostic pop template constexpr ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat> __fill_n_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>& __first, _Size __n, const _Tp& __value, std::input_iterator_tag); template __attribute__((__always_inline__)) constexpr inline _OutputIterator __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value, std::output_iterator_tag) { static_assert(is_integral<_Size>{}, "fill_n must pass integral size"); return __fill_n_a1(__first, __n, __value); } template __attribute__((__always_inline__)) constexpr inline _OutputIterator __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value, std::input_iterator_tag) { static_assert(is_integral<_Size>{}, "fill_n must pass integral size"); return __fill_n_a1(__first, __n, __value); } template __attribute__((__always_inline__)) constexpr inline _OutputIterator __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value, std::random_access_iterator_tag) { static_assert(is_integral<_Size>{}, "fill_n must pass integral size"); if (__n <= 0) return __first; ; std::__fill_a(__first, __first + __n, __value); return __first + __n; } # 1169 "/usr/include/c++/15/bits/stl_algobase.h" 3 template __attribute__((__always_inline__)) constexpr inline _OI fill_n(_OI __first, _Size __n, const _Tp& __value) { return std::__fill_n_a(__first, std::__size_to_integer(__n), __value, std::__iterator_category(__first)); } template struct __equal { template constexpr static bool equal(_II1 __first1, _II1 __last1, _II2 __first2) { for (; __first1 != __last1; ++__first1, (void) ++__first2) if (!(*__first1 == *__first2)) return false; return true; } }; template<> struct __equal { template constexpr static bool equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2) { if (const size_t __len = (__last1 - __first1)) return !std::__memcmp(__first1, __first2, __len); return true; } }; template typename __gnu_cxx::__enable_if< __is_random_access_iter<_II>::__value, bool>::__type __equal_aux1(std::_Deque_iterator<_Tp, _Ref, _Ptr>, std::_Deque_iterator<_Tp, _Ref, _Ptr>, _II); template bool __equal_aux1(std::_Deque_iterator<_Tp1, _Ref1, _Ptr1>, std::_Deque_iterator<_Tp1, _Ref1, _Ptr1>, std::_Deque_iterator<_Tp2, _Ref2, _Ptr2>); template typename __gnu_cxx::__enable_if< __is_random_access_iter<_II>::__value, bool>::__type __equal_aux1(_II, _II, std::_Deque_iterator<_Tp, _Ref, _Ptr>); template constexpr inline bool __equal_aux1(_II1 __first1, _II1 __last1, _II2 __first2) { typedef typename iterator_traits<_II1>::value_type _ValueType1; const bool __simple = ((__is_integer<_ValueType1>::__value || __is_pointer(_ValueType1) || is_same_v<_ValueType1, byte> ) && __memcmpable<_II1, _II2>::__value); return std::__equal<__simple>::equal(__first1, __last1, __first2); } template __attribute__((__always_inline__)) constexpr inline bool __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2) { return std::__equal_aux1(std::__niter_base(__first1), std::__niter_base(__last1), std::__niter_base(__first2)); } template constexpr bool __equal_aux(const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&, const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&, _II2); template constexpr bool __equal_aux(_II1, _II1, const ::__gnu_debug::_Safe_iterator<_II2, _Seq2, _Cat2>&); template constexpr bool __equal_aux(const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&, const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&, const ::__gnu_debug::_Safe_iterator<_II2, _Seq2, _Cat2>&); template struct __lc_rai { template constexpr static _II1 __newlast1(_II1, _II1 __last1, _II2, _II2) { return __last1; } template constexpr static bool __cnd2(_II __first, _II __last) { return __first != __last; } }; template<> struct __lc_rai { template constexpr static _RAI1 __newlast1(_RAI1 __first1, _RAI1 __last1, _RAI2 __first2, _RAI2 __last2) { const typename iterator_traits<_RAI1>::difference_type __diff1 = __last1 - __first1; const typename iterator_traits<_RAI2>::difference_type __diff2 = __last2 - __first2; return __diff2 < __diff1 ? __first1 + __diff2 : __last1; } template static constexpr bool __cnd2(_RAI, _RAI) { return true; } }; template constexpr bool __lexicographical_compare_impl(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2, _Compare __comp) { typedef typename iterator_traits<_II1>::iterator_category _Category1; typedef typename iterator_traits<_II2>::iterator_category _Category2; typedef std::__lc_rai<_Category1, _Category2> __rai_type; __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2); for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2); ++__first1, (void)++__first2) { if (__comp(__first1, __first2)) return true; if (__comp(__first2, __first1)) return false; } return __first1 == __last1 && __first2 != __last2; } template struct __lexicographical_compare { template constexpr static bool __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { using __gnu_cxx::__ops::__iter_less_iter; return std::__lexicographical_compare_impl(__first1, __last1, __first2, __last2, __iter_less_iter()); } template constexpr static int __3way(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { while (__first1 != __last1) { if (__first2 == __last2) return +1; if (*__first1 < *__first2) return -1; if (*__first2 < *__first1) return +1; ++__first1; ++__first2; } return int(__first2 == __last2) - 1; } }; template<> struct __lexicographical_compare { template constexpr static bool __lc(const _Tp* __first1, const _Tp* __last1, const _Up* __first2, const _Up* __last2) { return __3way(__first1, __last1, __first2, __last2) < 0; } template constexpr static ptrdiff_t __3way(const _Tp* __first1, const _Tp* __last1, const _Up* __first2, const _Up* __last2) { const size_t __len1 = __last1 - __first1; const size_t __len2 = __last2 - __first2; if (const size_t __len = std::min(__len1, __len2)) if (int __result = std::__memcmp(__first1, __first2, __len)) return __result; return ptrdiff_t(__len1 - __len2); } }; template constexpr inline bool __lexicographical_compare_aux1(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { typedef typename iterator_traits<_II1>::value_type _ValueType1; typedef typename iterator_traits<_II2>::value_type _ValueType2; const bool __simple = (__is_memcmp_ordered_with<_ValueType1, _ValueType2>::__value && __is_pointer(_II1) && __is_pointer(_II2) && !is_volatile_v>> && !is_volatile_v>> ); return std::__lexicographical_compare<__simple>::__lc(__first1, __last1, __first2, __last2); } template bool __lexicographical_compare_aux1( std::_Deque_iterator<_Tp1, _Ref1, _Ptr1>, std::_Deque_iterator<_Tp1, _Ref1, _Ptr1>, _Tp2*, _Tp2*); template bool __lexicographical_compare_aux1(_Tp1*, _Tp1*, std::_Deque_iterator<_Tp2, _Ref2, _Ptr2>, std::_Deque_iterator<_Tp2, _Ref2, _Ptr2>); template bool __lexicographical_compare_aux1( std::_Deque_iterator<_Tp1, _Ref1, _Ptr1>, std::_Deque_iterator<_Tp1, _Ref1, _Ptr1>, std::_Deque_iterator<_Tp2, _Ref2, _Ptr2>, std::_Deque_iterator<_Tp2, _Ref2, _Ptr2>); template constexpr inline bool __lexicographical_compare_aux(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { return std::__lexicographical_compare_aux1(std::__niter_base(__first1), std::__niter_base(__last1), std::__niter_base(__first2), std::__niter_base(__last2)); } template constexpr bool __lexicographical_compare_aux( const ::__gnu_debug::_Safe_iterator<_Iter1, _Seq1, _Cat1>&, const ::__gnu_debug::_Safe_iterator<_Iter1, _Seq1, _Cat1>&, _II2, _II2); template constexpr bool __lexicographical_compare_aux( _II1, _II1, const ::__gnu_debug::_Safe_iterator<_Iter2, _Seq2, _Cat2>&, const ::__gnu_debug::_Safe_iterator<_Iter2, _Seq2, _Cat2>&); template constexpr bool __lexicographical_compare_aux( const ::__gnu_debug::_Safe_iterator<_Iter1, _Seq1, _Cat1>&, const ::__gnu_debug::_Safe_iterator<_Iter1, _Seq1, _Cat1>&, const ::__gnu_debug::_Safe_iterator<_Iter2, _Seq2, _Cat2>&, const ::__gnu_debug::_Safe_iterator<_Iter2, _Seq2, _Cat2>&); template constexpr _ForwardIterator __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType; _DistanceType __len = std::distance(__first, __last); while (__len > 0) { _DistanceType __half = __len >> 1; _ForwardIterator __middle = __first; std::advance(__middle, __half); if (__comp(__middle, __val)) { __first = __middle; ++__first; __len = __len - __half - 1; } else __len = __half; } return __first; } # 1532 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val) { ; return std::__lower_bound(__first, __last, __val, __gnu_cxx::__ops::__iter_less_val()); } template inline constexpr _Tp __lg(_Tp __n) { return std::__bit_width(make_unsigned_t<_Tp>(__n)) - 1; # 1568 "/usr/include/c++/15/bits/stl_algobase.h" 3 } # 1584 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline bool equal(_II1 __first1, _II1 __last1, _II2 __first2) { ; return std::__equal_aux(__first1, __last1, __first2); } # 1615 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _BinaryPredicate __binary_pred) { ; for (; __first1 != __last1; ++__first1, (void)++__first2) if (!bool(__binary_pred(*__first1, *__first2))) return false; return true; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template constexpr inline bool __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { using _RATag = random_access_iterator_tag; using _Cat1 = typename iterator_traits<_II1>::iterator_category; using _Cat2 = typename iterator_traits<_II2>::iterator_category; using _RAIters = __and_, is_same<_Cat2, _RATag>>; if constexpr (_RAIters::value) { if ((__last1 - __first1) != (__last2 - __first2)) return false; return std::equal(__first1, __last1, __first2); } else { for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2) if (!(*__first1 == *__first2)) return false; return __first1 == __last1 && __first2 == __last2; } } template constexpr inline bool __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2, _BinaryPredicate __binary_pred) { using _RATag = random_access_iterator_tag; using _Cat1 = typename iterator_traits<_II1>::iterator_category; using _Cat2 = typename iterator_traits<_II2>::iterator_category; using _RAIters = __and_, is_same<_Cat2, _RATag>>; if constexpr (_RAIters::value) { if ((__last1 - __first1) != (__last2 - __first2)) return false; return std::equal(__first1, __last1, __first2, __binary_pred); } else { for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2) if (!bool(__binary_pred(*__first1, *__first2))) return false; return __first1 == __last1 && __first2 == __last2; } } #pragma GCC diagnostic pop # 1706 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline bool equal(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { ; ; return std::__equal4(__first1, __last1, __first2, __last2); } # 1739 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred) { ; ; return std::__equal4(__first1, __last1, __first2, __last2, __binary_pred); } # 1771 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline bool lexicographical_compare(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { ; ; return std::__lexicographical_compare_aux(__first1, __last1, __first2, __last2); } # 1806 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline bool lexicographical_compare(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2, _Compare __comp) { ; ; return std::__lexicographical_compare_impl (__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template concept __memcmp_ordered_with = (__is_memcmp_ordered_with, iter_value_t<_Iter2>>::__value) && contiguous_iterator<_Iter1> && contiguous_iterator<_Iter2>; template constexpr auto __min_cmp(_Tp __x, _Tp __y) { struct _Res { _Tp _M_min; decltype(__x <=> __y) _M_cmp; }; auto __c = __x <=> __y; if (__c > 0) return _Res{__y, __c}; return _Res{__x, __c}; } # 1860 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[nodiscard]] constexpr auto lexicographical_compare_three_way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Comp __comp) -> decltype(__comp(*__first1, *__first2)) { ; ; using _Cat = decltype(__comp(*__first1, *__first2)); static_assert(same_as, _Cat>); if (!std::__is_constant_evaluated()) if constexpr (same_as<_Comp, __detail::_Synth3way> || same_as<_Comp, compare_three_way>) if constexpr (__memcmp_ordered_with<_InputIter1, _InputIter2>) { const auto [__len, __lencmp] = std:: __min_cmp(__last1 - __first1, __last2 - __first2); if (__len) { const auto __blen = __len * sizeof(*__first1); const auto __c = __builtin_memcmp(&*__first1, &*__first2, __blen) <=> 0; if (__c != 0) return __c; } return __lencmp; } while (__first1 != __last1) { if (__first2 == __last2) return strong_ordering::greater; if (auto __cmp = __comp(*__first1, *__first2); __cmp != 0) return __cmp; ++__first1; ++__first2; } return (__first2 == __last2) <=> true; } template constexpr auto lexicographical_compare_three_way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2) { return std:: lexicographical_compare_three_way(__first1, __last1, __first2, __last2, compare_three_way{}); } template constexpr pair<_InputIterator1, _InputIterator2> __mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __binary_pred) { while (__first1 != __last1 && __binary_pred(__first1, __first2)) { ++__first1; ++__first2; } return pair<_InputIterator1, _InputIterator2>(__first1, __first2); } # 1949 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { ; return std::__mismatch(__first1, __last1, __first2, __gnu_cxx::__ops::__iter_equal_to_iter()); } # 1983 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __binary_pred) { ; return std::__mismatch(__first1, __last1, __first2, __gnu_cxx::__ops::__iter_comp_iter(__binary_pred)); } template constexpr pair<_InputIterator1, _InputIterator2> __mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __binary_pred) { while (__first1 != __last1 && __first2 != __last2 && __binary_pred(__first1, __first2)) { ++__first1; ++__first2; } return pair<_InputIterator1, _InputIterator2>(__first1, __first2); } # 2031 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { ; ; return std::__mismatch(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_equal_to_iter()); } # 2067 "/usr/include/c++/15/bits/stl_algobase.h" 3 template [[__nodiscard__]] constexpr inline pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __binary_pred) { ; ; return std::__mismatch(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__binary_pred)); } template constexpr inline _Iterator __find_if(_Iterator __first, _Iterator __last, _Predicate __pred) { #pragma GCC unroll 4 while (__first != __last && !__pred(__first)) ++__first; return __first; } template constexpr typename iterator_traits<_InputIterator>::difference_type __count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { typename iterator_traits<_InputIterator>::difference_type __n = 0; for (; __first != __last; ++__first) if (__pred(__first)) ++__n; return __n; } template constexpr _ForwardIterator __remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { __first = std::__find_if(__first, __last, __pred); if (__first == __last) return __first; _ForwardIterator __result = __first; ++__first; for (; __first != __last; ++__first) if (!__pred(__first)) { *__result = std::move(*__first); ++__result; } return __result; } template constexpr _ForwardIterator1 __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __predicate) { if (__first1 == __last1 || __first2 == __last2) return __first1; _ForwardIterator2 __p1(__first2); if (++__p1 == __last2) return std::__find_if(__first1, __last1, __gnu_cxx::__ops::__iter_comp_iter(__predicate, __first2)); _ForwardIterator1 __current = __first1; for (;;) { __first1 = std::__find_if(__first1, __last1, __gnu_cxx::__ops::__iter_comp_iter(__predicate, __first2)); if (__first1 == __last1) return __last1; _ForwardIterator2 __p = __p1; __current = __first1; if (++__current == __last1) return __last1; while (__predicate(__current, __p)) { if (++__p == __last2) return __first1; if (++__current == __last1) return __last1; } ++__first1; } return __first1; } template constexpr 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; _ForwardIterator2 __last2 = __first2; std::advance(__last2, std::distance(__first1, __last1)); for (_ForwardIterator1 __scan = __first1; __scan != __last1; ++__scan) { if (__scan != std::__find_if(__first1, __scan, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan))) continue; auto __matches = std::__count_if(__first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan)); if (0 == __matches || std::__count_if(__scan, __last1, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan)) != __matches) return false; } return true; } # 2230 "/usr/include/c++/15/bits/stl_algobase.h" 3 template constexpr inline bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { ; return std::__is_permutation(__first1, __last1, __first2, __gnu_cxx::__ops::__iter_equal_to_iter()); } # 2272 "/usr/include/c++/15/bits/stl_algobase.h" 3 template constexpr inline _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __predicate) { ; ; return std::__search(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__predicate)); } } # 37 "/usr/include/c++/15/bits/hashtable_policy.h" 2 3 # 1 "/usr/include/c++/15/ext/aligned_buffer.h" 1 3 # 42 "/usr/include/c++/15/ext/aligned_buffer.h" 3 namespace __gnu_cxx { template struct __aligned_membuf { # 60 "/usr/include/c++/15/ext/aligned_buffer.h" 3 alignas(_Tp) unsigned char _M_storage[sizeof(_Tp)]; __aligned_membuf() = default; __aligned_membuf(std::nullptr_t) { } void* _M_addr() noexcept { return static_cast(&_M_storage); } const void* _M_addr() const noexcept { return static_cast(&_M_storage); } _Tp* _M_ptr() noexcept { return static_cast<_Tp*>(_M_addr()); } const _Tp* _M_ptr() const noexcept { return static_cast(_M_addr()); } }; # 95 "/usr/include/c++/15/ext/aligned_buffer.h" 3 template struct __aligned_buffer { alignas(__alignof__(_Tp)) unsigned char _M_storage[sizeof(_Tp)]; __aligned_buffer() = default; __aligned_buffer(std::nullptr_t) { } void* _M_addr() noexcept { return static_cast(&_M_storage); } const void* _M_addr() const noexcept { return static_cast(&_M_storage); } _Tp* _M_ptr() noexcept { return static_cast<_Tp*>(_M_addr()); } const _Tp* _M_ptr() const noexcept { return static_cast(_M_addr()); } }; } # 39 "/usr/include/c++/15/bits/hashtable_policy.h" 2 3 # 1 "/usr/include/c++/15/ext/alloc_traits.h" 1 3 # 36 "/usr/include/c++/15/ext/alloc_traits.h" 3 # 1 "/usr/include/c++/15/bits/alloc_traits.h" 1 3 # 34 "/usr/include/c++/15/bits/alloc_traits.h" 3 # 1 "/usr/include/c++/15/bits/memoryfwd.h" 1 3 # 52 "/usr/include/c++/15/bits/memoryfwd.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 66 "/usr/include/c++/15/bits/memoryfwd.h" 3 template class allocator; template<> class allocator; template struct uses_allocator; template struct allocator_traits; } # 35 "/usr/include/c++/15/bits/alloc_traits.h" 2 3 # 1 "/usr/include/c++/15/bits/allocator.h" 1 3 # 46 "/usr/include/c++/15/bits/allocator.h" 3 # 1 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++allocator.h" 1 3 # 33 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++allocator.h" 3 # 1 "/usr/include/c++/15/bits/new_allocator.h" 1 3 # 41 "/usr/include/c++/15/bits/new_allocator.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 62 "/usr/include/c++/15/bits/new_allocator.h" 3 template class __new_allocator { public: typedef _Tp value_type; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; # 83 "/usr/include/c++/15/bits/new_allocator.h" 3 typedef std::true_type propagate_on_container_move_assignment; __attribute__((__always_inline__)) constexpr __new_allocator() noexcept { } __attribute__((__always_inline__)) constexpr __new_allocator(const __new_allocator&) noexcept { } template __attribute__((__always_inline__)) constexpr __new_allocator(const __new_allocator<_Tp1>&) noexcept { } __new_allocator& operator=(const __new_allocator&) = default; # 125 "/usr/include/c++/15/bits/new_allocator.h" 3 [[__nodiscard__]] _Tp* allocate(size_type __n, const void* = static_cast(0)) { static_assert(sizeof(_Tp) != 0, "cannot allocate incomplete types"); if (__builtin_expect(__n > this->_M_max_size(), false)) { if (__n > (std::size_t(-1) / sizeof(_Tp))) std::__throw_bad_array_new_length(); std::__throw_bad_alloc(); } if (alignof(_Tp) > 16) { std::align_val_t __al = std::align_val_t(alignof(_Tp)); return static_cast<_Tp*>(__builtin_operator_new(__n * sizeof(_Tp), __al)); } return static_cast<_Tp*>(__builtin_operator_new(__n * sizeof(_Tp))); } void deallocate(_Tp* __p, size_type __n __attribute__ ((__unused__))) { if (alignof(_Tp) > 16) { __builtin_operator_delete((__p), (__n) * sizeof(_Tp), std::align_val_t(alignof(_Tp))); return; } __builtin_operator_delete((__p), (__n) * sizeof(_Tp)); } # 213 "/usr/include/c++/15/bits/new_allocator.h" 3 template friend __attribute__((__always_inline__)) constexpr bool operator==(const __new_allocator&, const __new_allocator<_Up>&) noexcept { return true; } # 227 "/usr/include/c++/15/bits/new_allocator.h" 3 private: __attribute__((__always_inline__)) constexpr size_type _M_max_size() const noexcept { return std::size_t(0x7fffffffffffffffL) / sizeof(_Tp); } }; } # 34 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++allocator.h" 2 3 namespace std { # 46 "/usr/include/x86_64-linux-gnu/c++/15/bits/c++allocator.h" 3 template using __allocator_base = __new_allocator<_Tp>; } # 47 "/usr/include/c++/15/bits/allocator.h" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++11-extensions" namespace std __attribute__ ((__visibility__ ("default"))) { # 75 "/usr/include/c++/15/bits/allocator.h" 3 template<> class allocator { public: typedef void value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; # 96 "/usr/include/c++/15/bits/allocator.h" 3 using propagate_on_container_move_assignment = true_type; using is_always_equal __attribute__ ((__deprecated__ ("use '" "std::allocator_traits::is_always_equal" "' instead"))) = true_type; allocator() = default; ~allocator() = default; template __attribute__((__always_inline__)) constexpr allocator(const allocator<_Up>&) noexcept { } }; # 132 "/usr/include/c++/15/bits/allocator.h" 3 template class allocator : public __allocator_base<_Tp> { public: typedef _Tp value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; # 155 "/usr/include/c++/15/bits/allocator.h" 3 using propagate_on_container_move_assignment = true_type; using is_always_equal __attribute__ ((__deprecated__ ("use '" "std::allocator_traits::is_always_equal" "' instead"))) = true_type; __attribute__((__always_inline__)) constexpr allocator() noexcept { } __attribute__((__always_inline__)) constexpr allocator(const allocator& __a) noexcept : __allocator_base<_Tp>(__a) { } allocator& operator=(const allocator&) = default; template __attribute__((__always_inline__)) constexpr allocator(const allocator<_Tp1>&) noexcept { } __attribute__((__always_inline__)) constexpr ~allocator() noexcept { } [[nodiscard,__gnu__::__always_inline__]] constexpr _Tp* allocate(size_t __n) { if (std::__is_constant_evaluated()) { if (__builtin_mul_overflow(__n, sizeof(_Tp), &__n)) std::__throw_bad_array_new_length(); return static_cast<_Tp*>(::operator new(__n)); } return __allocator_base<_Tp>::allocate(__n, 0); } [[__gnu__::__always_inline__]] constexpr void deallocate(_Tp* __p, size_t __n) { if (std::__is_constant_evaluated()) { ::operator delete(__p); return; } __allocator_base<_Tp>::deallocate(__p, __n); } friend __attribute__((__always_inline__)) constexpr bool operator==(const allocator&, const allocator&) noexcept { return true; } # 232 "/usr/include/c++/15/bits/allocator.h" 3 }; template __attribute__((__always_inline__)) inline constexpr bool operator==(const allocator<_T1>&, const allocator<_T2>&) noexcept { return true; } # 259 "/usr/include/c++/15/bits/allocator.h" 3 template class allocator { public: typedef _Tp value_type; allocator() { } template allocator(const allocator<_Up>&) { } }; template class allocator { public: typedef _Tp value_type; allocator() { } template allocator(const allocator<_Up>&) { } }; template class allocator { public: typedef _Tp value_type; allocator() { } template allocator(const allocator<_Up>&) { } }; extern template class allocator; extern template class allocator; } #pragma GCC diagnostic pop # 40 "/usr/include/c++/15/bits/alloc_traits.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 52 "/usr/include/c++/15/bits/alloc_traits.h" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++14-extensions" #pragma GCC diagnostic ignored "-Wc++17-extensions" struct __allocator_traits_base { template struct __rebind : __replace_first_arg<_Tp, _Up> { static_assert(is_same< typename __replace_first_arg<_Tp, typename _Tp::value_type>::type, _Tp>::value, "allocator_traits::rebind_alloc must be A"); }; template requires requires { typename _Tp::template rebind<_Up>::other; } struct __rebind<_Tp, _Up> { using type = typename _Tp::template rebind<_Up>::other; static_assert(is_same< typename _Tp::template rebind::other, _Tp>::value, "allocator_traits::rebind_alloc must be A"); }; protected: template using __pointer = typename _Tp::pointer; template using __c_pointer = typename _Tp::const_pointer; template using __v_pointer = typename _Tp::void_pointer; template using __cv_pointer = typename _Tp::const_void_pointer; template using __pocca = typename _Tp::propagate_on_container_copy_assignment; template using __pocma = typename _Tp::propagate_on_container_move_assignment; template using __pocs = typename _Tp::propagate_on_container_swap; template using __equal = __type_identity; template static constexpr bool __has_allocate_hint = requires (_Alloc& __a, _Sz __n, _Vp __hint) { __a.allocate(__n, __hint); }; # 133 "/usr/include/c++/15/bits/alloc_traits.h" 3 template static constexpr bool __has_construct = requires (_Alloc& __a, _Tp* __p, _Args&&... __args) { __a.construct(__p, std::forward<_Args>(__args)...); }; template static constexpr bool __can_construct_at = requires (_Tp* __p, _Args&&... __args) { std::construct_at(__p, std::forward<_Args>(__args)...); }; template static constexpr bool __can_construct = __has_construct<_Alloc, _Tp, _Args...> || __can_construct_at<_Tp, _Args...>; # 184 "/usr/include/c++/15/bits/alloc_traits.h" 3 template static constexpr bool __has_destroy = requires (_Alloc& __a, _Tp* __p) { __a.destroy(__p); }; # 202 "/usr/include/c++/15/bits/alloc_traits.h" 3 template static constexpr bool __has_max_size = requires (const _Alloc& __a) { __a.max_size(); }; # 220 "/usr/include/c++/15/bits/alloc_traits.h" 3 template static constexpr bool __has_soccc = requires (const _Alloc& __a) { __a.select_on_container_copy_construction(); }; # 235 "/usr/include/c++/15/bits/alloc_traits.h" 3 }; template using __alloc_rebind = typename __allocator_traits_base::template __rebind<_Alloc, _Up>::type; # 248 "/usr/include/c++/15/bits/alloc_traits.h" 3 template struct allocator_traits : __allocator_traits_base { typedef _Alloc allocator_type; typedef typename _Alloc::value_type value_type; using pointer = __detected_or_t; private: template class _Func, typename _Tp, typename = void> struct _Ptr { using type = typename pointer_traits::template rebind<_Tp>; }; template class _Func, typename _Tp> struct _Ptr<_Func, _Tp, __void_t<_Func<_Alloc>>> { using type = _Func<_Alloc>; }; template struct _Diff { using type = typename pointer_traits<_PtrT>::difference_type; }; template struct _Diff<_A2, _PtrT, __void_t> { using type = typename _A2::difference_type; }; template struct _Size : make_unsigned<_DiffT> { }; template struct _Size<_A2, _DiffT, __void_t> { using type = typename _A2::size_type; }; public: using const_pointer = typename _Ptr<__c_pointer, const value_type>::type; using void_pointer = typename _Ptr<__v_pointer, void>::type; using const_void_pointer = typename _Ptr<__cv_pointer, const void>::type; using difference_type = typename _Diff<_Alloc, pointer>::type; using size_type = typename _Size<_Alloc, difference_type>::type; using propagate_on_container_copy_assignment = __detected_or_t; using propagate_on_container_move_assignment = __detected_or_t; using propagate_on_container_swap = __detected_or_t; using is_always_equal = typename __detected_or_t, __equal, _Alloc>::type; template using rebind_alloc = __alloc_rebind<_Alloc, _Tp>; template using rebind_traits = allocator_traits>; # 383 "/usr/include/c++/15/bits/alloc_traits.h" 3 [[__nodiscard__]] static constexpr pointer allocate(_Alloc& __a, size_type __n) { return __a.allocate(__n); } # 398 "/usr/include/c++/15/bits/alloc_traits.h" 3 [[__nodiscard__]] static constexpr pointer allocate(_Alloc& __a, size_type __n, const_void_pointer __hint) { if constexpr (__has_allocate_hint<_Alloc, size_type, const_void_pointer>) return __a.allocate(__n, __hint); else return __a.allocate(__n); } # 415 "/usr/include/c++/15/bits/alloc_traits.h" 3 static constexpr void deallocate(_Alloc& __a, pointer __p, size_type __n) { __a.deallocate(__p, __n); } # 430 "/usr/include/c++/15/bits/alloc_traits.h" 3 template requires __can_construct<_Alloc, _Tp, _Args...> static constexpr void construct(_Alloc& __a, _Tp* __p, _Args&&... __args) noexcept(_S_nothrow_construct<_Tp, _Args...>()) { if constexpr (__has_construct<_Alloc, _Tp, _Args...>) __a.construct(__p, std::forward<_Args>(__args)...); else std::_Construct(__p, std::forward<_Args>(__args)...); } # 454 "/usr/include/c++/15/bits/alloc_traits.h" 3 template static constexpr void destroy(_Alloc& __a, _Tp* __p) noexcept(_S_nothrow_destroy<_Tp>()) { if constexpr (__has_destroy<_Alloc, _Tp>) __a.destroy(__p); else std::_Destroy(__p); } # 473 "/usr/include/c++/15/bits/alloc_traits.h" 3 static constexpr size_type max_size(const _Alloc& __a) noexcept { if constexpr (__has_max_size<_Alloc>) return __a.max_size(); else return __gnu_cxx::__numeric_traits::__max / sizeof(value_type); } # 493 "/usr/include/c++/15/bits/alloc_traits.h" 3 static constexpr _Alloc select_on_container_copy_construction(const _Alloc& __rhs) { if constexpr (__has_soccc<_Alloc>) return __rhs.select_on_container_copy_construction(); else return __rhs; } private: template static constexpr bool _S_nothrow_construct(_Alloc* __a = nullptr, _Tp* __p = nullptr) { if constexpr (__has_construct<_Alloc, _Tp, _Args...>) return noexcept(__a->construct(__p, std::declval<_Args>()...)); else return __is_nothrow_new_constructible<_Tp, _Args...>; } template static constexpr bool _S_nothrow_destroy(_Alloc* __a = nullptr, _Tp* __p = nullptr) { if constexpr (__has_destroy<_Alloc, _Tp>) return noexcept(__a->destroy(__p)); else return is_nothrow_destructible<_Tp>::value; } # 548 "/usr/include/c++/15/bits/alloc_traits.h" 3 }; #pragma GCC diagnostic pop # 559 "/usr/include/c++/15/bits/alloc_traits.h" 3 template struct allocator_traits> { using allocator_type = allocator<_Tp>; using value_type = _Tp; using pointer = _Tp*; using const_pointer = const _Tp*; using void_pointer = void*; using const_void_pointer = const void*; using difference_type = std::ptrdiff_t; using size_type = std::size_t; using propagate_on_container_copy_assignment = false_type; using propagate_on_container_move_assignment = true_type; using propagate_on_container_swap = false_type; using is_always_equal = true_type; template using rebind_alloc = allocator<_Up>; template using rebind_traits = allocator_traits>; # 611 "/usr/include/c++/15/bits/alloc_traits.h" 3 [[__nodiscard__,__gnu__::__always_inline__]] static constexpr pointer allocate(allocator_type& __a, size_type __n) { return __a.allocate(__n); } # 626 "/usr/include/c++/15/bits/alloc_traits.h" 3 [[__nodiscard__,__gnu__::__always_inline__]] static constexpr pointer allocate(allocator_type& __a, size_type __n, [[maybe_unused]] const_void_pointer __hint) { return __a.allocate(__n); } # 646 "/usr/include/c++/15/bits/alloc_traits.h" 3 [[__gnu__::__always_inline__]] static constexpr void deallocate(allocator_type& __a, pointer __p, size_type __n) { __a.deallocate(__p, __n); } # 662 "/usr/include/c++/15/bits/alloc_traits.h" 3 template [[__gnu__::__always_inline__]] static constexpr void construct(allocator_type& __a __attribute__((__unused__)), _Up* __p, _Args&&... __args) noexcept(__is_nothrow_new_constructible<_Up, _Args...>) { std::construct_at(__p, std::forward<_Args>(__args)...); } # 689 "/usr/include/c++/15/bits/alloc_traits.h" 3 template [[__gnu__::__always_inline__]] static constexpr void destroy(allocator_type& __a __attribute__((__unused__)), _Up* __p) noexcept(is_nothrow_destructible<_Up>::value) { std::destroy_at(__p); } [[__gnu__::__always_inline__]] static constexpr size_type max_size(const allocator_type& __a __attribute__((__unused__))) noexcept { return size_t(-1) / sizeof(value_type); } [[__gnu__::__always_inline__]] static constexpr allocator_type select_on_container_copy_construction(const allocator_type& __rhs) { return __rhs; } }; # 736 "/usr/include/c++/15/bits/alloc_traits.h" 3 template<> struct allocator_traits> { using allocator_type = allocator; using value_type = void; using pointer = void*; using const_pointer = const void*; using void_pointer = void*; using const_void_pointer = const void*; using difference_type = std::ptrdiff_t; using size_type = std::size_t; using propagate_on_container_copy_assignment = false_type; using propagate_on_container_move_assignment = true_type; using propagate_on_container_swap = false_type; using is_always_equal = true_type; template using rebind_alloc = allocator<_Up>; template using rebind_traits = allocator_traits>; static void* allocate(allocator_type&, size_type, const void* = nullptr) = delete; static void deallocate(allocator_type&, void*, size_type) = delete; # 800 "/usr/include/c++/15/bits/alloc_traits.h" 3 template [[__gnu__::__always_inline__]] static constexpr void construct(allocator_type&, _Up* __p, _Args&&... __args) noexcept(__is_nothrow_new_constructible<_Up, _Args...>) { std::_Construct(__p, std::forward<_Args>(__args)...); } # 814 "/usr/include/c++/15/bits/alloc_traits.h" 3 template [[__gnu__::__always_inline__]] static constexpr void destroy(allocator_type&, _Up* __p) noexcept(is_nothrow_destructible<_Up>::value) { std::_Destroy(__p); } static size_type max_size(const allocator_type&) = delete; [[__gnu__::__always_inline__]] static constexpr allocator_type select_on_container_copy_construction(const allocator_type& __rhs) { return __rhs; } }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template [[__gnu__::__always_inline__]] constexpr inline void __alloc_on_copy(_Alloc& __one, const _Alloc& __two) { using __traits = allocator_traits<_Alloc>; using __pocca = typename __traits::propagate_on_container_copy_assignment::type; if constexpr (__pocca::value) __one = __two; } template [[__gnu__::__always_inline__]] constexpr _Alloc __alloc_on_copy(const _Alloc& __a) { typedef allocator_traits<_Alloc> __traits; return __traits::select_on_container_copy_construction(__a); } template [[__gnu__::__always_inline__]] constexpr inline void __alloc_on_move(_Alloc& __one, _Alloc& __two) { using __traits = allocator_traits<_Alloc>; using __pocma = typename __traits::propagate_on_container_move_assignment::type; if constexpr (__pocma::value) __one = std::move(__two); } template [[__gnu__::__always_inline__]] constexpr inline void __alloc_on_swap(_Alloc& __one, _Alloc& __two) { using __traits = allocator_traits<_Alloc>; using __pocs = typename __traits::propagate_on_container_swap::type; if constexpr (__pocs::value) { using std::swap; swap(__one, __two); } } #pragma GCC diagnostic pop template, typename = void> struct __is_alloc_insertable_impl : false_type { }; template struct __is_alloc_insertable_impl<_Alloc, _Tp, _ValueT, __void_t::construct( std::declval<_Alloc&>(), std::declval<_ValueT*>(), std::declval<_Tp>()))>> : true_type { }; template struct __is_copy_insertable : __is_alloc_insertable_impl<_Alloc, typename _Alloc::value_type const&>::type { }; template struct __is_copy_insertable> : is_copy_constructible<_Tp> { }; template struct __is_move_insertable : __is_alloc_insertable_impl<_Alloc, typename _Alloc::value_type>::type { }; template struct __is_move_insertable> : is_move_constructible<_Tp> { }; template struct __is_allocator : false_type { }; template struct __is_allocator<_Alloc, __void_t().allocate(size_t{}))>> : true_type { }; template using _RequireAllocator = typename enable_if<__is_allocator<_Alloc>::value, _Alloc>::type; template using _RequireNotAllocator = typename enable_if::value, _Alloc>::type; template concept __allocator_like = requires (_Alloc& __a) { typename _Alloc::value_type; __a.deallocate(__a.allocate(1u), 1u); }; template concept __not_allocator_like = !__allocator_like<_Alloc>; template struct __alloc_swap { static void _S_do_it(_Alloc&, _Alloc&) noexcept { } }; template struct __alloc_swap<_Alloc, false> { static void _S_do_it(_Alloc& __one, _Alloc& __two) noexcept { if (__one != __two) swap(__one, __two); } }; template, is_nothrow_move_constructible>::value> struct __shrink_to_fit_aux { static bool _S_do_it(_Tp&) noexcept { return false; } }; template struct __shrink_to_fit_aux<_Tp, true> { constexpr static bool _S_do_it(_Tp& __c) noexcept { try { _Tp(__make_move_if_noexcept_iterator(__c.begin()), __make_move_if_noexcept_iterator(__c.end()), __c.get_allocator()).swap(__c); return true; } catch(...) { return false; } } }; # 1023 "/usr/include/c++/15/bits/alloc_traits.h" 3 template constexpr void _Destroy(_ForwardIterator __first, _ForwardIterator __last, _Allocator& __alloc) { for (; __first != __last; ++__first) allocator_traits<_Allocator>::destroy(__alloc, std::__addressof(*__first)); } template __attribute__((__always_inline__)) constexpr inline void _Destroy(_ForwardIterator __first, _ForwardIterator __last, allocator<_Tp>&) { std::_Destroy(__first, __last); } } # 37 "/usr/include/c++/15/ext/alloc_traits.h" 2 3 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { template struct __alloc_traits : std::allocator_traits<_Alloc> { typedef _Alloc allocator_type; typedef std::allocator_traits<_Alloc> _Base_type; typedef typename _Base_type::value_type value_type; typedef typename _Base_type::pointer pointer; typedef typename _Base_type::const_pointer const_pointer; typedef typename _Base_type::size_type size_type; typedef typename _Base_type::difference_type difference_type; typedef value_type& reference; typedef const value_type& const_reference; using _Base_type::allocate; using _Base_type::deallocate; using _Base_type::construct; using _Base_type::destroy; using _Base_type::max_size; private: template using __is_custom_pointer = std::__and_, std::__not_>>; public: template [[__gnu__::__always_inline__]] static constexpr std::__enable_if_t<__is_custom_pointer<_Ptr>::value> construct(_Alloc& __a, _Ptr __p, _Args&&... __args) noexcept(noexcept(_Base_type::construct(__a, std::__to_address(__p), std::forward<_Args>(__args)...))) { _Base_type::construct(__a, std::__to_address(__p), std::forward<_Args>(__args)...); } template [[__gnu__::__always_inline__]] static constexpr std::__enable_if_t<__is_custom_pointer<_Ptr>::value> destroy(_Alloc& __a, _Ptr __p) noexcept(noexcept(_Base_type::destroy(__a, std::__to_address(__p)))) { _Base_type::destroy(__a, std::__to_address(__p)); } [[__gnu__::__always_inline__]] static constexpr _Alloc _S_select_on_copy(const _Alloc& __a) { return _Base_type::select_on_container_copy_construction(__a); } [[__gnu__::__always_inline__]] static constexpr void _S_on_swap(_Alloc& __a, _Alloc& __b) { std::__alloc_on_swap(__a, __b); } [[__gnu__::__always_inline__]] static constexpr bool _S_propagate_on_copy_assign() { return _Base_type::propagate_on_container_copy_assignment::value; } [[__gnu__::__always_inline__]] static constexpr bool _S_propagate_on_move_assign() { return _Base_type::propagate_on_container_move_assignment::value; } [[__gnu__::__always_inline__]] static constexpr bool _S_propagate_on_swap() { return _Base_type::propagate_on_container_swap::value; } [[__gnu__::__always_inline__]] static constexpr bool _S_always_equal() { return _Base_type::is_always_equal::value; } __attribute__((__always_inline__)) static constexpr bool _S_nothrow_move() { return _S_propagate_on_move_assign() || _S_always_equal(); } template struct rebind { typedef typename _Base_type::template rebind_alloc<_Tp> other; }; # 182 "/usr/include/c++/15/ext/alloc_traits.h" 3 }; } # 40 "/usr/include/c++/15/bits/hashtable_policy.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template class _Hashtable; namespace __detail { template struct _Hashtable_base; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template inline typename std::iterator_traits<_Iterator>::difference_type __distance_fw(_Iterator __first, _Iterator __last) { using _Cat = typename std::iterator_traits<_Iterator>::iterator_category; if constexpr (is_convertible<_Cat, forward_iterator_tag>::value) return std::distance(__first, __last); else return __first != __last ? 1 : 0; } #pragma GCC diagnostic pop struct _Identity { template _Tp&& operator()(_Tp&& __x) const noexcept { return std::forward<_Tp>(__x); } }; struct _Select1st { template struct __1st_type; template struct __1st_type> { using type = _Tp; }; template struct __1st_type> { using type = const _Tp; }; template struct __1st_type<_Pair&> { using type = typename __1st_type<_Pair>::type&; }; template typename __1st_type<_Tp>::type&& operator()(_Tp&& __x) const noexcept { return std::forward<_Tp>(__x).first; } }; template struct _NodeBuilder; template<> struct _NodeBuilder<_Select1st> { template static auto _S_build(_Kt&& __k, _Arg&& __arg, _NodeGenerator& __node_gen) -> typename _NodeGenerator::__node_ptr { return __node_gen(std::forward<_Kt>(__k), std::forward<_Arg>(__arg).second); } }; template<> struct _NodeBuilder<_Identity> { template static auto _S_build(_Kt&& __k, _Arg&&, _NodeGenerator& __node_gen) -> typename _NodeGenerator::__node_ptr { return __node_gen(std::forward<_Kt>(__k)); } }; template struct _NodePtrGuard { _HashtableAlloc& _M_h; _NodePtr _M_ptr; ~_NodePtrGuard() { if (_M_ptr) _M_h._M_deallocate_node_ptr(_M_ptr); } }; template struct _Hashtable_alloc; template struct _ReuseOrAllocNode { private: using __node_alloc_type = _NodeAlloc; using __hashtable_alloc = _Hashtable_alloc<__node_alloc_type>; using __node_alloc_traits = typename __hashtable_alloc::__node_alloc_traits; public: using __node_ptr = typename __hashtable_alloc::__node_ptr; _ReuseOrAllocNode(__node_ptr __nodes, __hashtable_alloc& __h) : _M_nodes(__nodes), _M_h(__h) { } _ReuseOrAllocNode(const _ReuseOrAllocNode&) = delete; ~_ReuseOrAllocNode() { _M_h._M_deallocate_nodes(_M_nodes); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template __node_ptr operator()(_Arg&& __arg) { if (!_M_nodes) return _M_h._M_allocate_node(std::forward<_Arg>(__arg)); using value_type = typename _NodeAlloc::value_type::value_type; __node_ptr __node = _M_nodes; if constexpr (is_assignable::value) { __node->_M_v() = std::forward<_Arg>(__arg); _M_nodes = _M_nodes->_M_next(); __node->_M_nxt = nullptr; } else { _M_nodes = _M_nodes->_M_next(); __node->_M_nxt = nullptr; auto& __a = _M_h._M_node_allocator(); __node_alloc_traits::destroy(__a, __node->_M_valptr()); _NodePtrGuard<__hashtable_alloc, __node_ptr> __guard{ _M_h, __node }; __node_alloc_traits::construct(__a, __node->_M_valptr(), std::forward<_Arg>(__arg)); __guard._M_ptr = nullptr; } return __node; } #pragma GCC diagnostic pop private: __node_ptr _M_nodes; __hashtable_alloc& _M_h; }; template struct _AllocNode { private: using __hashtable_alloc = _Hashtable_alloc<_NodeAlloc>; public: using __node_ptr = typename __hashtable_alloc::__node_ptr; _AllocNode(__hashtable_alloc& __h) : _M_h(__h) { } template __node_ptr operator()(_Args&&... __args) const { return _M_h._M_allocate_node(std::forward<_Args>(__args)...); } private: __hashtable_alloc& _M_h; }; # 262 "/usr/include/c++/15/bits/hashtable_policy.h" 3 template struct _Hashtable_traits { using __hash_cached = __bool_constant<_Cache_hash_code>; using __constant_iterators = __bool_constant<_Constant_iterators>; using __unique_keys = __bool_constant<_Unique_keys>; }; template struct _Hashtable_hash_traits { static constexpr size_t __small_size_threshold() noexcept { return std::__is_fast_hash<_Hash>::value ? 0 : 20; } }; # 292 "/usr/include/c++/15/bits/hashtable_policy.h" 3 struct _Hash_node_base { _Hash_node_base* _M_nxt; _Hash_node_base() noexcept : _M_nxt() { } _Hash_node_base(_Hash_node_base* __next) noexcept : _M_nxt(__next) { } }; template struct _Hash_node_value_base { using value_type = _Value; __gnu_cxx::__aligned_buffer<_Value> _M_storage; [[__gnu__::__always_inline__]] _Value* _M_valptr() noexcept { return _M_storage._M_ptr(); } [[__gnu__::__always_inline__]] const _Value* _M_valptr() const noexcept { return _M_storage._M_ptr(); } [[__gnu__::__always_inline__]] _Value& _M_v() noexcept { return *_M_valptr(); } [[__gnu__::__always_inline__]] const _Value& _M_v() const noexcept { return *_M_valptr(); } }; template struct _Hash_node_code_cache { }; template<> struct _Hash_node_code_cache { size_t _M_hash_code; }; template struct _Hash_node_value : _Hash_node_value_base<_Value> , _Hash_node_code_cache<_Cache_hash_code> { }; template struct _Hash_node : _Hash_node_base , _Hash_node_value<_Value, _Cache_hash_code> { _Hash_node* _M_next() const noexcept { return static_cast<_Hash_node*>(this->_M_nxt); } }; template struct _Node_iterator_base { using __node_type = _Hash_node<_Value, _Cache_hash_code>; __node_type* _M_cur; _Node_iterator_base() : _M_cur(nullptr) { } _Node_iterator_base(__node_type* __p) noexcept : _M_cur(__p) { } void _M_incr() noexcept { _M_cur = _M_cur->_M_next(); } friend bool operator==(const _Node_iterator_base& __x, const _Node_iterator_base& __y) noexcept { return __x._M_cur == __y._M_cur; } }; template struct _Node_iterator : public _Node_iterator_base<_Value, __cache> { private: using __base_type = _Node_iterator_base<_Value, __cache>; using __node_type = typename __base_type::__node_type; public: using value_type = _Value; using difference_type = ptrdiff_t; using iterator_category = forward_iterator_tag; using pointer = __conditional_t<__constant_iterators, const value_type*, value_type*>; using reference = __conditional_t<__constant_iterators, const value_type&, value_type&>; _Node_iterator() = default; explicit _Node_iterator(__node_type* __p) noexcept : __base_type(__p) { } reference operator*() const noexcept { return this->_M_cur->_M_v(); } pointer operator->() const noexcept { return this->_M_cur->_M_valptr(); } _Node_iterator& operator++() noexcept { this->_M_incr(); return *this; } _Node_iterator operator++(int) noexcept { _Node_iterator __tmp(*this); this->_M_incr(); return __tmp; } friend bool operator==(const _Node_iterator&, const _Node_iterator&) = default; # 463 "/usr/include/c++/15/bits/hashtable_policy.h" 3 }; template struct _Node_const_iterator : public _Node_iterator_base<_Value, __cache> { private: using __base_type = _Node_iterator_base<_Value, __cache>; using __node_type = typename __base_type::__node_type; using __iterator = _Node_iterator<_Value, __constant_iterators, __cache>; public: using value_type = _Value; using difference_type = ptrdiff_t; using iterator_category = forward_iterator_tag; using pointer = const value_type*; using reference = const value_type&; _Node_const_iterator() = default; explicit _Node_const_iterator(__node_type* __p) noexcept : __base_type(__p) { } _Node_const_iterator(const __iterator& __x) noexcept : __base_type(__x._M_cur) { } reference operator*() const noexcept { return this->_M_cur->_M_v(); } pointer operator->() const noexcept { return this->_M_cur->_M_valptr(); } _Node_const_iterator& operator++() noexcept { this->_M_incr(); return *this; } _Node_const_iterator operator++(int) noexcept { _Node_const_iterator __tmp(*this); this->_M_incr(); return __tmp; } friend bool operator==(const _Node_const_iterator&, const _Node_const_iterator&) = default; friend bool operator==(const _Node_const_iterator& __x, const __iterator& __y) { const __base_type& __bx = __x; const __base_type& __by = __y; return __bx == __by; } # 573 "/usr/include/c++/15/bits/hashtable_policy.h" 3 }; struct _Mod_range_hashing { size_t operator()(size_t __num, size_t __den) const noexcept { return __num % __den; } }; struct _Default_ranged_hash { }; struct _Prime_rehash_policy { using __has_load_factor = true_type; _Prime_rehash_policy(float __z = 1.0) noexcept : _M_max_load_factor(__z), _M_next_resize(0) { } float max_load_factor() const noexcept { return _M_max_load_factor; } size_t _M_next_bkt(size_t __n) const; size_t _M_bkt_for_elements(size_t __n) const { return __builtin_ceil(__n / (double)_M_max_load_factor); } std::pair _M_need_rehash(size_t __n_bkt, size_t __n_elt, size_t __n_ins) const; using _State = size_t; _State _M_state() const { return _M_next_resize; } void _M_reset() noexcept { _M_next_resize = 0; } void _M_reset(_State __state) { _M_next_resize = __state; } static const size_t _S_growth_factor = 2; float _M_max_load_factor; mutable size_t _M_next_resize; }; struct _Mask_range_hashing { size_t operator()(size_t __num, size_t __den) const noexcept { return __num & (__den - 1); } }; inline size_t __clp2(size_t __n) noexcept { using __gnu_cxx::__int_traits; if (__n < 2) return __n; const unsigned __lz = sizeof(size_t) > sizeof(long) ? __builtin_clzll(__n - 1ull) : __builtin_clzl(__n - 1ul); return (size_t(1) << (__int_traits::__digits - __lz - 1)) << 1; } struct _Power2_rehash_policy { using __has_load_factor = true_type; _Power2_rehash_policy(float __z = 1.0) noexcept : _M_max_load_factor(__z), _M_next_resize(0) { } float max_load_factor() const noexcept { return _M_max_load_factor; } size_t _M_next_bkt(size_t __n) noexcept { if (__n == 0) return 1; const auto __max_width = std::min(sizeof(size_t), 8); const auto __max_bkt = size_t(1) << (__max_width * 8 - 1); size_t __res = __clp2(__n); if (__res == 0) __res = __max_bkt; else if (__res == 1) __res = 2; if (__res == __max_bkt) _M_next_resize = size_t(-1); else _M_next_resize = __builtin_floor(__res * (double)_M_max_load_factor); return __res; } size_t _M_bkt_for_elements(size_t __n) const noexcept { return __builtin_ceil(__n / (double)_M_max_load_factor); } std::pair _M_need_rehash(size_t __n_bkt, size_t __n_elt, size_t __n_ins) noexcept { if (__n_elt + __n_ins > _M_next_resize) { double __min_bkts = std::max(__n_elt + __n_ins, _M_next_resize ? 0 : 11) / (double)_M_max_load_factor; if (__min_bkts >= __n_bkt) return { true, _M_next_bkt(std::max(__builtin_floor(__min_bkts) + 1, __n_bkt * _S_growth_factor)) }; _M_next_resize = __builtin_floor(__n_bkt * (double)_M_max_load_factor); return { false, 0 }; } else return { false, 0 }; } using _State = size_t; _State _M_state() const noexcept { return _M_next_resize; } void _M_reset() noexcept { _M_next_resize = 0; } void _M_reset(_State __state) noexcept { _M_next_resize = __state; } static const size_t _S_growth_factor = 2; float _M_max_load_factor; size_t _M_next_resize; }; template struct _RehashStateGuard { _RehashPolicy* _M_guarded_obj; typename _RehashPolicy::_State _M_prev_state; _RehashStateGuard(_RehashPolicy& __policy) : _M_guarded_obj(std::__addressof(__policy)) , _M_prev_state(__policy._M_state()) { } _RehashStateGuard(const _RehashStateGuard&) = delete; ~_RehashStateGuard() { if (_M_guarded_obj) _M_guarded_obj->_M_reset(_M_prev_state); } }; # 809 "/usr/include/c++/15/bits/hashtable_policy.h" 3 template struct _Map_base { }; template struct _Map_base<_Key, pair, _Alloc, _Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, false> { using mapped_type = _Val; }; template struct _Map_base<_Key, pair, _Alloc, _Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, true> { private: using __hashtable_base = _Hashtable_base<_Key, pair, _Select1st, _Equal, _Hash, _RangeHash, _Unused, _Traits>; using __hashtable = _Hashtable<_Key, pair, _Alloc, _Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>; using __hash_code = typename __hashtable_base::__hash_code; public: using key_type = typename __hashtable_base::key_type; using mapped_type = _Val; mapped_type& operator[](const key_type& __k); mapped_type& operator[](key_type&& __k); mapped_type& at(const key_type& __k) { auto __ite = static_cast<__hashtable*>(this)->find(__k); if (!__ite._M_cur) __throw_out_of_range(("unordered_map::at")); return __ite->second; } const mapped_type& at(const key_type& __k) const { auto __ite = static_cast(this)->find(__k); if (!__ite._M_cur) __throw_out_of_range(("unordered_map::at")); return __ite->second; } }; template auto _Map_base<_Key, pair, _Alloc, _Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, true>:: operator[](const key_type& __k) -> mapped_type& { __hashtable* __h = static_cast<__hashtable*>(this); __hash_code __code = __h->_M_hash_code(__k); size_t __bkt = __h->_M_bucket_index(__code); if (auto __node = __h->_M_find_node(__bkt, __k, __code)) return __node->_M_v().second; typename __hashtable::_Scoped_node __node { __h, std::piecewise_construct, std::tuple(__k), std::tuple<>() }; auto __pos = __h->_M_insert_unique_node(__bkt, __code, __node._M_node); __node._M_node = nullptr; return __pos->second; } template auto _Map_base<_Key, pair, _Alloc, _Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, true>:: operator[](key_type&& __k) -> mapped_type& { __hashtable* __h = static_cast<__hashtable*>(this); __hash_code __code = __h->_M_hash_code(__k); size_t __bkt = __h->_M_bucket_index(__code); if (auto __node = __h->_M_find_node(__bkt, __k, __code)) return __node->_M_v().second; typename __hashtable::_Scoped_node __node { __h, std::piecewise_construct, std::forward_as_tuple(std::move(__k)), std::tuple<>() }; auto __pos = __h->_M_insert_unique_node(__bkt, __code, __node._M_node); __node._M_node = nullptr; return __pos->second; } template struct _Map_base, _Alloc, _Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, __uniq> : _Map_base<_Key, pair, _Alloc, _Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, __uniq> { }; template using __has_load_factor = typename _Policy::__has_load_factor; template> struct _Rehash_base; template struct _Rehash_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, false_type > { }; template struct _Rehash_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, true_type > { private: using __hashtable = _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>; public: float max_load_factor() const noexcept { const __hashtable* __this = static_cast(this); return __this->__rehash_policy().max_load_factor(); } void max_load_factor(float __z) { __hashtable* __this = static_cast<__hashtable*>(this); __this->__rehash_policy(_RehashPolicy(__z)); } void reserve(size_t __n) { __hashtable* __this = static_cast<__hashtable*>(this); __this->rehash(__this->__rehash_policy()._M_bkt_for_elements(__n)); } }; template struct _Hashtable_ebo_helper { [[__no_unique_address__]] _Tp _M_obj; }; template struct _Hashtable_ebo_helper<_Tp, false> { _Tp _M_obj; }; # 1034 "/usr/include/c++/15/bits/hashtable_policy.h" 3 template struct _Local_iterator_base; template struct _Hash_code_base { friend struct _Local_iterator_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, false>; public: using hasher = _Hash; hasher hash_function() const { return _M_hash._M_obj; } protected: [[__no_unique_address__]] _Hashtable_ebo_helper<_Hash> _M_hash{}; using __hash_code = size_t; _Hash_code_base() = default; _Hash_code_base(const _Hash& __hash) : _M_hash{__hash} { } __hash_code _M_hash_code(const _Key& __k) const { static_assert(__is_invocable{}, "hash function must be invocable with an argument of key type"); return _M_hash._M_obj(__k); } template __hash_code _M_hash_code_tr(const _Kt& __k) const { static_assert(__is_invocable{}, "hash function must be invocable with an argument of key type"); return _M_hash._M_obj(__k); } __hash_code _M_hash_code(const _Hash_node_value<_Value, false>& __n) const { return _M_hash_code(_ExtractKey{}(__n._M_v())); } __hash_code _M_hash_code(const _Hash_node_value<_Value, true>& __n) const { return __n._M_hash_code; } size_t _M_bucket_index(__hash_code __c, size_t __bkt_count) const { return _RangeHash{}(__c, __bkt_count); } size_t _M_bucket_index(const _Hash_node_value<_Value, false>& __n, size_t __bkt_count) const noexcept( noexcept(declval()(declval())) ) { return _RangeHash{}(_M_hash_code(_ExtractKey{}(__n._M_v())), __bkt_count); } size_t _M_bucket_index(const _Hash_node_value<_Value, true>& __n, size_t __bkt_count) const noexcept { return _RangeHash{}(__n._M_hash_code, __bkt_count); } }; template struct _Local_iterator_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, true> : public _Node_iterator_base<_Value, true> { protected: using __base_node_iter = _Node_iterator_base<_Value, true>; using __hash_code_base = _Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, true>; _Local_iterator_base() = default; _Local_iterator_base(const __hash_code_base&, _Hash_node<_Value, true>* __p, size_t __bkt, size_t __bkt_count) : __base_node_iter(__p), _M_bucket(__bkt), _M_bucket_count(__bkt_count) { } void _M_incr() { __base_node_iter::_M_incr(); if (this->_M_cur) { size_t __bkt = _RangeHash{}(this->_M_cur->_M_hash_code, _M_bucket_count); if (__bkt != _M_bucket) this->_M_cur = nullptr; } } size_t _M_bucket = 0; size_t _M_bucket_count = 0; public: size_t _M_get_bucket() const { return _M_bucket; } }; template struct _Hash_obj_storage { union _Uninit_storage { _Uninit_storage() noexcept { } ~_Uninit_storage() { } [[__no_unique_address__]] _Hash _M_h; }; [[__no_unique_address__]] _Uninit_storage _M_u; }; template struct _Local_iterator_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, false> : _Hash_obj_storage<_Hash>, _Node_iterator_base<_Value, false> { protected: using __hash_code_base = _Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, false>; using __hash_obj_storage = _Hash_obj_storage<_Hash>; using __node_iter_base = _Node_iterator_base<_Value, false>; _Local_iterator_base() = default; _Local_iterator_base(const __hash_code_base& __base, _Hash_node<_Value, false>* __p, size_t __bkt, size_t __bkt_count) : __node_iter_base(__p), _M_bucket(__bkt), _M_bucket_count(__bkt_count) { _M_init(__base._M_hash._M_obj); } ~_Local_iterator_base() { if (_M_bucket_count != size_t(-1)) _M_destroy(); } _Local_iterator_base(const _Local_iterator_base& __iter) : __node_iter_base(__iter._M_cur), _M_bucket(__iter._M_bucket) , _M_bucket_count(__iter._M_bucket_count) { if (_M_bucket_count != size_t(-1)) _M_init(__iter._M_h()); } _Local_iterator_base& operator=(const _Local_iterator_base& __iter) { if (_M_bucket_count != size_t(-1)) _M_destroy(); this->_M_cur = __iter._M_cur; _M_bucket = __iter._M_bucket; _M_bucket_count = __iter._M_bucket_count; if (_M_bucket_count != size_t(-1)) _M_init(__iter._M_h()); return *this; } void _M_incr() { __node_iter_base::_M_incr(); if (this->_M_cur) { const auto __code = _M_h()(_ExtractKey{}(this->_M_cur->_M_v())); size_t __bkt = _RangeHash{}(__code, _M_bucket_count); if (__bkt != _M_bucket) this->_M_cur = nullptr; } } size_t _M_bucket = 0; size_t _M_bucket_count = -1; void _M_init(const _Hash& __h) { std::_Construct(std::__addressof(__hash_obj_storage::_M_u._M_h), __h); } void _M_destroy() { __hash_obj_storage::_M_u._M_h.~_Hash(); } const _Hash& _M_h() const { return __hash_obj_storage::_M_u._M_h; } public: size_t _M_get_bucket() const { return _M_bucket; } }; template struct _Local_iterator : public _Local_iterator_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache> { private: using __base_type = _Local_iterator_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache>; using __hash_code_base = typename __base_type::__hash_code_base; public: using value_type = _Value; using pointer = __conditional_t<__constant_iterators, const value_type*, value_type*>; using reference = __conditional_t<__constant_iterators, const value_type&, value_type&>; using difference_type = ptrdiff_t; using iterator_category = forward_iterator_tag; _Local_iterator() = default; _Local_iterator(const __hash_code_base& __base, _Hash_node<_Value, __cache>* __n, size_t __bkt, size_t __bkt_count) : __base_type(__base, __n, __bkt, __bkt_count) { } reference operator*() const { return this->_M_cur->_M_v(); } pointer operator->() const { return this->_M_cur->_M_valptr(); } _Local_iterator& operator++() { this->_M_incr(); return *this; } _Local_iterator operator++(int) { _Local_iterator __tmp(*this); this->_M_incr(); return __tmp; } }; template struct _Local_const_iterator : public _Local_iterator_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache> { private: using __base_type = _Local_iterator_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache>; using __hash_code_base = typename __base_type::__hash_code_base; public: using value_type = _Value; using pointer = const value_type*; using reference = const value_type&; using difference_type = ptrdiff_t; using iterator_category = forward_iterator_tag; _Local_const_iterator() = default; _Local_const_iterator(const __hash_code_base& __base, _Hash_node<_Value, __cache>* __n, size_t __bkt, size_t __bkt_count) : __base_type(__base, __n, __bkt, __bkt_count) { } _Local_const_iterator(const _Local_iterator<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __constant_iterators, __cache>& __x) : __base_type(__x) { } reference operator*() const { return this->_M_cur->_M_v(); } pointer operator->() const { return this->_M_cur->_M_valptr(); } _Local_const_iterator& operator++() { this->_M_incr(); return *this; } _Local_const_iterator operator++(int) { _Local_const_iterator __tmp(*this); this->_M_incr(); return __tmp; } }; # 1369 "/usr/include/c++/15/bits/hashtable_policy.h" 3 template struct _Hashtable_base : public _Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, _Traits::__hash_cached::value> { public: using key_type = _Key; using value_type = _Value; using key_equal = _Equal; using size_type = size_t; using difference_type = ptrdiff_t; using __traits_type = _Traits; using __hash_cached = typename __traits_type::__hash_cached; using __hash_code_base = _Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __hash_cached::value>; using __hash_code = typename __hash_code_base::__hash_code; protected: [[__no_unique_address__]] _Hashtable_ebo_helper<_Equal> _M_equal{}; _Hashtable_base() = default; _Hashtable_base(const _Hash& __hash, const _Equal& __eq) : __hash_code_base(__hash), _M_equal{__eq} { } bool _M_key_equals(const _Key& __k, const _Hash_node_value<_Value, __hash_cached::value>& __n) const { static_assert(__is_invocable{}, "key equality predicate must be invocable with two arguments of " "key type"); return _M_eq()(__k, _ExtractKey{}(__n._M_v())); } template bool _M_key_equals_tr(const _Kt& __k, const _Hash_node_value<_Value, __hash_cached::value>& __n) const { static_assert( __is_invocable{}, "key equality predicate must be invocable with the argument type " "and the key type"); return _M_eq()(__k, _ExtractKey{}(__n._M_v())); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" bool _M_equals(const _Key& __k, __hash_code __c, const _Hash_node_value<_Value, __hash_cached::value>& __n) const { if constexpr (__hash_cached::value) if (__c != __n._M_hash_code) return false; return _M_key_equals(__k, __n); } template bool _M_equals_tr(const _Kt& __k, __hash_code __c, const _Hash_node_value<_Value, __hash_cached::value>& __n) const { if constexpr (__hash_cached::value) if (__c != __n._M_hash_code) return false; return _M_key_equals_tr(__k, __n); } bool _M_node_equals( const _Hash_node_value<_Value, __hash_cached::value>& __lhn, const _Hash_node_value<_Value, __hash_cached::value>& __rhn) const { if constexpr (__hash_cached::value) if (__lhn._M_hash_code != __rhn._M_hash_code) return false; return _M_key_equals(_ExtractKey{}(__lhn._M_v()), __rhn); } #pragma GCC diagnostic pop const _Equal& _M_eq() const noexcept { return _M_equal._M_obj; } }; template struct _Hashtable_alloc { private: [[__no_unique_address__]] _Hashtable_ebo_helper<_NodeAlloc> _M_alloc{}; template struct __get_value_type; template struct __get_value_type<_Hash_node<_Val, _Cache_hash_code>> { using type = _Val; }; public: using __node_type = typename _NodeAlloc::value_type; using __node_alloc_type = _NodeAlloc; using __node_alloc_traits = __gnu_cxx::__alloc_traits<__node_alloc_type>; using __value_alloc_traits = typename __node_alloc_traits::template rebind_traits::type>; using __node_ptr = __node_type*; using __node_base = _Hash_node_base; using __node_base_ptr = __node_base*; using __buckets_alloc_type = __alloc_rebind<__node_alloc_type, __node_base_ptr>; using __buckets_alloc_traits = std::allocator_traits<__buckets_alloc_type>; using __buckets_ptr = __node_base_ptr*; _Hashtable_alloc() = default; _Hashtable_alloc(const _Hashtable_alloc&) = default; _Hashtable_alloc(_Hashtable_alloc&&) = default; template _Hashtable_alloc(_Alloc&& __a) : _M_alloc{std::forward<_Alloc>(__a)} { } __node_alloc_type& _M_node_allocator() { return _M_alloc._M_obj; } const __node_alloc_type& _M_node_allocator() const { return _M_alloc._M_obj; } template __node_ptr _M_allocate_node(_Args&&... __args); void _M_deallocate_node(__node_ptr __n); void _M_deallocate_node_ptr(__node_ptr __n); void _M_deallocate_nodes(__node_ptr __n); __buckets_ptr _M_allocate_buckets(size_t __bkt_count); void _M_deallocate_buckets(__buckets_ptr, size_t __bkt_count); }; template template auto _Hashtable_alloc<_NodeAlloc>::_M_allocate_node(_Args&&... __args) -> __node_ptr { auto& __alloc = _M_node_allocator(); auto __nptr = __node_alloc_traits::allocate(__alloc, 1); __node_ptr __n = std::__to_address(__nptr); try { ::new ((void*)__n) __node_type; __node_alloc_traits::construct(__alloc, __n->_M_valptr(), std::forward<_Args>(__args)...); return __n; } catch(...) { __n->~__node_type(); __node_alloc_traits::deallocate(__alloc, __nptr, 1); throw; } } template void _Hashtable_alloc<_NodeAlloc>::_M_deallocate_node(__node_ptr __n) { __node_alloc_traits::destroy(_M_node_allocator(), __n->_M_valptr()); _M_deallocate_node_ptr(__n); } template void _Hashtable_alloc<_NodeAlloc>::_M_deallocate_node_ptr(__node_ptr __n) { using _Ptr = typename __node_alloc_traits::pointer; auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__n); __n->~__node_type(); __node_alloc_traits::deallocate(_M_node_allocator(), __ptr, 1); } template void _Hashtable_alloc<_NodeAlloc>::_M_deallocate_nodes(__node_ptr __n) { while (__n) { __node_ptr __tmp = __n; __n = __n->_M_next(); _M_deallocate_node(__tmp); } } template auto _Hashtable_alloc<_NodeAlloc>::_M_allocate_buckets(size_t __bkt_count) -> __buckets_ptr { __buckets_alloc_type __alloc(_M_node_allocator()); auto __ptr = __buckets_alloc_traits::allocate(__alloc, __bkt_count); __buckets_ptr __p = std::__to_address(__ptr); __builtin_memset(__p, 0, __bkt_count * sizeof(__node_base_ptr)); return __p; } template void _Hashtable_alloc<_NodeAlloc>:: _M_deallocate_buckets(__buckets_ptr __bkts, size_t __bkt_count) { using _Ptr = typename __buckets_alloc_traits::pointer; auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__bkts); __buckets_alloc_type __alloc(_M_node_allocator()); __buckets_alloc_traits::deallocate(__alloc, __ptr, __bkt_count); } } } # 38 "/usr/include/c++/15/bits/hashtable.h" 2 3 # 1 "/usr/include/c++/15/bits/enable_special_members.h" 1 3 # 39 "/usr/include/c++/15/bits/enable_special_members.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { struct _Enable_default_constructor_tag { explicit constexpr _Enable_default_constructor_tag() = default; }; template struct _Enable_default_constructor { constexpr _Enable_default_constructor() noexcept = default; constexpr _Enable_default_constructor(_Enable_default_constructor const&) noexcept = default; constexpr _Enable_default_constructor(_Enable_default_constructor&&) noexcept = default; _Enable_default_constructor& operator=(_Enable_default_constructor const&) noexcept = default; _Enable_default_constructor& operator=(_Enable_default_constructor&&) noexcept = default; constexpr explicit _Enable_default_constructor(_Enable_default_constructor_tag) { } }; template struct _Enable_destructor { }; template struct _Enable_copy_move { }; # 98 "/usr/include/c++/15/bits/enable_special_members.h" 3 template struct _Enable_special_members : private _Enable_default_constructor<_Default, _Tag>, private _Enable_destructor<_Destructor, _Tag>, private _Enable_copy_move<_Copy, _CopyAssignment, _Move, _MoveAssignment, _Tag> { }; template struct _Enable_default_constructor { constexpr _Enable_default_constructor() noexcept = delete; constexpr _Enable_default_constructor(_Enable_default_constructor const&) noexcept = default; constexpr _Enable_default_constructor(_Enable_default_constructor&&) noexcept = default; _Enable_default_constructor& operator=(_Enable_default_constructor const&) noexcept = default; _Enable_default_constructor& operator=(_Enable_default_constructor&&) noexcept = default; constexpr explicit _Enable_default_constructor(_Enable_default_constructor_tag) { } }; template struct _Enable_destructor { ~_Enable_destructor() noexcept = delete; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = delete; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = default; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = default; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = delete; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = default; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = default; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = delete; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = default; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = default; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = delete; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = default; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = delete; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = delete; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = delete; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = delete; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = delete; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = delete; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = delete; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = delete; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = default; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = delete; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = delete; }; template struct _Enable_copy_move { constexpr _Enable_copy_move() noexcept = default; constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept = delete; constexpr _Enable_copy_move(_Enable_copy_move&&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move const&) noexcept = delete; _Enable_copy_move& operator=(_Enable_copy_move&&) noexcept = delete; }; } # 39 "/usr/include/c++/15/bits/hashtable.h" 2 3 # 1 "/usr/include/c++/15/bits/node_handle.h" 1 3 # 38 "/usr/include/c++/15/bits/node_handle.h" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 39 "/usr/include/c++/15/bits/node_handle.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 66 "/usr/include/c++/15/bits/node_handle.h" 3 template class _Node_handle_common { using _AllocTraits = allocator_traits<_NodeAlloc>; public: using allocator_type = __alloc_rebind<_NodeAlloc, _Val>; allocator_type get_allocator() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return allocator_type(_M_alloc._M_alloc); } explicit operator bool() const noexcept { return _M_ptr != nullptr; } [[nodiscard]] bool empty() const noexcept { return _M_ptr == nullptr; } protected: constexpr _Node_handle_common() noexcept : _M_ptr() { } ~_Node_handle_common() { if (!empty()) _M_reset(); } _Node_handle_common(_Node_handle_common&& __nh) noexcept : _M_ptr(__nh._M_ptr) { if (_M_ptr) _M_move(std::move(__nh)); } _Node_handle_common& operator=(_Node_handle_common&& __nh) noexcept { if (empty()) { if (!__nh.empty()) _M_move(std::move(__nh)); } else if (__nh.empty()) _M_reset(); else { _AllocTraits::destroy(*_M_alloc, _M_ptr->_M_valptr()); _AllocTraits::deallocate(*_M_alloc, _M_ptr, 1); _M_alloc = __nh._M_alloc.release(); _M_ptr = __nh._M_ptr; __nh._M_ptr = nullptr; } return *this; } _Node_handle_common(typename _AllocTraits::pointer __ptr, const _NodeAlloc& __alloc) : _M_ptr(__ptr), _M_alloc(__alloc) { do { if (std::__is_constant_evaluated() && !bool(__ptr != nullptr)) std::__glibcxx_assert_fail(); } while (false); } void _M_swap(_Node_handle_common& __nh) noexcept { if (empty()) { if (!__nh.empty()) _M_move(std::move(__nh)); } else if (__nh.empty()) __nh._M_move(std::move(*this)); else { using std::swap; swap(_M_ptr, __nh._M_ptr); _M_alloc.swap(__nh._M_alloc); } } private: void _M_move(_Node_handle_common&& __nh) noexcept { ::new (std::__addressof(_M_alloc)) _NodeAlloc(__nh._M_alloc.release()); _M_ptr = __nh._M_ptr; __nh._M_ptr = nullptr; } void _M_reset() noexcept { _NodeAlloc __alloc = _M_alloc.release(); _AllocTraits::destroy(__alloc, _M_ptr->_M_valptr()); _AllocTraits::deallocate(__alloc, _M_ptr, 1); _M_ptr = nullptr; } void release() noexcept { _M_alloc.release(); _M_ptr = nullptr; } protected: typename _AllocTraits::pointer _M_ptr; private: union _Optional_alloc { _Optional_alloc() { } ~_Optional_alloc() { } _Optional_alloc(_Optional_alloc&&) = delete; _Optional_alloc& operator=(_Optional_alloc&&) = delete; _Optional_alloc(const _NodeAlloc& __alloc) noexcept : _M_alloc(__alloc) { } void operator=(_NodeAlloc&& __alloc) noexcept { using _ATr = _AllocTraits; if constexpr (_ATr::propagate_on_container_move_assignment::value) _M_alloc = std::move(__alloc); else if constexpr (!_AllocTraits::is_always_equal::value) do { if (std::__is_constant_evaluated() && !bool(_M_alloc == __alloc)) std::__glibcxx_assert_fail(); } while (false); } void swap(_Optional_alloc& __other) noexcept { using std::swap; if constexpr (_AllocTraits::propagate_on_container_swap::value) swap(_M_alloc, __other._M_alloc); else if constexpr (!_AllocTraits::is_always_equal::value) do { if (std::__is_constant_evaluated() && !bool(_M_alloc == __other._M_alloc)) std::__glibcxx_assert_fail(); } while (false); } _NodeAlloc& operator*() noexcept { return _M_alloc; } _NodeAlloc release() noexcept { _NodeAlloc __tmp = std::move(_M_alloc); _M_alloc.~_NodeAlloc(); return __tmp; } [[__no_unique_address__]] _NodeAlloc _M_alloc; }; [[__no_unique_address__]] _Optional_alloc _M_alloc; template friend class _Rb_tree; template friend class _Hashtable; }; template class _Node_handle : public _Node_handle_common<_Value, _NodeAlloc> { public: constexpr _Node_handle() noexcept = default; ~_Node_handle() = default; _Node_handle(_Node_handle&&) noexcept = default; _Node_handle& operator=(_Node_handle&&) noexcept = default; using key_type = _Key; using mapped_type = typename _Value::second_type; key_type& key() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *_M_pkey; } mapped_type& mapped() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *_M_pmapped; } void swap(_Node_handle& __nh) noexcept { this->_M_swap(__nh); using std::swap; swap(_M_pkey, __nh._M_pkey); swap(_M_pmapped, __nh._M_pmapped); } friend void swap(_Node_handle& __x, _Node_handle& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } private: using _AllocTraits = allocator_traits<_NodeAlloc>; _Node_handle(typename _AllocTraits::pointer __ptr, const _NodeAlloc& __alloc) : _Node_handle_common<_Value, _NodeAlloc>(__ptr, __alloc) { if (__ptr) { auto& __key = const_cast<_Key&>(__ptr->_M_valptr()->first); _M_pkey = _S_pointer_to(__key); _M_pmapped = _S_pointer_to(__ptr->_M_valptr()->second); } else { _M_pkey = nullptr; _M_pmapped = nullptr; } } template using __pointer = __ptr_rebind>; __pointer<_Key> _M_pkey = nullptr; __pointer _M_pmapped = nullptr; template __pointer<_Tp> _S_pointer_to(_Tp& __obj) { return pointer_traits<__pointer<_Tp>>::pointer_to(__obj); } const key_type& _M_key() const noexcept { return key(); } template friend class _Rb_tree; template friend class _Hashtable; }; template class _Node_handle<_Value, _Value, _NodeAlloc> : public _Node_handle_common<_Value, _NodeAlloc> { public: constexpr _Node_handle() noexcept = default; ~_Node_handle() = default; _Node_handle(_Node_handle&&) noexcept = default; _Node_handle& operator=(_Node_handle&&) noexcept = default; using value_type = _Value; value_type& value() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *this->_M_ptr->_M_valptr(); } void swap(_Node_handle& __nh) noexcept { this->_M_swap(__nh); } friend void swap(_Node_handle& __x, _Node_handle& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } private: using _AllocTraits = allocator_traits<_NodeAlloc>; _Node_handle(typename _AllocTraits::pointer __ptr, const _NodeAlloc& __alloc) : _Node_handle_common<_Value, _NodeAlloc>(__ptr, __alloc) { } const value_type& _M_key() const noexcept { return value(); } template friend class _Rb_tree; template friend class _Hashtable; }; template struct _Node_insert_return { _Iterator position = _Iterator(); bool inserted = false; _NodeHandle node; }; } # 43 "/usr/include/c++/15/bits/hashtable.h" 2 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++11-extensions" namespace std __attribute__ ((__visibility__ ("default"))) { template using __cache_default = __not_<__and_< __is_fast_hash<_Hash>, __is_nothrow_invocable>>; template using _Hashtable_enable_default_ctor = _Enable_default_constructor<__and_, is_default_constructible<_Hash>, is_default_constructible<_Allocator>>{}, __detail::_Hash_node_base>; # 185 "/usr/include/c++/15/bits/hashtable.h" 3 template class _Hashtable : public __detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _Traits>, public __detail::_Map_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>, public __detail::_Rehash_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>, private __detail::_Hashtable_alloc< __alloc_rebind<_Alloc, __detail::_Hash_node<_Value, _Traits::__hash_cached::value>>>, private _Hashtable_enable_default_ctor<_Equal, _Hash, _Alloc> { static_assert(is_same::type, _Value>::value, "unordered container must have a non-const, non-volatile value_type"); static_assert(is_same{}, "unordered container must have the same value_type as its allocator"); static_assert(is_copy_constructible<_Hash>::value, "hash function must be copy constructible"); using __traits_type = _Traits; using __hash_cached = typename __traits_type::__hash_cached; using __constant_iterators = typename __traits_type::__constant_iterators; using __node_type = __detail::_Hash_node<_Value, __hash_cached::value>; using __node_alloc_type = __alloc_rebind<_Alloc, __node_type>; using __hashtable_alloc = __detail::_Hashtable_alloc<__node_alloc_type>; using __node_value_type = __detail::_Hash_node_value<_Value, __hash_cached::value>; using __node_ptr = typename __hashtable_alloc::__node_ptr; using __value_alloc_traits = typename __hashtable_alloc::__value_alloc_traits; using __node_alloc_traits = typename __hashtable_alloc::__node_alloc_traits; using __node_base = typename __hashtable_alloc::__node_base; using __node_base_ptr = typename __hashtable_alloc::__node_base_ptr; using __buckets_ptr = typename __hashtable_alloc::__buckets_ptr; using __enable_default_ctor = _Hashtable_enable_default_ctor<_Equal, _Hash, _Alloc>; using __rehash_guard_t = __detail::_RehashStateGuard<_RehashPolicy>; public: typedef _Key key_type; typedef _Value value_type; typedef _Alloc allocator_type; typedef _Equal key_equal; typedef typename __value_alloc_traits::pointer pointer; typedef typename __value_alloc_traits::const_pointer const_pointer; typedef value_type& reference; typedef const value_type& const_reference; using iterator = __detail::_Node_iterator<_Value, __constant_iterators::value, __hash_cached::value>; using const_iterator = __detail::_Node_const_iterator<_Value, __constant_iterators::value, __hash_cached::value>; using local_iterator = __detail::_Local_iterator; using const_local_iterator = __detail::_Local_const_iterator< key_type, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __constant_iterators::value, __hash_cached::value>; private: using __rehash_type = _RehashPolicy; using __unique_keys = typename __traits_type::__unique_keys; using __hashtable_base = __detail:: _Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _Traits>; using __hash_code_base = typename __hashtable_base::__hash_code_base; using __hash_code = typename __hashtable_base::__hash_code; using __ireturn_type = __conditional_t<__unique_keys::value, std::pair, iterator>; using __map_base = __detail::_Map_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>; using __rehash_base = __detail::_Rehash_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>; using __node_builder_t = __detail::_NodeBuilder<_ExtractKey>; struct _Scoped_node { _Scoped_node(__node_ptr __n, __hashtable_alloc* __h) : _M_h(__h), _M_node(__n) { } template _Scoped_node(__hashtable_alloc* __h, _Args&&... __args) : _M_h(__h), _M_node(__h->_M_allocate_node(std::forward<_Args>(__args)...)) { } ~_Scoped_node() { if (_M_node) _M_h->_M_deallocate_node(_M_node); }; _Scoped_node(const _Scoped_node&) = delete; _Scoped_node& operator=(const _Scoped_node&) = delete; __hashtable_alloc* _M_h; __node_ptr _M_node; }; struct __hash_code_base_access : __hash_code_base { using __hash_code_base::_M_bucket_index; }; static_assert(is_nothrow_default_constructible<_RangeHash>::value, "Functor used to map hash code to bucket index" " must be nothrow default constructible"); static_assert(noexcept( std::declval()((std::size_t)0, (std::size_t)0)), "Functor used to map hash code to bucket index must be" " noexcept"); static_assert(is_nothrow_default_constructible<_ExtractKey>::value, "_ExtractKey must be nothrow default constructible"); static_assert(noexcept( std::declval()(std::declval<_Value>())), "_ExtractKey functor must be noexcept invocable"); template friend struct __detail::_Map_base; public: using size_type = typename __hashtable_base::size_type; using difference_type = typename __hashtable_base::difference_type; using node_type = _Node_handle<_Key, _Value, __node_alloc_type>; using insert_return_type = _Node_insert_return; private: __buckets_ptr _M_buckets = &_M_single_bucket; size_type _M_bucket_count = 1; __node_base _M_before_begin; size_type _M_element_count = 0; _RehashPolicy _M_rehash_policy; __node_base_ptr _M_single_bucket = nullptr; void _M_update_bbegin() { if (auto __begin = _M_begin()) _M_buckets[_M_bucket_index(*__begin)] = &_M_before_begin; } void _M_update_bbegin(__node_ptr __n) { _M_before_begin._M_nxt = __n; _M_update_bbegin(); } bool _M_uses_single_bucket(__buckets_ptr __bkts) const { return __builtin_expect(__bkts == &_M_single_bucket, false); } bool _M_uses_single_bucket() const { return _M_uses_single_bucket(_M_buckets); } static constexpr size_t __small_size_threshold() noexcept { return __detail::_Hashtable_hash_traits<_Hash>::__small_size_threshold(); } __hashtable_alloc& _M_base_alloc() { return *this; } __buckets_ptr _M_allocate_buckets(size_type __bkt_count) { if (__builtin_expect(__bkt_count == 1, false)) { _M_single_bucket = nullptr; return &_M_single_bucket; } return __hashtable_alloc::_M_allocate_buckets(__bkt_count); } void _M_deallocate_buckets(__buckets_ptr __bkts, size_type __bkt_count) { if (_M_uses_single_bucket(__bkts)) return; __hashtable_alloc::_M_deallocate_buckets(__bkts, __bkt_count); } void _M_deallocate_buckets() { _M_deallocate_buckets(_M_buckets, _M_bucket_count); } __node_ptr _M_bucket_begin(size_type __bkt) const { __node_base_ptr __n = _M_buckets[__bkt]; return __n ? static_cast<__node_ptr>(__n->_M_nxt) : nullptr; } __node_ptr _M_begin() const { return static_cast<__node_ptr>(_M_before_begin._M_nxt); } template void _M_assign_elements(_Ht&&); template void _M_assign(_Ht&& __ht) { __detail::_AllocNode<__node_alloc_type> __alloc_node_gen(*this); _M_assign(std::forward<_Ht>(__ht), __alloc_node_gen); } template void _M_assign(_Ht&&, _NodeGenerator&); void _M_move_assign(_Hashtable&&, true_type); void _M_move_assign(_Hashtable&&, false_type); void _M_reset() noexcept; _Hashtable(const _Hash& __h, const _Equal& __eq, const allocator_type& __a) : __hashtable_base(__h, __eq), __hashtable_alloc(__node_alloc_type(__a)), __enable_default_ctor(_Enable_default_constructor_tag{}) { } template static constexpr bool _S_nothrow_move() { if constexpr (_No_realloc) if constexpr (is_nothrow_copy_constructible<_Hash>()) return is_nothrow_copy_constructible<_Equal>(); return false; } _Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type ) noexcept(_S_nothrow_move()); _Hashtable(_Hashtable&&, __node_alloc_type&&, false_type ); template _Hashtable(_InputIterator __first, _InputIterator __last, size_type __bkt_count_hint, const _Hash&, const _Equal&, const allocator_type&, true_type __uks); template _Hashtable(_InputIterator __first, _InputIterator __last, size_type __bkt_count_hint, const _Hash&, const _Equal&, const allocator_type&, false_type __uks); public: _Hashtable() = default; _Hashtable(const _Hashtable&); _Hashtable(const _Hashtable&, const allocator_type&); explicit _Hashtable(size_type __bkt_count_hint, const _Hash& __hf = _Hash(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()); _Hashtable(_Hashtable&& __ht) noexcept(_S_nothrow_move()) : _Hashtable(std::move(__ht), std::move(__ht._M_node_allocator()), true_type{}) { } _Hashtable(_Hashtable&& __ht, const allocator_type& __a) noexcept(_S_nothrow_move<__node_alloc_traits::_S_always_equal()>()) : _Hashtable(std::move(__ht), __node_alloc_type(__a), typename __node_alloc_traits::is_always_equal{}) { } explicit _Hashtable(const allocator_type& __a) : __hashtable_alloc(__node_alloc_type(__a)), __enable_default_ctor(_Enable_default_constructor_tag{}) { } template _Hashtable(_InputIterator __f, _InputIterator __l, size_type __bkt_count_hint = 0, const _Hash& __hf = _Hash(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _Hashtable(__f, __l, __bkt_count_hint, __hf, __eql, __a, __unique_keys{}) { } _Hashtable(initializer_list __l, size_type __bkt_count_hint = 0, const _Hash& __hf = _Hash(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _Hashtable(__l.begin(), __l.end(), __bkt_count_hint, __hf, __eql, __a, __unique_keys{}) { } _Hashtable& operator=(const _Hashtable& __ht); _Hashtable& operator=(_Hashtable&& __ht) noexcept(__node_alloc_traits::_S_nothrow_move() && is_nothrow_move_assignable<_Hash>::value && is_nothrow_move_assignable<_Equal>::value) { constexpr bool __move_storage = __node_alloc_traits::_S_propagate_on_move_assign() || __node_alloc_traits::_S_always_equal(); _M_move_assign(std::move(__ht), __bool_constant<__move_storage>()); return *this; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" _Hashtable& operator=(initializer_list __l) { using __reuse_or_alloc_node_gen_t = __detail::_ReuseOrAllocNode<__node_alloc_type>; __reuse_or_alloc_node_gen_t __roan(_M_begin(), *this); _M_before_begin._M_nxt = nullptr; clear(); auto __l_bkt_count = _M_rehash_policy._M_bkt_for_elements(__l.size()); if (_M_bucket_count < __l_bkt_count) rehash(__l_bkt_count); __hash_code __code; size_type __bkt; for (auto& __e : __l) { const key_type& __k = _ExtractKey{}(__e); if constexpr (__unique_keys::value) { if (auto __loc = _M_locate(__k)) continue; else { __code = __loc._M_hash_code; __bkt = __loc._M_bucket_index; } } else { __code = this->_M_hash_code(__k); __bkt = _M_bucket_index(__code); } _M_insert_unique_node(__bkt, __code, __roan(__e)); } return *this; } #pragma GCC diagnostic pop ~_Hashtable() noexcept; void swap(_Hashtable&) noexcept(__and_<__is_nothrow_swappable<_Hash>, __is_nothrow_swappable<_Equal>>::value); iterator begin() noexcept { return iterator(_M_begin()); } const_iterator begin() const noexcept { return const_iterator(_M_begin()); } iterator end() noexcept { return iterator(nullptr); } const_iterator end() const noexcept { return const_iterator(nullptr); } const_iterator cbegin() const noexcept { return const_iterator(_M_begin()); } const_iterator cend() const noexcept { return const_iterator(nullptr); } size_type size() const noexcept { return _M_element_count; } [[__nodiscard__]] bool empty() const noexcept { return size() == 0; } allocator_type get_allocator() const noexcept { return allocator_type(this->_M_node_allocator()); } size_type max_size() const noexcept { return __node_alloc_traits::max_size(this->_M_node_allocator()); } key_equal key_eq() const { return this->_M_eq(); } size_type bucket_count() const noexcept { return _M_bucket_count; } size_type max_bucket_count() const noexcept { return max_size(); } size_type bucket_size(size_type __bkt) const { return std::distance(begin(__bkt), end(__bkt)); } size_type bucket(const key_type& __k) const { return _M_bucket_index(this->_M_hash_code(__k)); } local_iterator begin(size_type __bkt) { return local_iterator(*this, _M_bucket_begin(__bkt), __bkt, _M_bucket_count); } local_iterator end(size_type __bkt) { return local_iterator(*this, nullptr, __bkt, _M_bucket_count); } const_local_iterator begin(size_type __bkt) const { return const_local_iterator(*this, _M_bucket_begin(__bkt), __bkt, _M_bucket_count); } const_local_iterator end(size_type __bkt) const { return const_local_iterator(*this, nullptr, __bkt, _M_bucket_count); } const_local_iterator cbegin(size_type __bkt) const { return const_local_iterator(*this, _M_bucket_begin(__bkt), __bkt, _M_bucket_count); } const_local_iterator cend(size_type __bkt) const { return const_local_iterator(*this, nullptr, __bkt, _M_bucket_count); } float load_factor() const noexcept { return static_cast(size()) / static_cast(bucket_count()); } const _RehashPolicy& __rehash_policy() const { return _M_rehash_policy; } void __rehash_policy(const _RehashPolicy& __pol) { _M_rehash_policy = __pol; } iterator find(const key_type& __k); const_iterator find(const key_type& __k) const; size_type count(const key_type& __k) const; std::pair equal_range(const key_type& __k); std::pair equal_range(const key_type& __k) const; template, typename = __has_is_transparent_t<_Equal, _Kt>> iterator _M_find_tr(const _Kt& __k); template, typename = __has_is_transparent_t<_Equal, _Kt>> const_iterator _M_find_tr(const _Kt& __k) const; template, typename = __has_is_transparent_t<_Equal, _Kt>> size_type _M_count_tr(const _Kt& __k) const; template, typename = __has_is_transparent_t<_Equal, _Kt>> pair _M_equal_range_tr(const _Kt& __k); template, typename = __has_is_transparent_t<_Equal, _Kt>> pair _M_equal_range_tr(const _Kt& __k) const; void _M_rehash_insert(size_type __n); private: size_type _M_bucket_index(const __node_value_type& __n) const noexcept { return __hash_code_base::_M_bucket_index(__n, _M_bucket_count); } size_type _M_bucket_index(__hash_code __c) const { return __hash_code_base::_M_bucket_index(__c, _M_bucket_count); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" __hash_code _M_hash_code_ext(const __node_value_type& __from) const { if constexpr (__and_<__hash_cached, is_empty<_Hash>>::value) return __from._M_hash_code; else return this->_M_hash_code(_ExtractKey{}(__from._M_v())); } size_type _M_bucket_index_ext(const __node_value_type& __from) const { return _RangeHash{}(_M_hash_code_ext(__from), _M_bucket_count); } void _M_copy_code(__node_value_type& __to, const __node_value_type& __from) const { if constexpr (__hash_cached::value) __to._M_hash_code = _M_hash_code_ext(__from); } void _M_store_code(__node_value_type& __to, __hash_code __code) const { if constexpr (__hash_cached::value) __to._M_hash_code = __code; } #pragma GCC diagnostic pop __node_base_ptr _M_find_before_node(size_type, const key_type&, __hash_code) const; template __node_base_ptr _M_find_before_node_tr(size_type, const _Kt&, __hash_code) const; struct __location_type { explicit operator bool() const noexcept { return static_cast(_M_before); } explicit operator iterator() const noexcept { return iterator(_M_node()); } explicit operator const_iterator() const noexcept { return const_iterator(_M_node()); } __node_ptr _M_node() const { if (_M_before) return static_cast<__node_ptr>(_M_before->_M_nxt); return __node_ptr(); } __node_base_ptr _M_before{}; __hash_code _M_hash_code{}; size_type _M_bucket_index = size_type(-1); }; # 902 "/usr/include/c++/15/bits/hashtable.h" 3 __location_type _M_locate(const key_type& __k) const; __node_ptr _M_find_node(size_type __bkt, const key_type& __key, __hash_code __c) const { if (__node_base_ptr __before_n = _M_find_before_node(__bkt, __key, __c)) return static_cast<__node_ptr>(__before_n->_M_nxt); return nullptr; } template __node_ptr _M_find_node_tr(size_type __bkt, const _Kt& __key, __hash_code __c) const { if (auto __before_n = _M_find_before_node_tr(__bkt, __key, __c)) return static_cast<__node_ptr>(__before_n->_M_nxt); return nullptr; } void _M_insert_bucket_begin(size_type __bkt, __node_ptr __node) { if (_M_buckets[__bkt]) { __node->_M_nxt = _M_buckets[__bkt]->_M_nxt; _M_buckets[__bkt]->_M_nxt = __node; } else { __node->_M_nxt = _M_before_begin._M_nxt; _M_before_begin._M_nxt = __node; if (__node->_M_nxt) _M_buckets[_M_bucket_index(*__node->_M_next())] = __node; _M_buckets[__bkt] = &_M_before_begin; } } void _M_remove_bucket_begin(size_type __bkt, __node_ptr __next_n, size_type __next_bkt) { if (!__next_n) _M_buckets[__bkt] = nullptr; else if (__next_bkt != __bkt) { _M_buckets[__next_bkt] = _M_buckets[__bkt]; _M_buckets[__bkt] = nullptr; } } __node_base_ptr _M_get_previous_node(size_type __bkt, __node_ptr __n); pair<__node_ptr, __hash_code> _M_compute_hash_code(__node_ptr __hint, const key_type& __k) const; iterator _M_insert_unique_node(size_type __bkt, __hash_code, __node_ptr __n, size_type __n_elt = 1); iterator _M_insert_multi_node(__node_ptr __hint, __hash_code __code, __node_ptr __n); template std::pair _M_emplace_uniq(_Args&&... __args); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++14-extensions" template, typename = _ExtractKey> static constexpr bool __is_key_type = false; template static constexpr bool __is_key_type<_Arg, key_type, __detail::_Identity> = true; template static constexpr bool __is_key_type<_Arg, pair<_Arg1, _Arg2>, __detail::_Select1st> = is_same<__remove_cvref_t<_Arg1>, key_type>::value; #pragma GCC diagnostic pop template iterator _M_emplace_multi(const_iterator, _Args&&... __args); iterator _M_erase(size_type __bkt, __node_base_ptr __prev_n, __node_ptr __n); template void _M_insert_range_multi(_InputIterator __first, _InputIterator __last); public: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template __ireturn_type emplace(_Args&&... __args) { if constexpr (__unique_keys::value) return _M_emplace_uniq(std::forward<_Args>(__args)...); else return _M_emplace_multi(cend(), std::forward<_Args>(__args)...); } template iterator emplace_hint(const_iterator __hint, _Args&&... __args) { if constexpr (__unique_keys::value) return _M_emplace_uniq(std::forward<_Args>(__args)...).first; else return _M_emplace_multi(__hint, std::forward<_Args>(__args)...); } __ireturn_type insert(const value_type& __v) { if constexpr (__unique_keys::value) return _M_emplace_uniq(__v); else return _M_emplace_multi(cend(), __v); } iterator insert(const_iterator __hint, const value_type& __v) { if constexpr (__unique_keys::value) return _M_emplace_uniq(__v).first; else return _M_emplace_multi(__hint, __v); } __ireturn_type insert(value_type&& __v) { if constexpr (__unique_keys::value) return _M_emplace_uniq(std::move(__v)); else return _M_emplace_multi(cend(), std::move(__v)); } iterator insert(const_iterator __hint, value_type&& __v) { if constexpr (__unique_keys::value) return _M_emplace_uniq(std::move(__v)).first; else return _M_emplace_multi(__hint, std::move(__v)); } template std::pair try_emplace(const_iterator, _KType&& __k, _Args&&... __args) { __hash_code __code; size_type __bkt; if (auto __loc = _M_locate(__k)) return { iterator(__loc), false }; else { __code = __loc._M_hash_code; __bkt = __loc._M_bucket_index; } _Scoped_node __node { this, std::piecewise_construct, std::forward_as_tuple(std::forward<_KType>(__k)), std::forward_as_tuple(std::forward<_Args>(__args)...) }; auto __it = _M_insert_unique_node(__bkt, __code, __node._M_node); __node._M_node = nullptr; return { __it, true }; } void insert(initializer_list __l) { this->insert(__l.begin(), __l.end()); } template void insert(_InputIterator __first, _InputIterator __last) { if constexpr (__unique_keys::value) for (; __first != __last; ++__first) _M_emplace_uniq(*__first); else return _M_insert_range_multi(__first, __last); } template>, is_constructible>> __ireturn_type insert(_Pair&& __v) { if constexpr (__unique_keys::value) return _M_emplace_uniq(std::forward<_Pair>(__v)); else return _M_emplace_multi(cend(), std::forward<_Pair>(__v)); } template>, is_constructible>> iterator insert(const_iterator __hint, _Pair&& __v) { if constexpr (__unique_keys::value) return _M_emplace_uniq(std::forward<_Pair>(__v)); else return _M_emplace_multi(__hint, std::forward<_Pair>(__v)); } #pragma GCC diagnostic pop iterator erase(const_iterator); iterator erase(iterator __it) { return erase(const_iterator(__it)); } size_type erase(const key_type& __k); iterator erase(const_iterator, const_iterator); void clear() noexcept; void rehash(size_type __bkt_count); insert_return_type _M_reinsert_node(node_type&& __nh) { insert_return_type __ret; if (__nh.empty()) __ret.position = end(); else { do { if (std::__is_constant_evaluated() && !bool(get_allocator() == __nh.get_allocator())) std::__glibcxx_assert_fail(); } while (false); if (auto __loc = _M_locate(__nh._M_key())) { __ret.node = std::move(__nh); __ret.position = iterator(__loc); __ret.inserted = false; } else { auto __code = __loc._M_hash_code; auto __bkt = __loc._M_bucket_index; __ret.position = _M_insert_unique_node(__bkt, __code, __nh._M_ptr); __ret.inserted = true; __nh.release(); } } return __ret; } iterator _M_reinsert_node_multi(const_iterator __hint, node_type&& __nh) { if (__nh.empty()) return end(); do { if (std::__is_constant_evaluated() && !bool(get_allocator() == __nh.get_allocator())) std::__glibcxx_assert_fail(); } while (false); const key_type& __k = __nh._M_key(); auto __code = this->_M_hash_code(__k); auto __ret = _M_insert_multi_node(__hint._M_cur, __code, __nh._M_ptr); __nh.release(); return __ret; } private: node_type _M_extract_node(size_t __bkt, __node_base_ptr __prev_n) { __node_ptr __n = static_cast<__node_ptr>(__prev_n->_M_nxt); if (__prev_n == _M_buckets[__bkt]) _M_remove_bucket_begin(__bkt, __n->_M_next(), __n->_M_nxt ? _M_bucket_index(*__n->_M_next()) : 0); else if (__n->_M_nxt) { size_type __next_bkt = _M_bucket_index(*__n->_M_next()); if (__next_bkt != __bkt) _M_buckets[__next_bkt] = __prev_n; } __prev_n->_M_nxt = __n->_M_nxt; __n->_M_nxt = nullptr; --_M_element_count; return { __n, this->_M_node_allocator() }; } template __hash_code _M_src_hash_code(const _H2&, const __node_value_type& __src_n) const { if constexpr (__and_<__hash_cached, is_same<_H2, _Hash>, is_empty<_Hash>>::value) return __src_n._M_hash_code; else return this->_M_hash_code(_ExtractKey{}(__src_n._M_v())); } public: node_type extract(const_iterator __pos) { size_t __bkt = _M_bucket_index(*__pos._M_cur); return _M_extract_node(__bkt, _M_get_previous_node(__bkt, __pos._M_cur)); } node_type extract(const _Key& __k) { node_type __nh; __hash_code __code = this->_M_hash_code(__k); std::size_t __bkt = _M_bucket_index(__code); if (__node_base_ptr __prev_node = _M_find_before_node(__bkt, __k, __code)) __nh = _M_extract_node(__bkt, __prev_node); return __nh; } void _M_merge_unique(_Hashtable& __src) { do { if (std::__is_constant_evaluated() && !bool(get_allocator() == __src.get_allocator())) std::__glibcxx_assert_fail(); } while (false); using _PTr = pointer_traits<__node_base_ptr>; auto __n_elt = __src.size(); size_type __first = 1; auto __prev = _PTr::pointer_to(__src._M_before_begin); while (__n_elt--) { const auto __next = __prev->_M_nxt; const auto& __node = static_cast<__node_type&>(*__next); const key_type& __k = _ExtractKey{}(__node._M_v()); const auto __loc = _M_locate(__k); if (__loc) { __prev = __next; continue; } auto __src_bkt = __src._M_bucket_index(__node); auto __nh = __src._M_extract_node(__src_bkt, __prev); _M_insert_unique_node(__loc._M_bucket_index, __loc._M_hash_code, __nh._M_ptr, __first * __n_elt + 1); __nh.release(); __first = 0; } } template void _M_merge_unique(_Compatible_Hashtable& __src) { static_assert(is_same_v, "Node types are compatible"); do { if (std::__is_constant_evaluated() && !bool(get_allocator() == __src.get_allocator())) std::__glibcxx_assert_fail(); } while (false); auto __n_elt = __src.size(); size_type __first = 1; for (auto __i = __src.cbegin(), __end = __src.cend(); __i != __end;) { --__n_elt; auto __pos = __i++; const key_type& __k = _ExtractKey{}(*__pos); const auto __loc = _M_locate(__k); if (__loc) continue; auto __nh = __src.extract(__pos); _M_insert_unique_node(__loc._M_bucket_index, __loc._M_hash_code, __nh._M_ptr, __first * __n_elt + 1); __nh.release(); __first = 0; } } void _M_merge_multi(_Hashtable& __src) { do { if (std::__is_constant_evaluated() && !bool(get_allocator() == __src.get_allocator())) std::__glibcxx_assert_fail(); } while (false); if (__src.size() == 0) [[__unlikely__]] return; using _PTr = pointer_traits<__node_base_ptr>; __node_ptr __hint = nullptr; this->reserve(size() + __src.size()); auto __prev = _PTr::pointer_to(__src._M_before_begin); do { const auto& __node = static_cast<__node_type&>(*__prev->_M_nxt); auto __code = _M_hash_code_ext(__node); size_type __src_bkt = __src._M_bucket_index(__node); auto __nh = __src._M_extract_node(__src_bkt, __prev); __hint = _M_insert_multi_node(__hint, __code, __nh._M_ptr)._M_cur; __nh.release(); } while (__prev->_M_nxt != nullptr); } template void _M_merge_multi(_Compatible_Hashtable& __src) { static_assert(is_same_v, "Node types are compatible"); do { if (std::__is_constant_evaluated() && !bool(get_allocator() == __src.get_allocator())) std::__glibcxx_assert_fail(); } while (false); __node_ptr __hint = nullptr; this->reserve(size() + __src.size()); for (auto __i = __src.cbegin(), __end = __src.cend(); __i != __end;) { auto __pos = __i++; __hash_code __code = _M_src_hash_code(__src.hash_function(), *__pos._M_cur); auto __nh = __src.extract(__pos); __hint = _M_insert_multi_node(__hint, __code, __nh._M_ptr)._M_cur; __nh.release(); } } bool _M_equal(const _Hashtable& __other) const; private: void _M_rehash(size_type __bkt_count, true_type __uks); void _M_rehash(size_type __bkt_count, false_type __uks); }; template _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _Hashtable(size_type __bkt_count_hint, const _Hash& __h, const _Equal& __eq, const allocator_type& __a) : _Hashtable(__h, __eq, __a) { auto __bkt_count = _M_rehash_policy._M_next_bkt(__bkt_count_hint); if (__bkt_count > _M_bucket_count) { _M_buckets = _M_allocate_buckets(__bkt_count); _M_bucket_count = __bkt_count; } } template template inline _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _Hashtable(_InputIterator __f, _InputIterator __l, size_type __bkt_count_hint, const _Hash& __h, const _Equal& __eq, const allocator_type& __a, true_type ) : _Hashtable(__bkt_count_hint, __h, __eq, __a) { this->insert(__f, __l); } template template _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _Hashtable(_InputIterator __f, _InputIterator __l, size_type __bkt_count_hint, const _Hash& __h, const _Equal& __eq, const allocator_type& __a, false_type __uks) : _Hashtable(__h, __eq, __a) { auto __nb_elems = __detail::__distance_fw(__f, __l); auto __bkt_count = _M_rehash_policy._M_next_bkt( std::max(_M_rehash_policy._M_bkt_for_elements(__nb_elems), __bkt_count_hint)); if (__bkt_count > _M_bucket_count) { _M_buckets = _M_allocate_buckets(__bkt_count); _M_bucket_count = __bkt_count; } for (; __f != __l; ++__f) _M_emplace_multi(cend(), *__f); } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: operator=(const _Hashtable& __ht) -> _Hashtable& { if (&__ht == this) return *this; if (__node_alloc_traits::_S_propagate_on_copy_assign()) { auto& __this_alloc = this->_M_node_allocator(); auto& __that_alloc = __ht._M_node_allocator(); if (!__node_alloc_traits::_S_always_equal() && __this_alloc != __that_alloc) { this->_M_deallocate_nodes(_M_begin()); _M_before_begin._M_nxt = nullptr; _M_deallocate_buckets(); _M_buckets = nullptr; std::__alloc_on_copy(__this_alloc, __that_alloc); __hashtable_base::operator=(__ht); _M_bucket_count = __ht._M_bucket_count; _M_element_count = __ht._M_element_count; _M_rehash_policy = __ht._M_rehash_policy; struct _Guard { ~_Guard() { if (_M_ht) _M_ht->_M_reset(); } _Hashtable* _M_ht; }; _Guard __guard{this}; _M_assign(__ht); __guard._M_ht = nullptr; return *this; } std::__alloc_on_copy(__this_alloc, __that_alloc); } _M_assign_elements(__ht); return *this; } template template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_assign_elements(_Ht&& __ht) { using __reuse_or_alloc_node_gen_t = __detail::_ReuseOrAllocNode<__node_alloc_type>; __buckets_ptr __former_buckets = nullptr; std::size_t __former_bucket_count = _M_bucket_count; __rehash_guard_t __rehash_guard(_M_rehash_policy); if (_M_bucket_count != __ht._M_bucket_count) { __former_buckets = _M_buckets; _M_buckets = _M_allocate_buckets(__ht._M_bucket_count); _M_bucket_count = __ht._M_bucket_count; } else std::fill_n(_M_buckets, _M_bucket_count, nullptr); try { __hashtable_base::operator=(std::forward<_Ht>(__ht)); _M_element_count = __ht._M_element_count; _M_rehash_policy = __ht._M_rehash_policy; __reuse_or_alloc_node_gen_t __roan(_M_begin(), *this); _M_before_begin._M_nxt = nullptr; _M_assign(std::forward<_Ht>(__ht), __roan); if (__former_buckets) _M_deallocate_buckets(__former_buckets, __former_bucket_count); __rehash_guard._M_guarded_obj = nullptr; } catch(...) { if (__former_buckets) { _M_deallocate_buckets(); _M_buckets = __former_buckets; _M_bucket_count = __former_bucket_count; } std::fill_n(_M_buckets, _M_bucket_count, nullptr); throw; } } template template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_assign(_Ht&& __ht, _NodeGenerator& __node_gen) { struct _Guard { ~_Guard() { if (_M_ht) { _M_ht->clear(); if (_M_dealloc_buckets) _M_ht->_M_deallocate_buckets(); } } _Hashtable* _M_ht = nullptr; bool _M_dealloc_buckets = false; }; _Guard __guard; if (!_M_buckets) { _M_buckets = _M_allocate_buckets(_M_bucket_count); __guard._M_dealloc_buckets = true; } if (!__ht._M_before_begin._M_nxt) return; __guard._M_ht = this; using _FromVal = __conditional_t::value, const value_type&, value_type&&>; __node_ptr __ht_n = __ht._M_begin(); __node_ptr __this_n = __node_gen(static_cast<_FromVal>(__ht_n->_M_v())); _M_copy_code(*__this_n, *__ht_n); _M_update_bbegin(__this_n); __node_ptr __prev_n = __this_n; for (__ht_n = __ht_n->_M_next(); __ht_n; __ht_n = __ht_n->_M_next()) { __this_n = __node_gen(static_cast<_FromVal>(__ht_n->_M_v())); __prev_n->_M_nxt = __this_n; _M_copy_code(*__this_n, *__ht_n); size_type __bkt = _M_bucket_index(*__this_n); if (!_M_buckets[__bkt]) _M_buckets[__bkt] = __prev_n; __prev_n = __this_n; } __guard._M_ht = nullptr; } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_reset() noexcept { _M_rehash_policy._M_reset(); _M_bucket_count = 1; _M_single_bucket = nullptr; _M_buckets = &_M_single_bucket; _M_before_begin._M_nxt = nullptr; _M_element_count = 0; } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_move_assign(_Hashtable&& __ht, true_type) { if (__builtin_expect(std::__addressof(__ht) == this, false)) return; this->_M_deallocate_nodes(_M_begin()); _M_deallocate_buckets(); __hashtable_base::operator=(std::move(__ht)); _M_rehash_policy = __ht._M_rehash_policy; if (!__ht._M_uses_single_bucket()) _M_buckets = __ht._M_buckets; else { _M_buckets = &_M_single_bucket; _M_single_bucket = __ht._M_single_bucket; } _M_bucket_count = __ht._M_bucket_count; _M_before_begin._M_nxt = __ht._M_before_begin._M_nxt; _M_element_count = __ht._M_element_count; std::__alloc_on_move(this->_M_node_allocator(), __ht._M_node_allocator()); _M_update_bbegin(); __ht._M_reset(); } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_move_assign(_Hashtable&& __ht, false_type) { if (__ht._M_node_allocator() == this->_M_node_allocator()) _M_move_assign(std::move(__ht), true_type{}); else { _M_assign_elements(std::move(__ht)); __ht.clear(); } } template inline _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _Hashtable(const _Hashtable& __ht) : __hashtable_base(__ht), __map_base(__ht), __rehash_base(__ht), __hashtable_alloc( __node_alloc_traits::_S_select_on_copy(__ht._M_node_allocator())), __enable_default_ctor(__ht), _M_buckets(nullptr), _M_bucket_count(__ht._M_bucket_count), _M_element_count(__ht._M_element_count), _M_rehash_policy(__ht._M_rehash_policy) { _M_assign(__ht); } template _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type ) noexcept(_S_nothrow_move()) : __hashtable_base(__ht), __map_base(__ht), __rehash_base(__ht), __hashtable_alloc(std::move(__a)), __enable_default_ctor(__ht), _M_buckets(__ht._M_buckets), _M_bucket_count(__ht._M_bucket_count), _M_before_begin(__ht._M_before_begin._M_nxt), _M_element_count(__ht._M_element_count), _M_rehash_policy(__ht._M_rehash_policy) { if (__ht._M_uses_single_bucket()) { _M_buckets = &_M_single_bucket; _M_single_bucket = __ht._M_single_bucket; } _M_update_bbegin(); __ht._M_reset(); } template inline _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _Hashtable(const _Hashtable& __ht, const allocator_type& __a) : __hashtable_base(__ht), __map_base(__ht), __rehash_base(__ht), __hashtable_alloc(__node_alloc_type(__a)), __enable_default_ctor(__ht), _M_buckets(), _M_bucket_count(__ht._M_bucket_count), _M_element_count(__ht._M_element_count), _M_rehash_policy(__ht._M_rehash_policy) { _M_assign(__ht); } template _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, false_type ) : __hashtable_base(__ht), __map_base(__ht), __rehash_base(__ht), __hashtable_alloc(std::move(__a)), __enable_default_ctor(__ht), _M_buckets(nullptr), _M_bucket_count(__ht._M_bucket_count), _M_element_count(__ht._M_element_count), _M_rehash_policy(__ht._M_rehash_policy) { if (__ht._M_node_allocator() == this->_M_node_allocator()) { if (__ht._M_uses_single_bucket()) { _M_buckets = &_M_single_bucket; _M_single_bucket = __ht._M_single_bucket; } else _M_buckets = __ht._M_buckets; _M_update_bbegin(__ht._M_begin()); __ht._M_reset(); } else { using _Fwd_Ht = __conditional_t< __move_if_noexcept_cond::value, const _Hashtable&, _Hashtable&&>; _M_assign(std::forward<_Fwd_Ht>(__ht)); __ht.clear(); } } template _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: ~_Hashtable() noexcept { static_assert(noexcept(declval() ._M_bucket_index(declval(), (std::size_t)0)), "Cache the hash code or qualify your functors involved" " in hash code and bucket index computation with noexcept"); this->_M_deallocate_nodes(_M_begin()); _M_deallocate_buckets(); } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: swap(_Hashtable& __x) noexcept(__and_<__is_nothrow_swappable<_Hash>, __is_nothrow_swappable<_Equal>>::value) { using std::swap; swap(__hash_code_base::_M_hash._M_obj, __x.__hash_code_base::_M_hash._M_obj); swap(__hashtable_base::_M_equal._M_obj, __x.__hashtable_base::_M_equal._M_obj); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" if constexpr (__node_alloc_traits::propagate_on_container_swap::value) swap(this->_M_node_allocator(), __x._M_node_allocator()); #pragma GCC diagnostic pop std::swap(_M_rehash_policy, __x._M_rehash_policy); if (this->_M_uses_single_bucket()) { if (!__x._M_uses_single_bucket()) { _M_buckets = __x._M_buckets; __x._M_buckets = &__x._M_single_bucket; } } else if (__x._M_uses_single_bucket()) { __x._M_buckets = _M_buckets; _M_buckets = &_M_single_bucket; } else std::swap(_M_buckets, __x._M_buckets); std::swap(_M_bucket_count, __x._M_bucket_count); std::swap(_M_before_begin._M_nxt, __x._M_before_begin._M_nxt); std::swap(_M_element_count, __x._M_element_count); std::swap(_M_single_bucket, __x._M_single_bucket); _M_update_bbegin(); __x._M_update_bbegin(); } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: find(const key_type& __k) -> iterator { return iterator(_M_locate(__k)); } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: find(const key_type& __k) const -> const_iterator { return const_iterator(_M_locate(__k)); } template template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_find_tr(const _Kt& __k) -> iterator { if (size() <= __small_size_threshold()) { for (auto __n = _M_begin(); __n; __n = __n->_M_next()) if (this->_M_key_equals_tr(__k, *__n)) return iterator(__n); return end(); } __hash_code __code = this->_M_hash_code_tr(__k); std::size_t __bkt = _M_bucket_index(__code); return iterator(_M_find_node_tr(__bkt, __k, __code)); } template template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_find_tr(const _Kt& __k) const -> const_iterator { if (size() <= __small_size_threshold()) { for (auto __n = _M_begin(); __n; __n = __n->_M_next()) if (this->_M_key_equals_tr(__k, *__n)) return const_iterator(__n); return end(); } __hash_code __code = this->_M_hash_code_tr(__k); std::size_t __bkt = _M_bucket_index(__code); return const_iterator(_M_find_node_tr(__bkt, __k, __code)); } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: count(const key_type& __k) const -> size_type { auto __it = find(__k); if (!__it._M_cur) return 0; if (__unique_keys::value) return 1; size_type __result = 1; for (auto __ref = __it++; __it._M_cur && this->_M_node_equals(*__ref._M_cur, *__it._M_cur); ++__it) ++__result; return __result; } template template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_count_tr(const _Kt& __k) const -> size_type { if (size() <= __small_size_threshold()) { size_type __result = 0; for (auto __n = _M_begin(); __n; __n = __n->_M_next()) { if (this->_M_key_equals_tr(__k, *__n)) { ++__result; continue; } if (__result) break; } return __result; } __hash_code __code = this->_M_hash_code_tr(__k); std::size_t __bkt = _M_bucket_index(__code); auto __n = _M_find_node_tr(__bkt, __k, __code); if (!__n) return 0; iterator __it(__n); size_type __result = 1; for (++__it; __it._M_cur && this->_M_equals_tr(__k, __code, *__it._M_cur); ++__it) ++__result; return __result; } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: equal_range(const key_type& __k) -> pair { auto __ite = find(__k); if (!__ite._M_cur) return { __ite, __ite }; auto __beg = __ite++; if (__unique_keys::value) return { __beg, __ite }; while (__ite._M_cur && this->_M_node_equals(*__beg._M_cur, *__ite._M_cur)) ++__ite; return { __beg, __ite }; } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: equal_range(const key_type& __k) const -> pair { auto __ite = find(__k); if (!__ite._M_cur) return { __ite, __ite }; auto __beg = __ite++; if (__unique_keys::value) return { __beg, __ite }; while (__ite._M_cur && this->_M_node_equals(*__beg._M_cur, *__ite._M_cur)) ++__ite; return { __beg, __ite }; } template template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_equal_range_tr(const _Kt& __k) -> pair { if (size() <= __small_size_threshold()) { __node_ptr __n, __beg = nullptr; for (__n = _M_begin(); __n; __n = __n->_M_next()) { if (this->_M_key_equals_tr(__k, *__n)) { if (!__beg) __beg = __n; continue; } if (__beg) break; } return { iterator(__beg), iterator(__n) }; } __hash_code __code = this->_M_hash_code_tr(__k); std::size_t __bkt = _M_bucket_index(__code); auto __n = _M_find_node_tr(__bkt, __k, __code); iterator __ite(__n); if (!__n) return { __ite, __ite }; auto __beg = __ite++; while (__ite._M_cur && this->_M_equals_tr(__k, __code, *__ite._M_cur)) ++__ite; return { __beg, __ite }; } template template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_equal_range_tr(const _Kt& __k) const -> pair { if (size() <= __small_size_threshold()) { __node_ptr __n, __beg = nullptr; for (__n = _M_begin(); __n; __n = __n->_M_next()) { if (this->_M_key_equals_tr(__k, *__n)) { if (!__beg) __beg = __n; continue; } if (__beg) break; } return { const_iterator(__beg), const_iterator(__n) }; } __hash_code __code = this->_M_hash_code_tr(__k); std::size_t __bkt = _M_bucket_index(__code); auto __n = _M_find_node_tr(__bkt, __k, __code); const_iterator __ite(__n); if (!__n) return { __ite, __ite }; auto __beg = __ite++; while (__ite._M_cur && this->_M_equals_tr(__k, __code, *__ite._M_cur)) ++__ite; return { __beg, __ite }; } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_find_before_node(size_type __bkt, const key_type& __k, __hash_code __code) const -> __node_base_ptr { __node_base_ptr __prev_p = _M_buckets[__bkt]; if (!__prev_p) return nullptr; for (__node_ptr __p = static_cast<__node_ptr>(__prev_p->_M_nxt);; __p = __p->_M_next()) { if (this->_M_equals(__k, __code, *__p)) return __prev_p; if (__builtin_expect (!__p->_M_nxt || _M_bucket_index(*__p->_M_next()) != __bkt, 0)) break; __prev_p = __p; } return nullptr; } template template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_find_before_node_tr(size_type __bkt, const _Kt& __k, __hash_code __code) const -> __node_base_ptr { __node_base_ptr __prev_p = _M_buckets[__bkt]; if (!__prev_p) return nullptr; for (__node_ptr __p = static_cast<__node_ptr>(__prev_p->_M_nxt);; __p = __p->_M_next()) { if (this->_M_equals_tr(__k, __code, *__p)) return __prev_p; if (__builtin_expect (!__p->_M_nxt || _M_bucket_index(*__p->_M_next()) != __bkt, 0)) break; __prev_p = __p; } return nullptr; } template inline auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_locate(const key_type& __k) const -> __location_type { __location_type __loc; const auto __size = size(); if (__size <= __small_size_threshold()) { __loc._M_before = pointer_traits<__node_base_ptr>:: pointer_to(const_cast<__node_base&>(_M_before_begin)); while (__loc._M_before->_M_nxt) { if (this->_M_key_equals(__k, *__loc._M_node())) return __loc; __loc._M_before = __loc._M_before->_M_nxt; } __loc._M_before = nullptr; } __loc._M_hash_code = this->_M_hash_code(__k); __loc._M_bucket_index = _M_bucket_index(__loc._M_hash_code); if (__size > __small_size_threshold()) __loc._M_before = _M_find_before_node(__loc._M_bucket_index, __k, __loc._M_hash_code); return __loc; } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_get_previous_node(size_type __bkt, __node_ptr __n) -> __node_base_ptr { __node_base_ptr __prev_n = _M_buckets[__bkt]; while (__prev_n->_M_nxt != __n) __prev_n = __prev_n->_M_nxt; return __prev_n; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_emplace_uniq(_Args&&... __args) -> pair { const key_type* __kp = nullptr; if constexpr (sizeof...(_Args) == 1) { if constexpr (__is_key_type<_Args...>) { const auto& __key = _ExtractKey{}(__args...); __kp = std::__addressof(__key); } } else if constexpr (sizeof...(_Args) == 2) { if constexpr (__is_key_type>) { pair __refs(__args...); const auto& __key = _ExtractKey{}(__refs); __kp = std::__addressof(__key); } } _Scoped_node __node { __node_ptr(), this }; __hash_code __code = 0; size_type __bkt = 0; if (__kp == nullptr) { __node._M_node = this->_M_allocate_node(std::forward<_Args>(__args)...); const key_type& __key = _ExtractKey{}(__node._M_node->_M_v()); __kp = std::__addressof(__key); } if (auto __loc = _M_locate(*__kp)) return { iterator(__loc), false }; else { __code = __loc._M_hash_code; __bkt = __loc._M_bucket_index; } if (!__node._M_node) __node._M_node = this->_M_allocate_node(std::forward<_Args>(__args)...); auto __pos = _M_insert_unique_node(__bkt, __code, __node._M_node); __node._M_node = nullptr; return { __pos, true }; } #pragma GCC diagnostic pop template template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_emplace_multi(const_iterator __hint, _Args&&... __args) -> iterator { _Scoped_node __node { this, std::forward<_Args>(__args)... }; const key_type& __k = _ExtractKey{}(__node._M_node->_M_v()); auto __res = this->_M_compute_hash_code(__hint._M_cur, __k); auto __pos = _M_insert_multi_node(__res.first, __res.second, __node._M_node); __node._M_node = nullptr; return __pos; } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_rehash_insert(size_type __n) { using __pair_type = std::pair; if (__n == 0) return; __rehash_guard_t __rehash_guard(_M_rehash_policy); __pair_type __do_rehash = _M_rehash_policy._M_need_rehash(_M_bucket_count, _M_element_count, __n); if (__do_rehash.first) _M_rehash(__do_rehash.second, false_type{}); __rehash_guard._M_guarded_obj = nullptr; } template template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_insert_range_multi(_InputIterator __first, _InputIterator __last) { _M_rehash_insert(__detail::__distance_fw(__first, __last)); for (; __first != __last; ++__first) _M_emplace_multi(cend(), *__first); } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_compute_hash_code(__node_ptr __hint, const key_type& __k) const -> pair<__node_ptr, __hash_code> { if (size() <= __small_size_threshold()) { if (__hint) { for (auto __it = __hint; __it; __it = __it->_M_next()) if (this->_M_key_equals(__k, *__it)) return { __it, this->_M_hash_code(*__it) }; } for (auto __it = _M_begin(); __it != __hint; __it = __it->_M_next()) if (this->_M_key_equals(__k, *__it)) return { __it, this->_M_hash_code(*__it) }; __hint = nullptr; } return { __hint, this->_M_hash_code(__k) }; } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_insert_unique_node(size_type __bkt, __hash_code __code, __node_ptr __node, size_type __n_elt) -> iterator { __rehash_guard_t __rehash_guard(_M_rehash_policy); std::pair __do_rehash = _M_rehash_policy._M_need_rehash(_M_bucket_count, _M_element_count, __n_elt); if (__do_rehash.first) { _M_rehash(__do_rehash.second, true_type{}); __bkt = _M_bucket_index(__code); } __rehash_guard._M_guarded_obj = nullptr; _M_store_code(*__node, __code); _M_insert_bucket_begin(__bkt, __node); ++_M_element_count; return iterator(__node); } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_insert_multi_node(__node_ptr __hint, __hash_code __code, __node_ptr __node) -> iterator { __rehash_guard_t __rehash_guard(_M_rehash_policy); std::pair __do_rehash = _M_rehash_policy._M_need_rehash(_M_bucket_count, _M_element_count, 1); if (__do_rehash.first) _M_rehash(__do_rehash.second, false_type{}); __rehash_guard._M_guarded_obj = nullptr; _M_store_code(*__node, __code); const key_type& __k = _ExtractKey{}(__node->_M_v()); size_type __bkt = _M_bucket_index(__code); __node_base_ptr __prev = __builtin_expect(__hint != nullptr, false) && this->_M_equals(__k, __code, *__hint) ? __hint : _M_find_before_node(__bkt, __k, __code); if (__prev) { __node->_M_nxt = __prev->_M_nxt; __prev->_M_nxt = __node; if (__builtin_expect(__prev == __hint, false)) if (__node->_M_nxt && !this->_M_equals(__k, __code, *__node->_M_next())) { size_type __next_bkt = _M_bucket_index(*__node->_M_next()); if (__next_bkt != __bkt) _M_buckets[__next_bkt] = __node; } } else _M_insert_bucket_begin(__bkt, __node); ++_M_element_count; return iterator(__node); } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: erase(const_iterator __it) -> iterator { __node_ptr __n = __it._M_cur; std::size_t __bkt = _M_bucket_index(*__n); __node_base_ptr __prev_n = _M_get_previous_node(__bkt, __n); return _M_erase(__bkt, __prev_n, __n); } template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_erase(size_type __bkt, __node_base_ptr __prev_n, __node_ptr __n) -> iterator { if (__prev_n == _M_buckets[__bkt]) _M_remove_bucket_begin(__bkt, __n->_M_next(), __n->_M_nxt ? _M_bucket_index(*__n->_M_next()) : 0); else if (__n->_M_nxt) { size_type __next_bkt = _M_bucket_index(*__n->_M_next()); if (__next_bkt != __bkt) _M_buckets[__next_bkt] = __prev_n; } __prev_n->_M_nxt = __n->_M_nxt; iterator __result(__n->_M_next()); this->_M_deallocate_node(__n); --_M_element_count; return __result; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: erase(const key_type& __k) -> size_type { auto __loc = _M_locate(__k); if (!__loc) return 0; __node_base_ptr __prev_n = __loc._M_before; __node_ptr __n = __loc._M_node(); auto __bkt = __loc._M_bucket_index; if (__bkt == size_type(-1)) __bkt = _M_bucket_index(*__n); if constexpr (__unique_keys::value) { _M_erase(__bkt, __prev_n, __n); return 1; } else { __node_ptr __n_last = __n->_M_next(); while (__n_last && this->_M_node_equals(*__n, *__n_last)) __n_last = __n_last->_M_next(); std::size_t __n_last_bkt = __n_last ? _M_bucket_index(*__n_last) : __bkt; size_type __result = 0; do { __node_ptr __p = __n->_M_next(); this->_M_deallocate_node(__n); __n = __p; ++__result; } while (__n != __n_last); _M_element_count -= __result; if (__prev_n == _M_buckets[__bkt]) _M_remove_bucket_begin(__bkt, __n_last, __n_last_bkt); else if (__n_last_bkt != __bkt) _M_buckets[__n_last_bkt] = __prev_n; __prev_n->_M_nxt = __n_last; return __result; } } #pragma GCC diagnostic pop template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: erase(const_iterator __first, const_iterator __last) -> iterator { __node_ptr __n = __first._M_cur; __node_ptr __last_n = __last._M_cur; if (__n == __last_n) return iterator(__n); std::size_t __bkt = _M_bucket_index(*__n); __node_base_ptr __prev_n = _M_get_previous_node(__bkt, __n); bool __is_bucket_begin = __n == _M_bucket_begin(__bkt); std::size_t __n_bkt = __bkt; for (;;) { do { __node_ptr __tmp = __n; __n = __n->_M_next(); this->_M_deallocate_node(__tmp); --_M_element_count; if (!__n) break; __n_bkt = _M_bucket_index(*__n); } while (__n != __last_n && __n_bkt == __bkt); if (__is_bucket_begin) _M_remove_bucket_begin(__bkt, __n, __n_bkt); if (__n == __last_n) break; __is_bucket_begin = true; __bkt = __n_bkt; } if (__n && (__n_bkt != __bkt || __is_bucket_begin)) _M_buckets[__n_bkt] = __prev_n; __prev_n->_M_nxt = __n; return iterator(__n); } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: clear() noexcept { this->_M_deallocate_nodes(_M_begin()); std::fill_n(_M_buckets, _M_bucket_count, nullptr); _M_element_count = 0; _M_before_begin._M_nxt = nullptr; } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: rehash(size_type __bkt_count) { __rehash_guard_t __rehash_guard(_M_rehash_policy); __bkt_count = std::max(_M_rehash_policy._M_bkt_for_elements(_M_element_count + 1), __bkt_count); __bkt_count = _M_rehash_policy._M_next_bkt(__bkt_count); if (__bkt_count != _M_bucket_count) { _M_rehash(__bkt_count, __unique_keys{}); __rehash_guard._M_guarded_obj = nullptr; } } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_rehash(size_type __bkt_count, true_type ) { __buckets_ptr __new_buckets = _M_allocate_buckets(__bkt_count); __node_ptr __p = _M_begin(); _M_before_begin._M_nxt = nullptr; std::size_t __bbegin_bkt = 0; while (__p) { __node_ptr __next = __p->_M_next(); std::size_t __bkt = __hash_code_base::_M_bucket_index(*__p, __bkt_count); if (!__new_buckets[__bkt]) { __p->_M_nxt = _M_before_begin._M_nxt; _M_before_begin._M_nxt = __p; __new_buckets[__bkt] = &_M_before_begin; if (__p->_M_nxt) __new_buckets[__bbegin_bkt] = __p; __bbegin_bkt = __bkt; } else { __p->_M_nxt = __new_buckets[__bkt]->_M_nxt; __new_buckets[__bkt]->_M_nxt = __p; } __p = __next; } _M_deallocate_buckets(); _M_bucket_count = __bkt_count; _M_buckets = __new_buckets; } template void _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_rehash(size_type __bkt_count, false_type ) { __buckets_ptr __new_buckets = _M_allocate_buckets(__bkt_count); __node_ptr __p = _M_begin(); _M_before_begin._M_nxt = nullptr; std::size_t __bbegin_bkt = 0; std::size_t __prev_bkt = 0; __node_ptr __prev_p = nullptr; bool __check_bucket = false; while (__p) { __node_ptr __next = __p->_M_next(); std::size_t __bkt = __hash_code_base::_M_bucket_index(*__p, __bkt_count); if (__prev_p && __prev_bkt == __bkt) { __p->_M_nxt = __prev_p->_M_nxt; __prev_p->_M_nxt = __p; __check_bucket = true; } else { if (__check_bucket) { if (__prev_p->_M_nxt) { std::size_t __next_bkt = __hash_code_base::_M_bucket_index( *__prev_p->_M_next(), __bkt_count); if (__next_bkt != __prev_bkt) __new_buckets[__next_bkt] = __prev_p; } __check_bucket = false; } if (!__new_buckets[__bkt]) { __p->_M_nxt = _M_before_begin._M_nxt; _M_before_begin._M_nxt = __p; __new_buckets[__bkt] = &_M_before_begin; if (__p->_M_nxt) __new_buckets[__bbegin_bkt] = __p; __bbegin_bkt = __bkt; } else { __p->_M_nxt = __new_buckets[__bkt]->_M_nxt; __new_buckets[__bkt]->_M_nxt = __p; } } __prev_p = __p; __prev_bkt = __bkt; __p = __next; } if (__check_bucket && __prev_p->_M_nxt) { std::size_t __next_bkt = __hash_code_base::_M_bucket_index(*__prev_p->_M_next(), __bkt_count); if (__next_bkt != __prev_bkt) __new_buckets[__next_bkt] = __prev_p; } _M_deallocate_buckets(); _M_bucket_count = __bkt_count; _M_buckets = __new_buckets; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" template bool _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>:: _M_equal(const _Hashtable& __other) const { if (size() != __other.size()) return false; if constexpr (__unique_keys::value) for (auto __x_n = _M_begin(); __x_n; __x_n = __x_n->_M_next()) { std::size_t __ybkt = __other._M_bucket_index_ext(*__x_n); auto __prev_n = __other._M_buckets[__ybkt]; if (!__prev_n) return false; for (__node_ptr __n = static_cast<__node_ptr>(__prev_n->_M_nxt);; __n = __n->_M_next()) { if (__n->_M_v() == __x_n->_M_v()) break; if (!__n->_M_nxt || __other._M_bucket_index(*__n->_M_next()) != __ybkt) return false; } } else for (auto __x_n = _M_begin(); __x_n;) { std::size_t __x_count = 1; auto __x_n_end = __x_n->_M_next(); for (; __x_n_end && key_eq()(_ExtractKey{}(__x_n->_M_v()), _ExtractKey{}(__x_n_end->_M_v())); __x_n_end = __x_n_end->_M_next()) ++__x_count; std::size_t __ybkt = __other._M_bucket_index_ext(*__x_n); auto __y_prev_n = __other._M_buckets[__ybkt]; if (!__y_prev_n) return false; __node_ptr __y_n = static_cast<__node_ptr>(__y_prev_n->_M_nxt); for (;;) { if (key_eq()(_ExtractKey{}(__y_n->_M_v()), _ExtractKey{}(__x_n->_M_v()))) break; auto __y_ref_n = __y_n; for (__y_n = __y_n->_M_next(); __y_n; __y_n = __y_n->_M_next()) if (!__other._M_node_equals(*__y_ref_n, *__y_n)) break; if (!__y_n || __other._M_bucket_index(*__y_n) != __ybkt) return false; } auto __y_n_end = __y_n; for (; __y_n_end; __y_n_end = __y_n_end->_M_next()) if (--__x_count == 0) break; if (__x_count != 0) return false; const_iterator __itx(__x_n), __itx_end(__x_n_end); const_iterator __ity(__y_n); if (!std::is_permutation(__itx, __itx_end, __ity)) return false; __x_n = __x_n_end; } return true; } #pragma GCC diagnostic pop template class _Hash_merge_helper { }; template using _RequireNotAllocatorOrIntegral = __enable_if_t, __is_allocator<_Hash>>::value>; } #pragma GCC diagnostic pop # 34 "/usr/include/c++/15/bits/unordered_map.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template using __umap_traits = __detail::_Hashtable_traits<_Cache, false, true>; template, typename _Pred = std::equal_to<_Key>, typename _Alloc = std::allocator >, typename _Tr = __umap_traits<__cache_default<_Key, _Hash>::value>> using __umap_hashtable = _Hashtable<_Key, std::pair, _Alloc, __detail::_Select1st, _Pred, _Hash, __detail::_Mod_range_hashing, __detail::_Default_ranged_hash, __detail::_Prime_rehash_policy, _Tr>; template using __ummap_traits = __detail::_Hashtable_traits<_Cache, false, false>; template, typename _Pred = std::equal_to<_Key>, typename _Alloc = std::allocator >, typename _Tr = __ummap_traits<__cache_default<_Key, _Hash>::value>> using __ummap_hashtable = _Hashtable<_Key, std::pair, _Alloc, __detail::_Select1st, _Pred, _Hash, __detail::_Mod_range_hashing, __detail::_Default_ranged_hash, __detail::_Prime_rehash_policy, _Tr>; template class unordered_multimap; # 108 "/usr/include/c++/15/bits/unordered_map.h" 3 template, typename _Pred = equal_to<_Key>, typename _Alloc = allocator>> class unordered_map { typedef __umap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable; _Hashtable _M_h; public: typedef typename _Hashtable::key_type key_type; typedef typename _Hashtable::value_type value_type; typedef typename _Hashtable::mapped_type mapped_type; typedef typename _Hashtable::hasher hasher; typedef typename _Hashtable::key_equal key_equal; typedef typename _Hashtable::allocator_type allocator_type; typedef typename _Hashtable::pointer pointer; typedef typename _Hashtable::const_pointer const_pointer; typedef typename _Hashtable::reference reference; typedef typename _Hashtable::const_reference const_reference; typedef typename _Hashtable::iterator iterator; typedef typename _Hashtable::const_iterator const_iterator; typedef typename _Hashtable::local_iterator local_iterator; typedef typename _Hashtable::const_local_iterator const_local_iterator; typedef typename _Hashtable::size_type size_type; typedef typename _Hashtable::difference_type difference_type; using node_type = typename _Hashtable::node_type; using insert_return_type = typename _Hashtable::insert_return_type; unordered_map() = default; # 160 "/usr/include/c++/15/bits/unordered_map.h" 3 explicit unordered_map(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _M_h(__n, __hf, __eql, __a) { } # 181 "/usr/include/c++/15/bits/unordered_map.h" 3 template unordered_map(_InputIterator __first, _InputIterator __last, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _M_h(__first, __last, __n, __hf, __eql, __a) { } unordered_map(const unordered_map&) = default; unordered_map(unordered_map&&) = default; explicit unordered_map(const allocator_type& __a) : _M_h(__a) { } unordered_map(const unordered_map& __umap, const allocator_type& __a) : _M_h(__umap._M_h, __a) { } unordered_map(unordered_map&& __umap, const allocator_type& __a) noexcept( noexcept(_Hashtable(std::move(__umap._M_h), __a)) ) : _M_h(std::move(__umap._M_h), __a) { } # 237 "/usr/include/c++/15/bits/unordered_map.h" 3 unordered_map(initializer_list __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _M_h(__l, __n, __hf, __eql, __a) { } unordered_map(size_type __n, const allocator_type& __a) : unordered_map(__n, hasher(), key_equal(), __a) { } unordered_map(size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_map(__n, __hf, key_equal(), __a) { } template unordered_map(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a) : unordered_map(__first, __last, __n, hasher(), key_equal(), __a) { } template unordered_map(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_map(__first, __last, __n, __hf, key_equal(), __a) { } unordered_map(initializer_list __l, size_type __n, const allocator_type& __a) : unordered_map(__l, __n, hasher(), key_equal(), __a) { } unordered_map(initializer_list __l, size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_map(__l, __n, __hf, key_equal(), __a) { } # 294 "/usr/include/c++/15/bits/unordered_map.h" 3 template<__detail::__container_compatible_range _Rg> unordered_map(from_range_t, _Rg&& __rg, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _M_h(__n, __hf, __eql, __a) { insert_range(std::forward<_Rg>(__rg)); } template<__detail::__container_compatible_range _Rg> unordered_map(from_range_t, _Rg&& __rg, const allocator_type& __a) : _M_h(0, hasher(), key_equal(), __a) { insert_range(std::forward<_Rg>(__rg)); } template<__detail::__container_compatible_range _Rg> unordered_map(from_range_t, _Rg&& __rg, size_type __n, const allocator_type& __a) : _M_h(__n, hasher(), key_equal(), __a) { insert_range(std::forward<_Rg>(__rg)); } template<__detail::__container_compatible_range _Rg> unordered_map(from_range_t, _Rg&& __rg, size_type __n, const hasher& __hf, const allocator_type& __a) : _M_h(__n, __hf, key_equal(), __a) { insert_range(std::forward<_Rg>(__rg)); } unordered_map& operator=(const unordered_map&) = default; unordered_map& operator=(unordered_map&&) = default; # 342 "/usr/include/c++/15/bits/unordered_map.h" 3 unordered_map& operator=(initializer_list __l) { _M_h = __l; return *this; } allocator_type get_allocator() const noexcept { return _M_h.get_allocator(); } [[__nodiscard__]] bool empty() const noexcept { return _M_h.empty(); } size_type size() const noexcept { return _M_h.size(); } size_type max_size() const noexcept { return _M_h.max_size(); } iterator begin() noexcept { return _M_h.begin(); } const_iterator begin() const noexcept { return _M_h.begin(); } const_iterator cbegin() const noexcept { return _M_h.begin(); } iterator end() noexcept { return _M_h.end(); } const_iterator end() const noexcept { return _M_h.end(); } const_iterator cend() const noexcept { return _M_h.end(); } # 439 "/usr/include/c++/15/bits/unordered_map.h" 3 template std::pair emplace(_Args&&... __args) { return _M_h.emplace(std::forward<_Args>(__args)...); } # 470 "/usr/include/c++/15/bits/unordered_map.h" 3 template iterator emplace_hint(const_iterator __pos, _Args&&... __args) { return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); } node_type extract(const_iterator __pos) { do { if (std::__is_constant_evaluated() && !bool(__pos != end())) std::__glibcxx_assert_fail(); } while (false); return _M_h.extract(__pos); } node_type extract(const key_type& __key) { return _M_h.extract(__key); } insert_return_type insert(node_type&& __nh) { return _M_h._M_reinsert_node(std::move(__nh)); } iterator insert(const_iterator, node_type&& __nh) { return _M_h._M_reinsert_node(std::move(__nh)).position; } # 523 "/usr/include/c++/15/bits/unordered_map.h" 3 template pair try_emplace(const key_type& __k, _Args&&... __args) { return _M_h.try_emplace(cend(), __k, std::forward<_Args>(__args)...); } template pair try_emplace(key_type&& __k, _Args&&... __args) { return _M_h.try_emplace(cend(), std::move(__k), std::forward<_Args>(__args)...); } # 567 "/usr/include/c++/15/bits/unordered_map.h" 3 template iterator try_emplace(const_iterator __hint, const key_type& __k, _Args&&... __args) { return _M_h.try_emplace(__hint, __k, std::forward<_Args>(__args)...).first; } template iterator try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args) { return _M_h.try_emplace(__hint, std::move(__k), std::forward<_Args>(__args)...).first; } # 604 "/usr/include/c++/15/bits/unordered_map.h" 3 std::pair insert(const value_type& __x) { return _M_h.insert(__x); } std::pair insert(value_type&& __x) { return _M_h.insert(std::move(__x)); } template __enable_if_t::value, pair> insert(_Pair&& __x) { return _M_h.emplace(std::forward<_Pair>(__x)); } # 643 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator insert(const_iterator __hint, const value_type& __x) { return _M_h.insert(__hint, __x); } iterator insert(const_iterator __hint, value_type&& __x) { return _M_h.insert(__hint, std::move(__x)); } template __enable_if_t::value, iterator> insert(const_iterator __hint, _Pair&& __x) { return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); } # 668 "/usr/include/c++/15/bits/unordered_map.h" 3 template void insert(_InputIterator __first, _InputIterator __last) { _M_h.insert(__first, __last); } # 680 "/usr/include/c++/15/bits/unordered_map.h" 3 void insert(initializer_list __l) { _M_h.insert(__l); } # 691 "/usr/include/c++/15/bits/unordered_map.h" 3 template<__detail::__container_compatible_range _Rg> void insert_range(_Rg&& __rg) { auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); for (; __first != __last; ++__first) _M_h.emplace(*__first); } # 723 "/usr/include/c++/15/bits/unordered_map.h" 3 template pair insert_or_assign(const key_type& __k, _Obj&& __obj) { auto __ret = _M_h.try_emplace(cend(), __k, std::forward<_Obj>(__obj)); if (!__ret.second) __ret.first->second = std::forward<_Obj>(__obj); return __ret; } template pair insert_or_assign(key_type&& __k, _Obj&& __obj) { auto __ret = _M_h.try_emplace(cend(), std::move(__k), std::forward<_Obj>(__obj)); if (!__ret.second) __ret.first->second = std::forward<_Obj>(__obj); return __ret; } # 772 "/usr/include/c++/15/bits/unordered_map.h" 3 template iterator insert_or_assign(const_iterator __hint, const key_type& __k, _Obj&& __obj) { auto __ret = _M_h.try_emplace(__hint, __k, std::forward<_Obj>(__obj)); if (!__ret.second) __ret.first->second = std::forward<_Obj>(__obj); return __ret.first; } template iterator insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj) { auto __ret = _M_h.try_emplace(__hint, std::move(__k), std::forward<_Obj>(__obj)); if (!__ret.second) __ret.first->second = std::forward<_Obj>(__obj); return __ret.first; } # 810 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator erase(const_iterator __position) { return _M_h.erase(__position); } iterator erase(iterator __position) { return _M_h.erase(__position); } # 832 "/usr/include/c++/15/bits/unordered_map.h" 3 size_type erase(const key_type& __x) { return _M_h.erase(__x); } # 850 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator erase(const_iterator __first, const_iterator __last) { return _M_h.erase(__first, __last); } void clear() noexcept { _M_h.clear(); } # 874 "/usr/include/c++/15/bits/unordered_map.h" 3 void swap(unordered_map& __x) noexcept( noexcept(_M_h.swap(__x._M_h)) ) { _M_h.swap(__x._M_h); } template friend class std::_Hash_merge_helper; template void merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source) { if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>) if (std::__addressof(__source) == this) [[__unlikely__]] return; using _Merge_helper = _Hash_merge_helper; _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source)); } template void merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source) { using _Merge_helper = _Hash_merge_helper; _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source)); } template void merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source) { using _Merge_helper = _Hash_merge_helper; _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source)); } template void merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source) { merge(__source); } hasher hash_function() const { return _M_h.hash_function(); } key_equal key_eq() const { return _M_h.key_eq(); } # 945 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator find(const key_type& __x) { return _M_h.find(__x); } template auto find(const _Kt& __x) -> decltype(_M_h._M_find_tr(__x)) { return _M_h._M_find_tr(__x); } const_iterator find(const key_type& __x) const { return _M_h.find(__x); } template auto find(const _Kt& __x) const -> decltype(_M_h._M_find_tr(__x)) { return _M_h._M_find_tr(__x); } # 978 "/usr/include/c++/15/bits/unordered_map.h" 3 size_type count(const key_type& __x) const { return _M_h.count(__x); } template auto count(const _Kt& __x) const -> decltype(_M_h._M_count_tr(__x)) { return _M_h._M_count_tr(__x); } # 997 "/usr/include/c++/15/bits/unordered_map.h" 3 bool contains(const key_type& __x) const { return _M_h.find(__x) != _M_h.end(); } template auto contains(const _Kt& __x) const -> decltype(_M_h._M_find_tr(__x), void(), true) { return _M_h._M_find_tr(__x) != _M_h.end(); } # 1018 "/usr/include/c++/15/bits/unordered_map.h" 3 std::pair equal_range(const key_type& __x) { return _M_h.equal_range(__x); } template auto equal_range(const _Kt& __x) -> decltype(_M_h._M_equal_range_tr(__x)) { return _M_h._M_equal_range_tr(__x); } std::pair equal_range(const key_type& __x) const { return _M_h.equal_range(__x); } template auto equal_range(const _Kt& __x) const -> decltype(_M_h._M_equal_range_tr(__x)) { return _M_h._M_equal_range_tr(__x); } # 1056 "/usr/include/c++/15/bits/unordered_map.h" 3 mapped_type& operator[](const key_type& __k) { return _M_h[__k]; } mapped_type& operator[](key_type&& __k) { return _M_h[std::move(__k)]; } # 1073 "/usr/include/c++/15/bits/unordered_map.h" 3 mapped_type& at(const key_type& __k) { return _M_h.at(__k); } const mapped_type& at(const key_type& __k) const { return _M_h.at(__k); } size_type bucket_count() const noexcept { return _M_h.bucket_count(); } size_type max_bucket_count() const noexcept { return _M_h.max_bucket_count(); } size_type bucket_size(size_type __n) const { return _M_h.bucket_size(__n); } size_type bucket(const key_type& __key) const { return _M_h.bucket(__key); } local_iterator begin(size_type __n) { return _M_h.begin(__n); } # 1129 "/usr/include/c++/15/bits/unordered_map.h" 3 const_local_iterator begin(size_type __n) const { return _M_h.begin(__n); } const_local_iterator cbegin(size_type __n) const { return _M_h.cbegin(__n); } # 1144 "/usr/include/c++/15/bits/unordered_map.h" 3 local_iterator end(size_type __n) { return _M_h.end(__n); } # 1155 "/usr/include/c++/15/bits/unordered_map.h" 3 const_local_iterator end(size_type __n) const { return _M_h.end(__n); } const_local_iterator cend(size_type __n) const { return _M_h.cend(__n); } float load_factor() const noexcept { return _M_h.load_factor(); } float max_load_factor() const noexcept { return _M_h.max_load_factor(); } void max_load_factor(float __z) { _M_h.max_load_factor(__z); } # 1192 "/usr/include/c++/15/bits/unordered_map.h" 3 void rehash(size_type __n) { _M_h.rehash(__n); } # 1203 "/usr/include/c++/15/bits/unordered_map.h" 3 void reserve(size_type __n) { _M_h.reserve(__n); } template friend bool operator==(const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&); }; template>, typename _Pred = equal_to<__iter_key_t<_InputIterator>>, typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>, typename = _RequireInputIter<_InputIterator>, typename = _RequireNotAllocatorOrIntegral<_Hash>, typename = _RequireNotAllocator<_Pred>, typename = _RequireAllocator<_Allocator>> unordered_map(_InputIterator, _InputIterator, typename unordered_map::size_type = {}, _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) -> unordered_map<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, _Hash, _Pred, _Allocator>; template, typename _Pred = equal_to<_Key>, typename _Allocator = allocator>, typename = _RequireNotAllocatorOrIntegral<_Hash>, typename = _RequireNotAllocator<_Pred>, typename = _RequireAllocator<_Allocator>> unordered_map(initializer_list>, typename unordered_map::size_type = {}, _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) -> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>; template, typename = _RequireAllocator<_Allocator>> unordered_map(_InputIterator, _InputIterator, typename unordered_map::size_type, _Allocator) -> unordered_map<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, hash<__iter_key_t<_InputIterator>>, equal_to<__iter_key_t<_InputIterator>>, _Allocator>; template, typename = _RequireAllocator<_Allocator>> unordered_map(_InputIterator, _InputIterator, _Allocator) -> unordered_map<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, hash<__iter_key_t<_InputIterator>>, equal_to<__iter_key_t<_InputIterator>>, _Allocator>; template, typename = _RequireNotAllocatorOrIntegral<_Hash>, typename = _RequireAllocator<_Allocator>> unordered_map(_InputIterator, _InputIterator, typename unordered_map::size_type, _Hash, _Allocator) -> unordered_map<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, _Hash, equal_to<__iter_key_t<_InputIterator>>, _Allocator>; template> unordered_map(initializer_list>, typename unordered_map::size_type, _Allocator) -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>; template> unordered_map(initializer_list>, _Allocator) -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>; template, typename = _RequireAllocator<_Allocator>> unordered_map(initializer_list>, typename unordered_map::size_type, _Hash, _Allocator) -> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>; template>, __not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>, __allocator_like _Allocator = allocator<__detail::__range_to_alloc_type<_Rg>>> unordered_map(from_range_t, _Rg&&, unordered_map::size_type = {}, _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) -> unordered_map<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>, _Hash, _Pred, _Allocator>; template unordered_map(from_range_t, _Rg&&, unordered_map::size_type, _Allocator) -> unordered_map<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>, hash<__detail::__range_key_type<_Rg>>, equal_to<__detail::__range_key_type<_Rg>>, _Allocator>; template unordered_map(from_range_t, _Rg&&, _Allocator) -> unordered_map<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>, hash<__detail::__range_key_type<_Rg>>, equal_to<__detail::__range_key_type<_Rg>>, _Allocator>; template unordered_map(from_range_t, _Rg&&, unordered_map::size_type, _Hash, _Allocator) -> unordered_map<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>, _Hash, equal_to<__detail::__range_key_type<_Rg>>, _Allocator>; # 1362 "/usr/include/c++/15/bits/unordered_map.h" 3 template, typename _Pred = equal_to<_Key>, typename _Alloc = allocator>> class unordered_multimap { typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable; _Hashtable _M_h; public: typedef typename _Hashtable::key_type key_type; typedef typename _Hashtable::value_type value_type; typedef typename _Hashtable::mapped_type mapped_type; typedef typename _Hashtable::hasher hasher; typedef typename _Hashtable::key_equal key_equal; typedef typename _Hashtable::allocator_type allocator_type; typedef typename _Hashtable::pointer pointer; typedef typename _Hashtable::const_pointer const_pointer; typedef typename _Hashtable::reference reference; typedef typename _Hashtable::const_reference const_reference; typedef typename _Hashtable::iterator iterator; typedef typename _Hashtable::const_iterator const_iterator; typedef typename _Hashtable::local_iterator local_iterator; typedef typename _Hashtable::const_local_iterator const_local_iterator; typedef typename _Hashtable::size_type size_type; typedef typename _Hashtable::difference_type difference_type; using node_type = typename _Hashtable::node_type; unordered_multimap() = default; # 1413 "/usr/include/c++/15/bits/unordered_map.h" 3 explicit unordered_multimap(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _M_h(__n, __hf, __eql, __a) { } # 1434 "/usr/include/c++/15/bits/unordered_map.h" 3 template unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _M_h(__first, __last, __n, __hf, __eql, __a) { } unordered_multimap(const unordered_multimap&) = default; unordered_multimap(unordered_multimap&&) = default; explicit unordered_multimap(const allocator_type& __a) : _M_h(__a) { } unordered_multimap(const unordered_multimap& __ummap, const allocator_type& __a) : _M_h(__ummap._M_h, __a) { } unordered_multimap(unordered_multimap&& __ummap, const allocator_type& __a) noexcept( noexcept(_Hashtable(std::move(__ummap._M_h), __a)) ) : _M_h(std::move(__ummap._M_h), __a) { } # 1490 "/usr/include/c++/15/bits/unordered_map.h" 3 unordered_multimap(initializer_list __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _M_h(__l, __n, __hf, __eql, __a) { } unordered_multimap(size_type __n, const allocator_type& __a) : unordered_multimap(__n, hasher(), key_equal(), __a) { } unordered_multimap(size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_multimap(__n, __hf, key_equal(), __a) { } template unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a) : unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a) { } template unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_multimap(__first, __last, __n, __hf, key_equal(), __a) { } unordered_multimap(initializer_list __l, size_type __n, const allocator_type& __a) : unordered_multimap(__l, __n, hasher(), key_equal(), __a) { } unordered_multimap(initializer_list __l, size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_multimap(__l, __n, __hf, key_equal(), __a) { } # 1547 "/usr/include/c++/15/bits/unordered_map.h" 3 template<__detail::__container_compatible_range _Rg> unordered_multimap(from_range_t, _Rg&& __rg, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) : _M_h(__n, __hf, __eql, __a) { insert_range(std::forward<_Rg>(__rg)); } template<__detail::__container_compatible_range _Rg> unordered_multimap(from_range_t, _Rg&& __rg, const allocator_type& __a) : _M_h(0, hasher(), key_equal(), __a) { insert_range(std::forward<_Rg>(__rg)); } template<__detail::__container_compatible_range _Rg> unordered_multimap(from_range_t, _Rg&& __rg, size_type __n, const allocator_type& __a) : _M_h(__n, hasher(), key_equal(), __a) { insert_range(std::forward<_Rg>(__rg)); } template<__detail::__container_compatible_range _Rg> unordered_multimap(from_range_t, _Rg&& __rg, size_type __n, const hasher& __hf, const allocator_type& __a) : _M_h(__n, __hf, key_equal(), __a) { insert_range(std::forward<_Rg>(__rg)); } unordered_multimap& operator=(const unordered_multimap&) = default; unordered_multimap& operator=(unordered_multimap&&) = default; # 1595 "/usr/include/c++/15/bits/unordered_map.h" 3 unordered_multimap& operator=(initializer_list __l) { _M_h = __l; return *this; } allocator_type get_allocator() const noexcept { return _M_h.get_allocator(); } [[__nodiscard__]] bool empty() const noexcept { return _M_h.empty(); } size_type size() const noexcept { return _M_h.size(); } size_type max_size() const noexcept { return _M_h.max_size(); } iterator begin() noexcept { return _M_h.begin(); } const_iterator begin() const noexcept { return _M_h.begin(); } const_iterator cbegin() const noexcept { return _M_h.begin(); } iterator end() noexcept { return _M_h.end(); } const_iterator end() const noexcept { return _M_h.end(); } const_iterator cend() const noexcept { return _M_h.end(); } # 1687 "/usr/include/c++/15/bits/unordered_map.h" 3 template iterator emplace(_Args&&... __args) { return _M_h.emplace(std::forward<_Args>(__args)...); } # 1714 "/usr/include/c++/15/bits/unordered_map.h" 3 template iterator emplace_hint(const_iterator __pos, _Args&&... __args) { return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); } # 1729 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator insert(const value_type& __x) { return _M_h.insert(__x); } iterator insert(value_type&& __x) { return _M_h.insert(std::move(__x)); } template __enable_if_t::value, iterator> insert(_Pair&& __x) { return _M_h.emplace(std::forward<_Pair>(__x)); } # 1763 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator insert(const_iterator __hint, const value_type& __x) { return _M_h.insert(__hint, __x); } iterator insert(const_iterator __hint, value_type&& __x) { return _M_h.insert(__hint, std::move(__x)); } template __enable_if_t::value, iterator> insert(const_iterator __hint, _Pair&& __x) { return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); } # 1788 "/usr/include/c++/15/bits/unordered_map.h" 3 template void insert(_InputIterator __first, _InputIterator __last) { _M_h.insert(__first, __last); } # 1801 "/usr/include/c++/15/bits/unordered_map.h" 3 void insert(initializer_list __l) { _M_h.insert(__l); } # 1812 "/usr/include/c++/15/bits/unordered_map.h" 3 template<__detail::__container_compatible_range _Rg> void insert_range(_Rg&& __rg) { auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); if (__first == __last) return; if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>) _M_h._M_rehash_insert(size_type(ranges::distance(__rg))); else _M_h._M_rehash_insert(1); for (; __first != __last; ++__first) _M_h.emplace(*__first); } node_type extract(const_iterator __pos) { do { if (std::__is_constant_evaluated() && !bool(__pos != end())) std::__glibcxx_assert_fail(); } while (false); return _M_h.extract(__pos); } node_type extract(const key_type& __key) { return _M_h.extract(__key); } iterator insert(node_type&& __nh) { return _M_h._M_reinsert_node_multi(cend(), std::move(__nh)); } iterator insert(const_iterator __hint, node_type&& __nh) { return _M_h._M_reinsert_node_multi(__hint, std::move(__nh)); } # 1870 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator erase(const_iterator __position) { return _M_h.erase(__position); } iterator erase(iterator __position) { return _M_h.erase(__position); } # 1891 "/usr/include/c++/15/bits/unordered_map.h" 3 size_type erase(const key_type& __x) { return _M_h.erase(__x); } # 1910 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator erase(const_iterator __first, const_iterator __last) { return _M_h.erase(__first, __last); } void clear() noexcept { _M_h.clear(); } # 1934 "/usr/include/c++/15/bits/unordered_map.h" 3 void swap(unordered_multimap& __x) noexcept( noexcept(_M_h.swap(__x._M_h)) ) { _M_h.swap(__x._M_h); } template friend class std::_Hash_merge_helper; template void merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source) { if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>) if (std::__addressof(__source) == this) [[__unlikely__]] return; using _Merge_helper = _Hash_merge_helper; _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source)); } template void merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source) { using _Merge_helper = _Hash_merge_helper; _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source)); } template void merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source) { using _Merge_helper = _Hash_merge_helper; _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source)); } template void merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source) { merge(__source); } hasher hash_function() const { return _M_h.hash_function(); } key_equal key_eq() const { return _M_h.key_eq(); } # 2008 "/usr/include/c++/15/bits/unordered_map.h" 3 iterator find(const key_type& __x) { return _M_h.find(__x); } template auto find(const _Kt& __x) -> decltype(_M_h._M_find_tr(__x)) { return _M_h._M_find_tr(__x); } const_iterator find(const key_type& __x) const { return _M_h.find(__x); } template auto find(const _Kt& __x) const -> decltype(_M_h._M_find_tr(__x)) { return _M_h._M_find_tr(__x); } # 2037 "/usr/include/c++/15/bits/unordered_map.h" 3 size_type count(const key_type& __x) const { return _M_h.count(__x); } template auto count(const _Kt& __x) const -> decltype(_M_h._M_count_tr(__x)) { return _M_h._M_count_tr(__x); } # 2056 "/usr/include/c++/15/bits/unordered_map.h" 3 bool contains(const key_type& __x) const { return _M_h.find(__x) != _M_h.end(); } template auto contains(const _Kt& __x) const -> decltype(_M_h._M_find_tr(__x), void(), true) { return _M_h._M_find_tr(__x) != _M_h.end(); } # 2075 "/usr/include/c++/15/bits/unordered_map.h" 3 std::pair equal_range(const key_type& __x) { return _M_h.equal_range(__x); } template auto equal_range(const _Kt& __x) -> decltype(_M_h._M_equal_range_tr(__x)) { return _M_h._M_equal_range_tr(__x); } std::pair equal_range(const key_type& __x) const { return _M_h.equal_range(__x); } template auto equal_range(const _Kt& __x) const -> decltype(_M_h._M_equal_range_tr(__x)) { return _M_h._M_equal_range_tr(__x); } size_type bucket_count() const noexcept { return _M_h.bucket_count(); } size_type max_bucket_count() const noexcept { return _M_h.max_bucket_count(); } size_type bucket_size(size_type __n) const { return _M_h.bucket_size(__n); } size_type bucket(const key_type& __key) const { return _M_h.bucket(__key); } local_iterator begin(size_type __n) { return _M_h.begin(__n); } # 2147 "/usr/include/c++/15/bits/unordered_map.h" 3 const_local_iterator begin(size_type __n) const { return _M_h.begin(__n); } const_local_iterator cbegin(size_type __n) const { return _M_h.cbegin(__n); } # 2162 "/usr/include/c++/15/bits/unordered_map.h" 3 local_iterator end(size_type __n) { return _M_h.end(__n); } # 2173 "/usr/include/c++/15/bits/unordered_map.h" 3 const_local_iterator end(size_type __n) const { return _M_h.end(__n); } const_local_iterator cend(size_type __n) const { return _M_h.cend(__n); } float load_factor() const noexcept { return _M_h.load_factor(); } float max_load_factor() const noexcept { return _M_h.max_load_factor(); } void max_load_factor(float __z) { _M_h.max_load_factor(__z); } # 2210 "/usr/include/c++/15/bits/unordered_map.h" 3 void rehash(size_type __n) { _M_h.rehash(__n); } # 2221 "/usr/include/c++/15/bits/unordered_map.h" 3 void reserve(size_type __n) { _M_h.reserve(__n); } template friend bool operator==(const unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, const unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&); }; template>, typename _Pred = equal_to<__iter_key_t<_InputIterator>>, typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>, typename = _RequireInputIter<_InputIterator>, typename = _RequireNotAllocatorOrIntegral<_Hash>, typename = _RequireNotAllocator<_Pred>, typename = _RequireAllocator<_Allocator>> unordered_multimap(_InputIterator, _InputIterator, unordered_multimap::size_type = {}, _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) -> unordered_multimap<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, _Hash, _Pred, _Allocator>; template, typename _Pred = equal_to<_Key>, typename _Allocator = allocator>, typename = _RequireNotAllocatorOrIntegral<_Hash>, typename = _RequireNotAllocator<_Pred>, typename = _RequireAllocator<_Allocator>> unordered_multimap(initializer_list>, unordered_multimap::size_type = {}, _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) -> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>; template, typename = _RequireAllocator<_Allocator>> unordered_multimap(_InputIterator, _InputIterator, unordered_multimap::size_type, _Allocator) -> unordered_multimap<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, hash<__iter_key_t<_InputIterator>>, equal_to<__iter_key_t<_InputIterator>>, _Allocator>; template, typename = _RequireAllocator<_Allocator>> unordered_multimap(_InputIterator, _InputIterator, _Allocator) -> unordered_multimap<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, hash<__iter_key_t<_InputIterator>>, equal_to<__iter_key_t<_InputIterator>>, _Allocator>; template, typename = _RequireNotAllocatorOrIntegral<_Hash>, typename = _RequireAllocator<_Allocator>> unordered_multimap(_InputIterator, _InputIterator, unordered_multimap::size_type, _Hash, _Allocator) -> unordered_multimap<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, _Hash, equal_to<__iter_key_t<_InputIterator>>, _Allocator>; template> unordered_multimap(initializer_list>, unordered_multimap::size_type, _Allocator) -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>; template> unordered_multimap(initializer_list>, _Allocator) -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>; template, typename = _RequireAllocator<_Allocator>> unordered_multimap(initializer_list>, unordered_multimap::size_type, _Hash, _Allocator) -> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>; template>, __not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>, __allocator_like _Allocator = allocator<__detail::__range_to_alloc_type<_Rg>>> unordered_multimap(from_range_t, _Rg&&, unordered_multimap::size_type = {}, _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) -> unordered_multimap<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>, _Hash, _Pred, _Allocator>; template unordered_multimap(from_range_t, _Rg&&, unordered_multimap::size_type, _Allocator) -> unordered_multimap<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>, hash<__detail::__range_key_type<_Rg>>, equal_to<__detail::__range_key_type<_Rg>>, _Allocator>; template unordered_multimap(from_range_t, _Rg&&, _Allocator) -> unordered_multimap<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>, hash<__detail::__range_key_type<_Rg>>, equal_to<__detail::__range_key_type<_Rg>>, _Allocator>; template unordered_multimap(from_range_t, _Rg&&, unordered_multimap::size_type, _Hash, _Allocator) -> unordered_multimap<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>, _Hash, equal_to<__detail::__range_key_type<_Rg>>, _Allocator>; template inline void swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template inline void swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template inline bool operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return __x._M_h._M_equal(__y._M_h); } # 2388 "/usr/include/c++/15/bits/unordered_map.h" 3 template inline bool operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return __x._M_h._M_equal(__y._M_h); } # 2402 "/usr/include/c++/15/bits/unordered_map.h" 3 template struct _Hash_merge_helper< std::unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>, _Hash2, _Eq2> { private: template using unordered_map = std::unordered_map<_Tp...>; template using unordered_multimap = std::unordered_multimap<_Tp...>; friend unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>; static auto& _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map) { return __map._M_h; } static auto& _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map) { return __map._M_h; } }; template struct _Hash_merge_helper< std::unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>, _Hash2, _Eq2> { private: template using unordered_map = std::unordered_map<_Tp...>; template using unordered_multimap = std::unordered_multimap<_Tp...>; friend unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>; static auto& _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map) { return __map._M_h; } static auto& _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map) { return __map._M_h; } }; } # 44 "/usr/include/c++/15/unordered_map" 2 3 # 1 "/usr/include/c++/15/bits/range_access.h" 1 3 # 42 "/usr/include/c++/15/bits/range_access.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto begin(_Container& __cont) noexcept(noexcept(__cont.begin())) -> decltype(__cont.begin()) { return __cont.begin(); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto begin(const _Container& __cont) noexcept(noexcept(__cont.begin())) -> decltype(__cont.begin()) { return __cont.begin(); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto end(_Container& __cont) noexcept(noexcept(__cont.end())) -> decltype(__cont.end()) { return __cont.end(); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto end(const _Container& __cont) noexcept(noexcept(__cont.end())) -> decltype(__cont.end()) { return __cont.end(); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr _Tp* begin(_Tp (&__arr)[_Nm]) noexcept { return __arr; } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr _Tp* end(_Tp (&__arr)[_Nm]) noexcept { return __arr + _Nm; } template class valarray; template _Tp* begin(valarray<_Tp>&) noexcept; template const _Tp* begin(const valarray<_Tp>&) noexcept; template _Tp* end(valarray<_Tp>&) noexcept; template const _Tp* end(const valarray<_Tp>&) noexcept; template [[__nodiscard__, __gnu__::__always_inline__]] constexpr auto cbegin(const _Container& __cont) noexcept(noexcept(std::begin(__cont))) -> decltype(std::begin(__cont)) { return std::begin(__cont); } template [[__nodiscard__, __gnu__::__always_inline__]] constexpr auto cend(const _Container& __cont) noexcept(noexcept(std::end(__cont))) -> decltype(std::end(__cont)) { return std::end(__cont); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto rbegin(_Container& __cont) noexcept(noexcept(__cont.rbegin())) -> decltype(__cont.rbegin()) { return __cont.rbegin(); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto rbegin(const _Container& __cont) noexcept(noexcept(__cont.rbegin())) -> decltype(__cont.rbegin()) { return __cont.rbegin(); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto rend(_Container& __cont) noexcept(noexcept(__cont.rend())) -> decltype(__cont.rend()) { return __cont.rend(); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto rend(const _Container& __cont) noexcept(noexcept(__cont.rend())) -> decltype(__cont.rend()) { return __cont.rend(); } template [[__nodiscard__]] inline constexpr reverse_iterator<_Tp*> rbegin(_Tp (&__arr)[_Nm]) noexcept { return reverse_iterator<_Tp*>(__arr + _Nm); } template [[__nodiscard__]] inline constexpr reverse_iterator<_Tp*> rend(_Tp (&__arr)[_Nm]) noexcept { return reverse_iterator<_Tp*>(__arr); } template [[__nodiscard__]] inline constexpr reverse_iterator rbegin(initializer_list<_Tp> __il) noexcept { return reverse_iterator(__il.end()); } template [[__nodiscard__]] inline constexpr reverse_iterator rend(initializer_list<_Tp> __il) noexcept { return reverse_iterator(__il.begin()); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto crbegin(const _Container& __cont) noexcept(noexcept(std::rbegin(__cont))) -> decltype(std::rbegin(__cont)) { return std::rbegin(__cont); } template [[__nodiscard__, __gnu__::__always_inline__]] inline constexpr auto crend(const _Container& __cont) noexcept(noexcept(std::rend(__cont))) -> decltype(std::rend(__cont)) { return std::rend(__cont); } # 271 "/usr/include/c++/15/bits/range_access.h" 3 template [[nodiscard, __gnu__::__always_inline__]] constexpr auto size(const _Container& __cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size()) { return __cont.size(); } template [[nodiscard, __gnu__::__always_inline__]] constexpr size_t size(const _Tp (&)[_Nm]) noexcept { return _Nm; } template [[nodiscard, __gnu__::__always_inline__]] constexpr auto empty(const _Container& __cont) noexcept(noexcept(__cont.empty())) -> decltype(__cont.empty()) { return __cont.empty(); } template [[nodiscard, __gnu__::__always_inline__]] constexpr bool empty(const _Tp (&)[_Nm]) noexcept { return false; } template [[nodiscard, __gnu__::__always_inline__]] constexpr bool empty(initializer_list<_Tp> __il) noexcept { return __il.size() == 0;} template [[nodiscard, __gnu__::__always_inline__]] constexpr auto data(_Container& __cont) noexcept(noexcept(__cont.data())) -> decltype(__cont.data()) { return __cont.data(); } template [[nodiscard, __gnu__::__always_inline__]] constexpr auto data(const _Container& __cont) noexcept(noexcept(__cont.data())) -> decltype(__cont.data()) { return __cont.data(); } template [[nodiscard, __gnu__::__always_inline__]] constexpr _Tp* data(_Tp (&__array)[_Nm]) noexcept { return __array; } template [[nodiscard, __gnu__::__always_inline__]] constexpr const _Tp* data(initializer_list<_Tp> __il) noexcept { return __il.begin(); } template [[nodiscard, __gnu__::__always_inline__]] constexpr auto ssize(const _Container& __cont) noexcept(noexcept(__cont.size())) -> common_type_t> { using type = make_signed_t; return static_cast>(__cont.size()); } template [[nodiscard, __gnu__::__always_inline__]] constexpr ptrdiff_t ssize(const _Tp (&)[_Num]) noexcept { return _Num; } } # 45 "/usr/include/c++/15/unordered_map" 2 3 # 1 "/usr/include/c++/15/bits/erase_if.h" 1 3 # 41 "/usr/include/c++/15/bits/erase_if.h" 3 namespace std { namespace __detail { template typename _Container::size_type __erase_nodes_if(_Container& __cont, _UnsafeContainer& __ucont, _Predicate __pred) { typename _Container::size_type __num = 0; for (auto __iter = __ucont.begin(), __last = __ucont.end(); __iter != __last;) { if (__pred(*__iter)) { __iter = __cont.erase(__iter); ++__num; } else ++__iter; } return __num; } } } # 46 "/usr/include/c++/15/unordered_map" 2 3 # 59 "/usr/include/c++/15/unordered_map" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 60 "/usr/include/c++/15/unordered_map" 2 3 # 1 "/usr/include/c++/15/bits/memory_resource.h" 1 3 # 43 "/usr/include/c++/15/bits/memory_resource.h" 3 # 1 "/usr/include/c++/15/bits/uses_allocator_args.h" 1 3 # 37 "/usr/include/c++/15/bits/uses_allocator_args.h" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 38 "/usr/include/c++/15/bits/uses_allocator_args.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template concept _Std_pair = __is_pair>; template constexpr auto uses_allocator_construction_args(const _Alloc& __a, _Args&&... __args) noexcept requires (! _Std_pair<_Tp>) { if constexpr (uses_allocator_v, _Alloc>) { if constexpr (is_constructible_v<_Tp, allocator_arg_t, const _Alloc&, _Args...>) { return tuple( allocator_arg, __a, std::forward<_Args>(__args)...); } else { static_assert(is_constructible_v<_Tp, _Args..., const _Alloc&>, "construction with an allocator must be possible" " if uses_allocator is true"); return tuple<_Args&&..., const _Alloc&>( std::forward<_Args>(__args)..., __a); } } else { static_assert(is_constructible_v<_Tp, _Args...>); return tuple<_Args&&...>(std::forward<_Args>(__args)...); } } template<_Std_pair _Tp, typename _Alloc, typename _Tuple1, typename _Tuple2> constexpr auto uses_allocator_construction_args(const _Alloc& __a, piecewise_construct_t, _Tuple1&& __x, _Tuple2&& __y) noexcept; template<_Std_pair _Tp, typename _Alloc> constexpr auto uses_allocator_construction_args(const _Alloc&) noexcept; template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc&, _Up&&, _Vp&&) noexcept; template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc&, const pair<_Up, _Vp>&) noexcept; template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc&, pair<_Up, _Vp>&&) noexcept; template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc&, pair<_Up, _Vp>&) noexcept; template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc&, const pair<_Up, _Vp>&&) noexcept; template<_Std_pair _Tp, typename _Alloc, typename _Tuple1, typename _Tuple2> constexpr auto uses_allocator_construction_args(const _Alloc& __a, piecewise_construct_t, _Tuple1&& __x, _Tuple2&& __y) noexcept { using _Tp1 = typename _Tp::first_type; using _Tp2 = typename _Tp::second_type; return std::make_tuple(piecewise_construct, std::apply([&__a](auto&&... __args1) { return std::uses_allocator_construction_args<_Tp1>( __a, std::forward(__args1)...); }, std::forward<_Tuple1>(__x)), std::apply([&__a](auto&&... __args2) { return std::uses_allocator_construction_args<_Tp2>( __a, std::forward(__args2)...); }, std::forward<_Tuple2>(__y))); } template<_Std_pair _Tp, typename _Alloc> constexpr auto uses_allocator_construction_args(const _Alloc& __a) noexcept { using _Tp1 = typename _Tp::first_type; using _Tp2 = typename _Tp::second_type; return std::make_tuple(piecewise_construct, std::uses_allocator_construction_args<_Tp1>(__a), std::uses_allocator_construction_args<_Tp2>(__a)); } template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc& __a, _Up&& __u, _Vp&& __v) noexcept { using _Tp1 = typename _Tp::first_type; using _Tp2 = typename _Tp::second_type; return std::make_tuple(piecewise_construct, std::uses_allocator_construction_args<_Tp1>(__a, std::forward<_Up>(__u)), std::uses_allocator_construction_args<_Tp2>(__a, std::forward<_Vp>(__v))); } template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc& __a, const pair<_Up, _Vp>& __pr) noexcept { using _Tp1 = typename _Tp::first_type; using _Tp2 = typename _Tp::second_type; return std::make_tuple(piecewise_construct, std::uses_allocator_construction_args<_Tp1>(__a, __pr.first), std::uses_allocator_construction_args<_Tp2>(__a, __pr.second)); } template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc& __a, pair<_Up, _Vp>&& __pr) noexcept { using _Tp1 = typename _Tp::first_type; using _Tp2 = typename _Tp::second_type; return std::make_tuple(piecewise_construct, std::uses_allocator_construction_args<_Tp1>(__a, std::get<0>(std::move(__pr))), std::uses_allocator_construction_args<_Tp2>(__a, std::get<1>(std::move(__pr)))); } template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc& __a, pair<_Up, _Vp>& __pr) noexcept { using _Tp1 = typename _Tp::first_type; using _Tp2 = typename _Tp::second_type; return std::make_tuple(piecewise_construct, std::uses_allocator_construction_args<_Tp1>(__a, __pr.first), std::uses_allocator_construction_args<_Tp2>(__a, __pr.second)); } template<_Std_pair _Tp, typename _Alloc, typename _Up, typename _Vp> constexpr auto uses_allocator_construction_args(const _Alloc& __a, const pair<_Up, _Vp>&& __pr) noexcept { using _Tp1 = typename _Tp::first_type; using _Tp2 = typename _Tp::second_type; return std::make_tuple(piecewise_construct, std::uses_allocator_construction_args<_Tp1>(__a, std::get<0>(std::move(__pr))), std::uses_allocator_construction_args<_Tp2>(__a, std::get<1>(std::move(__pr)))); } template constexpr _Tp make_obj_using_allocator(const _Alloc& __a, _Args&&... __args) { return std::make_from_tuple<_Tp>( std::uses_allocator_construction_args<_Tp>(__a, std::forward<_Args>(__args)...)); } template constexpr _Tp* uninitialized_construct_using_allocator(_Tp* __p, const _Alloc& __a, _Args&&... __args) { return std::apply([&](auto&&... __xs) { return std::construct_at(__p, std::forward(__xs)...); }, std::uses_allocator_construction_args<_Tp>(__a, std::forward<_Args>(__args)...)); } } # 44 "/usr/include/c++/15/bits/memory_resource.h" 2 3 # 52 "/usr/include/c++/15/bits/memory_resource.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { namespace pmr { class memory_resource { static constexpr size_t _S_max_align = alignof(max_align_t); public: memory_resource() = default; memory_resource(const memory_resource&) = default; virtual ~memory_resource(); memory_resource& operator=(const memory_resource&) = default; [[nodiscard]] void* allocate(size_t __bytes, size_t __alignment = _S_max_align) __attribute__((__returns_nonnull__,__alloc_size__(2),__alloc_align__(3))) { return ::operator new(__bytes, do_allocate(__bytes, __alignment)); } void deallocate(void* __p, size_t __bytes, size_t __alignment = _S_max_align) __attribute__((__nonnull__)) { return do_deallocate(__p, __bytes, __alignment); } [[nodiscard]] bool is_equal(const memory_resource& __other) const noexcept { return do_is_equal(__other); } private: virtual void* do_allocate(size_t __bytes, size_t __alignment) = 0; virtual void do_deallocate(void* __p, size_t __bytes, size_t __alignment) = 0; virtual bool do_is_equal(const memory_resource& __other) const noexcept = 0; }; [[nodiscard]] inline bool operator==(const memory_resource& __a, const memory_resource& __b) noexcept { return &__a == &__b || __a.is_equal(__b); } # 121 "/usr/include/c++/15/bits/memory_resource.h" 3 template class polymorphic_allocator { template struct __not_pair { using type = void; }; template struct __not_pair> { }; public: using value_type = _Tp; polymorphic_allocator() noexcept { extern memory_resource* get_default_resource() noexcept __attribute__((__returns_nonnull__)); _M_resource = get_default_resource(); } polymorphic_allocator(memory_resource* __r) noexcept __attribute__((__nonnull__)) : _M_resource(__r) { ; } polymorphic_allocator(const polymorphic_allocator& __other) = default; template polymorphic_allocator(const polymorphic_allocator<_Up>& __x) noexcept : _M_resource(__x.resource()) { } polymorphic_allocator& operator=(const polymorphic_allocator&) = delete; [[nodiscard]] _Tp* allocate(size_t __n) __attribute__((__returns_nonnull__)) { if ((__gnu_cxx::__int_traits::__max / sizeof(_Tp)) < __n) std::__throw_bad_array_new_length(); return static_cast<_Tp*>(_M_resource->allocate(__n * sizeof(_Tp), alignof(_Tp))); } void deallocate(_Tp* __p, size_t __n) noexcept __attribute__((__nonnull__)) { _M_resource->deallocate(__p, __n * sizeof(_Tp), alignof(_Tp)); } [[nodiscard]] void* allocate_bytes(size_t __nbytes, size_t __alignment = alignof(max_align_t)) { return _M_resource->allocate(__nbytes, __alignment); } void deallocate_bytes(void* __p, size_t __nbytes, size_t __alignment = alignof(max_align_t)) { _M_resource->deallocate(__p, __nbytes, __alignment); } template [[nodiscard]] _Up* allocate_object(size_t __n = 1) { if ((__gnu_cxx::__int_traits::__max / sizeof(_Up)) < __n) std::__throw_bad_array_new_length(); return static_cast<_Up*>(allocate_bytes(__n * sizeof(_Up), alignof(_Up))); } template void deallocate_object(_Up* __p, size_t __n = 1) { deallocate_bytes(__p, __n * sizeof(_Up), alignof(_Up)); } template [[nodiscard]] _Up* new_object(_CtorArgs&&... __ctor_args) { _Up* __p = allocate_object<_Up>(); try { construct(__p, std::forward<_CtorArgs>(__ctor_args)...); } catch(...) { deallocate_object(__p); throw; } return __p; } template void delete_object(_Up* __p) { __p->~_Up(); deallocate_object(__p); } # 299 "/usr/include/c++/15/bits/memory_resource.h" 3 template __attribute__((__nonnull__)) void construct(_Tp1* __p, _Args&&... __args) { std::uninitialized_construct_using_allocator(__p, *this, std::forward<_Args>(__args)...); } template __attribute__((__nonnull__)) void destroy(_Up* __p) { __p->~_Up(); } polymorphic_allocator select_on_container_copy_construction() const noexcept { return polymorphic_allocator(); } memory_resource* resource() const noexcept __attribute__((__returns_nonnull__)) { return _M_resource; } [[nodiscard]] friend bool operator==(const polymorphic_allocator& __a, const polymorphic_allocator& __b) noexcept { return *__a.resource() == *__b.resource(); } # 340 "/usr/include/c++/15/bits/memory_resource.h" 3 private: # 367 "/usr/include/c++/15/bits/memory_resource.h" 3 memory_resource* _M_resource; }; template [[nodiscard]] inline bool operator==(const polymorphic_allocator<_Tp1>& __a, const polymorphic_allocator<_Tp2>& __b) noexcept { return *__a.resource() == *__b.resource(); } # 386 "/usr/include/c++/15/bits/memory_resource.h" 3 } template struct allocator_traits; template struct allocator_traits> { using allocator_type = pmr::polymorphic_allocator<_Tp>; using value_type = _Tp; using pointer = _Tp*; using const_pointer = const _Tp*; using void_pointer = void*; using const_void_pointer = const void*; using difference_type = std::ptrdiff_t; using size_type = std::size_t; using propagate_on_container_copy_assignment = false_type; using propagate_on_container_move_assignment = false_type; using propagate_on_container_swap = false_type; static allocator_type select_on_container_copy_construction(const allocator_type&) noexcept { return allocator_type(); } using is_always_equal = false_type; template using rebind_alloc = pmr::polymorphic_allocator<_Up>; template using rebind_traits = allocator_traits>; # 452 "/usr/include/c++/15/bits/memory_resource.h" 3 [[nodiscard]] static pointer allocate(allocator_type& __a, size_type __n) { return __a.allocate(__n); } # 467 "/usr/include/c++/15/bits/memory_resource.h" 3 [[nodiscard]] static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer) { return __a.allocate(__n); } # 479 "/usr/include/c++/15/bits/memory_resource.h" 3 static void deallocate(allocator_type& __a, pointer __p, size_type __n) { __a.deallocate(__p, __n); } # 494 "/usr/include/c++/15/bits/memory_resource.h" 3 template static void construct(allocator_type& __a, _Up* __p, _Args&&... __args) { __a.construct(__p, std::forward<_Args>(__args)...); } # 506 "/usr/include/c++/15/bits/memory_resource.h" 3 template static constexpr void destroy(allocator_type&, _Up* __p) noexcept(is_nothrow_destructible<_Up>::value) { __p->~_Up(); } static constexpr size_type max_size(const allocator_type&) noexcept { return size_t(-1) / sizeof(value_type); } }; } # 63 "/usr/include/c++/15/unordered_map" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { namespace pmr { template, typename _Pred = std::equal_to<_Key>> using unordered_map = std::unordered_map<_Key, _Tp, _Hash, _Pred, polymorphic_allocator>>; template, typename _Pred = std::equal_to<_Key>> using unordered_multimap = std::unordered_multimap<_Key, _Tp, _Hash, _Pred, polymorphic_allocator>>; } } namespace std __attribute__ ((__visibility__ ("default"))) { template inline typename unordered_map<_Key, _Tp, _Hash, _CPred, _Alloc>::size_type erase_if(unordered_map<_Key, _Tp, _Hash, _CPred, _Alloc>& __cont, _Predicate __pred) { std::unordered_map<_Key, _Tp, _Hash, _CPred, _Alloc>& __ucont = __cont; return __detail::__erase_nodes_if(__cont, __ucont, __pred); } template inline typename unordered_multimap<_Key, _Tp, _Hash, _CPred, _Alloc>:: size_type erase_if(unordered_multimap<_Key, _Tp, _Hash, _CPred, _Alloc>& __cont, _Predicate __pred) { std::unordered_multimap<_Key, _Tp, _Hash, _CPred, _Alloc>& __ucont = __cont; return __detail::__erase_nodes_if(__cont, __ucont, __pred); } } # 66 "/usr/include/c++/15/functional" 2 3 # 1 "/usr/include/c++/15/vector" 1 3 # 67 "/usr/include/c++/15/vector" 3 # 1 "/usr/include/c++/15/bits/stl_uninitialized.h" 1 3 # 71 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template struct _UninitDestroyGuard { constexpr explicit _UninitDestroyGuard(_ForwardIterator& __first, _Alloc& __a) : _M_first(__first), _M_cur(__builtin_addressof(__first)), _M_alloc(__a) { } constexpr ~_UninitDestroyGuard() { if (__builtin_expect(_M_cur != 0, 0)) std::_Destroy(_M_first, *_M_cur, _M_alloc); } constexpr void release() { _M_cur = 0; } private: _ForwardIterator const _M_first; _ForwardIterator* _M_cur; _Alloc& _M_alloc; _UninitDestroyGuard(const _UninitDestroyGuard&); }; template struct _UninitDestroyGuard<_ForwardIterator, void> { constexpr explicit _UninitDestroyGuard(_ForwardIterator& __first) : _M_first(__first), _M_cur(__builtin_addressof(__first)) { } constexpr ~_UninitDestroyGuard() { if (__builtin_expect(_M_cur != 0, 0)) std::_Destroy(_M_first, *_M_cur); } constexpr void release() { _M_cur = 0; } _ForwardIterator const _M_first; _ForwardIterator* _M_cur; private: _UninitDestroyGuard(const _UninitDestroyGuard&); }; template constexpr _ForwardIterator __do_uninit_copy(_InputIterator __first, _Sentinel __last, _ForwardIterator __result) { _UninitDestroyGuard<_ForwardIterator> __guard(__result); for (; __first != __last; ++__first, (void)++__result) std::_Construct(std::__addressof(*__result), *__first); __guard.release(); return __result; } # 217 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" # 228 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline _ForwardIterator uninitialized_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result) { # 256 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 using _Dest = decltype(std::__niter_base(__result)); using _Src = decltype(std::__niter_base(__first)); using _ValT = typename iterator_traits<_ForwardIterator>::value_type; if constexpr (!__is_trivially_constructible(_ValT, decltype(*__first))) return std::__do_uninit_copy(__first, __last, __result); else if constexpr (__memcpyable<_Dest, _Src>::__value) { ptrdiff_t __n = __last - __first; if (__n > 0) [[__likely__]] { using _ValT = typename remove_pointer<_Src>::type; __builtin_memcpy(std::__niter_base(__result), std::__niter_base(__first), __n * sizeof(_ValT)); __result += __n; } return __result; } else if constexpr (contiguous_iterator<_ForwardIterator> && contiguous_iterator<_InputIterator>) { using _DestPtr = decltype(std::to_address(__result)); using _SrcPtr = decltype(std::to_address(__first)); if constexpr (__memcpyable<_DestPtr, _SrcPtr>::__value) { if (auto __n = __last - __first; __n > 0) [[likely]] { void* __dest = std::to_address(__result); const void* __src = std::to_address(__first); size_t __nbytes = __n * sizeof(remove_pointer_t<_DestPtr>); __builtin_memcpy(__dest, __src, __nbytes); __result += __n; } return __result; } else return std::__do_uninit_copy(__first, __last, __result); } else return std::__do_uninit_copy(__first, __last, __result); # 317 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 } #pragma GCC diagnostic pop template constexpr void __do_uninit_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x) { _UninitDestroyGuard<_ForwardIterator> __guard(__first); for (; __first != __last; ++__first) std::_Construct(std::__addressof(*__first), __x); __guard.release(); } # 389 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline void uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x) { # 404 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" if constexpr (__is_byte<_ValueType>::__value) if constexpr (is_same<_ValueType, _Tp>::value || is_integral<_Tp>::value) { using _BasePtr = decltype(std::__niter_base(__first)); if constexpr (is_pointer<_BasePtr>::value) { void* __dest = std::__niter_base(__first); ptrdiff_t __n = __last - __first; if (__n > 0) [[__likely__]] __builtin_memset(__dest, (unsigned char)__x, __n); return; } else if constexpr (contiguous_iterator<_ForwardIterator>) { auto __dest = std::to_address(__first); auto __n = __last - __first; if (__n > 0) [[__likely__]] __builtin_memset(__dest, (unsigned char)__x, __n); return; } } std::__do_uninit_fill(__first, __last, __x); #pragma GCC diagnostic pop } template constexpr _ForwardIterator __do_uninit_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) { _UninitDestroyGuard<_ForwardIterator> __guard(__first); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" if constexpr (is_integral<_Size>::value) do { if (std::__is_constant_evaluated() && !bool(__n >= 0)) std::__glibcxx_assert_fail(); } while (false); else if constexpr (is_floating_point<_Size>::value) do { if (std::__is_constant_evaluated() && !bool(__n >= 0 && static_cast(__n) == __n)) std::__glibcxx_assert_fail(); } while (false); #pragma GCC diagnostic pop for (; __n--; ++__first) std::_Construct(std::__addressof(*__first), __x); __guard.release(); return __first; } # 510 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" # 523 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline _ForwardIterator uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; if constexpr (__is_byte<_ValueType>::__value) if constexpr (is_integral<_Tp>::value) if constexpr (is_integral<_Size>::value) { using _BasePtr = decltype(std::__niter_base(__first)); if constexpr (is_pointer<_BasePtr>::value) { void* __dest = std::__niter_base(__first); if (__n > 0) [[__likely__]] { __builtin_memset(__dest, (unsigned char)__x, __n); __first += __n; } return __first; } else if constexpr (contiguous_iterator<_ForwardIterator>) { auto __dest = std::to_address(__first); if (__n > 0) [[__likely__]] { __builtin_memset(__dest, (unsigned char)__x, __n); __first += __n; } return __first; } } return std::__do_uninit_fill_n(__first, __n, __x); # 580 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 } #pragma GCC diagnostic pop # 591 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template constexpr _ForwardIterator __uninitialized_copy_a(_InputIterator __first, _Sentinel __last, _ForwardIterator __result, _Allocator& __alloc) { _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__result, __alloc); typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __first != __last; ++__first, (void)++__result) __traits::construct(__alloc, std::__addressof(*__result), *__first); __guard.release(); return __result; } template constexpr inline _ForwardIterator __uninitialized_copy_a(_InputIterator __first, _Sentinel __last, _ForwardIterator __result, allocator<_Tp>&) { if (std::is_constant_evaluated()) return std::__do_uninit_copy(std::move(__first), __last, __result); if constexpr (!is_same_v<_InputIterator, _Sentinel>) { if constexpr (sized_sentinel_for<_Sentinel, _InputIterator> && random_access_iterator<_InputIterator>) return std::uninitialized_copy(__first, __first + (__last - __first), __result); else return std::__do_uninit_copy(std::move(__first), __last, __result); } else return std::uninitialized_copy(std::move(__first), __last, __result); } template constexpr inline _ForwardIterator __uninitialized_move_a(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _Allocator& __alloc) { return std::__uninitialized_copy_a(std::make_move_iterator(__first), std::make_move_iterator(__last), __result, __alloc); } template constexpr inline _ForwardIterator __uninitialized_move_if_noexcept_a(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _Allocator& __alloc) { return std::__uninitialized_copy_a (std::__make_move_if_noexcept_iterator(__first), std::__make_move_if_noexcept_iterator(__last), __result, __alloc); } template constexpr void __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x, _Allocator& __alloc) { _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__first, __alloc); typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __first != __last; ++__first) __traits::construct(__alloc, std::__addressof(*__first), __x); __guard.release(); } template constexpr inline void __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x, allocator<_Tp2>&) { if (std::is_constant_evaluated()) return std::__do_uninit_fill(__first, __last, __x); std::uninitialized_fill(__first, __last, __x); } template constexpr _ForwardIterator __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n, const _Tp& __x, _Allocator& __alloc) { _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__first, __alloc); typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __n > 0; --__n, (void) ++__first) __traits::construct(__alloc, std::__addressof(*__first), __x); __guard.release(); return __first; } template constexpr inline _ForwardIterator __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n, const _Tp& __x, allocator<_Tp2>&) { if (std::is_constant_evaluated()) return std::__do_uninit_fill_n(__first, __n, __x); return std::uninitialized_fill_n(__first, __n, __x); } # 740 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline _ForwardIterator __uninitialized_copy_move(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _ForwardIterator __result, _Allocator& __alloc) { _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1, __result, __alloc); _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__result, __alloc); __result = __mid; __result = std::__uninitialized_move_a(__first2, __last2, __mid, __alloc); __guard.release(); return __result; } template inline _ForwardIterator __uninitialized_move_copy(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _ForwardIterator __result, _Allocator& __alloc) { _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1, __result, __alloc); _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__result, __alloc); __result = __mid; __result = std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc); __guard.release(); return __result; } template inline _ForwardIterator __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid, const _Tp& __x, _InputIterator __first, _InputIterator __last, _Allocator& __alloc) { std::__uninitialized_fill_a(__result, __mid, __x, __alloc); _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__result, __alloc); __result = __mid; __result = std::__uninitialized_move_a(__first, __last, __mid, __alloc); __guard.release(); return __result; } template inline void __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2, const _Tp& __x, _Allocator& __alloc) { _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1, __first2, __alloc); _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__first2, __alloc); __first2 = __mid2; std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc); __guard.release(); } # 832 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template struct __uninitialized_default_1 { template static void __uninit_default(_ForwardIterator __first, _ForwardIterator __last) { _UninitDestroyGuard<_ForwardIterator> __guard(__first); for (; __first != __last; ++__first) std::_Construct(std::__addressof(*__first)); __guard.release(); } }; template<> struct __uninitialized_default_1 { template static void __uninit_default(_ForwardIterator __first, _ForwardIterator __last) { if (__first == __last) return; typename iterator_traits<_ForwardIterator>::value_type* __val = std::__addressof(*__first); std::_Construct(__val); if (++__first != __last) std::fill(__first, __last, *__val); } }; template struct __uninitialized_default_n_1 { template constexpr static _ForwardIterator __uninit_default_n(_ForwardIterator __first, _Size __n) { _UninitDestroyGuard<_ForwardIterator> __guard(__first); for (; __n > 0; --__n, (void) ++__first) std::_Construct(std::__addressof(*__first)); __guard.release(); return __first; } }; template<> struct __uninitialized_default_n_1 { template constexpr static _ForwardIterator __uninit_default_n(_ForwardIterator __first, _Size __n) { if (__n > 0) { typename iterator_traits<_ForwardIterator>::value_type* __val = std::__addressof(*__first); std::_Construct(__val); ++__first; __first = std::fill_n(__first, __n - 1, *__val); } return __first; } }; template constexpr inline void __uninitialized_default(_ForwardIterator __first, _ForwardIterator __last) { if (std::is_constant_evaluated()) return __uninitialized_default_1:: __uninit_default(__first, __last); typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; const bool __assignable = is_copy_assignable<_ValueType>::value; std::__uninitialized_default_1<__is_trivial(_ValueType) && __assignable>:: __uninit_default(__first, __last); } template constexpr inline _ForwardIterator __uninitialized_default_n(_ForwardIterator __first, _Size __n) { if (std::is_constant_evaluated()) return __uninitialized_default_n_1:: __uninit_default_n(__first, __n); typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; constexpr bool __can_fill = __and_, is_copy_assignable<_ValueType>>::value; return __uninitialized_default_n_1<__is_trivial(_ValueType) && __can_fill>:: __uninit_default_n(__first, __n); } template void __uninitialized_default_a(_ForwardIterator __first, _ForwardIterator __last, _Allocator& __alloc) { _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__first, __alloc); typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __first != __last; ++__first) __traits::construct(__alloc, std::__addressof(*__first)); __guard.release(); } template inline void __uninitialized_default_a(_ForwardIterator __first, _ForwardIterator __last, allocator<_Tp>&) { std::__uninitialized_default(__first, __last); } template constexpr _ForwardIterator __uninitialized_default_n_a(_ForwardIterator __first, _Size __n, _Allocator& __alloc) { _UninitDestroyGuard<_ForwardIterator, _Allocator> __guard(__first, __alloc); typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __n > 0; --__n, (void) ++__first) __traits::construct(__alloc, std::__addressof(*__first)); __guard.release(); return __first; } template constexpr inline _ForwardIterator __uninitialized_default_n_a(_ForwardIterator __first, _Size __n, allocator<_Tp>&) { return std::__uninitialized_default_n(__first, __n); } template struct __uninitialized_default_novalue_1 { template static void __uninit_default_novalue(_ForwardIterator __first, _ForwardIterator __last) { _UninitDestroyGuard<_ForwardIterator> __guard(__first); for (; __first != __last; ++__first) std::_Construct_novalue(std::__addressof(*__first)); __guard.release(); } }; template<> struct __uninitialized_default_novalue_1 { template static void __uninit_default_novalue(_ForwardIterator, _ForwardIterator) { } }; template struct __uninitialized_default_novalue_n_1 { template static _ForwardIterator __uninit_default_novalue_n(_ForwardIterator __first, _Size __n) { _UninitDestroyGuard<_ForwardIterator> __guard(__first); for (; __n > 0; --__n, (void) ++__first) std::_Construct_novalue(std::__addressof(*__first)); __guard.release(); return __first; } }; template<> struct __uninitialized_default_novalue_n_1 { template static _ForwardIterator __uninit_default_novalue_n(_ForwardIterator __first, _Size __n) { return std::next(__first, __n); } }; template inline void __uninitialized_default_novalue(_ForwardIterator __first, _ForwardIterator __last) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; std::__uninitialized_default_novalue_1< is_trivially_default_constructible<_ValueType>::value>:: __uninit_default_novalue(__first, __last); } template inline _ForwardIterator __uninitialized_default_novalue_n(_ForwardIterator __first, _Size __n) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; return __uninitialized_default_novalue_n_1< is_trivially_default_constructible<_ValueType>::value>:: __uninit_default_novalue_n(__first, __n); } template _ForwardIterator __uninitialized_copy_n(_InputIterator __first, _Size __n, _ForwardIterator __result, input_iterator_tag) { _UninitDestroyGuard<_ForwardIterator> __guard(__result); for (; __n > 0; --__n, (void) ++__first, ++__result) std::_Construct(std::__addressof(*__result), *__first); __guard.release(); return __result; } template inline _ForwardIterator __uninitialized_copy_n(_RandomAccessIterator __first, _Size __n, _ForwardIterator __result, random_access_iterator_tag) { return std::uninitialized_copy(__first, __first + __n, __result); } template pair<_InputIterator, _ForwardIterator> __uninitialized_copy_n_pair(_InputIterator __first, _Size __n, _ForwardIterator __result, input_iterator_tag) { _UninitDestroyGuard<_ForwardIterator> __guard(__result); for (; __n > 0; --__n, (void) ++__first, ++__result) std::_Construct(std::__addressof(*__result), *__first); __guard.release(); return {__first, __result}; } template inline pair<_RandomAccessIterator, _ForwardIterator> __uninitialized_copy_n_pair(_RandomAccessIterator __first, _Size __n, _ForwardIterator __result, random_access_iterator_tag) { auto __second_res = uninitialized_copy(__first, __first + __n, __result); auto __first_res = std::next(__first, __n); return {__first_res, __second_res}; } # 1151 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline _ForwardIterator uninitialized_copy_n(_InputIterator __first, _Size __n, _ForwardIterator __result) { return std::__uninitialized_copy_n(__first, __n, __result, std::__iterator_category(__first)); } template inline pair<_InputIterator, _ForwardIterator> __uninitialized_copy_n_pair(_InputIterator __first, _Size __n, _ForwardIterator __result) { return std::__uninitialized_copy_n_pair(__first, __n, __result, std::__iterator_category(__first)); } # 1180 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) { std::__uninitialized_default_novalue(__first, __last); } # 1196 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline _ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __count) { return std::__uninitialized_default_novalue_n(__first, __count); } template inline void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) { return std::__uninitialized_default(__first, __last); } # 1226 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline _ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __count) { return std::__uninitialized_default_n(__first, __count); } # 1242 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline _ForwardIterator uninitialized_move(_InputIterator __first, _InputIterator __last, _ForwardIterator __result) { return std::uninitialized_copy (std::make_move_iterator(__first), std::make_move_iterator(__last), __result); } # 1261 "/usr/include/c++/15/bits/stl_uninitialized.h" 3 template inline pair<_InputIterator, _ForwardIterator> uninitialized_move_n(_InputIterator __first, _Size __count, _ForwardIterator __result) { auto __res = std::__uninitialized_copy_n_pair (std::make_move_iterator(__first), __count, __result); return {__res.first.base(), __res.second}; } template constexpr inline void __relocate_object_a(_Tp* __restrict __dest, _Up* __restrict __orig, _Allocator& __alloc) noexcept(noexcept(std::allocator_traits<_Allocator>::construct(__alloc, __dest, std::move(*__orig))) && noexcept(std::allocator_traits<_Allocator>::destroy( __alloc, std::__addressof(*__orig)))) { typedef std::allocator_traits<_Allocator> __traits; __traits::construct(__alloc, __dest, std::move(*__orig)); __traits::destroy(__alloc, std::__addressof(*__orig)); } template struct __is_bitwise_relocatable : __bool_constant<__is_trivial(_Tp)> { }; template constexpr inline _ForwardIterator __relocate_a_1(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _Allocator& __alloc) noexcept(noexcept(std::__relocate_object_a(std::addressof(*__result), std::addressof(*__first), __alloc))) { typedef typename iterator_traits<_InputIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType2; static_assert(std::is_same<_ValueType, _ValueType2>::value, "relocation is only possible for values of the same type"); _ForwardIterator __cur = __result; for (; __first != __last; ++__first, (void)++__cur) std::__relocate_object_a(std::__addressof(*__cur), std::__addressof(*__first), __alloc); return __cur; } template constexpr inline __enable_if_t::value, _Tp*> __relocate_a_1(_Tp* __first, _Tp* __last, _Tp* __result, [[__maybe_unused__]] allocator<_Up>& __alloc) noexcept { ptrdiff_t __count = __last - __first; if (__count > 0) { if (std::is_constant_evaluated()) { __gnu_cxx::__normal_iterator<_Tp*, void> __out(__result); __out = std::__relocate_a_1(__first, __last, __out, __alloc); return __out.base(); } __builtin_memcpy(__result, __first, __count * sizeof(_Tp)); } return __result + __count; } template constexpr inline _ForwardIterator __relocate_a(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _Allocator& __alloc) noexcept(noexcept(__relocate_a_1(std::__niter_base(__first), std::__niter_base(__last), std::__niter_base(__result), __alloc))) { return std::__relocate_a_1(std::__niter_base(__first), std::__niter_base(__last), std::__niter_base(__result), __alloc); } } # 68 "/usr/include/c++/15/vector" 2 3 # 1 "/usr/include/c++/15/bits/stl_vector.h" 1 3 # 72 "/usr/include/c++/15/bits/stl_vector.h" 3 # 1 "/usr/include/c++/15/bits/ranges_algobase.h" 1 3 # 44 "/usr/include/c++/15/bits/ranges_algobase.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { namespace ranges { namespace __detail { template constexpr inline bool __is_normal_iterator = false; template constexpr inline bool __is_normal_iterator<__gnu_cxx::__normal_iterator<_Iterator, _Container>> = true; template constexpr inline bool __is_reverse_iterator = false; template constexpr inline bool __is_reverse_iterator> = true; template constexpr inline bool __is_move_iterator = false; template constexpr inline bool __is_move_iterator> = true; } template struct out_value_result { [[no_unique_address]] _Out out; [[no_unique_address]] _Tp value; template requires convertible_to && convertible_to constexpr operator out_value_result<_Out2, _Tp2>() const & { return {out, value}; } template requires convertible_to<_Out, _Out2> && convertible_to<_Tp, _Tp2> constexpr operator out_value_result<_Out2, _Tp2>() && { return {std::move(out), std::move(value)}; } }; struct __equal_fn { template _Sent1, input_iterator _Iter2, sentinel_for<_Iter2> _Sent2, typename _Pred = ranges::equal_to, typename _Proj1 = identity, typename _Proj2 = identity> requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> constexpr bool operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { if constexpr (__detail::__is_normal_iterator<_Iter1> && same_as<_Iter1, _Sent1>) return (*this)(__first1.base(), __last1.base(), std::move(__first2), std::move(__last2), std::move(__pred), std::move(__proj1), std::move(__proj2)); else if constexpr (__detail::__is_normal_iterator<_Iter2> && same_as<_Iter2, _Sent2>) return (*this)(std::move(__first1), std::move(__last1), __first2.base(), __last2.base(), std::move(__pred), std::move(__proj1), std::move(__proj2)); else if constexpr (sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>) { auto __d1 = ranges::distance(__first1, __last1); auto __d2 = ranges::distance(__first2, __last2); if (__d1 != __d2) return false; using _ValueType1 = iter_value_t<_Iter1>; constexpr bool __use_memcmp = ((is_integral_v<_ValueType1> || is_pointer_v<_ValueType1>) && __memcmpable<_Iter1, _Iter2>::__value && is_same_v<_Pred, ranges::equal_to> && is_same_v<_Proj1, identity> && is_same_v<_Proj2, identity>); if constexpr (__use_memcmp) { if (const size_t __len = (__last1 - __first1)) return !std::__memcmp(__first1, __first2, __len); return true; } else { for (; __first1 != __last1; ++__first1, (void)++__first2) if (!(bool)std::__invoke(__pred, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2))) return false; return true; } } else { for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2) if (!(bool)std::__invoke(__pred, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2))) return false; return __first1 == __last1 && __first2 == __last2; } } template requires indirectly_comparable, iterator_t<_Range2>, _Pred, _Proj1, _Proj2> constexpr bool operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const { if constexpr (sized_range<_Range1>) if constexpr (sized_range<_Range2>) if (ranges::distance(__r1) != ranges::distance(__r2)) return false; return (*this)(ranges::begin(__r1), ranges::end(__r1), ranges::begin(__r2), ranges::end(__r2), std::move(__pred), std::move(__proj1), std::move(__proj2)); } }; inline constexpr __equal_fn equal{}; namespace __detail { template [[__gnu__::__always_inline__]] constexpr void __assign_one(_OutIter& __out, _InIter& __in) { if constexpr (_IsMove) *__out = ranges::iter_move(__in); else *__out = *__in; } } template struct in_out_result { [[no_unique_address]] _Iter in; [[no_unique_address]] _Out out; template requires convertible_to && convertible_to constexpr operator in_out_result<_Iter2, _Out2>() const & { return {in, out}; } template requires convertible_to<_Iter, _Iter2> && convertible_to<_Out, _Out2> constexpr operator in_out_result<_Iter2, _Out2>() && { return {std::move(in), std::move(out)}; } }; template using copy_result = in_out_result<_Iter, _Out>; template using move_result = in_out_result<_Iter, _Out>; template using move_backward_result = in_out_result<_Iter1, _Iter2>; template using copy_backward_result = in_out_result<_Iter1, _Iter2>; template _Sent, bidirectional_iterator _Out> requires (_IsMove ? indirectly_movable<_Iter, _Out> : indirectly_copyable<_Iter, _Out>) constexpr __conditional_t<_IsMove, move_backward_result<_Iter, _Out>, copy_backward_result<_Iter, _Out>> __copy_or_move_backward(_Iter __first, _Sent __last, _Out __result); template _Sent, weakly_incrementable _Out> requires (_IsMove ? indirectly_movable<_Iter, _Out> : indirectly_copyable<_Iter, _Out>) constexpr __conditional_t<_IsMove, move_result<_Iter, _Out>, copy_result<_Iter, _Out>> __copy_or_move(_Iter __first, _Sent __last, _Out __result) { using __detail::__is_move_iterator; using __detail::__is_reverse_iterator; using __detail::__is_normal_iterator; if constexpr (__is_move_iterator<_Iter> && same_as<_Iter, _Sent>) { auto [__in, __out] = ranges::__copy_or_move(std::move(__first).base(), std::move(__last).base(), std::move(__result)); return {move_iterator{std::move(__in)}, std::move(__out)}; } else if constexpr (__is_reverse_iterator<_Iter> && same_as<_Iter, _Sent> && __is_reverse_iterator<_Out>) { auto [__in,__out] = ranges::__copy_or_move_backward<_IsMove>(std::move(__last).base(), std::move(__first).base(), std::move(__result).base()); return {reverse_iterator{std::move(__in)}, reverse_iterator{std::move(__out)}}; } else if constexpr (__is_normal_iterator<_Iter> && same_as<_Iter, _Sent>) { auto [__in,__out] = ranges::__copy_or_move<_IsMove>(__first.base(), __last.base(), std::move(__result)); return {decltype(__first){__in}, std::move(__out)}; } else if constexpr (__is_normal_iterator<_Out>) { auto [__in,__out] = ranges::__copy_or_move<_IsMove>(std::move(__first), __last, __result.base()); return {std::move(__in), decltype(__result){__out}}; } else if constexpr (sized_sentinel_for<_Sent, _Iter>) { if (!std::__is_constant_evaluated()) { if constexpr (__memcpyable<_Out, _Iter>::__value) { using _ValueTypeI = iter_value_t<_Iter>; auto __num = __last - __first; if (__num > 1) [[likely]] __builtin_memmove(__result, __first, sizeof(_ValueTypeI) * __num); else if (__num == 1) __detail::__assign_one<_IsMove>(__result, __first); return {__first + __num, __result + __num}; } } for (auto __n = __last - __first; __n > 0; --__n) { __detail::__assign_one<_IsMove>(__result, __first); ++__first; ++__result; } return {std::move(__first), std::move(__result)}; } else { while (__first != __last) { __detail::__assign_one<_IsMove>(__result, __first); ++__first; ++__result; } return {std::move(__first), std::move(__result)}; } } struct __copy_fn { template _Sent, weakly_incrementable _Out> requires indirectly_copyable<_Iter, _Out> constexpr copy_result<_Iter, _Out> operator()(_Iter __first, _Sent __last, _Out __result) const { return ranges::__copy_or_move(std::move(__first), std::move(__last), std::move(__result)); } template requires indirectly_copyable, _Out> constexpr copy_result, _Out> operator()(_Range&& __r, _Out __result) const { return (*this)(ranges::begin(__r), ranges::end(__r), std::move(__result)); } }; inline constexpr __copy_fn copy{}; struct __move_fn { template _Sent, weakly_incrementable _Out> requires indirectly_movable<_Iter, _Out> constexpr move_result<_Iter, _Out> operator()(_Iter __first, _Sent __last, _Out __result) const { return ranges::__copy_or_move(std::move(__first), std::move(__last), std::move(__result)); } template requires indirectly_movable, _Out> constexpr move_result, _Out> operator()(_Range&& __r, _Out __result) const { return (*this)(ranges::begin(__r), ranges::end(__r), std::move(__result)); } }; inline constexpr __move_fn move{}; template _Sent, bidirectional_iterator _Out> requires (_IsMove ? indirectly_movable<_Iter, _Out> : indirectly_copyable<_Iter, _Out>) constexpr __conditional_t<_IsMove, move_backward_result<_Iter, _Out>, copy_backward_result<_Iter, _Out>> __copy_or_move_backward(_Iter __first, _Sent __last, _Out __result) { using __detail::__is_reverse_iterator; using __detail::__is_normal_iterator; if constexpr (__is_reverse_iterator<_Iter> && same_as<_Iter, _Sent> && __is_reverse_iterator<_Out>) { auto [__in,__out] = ranges::__copy_or_move<_IsMove>(std::move(__last).base(), std::move(__first).base(), std::move(__result).base()); return {reverse_iterator{std::move(__in)}, reverse_iterator{std::move(__out)}}; } else if constexpr (__is_normal_iterator<_Iter> && same_as<_Iter, _Sent>) { auto [__in,__out] = ranges::__copy_or_move_backward<_IsMove>(__first.base(), __last.base(), std::move(__result)); return {decltype(__first){__in}, std::move(__out)}; } else if constexpr (__is_normal_iterator<_Out>) { auto [__in,__out] = ranges::__copy_or_move_backward<_IsMove>(std::move(__first), std::move(__last), __result.base()); return {std::move(__in), decltype(__result){__out}}; } else if constexpr (sized_sentinel_for<_Sent, _Iter>) { if (!std::__is_constant_evaluated()) { if constexpr (__memcpyable<_Out, _Iter>::__value) { using _ValueTypeI = iter_value_t<_Iter>; auto __num = __last - __first; __result -= __num; if (__num > 1) [[likely]] __builtin_memmove(__result, __first, sizeof(_ValueTypeI) * __num); else if (__num == 1) __detail::__assign_one<_IsMove>(__result, __first); return {__first + __num, __result}; } } auto __lasti = ranges::next(__first, __last); auto __tail = __lasti; for (auto __n = __last - __first; __n > 0; --__n) { --__tail; --__result; __detail::__assign_one<_IsMove>(__result, __tail); } return {std::move(__lasti), std::move(__result)}; } else { auto __lasti = ranges::next(__first, __last); auto __tail = __lasti; while (__first != __tail) { --__tail; --__result; __detail::__assign_one<_IsMove>(__result, __tail); } return {std::move(__lasti), std::move(__result)}; } } struct __copy_backward_fn { template _Sent1, bidirectional_iterator _Iter2> requires indirectly_copyable<_Iter1, _Iter2> constexpr copy_backward_result<_Iter1, _Iter2> operator()(_Iter1 __first, _Sent1 __last, _Iter2 __result) const { return ranges::__copy_or_move_backward(std::move(__first), std::move(__last), std::move(__result)); } template requires indirectly_copyable, _Iter> constexpr copy_backward_result, _Iter> operator()(_Range&& __r, _Iter __result) const { return (*this)(ranges::begin(__r), ranges::end(__r), std::move(__result)); } }; inline constexpr __copy_backward_fn copy_backward{}; struct __move_backward_fn { template _Sent1, bidirectional_iterator _Iter2> requires indirectly_movable<_Iter1, _Iter2> constexpr move_backward_result<_Iter1, _Iter2> operator()(_Iter1 __first, _Sent1 __last, _Iter2 __result) const { return ranges::__copy_or_move_backward(std::move(__first), std::move(__last), std::move(__result)); } template requires indirectly_movable, _Iter> constexpr move_backward_result, _Iter> operator()(_Range&& __r, _Iter __result) const { return (*this)(ranges::begin(__r), ranges::end(__r), std::move(__result)); } }; inline constexpr __move_backward_fn move_backward{}; template using copy_n_result = in_out_result<_Iter, _Out>; struct __copy_n_fn { template requires indirectly_copyable<_Iter, _Out> constexpr copy_n_result<_Iter, _Out> operator()(_Iter __first, iter_difference_t<_Iter> __n, _Out __result) const { if constexpr (random_access_iterator<_Iter>) { if (__n > 0) return ranges::copy(__first, __first + __n, std::move(__result)); } else { for (; __n > 0; --__n, (void)++__result, (void)++__first) *__result = *__first; } return {std::move(__first), std::move(__result)}; } }; inline constexpr __copy_n_fn copy_n{}; struct __fill_n_fn { template requires output_iterator<_Out, const _Tp&> constexpr _Out operator()(_Out __first, iter_difference_t<_Out> __n, const _Tp& __value) const { if (__n <= 0) return __first; if constexpr (is_scalar_v<_Tp>) { if constexpr (is_pointer_v<_Out> && __is_byte>::__value && integral<_Tp>) { if (!std::__is_constant_evaluated()) { __builtin_memset(__first, static_cast(__value), __n); return __first + __n; } } const auto __tmp = __value; for (; __n > 0; --__n, (void)++__first) *__first = __tmp; return __first; } else { for (; __n > 0; --__n, (void)++__first) *__first = __value; return __first; } } }; inline constexpr __fill_n_fn fill_n{}; struct __fill_fn { template _Sent, typename _Tp > requires output_iterator<_Out, const _Tp&> constexpr _Out operator()(_Out __first, _Sent __last, const _Tp& __value) const { if constexpr (sized_sentinel_for<_Sent, _Out>) { const auto __len = __last - __first; return ranges::fill_n(std::move(__first), __len, __value); } else if constexpr (is_scalar_v<_Tp>) { const auto __tmp = __value; for (; __first != __last; ++__first) *__first = __tmp; return __first; } else { for (; __first != __last; ++__first) *__first = __value; return __first; } } template requires output_range<_Range, const _Tp&> constexpr borrowed_iterator_t<_Range> operator()(_Range&& __r, const _Tp& __value) const { return (*this)(ranges::begin(__r), ranges::end(__r), __value); } }; inline constexpr __fill_fn fill{}; } } # 73 "/usr/include/c++/15/bits/stl_vector.h" 2 3 # 84 "/usr/include/c++/15/bits/stl_vector.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template struct _Vector_base { typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type; typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer pointer; struct _Vector_impl_data { pointer _M_start; pointer _M_finish; pointer _M_end_of_storage; constexpr _Vector_impl_data() noexcept : _M_start(), _M_finish(), _M_end_of_storage() { } constexpr _Vector_impl_data(_Vector_impl_data&& __x) noexcept : _M_start(__x._M_start), _M_finish(__x._M_finish), _M_end_of_storage(__x._M_end_of_storage) { __x._M_start = __x._M_finish = __x._M_end_of_storage = pointer(); } constexpr void _M_copy_data(_Vector_impl_data const& __x) noexcept { _M_start = __x._M_start; _M_finish = __x._M_finish; _M_end_of_storage = __x._M_end_of_storage; } constexpr void _M_swap_data(_Vector_impl_data& __x) noexcept { _Vector_impl_data __tmp; __tmp._M_copy_data(*this); _M_copy_data(__x); __x._M_copy_data(__tmp); } }; struct _Vector_impl : public _Tp_alloc_type, public _Vector_impl_data { constexpr _Vector_impl() noexcept(is_nothrow_default_constructible<_Tp_alloc_type>::value) requires is_default_constructible_v<_Tp_alloc_type> : _Tp_alloc_type() { } constexpr _Vector_impl(_Tp_alloc_type const& __a) noexcept : _Tp_alloc_type(__a) { } constexpr _Vector_impl(_Vector_impl&& __x) noexcept : _Tp_alloc_type(std::move(__x)), _Vector_impl_data(std::move(__x)) { } constexpr _Vector_impl(_Tp_alloc_type&& __a) noexcept : _Tp_alloc_type(std::move(__a)) { } constexpr _Vector_impl(_Tp_alloc_type&& __a, _Vector_impl&& __rv) noexcept : _Tp_alloc_type(std::move(__a)), _Vector_impl_data(std::move(__rv)) { } # 300 "/usr/include/c++/15/bits/stl_vector.h" 3 }; public: typedef _Alloc allocator_type; constexpr _Tp_alloc_type& _M_get_Tp_allocator() noexcept { return this->_M_impl; } constexpr const _Tp_alloc_type& _M_get_Tp_allocator() const noexcept { return this->_M_impl; } constexpr allocator_type get_allocator() const noexcept { return allocator_type(_M_get_Tp_allocator()); } _Vector_base() = default; constexpr _Vector_base(const allocator_type& __a) noexcept : _M_impl(__a) { } constexpr _Vector_base(size_t __n) : _M_impl() { _M_create_storage(__n); } constexpr _Vector_base(size_t __n, const allocator_type& __a) : _M_impl(__a) { _M_create_storage(__n); } _Vector_base(_Vector_base&&) = default; constexpr _Vector_base(_Tp_alloc_type&& __a) noexcept : _M_impl(std::move(__a)) { } constexpr _Vector_base(_Vector_base&& __x, const allocator_type& __a) : _M_impl(__a) { if (__x.get_allocator() == __a) this->_M_impl._M_swap_data(__x._M_impl); else { size_t __n = __x._M_impl._M_finish - __x._M_impl._M_start; _M_create_storage(__n); } } constexpr _Vector_base(const allocator_type& __a, _Vector_base&& __x) : _M_impl(_Tp_alloc_type(__a), std::move(__x._M_impl)) { } constexpr ~_Vector_base() noexcept { _M_deallocate(_M_impl._M_start, _M_impl._M_end_of_storage - _M_impl._M_start); } public: _Vector_impl _M_impl; constexpr pointer _M_allocate(size_t __n) { typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr; return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer(); } constexpr void _M_deallocate(pointer __p, size_t __n) { typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr; if (__p) _Tr::deallocate(_M_impl, __p, __n); } protected: constexpr void _M_create_storage(size_t __n) { this->_M_impl._M_start = this->_M_allocate(__n); this->_M_impl._M_finish = this->_M_impl._M_start; this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; } template constexpr void _M_append_range_to(_Rg&& __rg, pointer& __ptr) { __ptr = std::__uninitialized_copy_a(ranges::begin(__rg), ranges::end(__rg), __ptr, _M_get_Tp_allocator()); } template constexpr void _M_append_range(_Rg&& __rg) { _M_append_range_to(std::forward<_Rg>(__rg), _M_impl._M_finish); } }; # 457 "/usr/include/c++/15/bits/stl_vector.h" 3 template > class vector : protected _Vector_base<_Tp, _Alloc> { # 470 "/usr/include/c++/15/bits/stl_vector.h" 3 static_assert(is_same::type, _Tp>::value, "std::vector must have a non-const, non-volatile value_type"); static_assert(is_same::value, "std::vector must have the same value_type as its allocator"); typedef _Vector_base<_Tp, _Alloc> _Base; typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits; public: typedef _Tp value_type; typedef typename _Base::pointer pointer; typedef typename _Alloc_traits::const_pointer const_pointer; typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::const_reference const_reference; typedef __gnu_cxx::__normal_iterator iterator; typedef __gnu_cxx::__normal_iterator const_iterator; typedef std::reverse_iterator const_reverse_iterator; typedef std::reverse_iterator reverse_iterator; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Alloc allocator_type; private: static constexpr bool _S_nothrow_relocate(true_type) { return noexcept(std::__relocate_a(std::declval(), std::declval(), std::declval(), std::declval<_Tp_alloc_type&>())); } static constexpr bool _S_nothrow_relocate(false_type) { return false; } static constexpr bool _S_use_relocate() { return _S_nothrow_relocate(__is_move_insertable<_Tp_alloc_type>{}); } static pointer _S_do_relocate(pointer __first, pointer __last, pointer __result, _Tp_alloc_type& __alloc, true_type) noexcept { return std::__relocate_a(__first, __last, __result, __alloc); } static pointer _S_do_relocate(pointer, pointer, pointer __result, _Tp_alloc_type&, false_type) noexcept { return __result; } static constexpr pointer _S_relocate(pointer __first, pointer __last, pointer __result, _Tp_alloc_type& __alloc) noexcept { return std::__relocate_a(__first, __last, __result, __alloc); } protected: using _Base::_M_allocate; using _Base::_M_deallocate; using _Base::_M_impl; using _Base::_M_get_Tp_allocator; public: vector() = default; # 570 "/usr/include/c++/15/bits/stl_vector.h" 3 explicit constexpr vector(const allocator_type& __a) noexcept : _Base(__a) { } # 584 "/usr/include/c++/15/bits/stl_vector.h" 3 explicit constexpr vector(size_type __n, const allocator_type& __a = allocator_type()) : _Base(_S_check_init_len(__n, __a), __a) { _M_default_initialize(__n); } # 598 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr vector(size_type __n, const value_type& __value, const allocator_type& __a = allocator_type()) : _Base(_S_check_init_len(__n, __a), __a) { _M_fill_initialize(__n, __value); } # 630 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr vector(const vector& __x) : _Base(__x.size(), _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator())) { this->_M_impl._M_finish = std::__uninitialized_copy_a(__x.begin(), __x.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); } # 650 "/usr/include/c++/15/bits/stl_vector.h" 3 vector(vector&&) noexcept = default; constexpr vector(const vector& __x, const __type_identity_t& __a) : _Base(__x.size(), __a) { this->_M_impl._M_finish = std::__uninitialized_copy_a(__x.begin(), __x.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); } private: constexpr vector(vector&& __rv, const allocator_type& __m, true_type) noexcept : _Base(__m, std::move(__rv)) { } constexpr vector(vector&& __rv, const allocator_type& __m, false_type) : _Base(__m) { if (__rv.get_allocator() == __m) this->_M_impl._M_swap_data(__rv._M_impl); else if (!__rv.empty()) { this->_M_create_storage(__rv.size()); this->_M_impl._M_finish = std::__uninitialized_move_a(__rv.begin(), __rv.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); __rv.clear(); } } public: constexpr vector(vector&& __rv, const __type_identity_t& __m) noexcept( noexcept( vector(std::declval(), std::declval(), std::declval())) ) : vector(std::move(__rv), __m, typename _Alloc_traits::is_always_equal{}) { } # 707 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr vector(initializer_list __l, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_range_initialize_n(__l.begin(), __l.end(), __l.size()); } # 733 "/usr/include/c++/15/bits/stl_vector.h" 3 template> constexpr vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { if constexpr (sized_sentinel_for<_InputIterator, _InputIterator> || forward_iterator<_InputIterator>) { const auto __n = static_cast(ranges::distance(__first, __last)); _M_range_initialize_n(__first, __last, __n); return; } else _M_range_initialize(__first, __last, std::__iterator_category(__first)); } # 772 "/usr/include/c++/15/bits/stl_vector.h" 3 template<__detail::__container_compatible_range<_Tp> _Rg> constexpr vector(from_range_t, _Rg&& __rg, const _Alloc& __a = _Alloc()) : vector(__a) { if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>) { const auto __n = static_cast(ranges::distance(__rg)); _M_range_initialize_n(ranges::begin(__rg), ranges::end(__rg), __n); } else { auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); for (; __first != __last; ++__first) emplace_back(*__first); } } # 799 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr ~vector() noexcept { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); ; } # 816 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr vector& operator=(const vector& __x); # 831 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr vector& operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) { constexpr bool __move_storage = _Alloc_traits::_S_propagate_on_move_assign() || _Alloc_traits::_S_always_equal(); _M_move_assign(std::move(__x), __bool_constant<__move_storage>()); return *this; } # 853 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr vector& operator=(initializer_list __l) { this->_M_assign_aux(__l.begin(), __l.end(), random_access_iterator_tag()); return *this; } # 873 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void assign(size_type __n, const value_type& __val) { _M_fill_assign(__n, __val); } # 891 "/usr/include/c++/15/bits/stl_vector.h" 3 template> constexpr void assign(_InputIterator __first, _InputIterator __last) { _M_assign_aux(__first, __last, std::__iterator_category(__first)); } # 920 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void assign(initializer_list __l) { this->_M_assign_aux(__l.begin(), __l.end(), random_access_iterator_tag()); } # 936 "/usr/include/c++/15/bits/stl_vector.h" 3 template<__detail::__container_compatible_range<_Tp> _Rg> constexpr void assign_range(_Rg&& __rg) { static_assert(assignable_from<_Tp&, ranges::range_reference_t<_Rg>>); if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>) { const auto __n = size_type(ranges::distance(__rg)); if (__n <= size()) { auto __res = ranges::copy(__rg, this->_M_impl._M_start); _M_erase_at_end(__res.out); return; } reserve(__n); auto __first = ranges::copy_n(ranges::begin(__rg), size(), this->_M_impl._M_start).in; [[maybe_unused]] const auto __diff = __n - size(); ; _Base::_M_append_range(ranges::subrange(std::move(__first), ranges::end(__rg))); ; } else { auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); pointer __ptr = this->_M_impl._M_start; pointer const __end = this->_M_impl._M_finish; while (__ptr < __end && __first != __last) { *__ptr = *__first; ++__ptr; ++__first; } if (__first == __last) _M_erase_at_end(__ptr); else { do emplace_back(*__first); while (++__first != __last); } } } using _Base::get_allocator; [[__nodiscard__]] constexpr iterator begin() noexcept { return iterator(this->_M_impl._M_start); } [[__nodiscard__]] constexpr const_iterator begin() const noexcept { return const_iterator(this->_M_impl._M_start); } [[__nodiscard__]] constexpr iterator end() noexcept { return iterator(this->_M_impl._M_finish); } [[__nodiscard__]] constexpr const_iterator end() const noexcept { return const_iterator(this->_M_impl._M_finish); } [[__nodiscard__]] constexpr reverse_iterator rbegin() noexcept { return reverse_iterator(end()); } [[__nodiscard__]] constexpr const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); } [[__nodiscard__]] constexpr reverse_iterator rend() noexcept { return reverse_iterator(begin()); } [[__nodiscard__]] constexpr const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); } [[__nodiscard__]] constexpr const_iterator cbegin() const noexcept { return const_iterator(this->_M_impl._M_start); } [[__nodiscard__]] constexpr const_iterator cend() const noexcept { return const_iterator(this->_M_impl._M_finish); } [[__nodiscard__]] constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); } [[__nodiscard__]] constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); } [[__nodiscard__]] constexpr size_type size() const noexcept { ptrdiff_t __dif = this->_M_impl._M_finish - this->_M_impl._M_start; if (__dif < 0) __builtin_unreachable (); return size_type(__dif); } [[__nodiscard__]] constexpr size_type max_size() const noexcept { return _S_max_size(_M_get_Tp_allocator()); } # 1141 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void resize(size_type __new_size) { if (__new_size > size()) _M_default_append(__new_size - size()); else if (__new_size < size()) _M_erase_at_end(this->_M_impl._M_start + __new_size); } # 1162 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void resize(size_type __new_size, const value_type& __x) { if (__new_size > size()) _M_fill_append(__new_size - size(), __x); else if (__new_size < size()) _M_erase_at_end(this->_M_impl._M_start + __new_size); } # 1196 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void shrink_to_fit() { _M_shrink_to_fit(); } [[__nodiscard__]] constexpr size_type capacity() const noexcept { ptrdiff_t __dif = this->_M_impl._M_end_of_storage - this->_M_impl._M_start; if (__dif < 0) __builtin_unreachable (); return size_type(__dif); } [[__nodiscard__]] constexpr bool empty() const noexcept { return begin() == end(); } # 1243 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void reserve(size_type __n); # 1259 "/usr/include/c++/15/bits/stl_vector.h" 3 [[__nodiscard__]] constexpr reference operator[](size_type __n) noexcept { do { if (std::__is_constant_evaluated() && !bool(__n < this->size())) std::__glibcxx_assert_fail(); } while (false); return *(this->_M_impl._M_start + __n); } # 1278 "/usr/include/c++/15/bits/stl_vector.h" 3 [[__nodiscard__]] constexpr const_reference operator[](size_type __n) const noexcept { do { if (std::__is_constant_evaluated() && !bool(__n < this->size())) std::__glibcxx_assert_fail(); } while (false); return *(this->_M_impl._M_start + __n); } protected: constexpr void _M_range_check(size_type __n) const { if (__n >= this->size()) __throw_out_of_range_fmt(("vector::_M_range_check: __n " "(which is %zu) >= this->size() " "(which is %zu)") , __n, this->size()); } public: # 1311 "/usr/include/c++/15/bits/stl_vector.h" 3 [[__nodiscard__]] constexpr reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } # 1330 "/usr/include/c++/15/bits/stl_vector.h" 3 [[__nodiscard__]] constexpr const_reference at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; } [[__nodiscard__]] constexpr reference front() noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *begin(); } [[__nodiscard__]] constexpr const_reference front() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *begin(); } [[__nodiscard__]] constexpr reference back() noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *(end() - 1); } [[__nodiscard__]] constexpr const_reference back() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *(end() - 1); } # 1393 "/usr/include/c++/15/bits/stl_vector.h" 3 [[__nodiscard__]] constexpr _Tp* data() noexcept { return _M_data_ptr(this->_M_impl._M_start); } [[__nodiscard__]] constexpr const _Tp* data() const noexcept { return _M_data_ptr(this->_M_impl._M_start); } # 1414 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void push_back(const value_type& __x) { if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) { ; _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, __x); ++this->_M_impl._M_finish; ; } else _M_realloc_append(__x); } constexpr void push_back(value_type&& __x) { emplace_back(std::move(__x)); } template constexpr reference emplace_back(_Args&&... __args); # 1455 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void pop_back() noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); --this->_M_impl._M_finish; _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish); ; } # 1478 "/usr/include/c++/15/bits/stl_vector.h" 3 template constexpr iterator emplace(const_iterator __position, _Args&&... __args) { return _M_emplace_aux(__position, std::forward<_Args>(__args)...); } # 1495 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr iterator insert(const_iterator __position, const value_type& __x); # 1526 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr iterator insert(const_iterator __position, value_type&& __x) { return _M_insert_rval(__position, std::move(__x)); } # 1544 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr iterator insert(const_iterator __position, initializer_list __l) { auto __offset = __position - cbegin(); _M_range_insert(begin() + __offset, __l.begin(), __l.end(), std::random_access_iterator_tag()); return begin() + __offset; } # 1570 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr iterator insert(const_iterator __position, size_type __n, const value_type& __x) { difference_type __offset = __position - cbegin(); _M_fill_insert(begin() + __offset, __n, __x); return begin() + __offset; } # 1613 "/usr/include/c++/15/bits/stl_vector.h" 3 template> constexpr iterator insert(const_iterator __position, _InputIterator __first, _InputIterator __last) { difference_type __offset = __position - cbegin(); _M_range_insert(begin() + __offset, __first, __last, std::__iterator_category(__first)); return begin() + __offset; } # 1660 "/usr/include/c++/15/bits/stl_vector.h" 3 template<__detail::__container_compatible_range<_Tp> _Rg> constexpr iterator insert_range(const_iterator __pos, _Rg&& __rg); template<__detail::__container_compatible_range<_Tp> _Rg> constexpr void append_range(_Rg&& __rg) { if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>) { const auto __n = size_type(ranges::distance(__rg)); if (capacity() == 0) reserve(__n); const auto __sz = size(); const auto __capacity = capacity(); if ((__capacity - __sz) >= __n) { ; _Base::_M_append_range(__rg); ; return; } const size_type __len = _M_check_len(__n, "vector::append_range"); pointer __old_start = this->_M_impl._M_start; pointer __old_finish = this->_M_impl._M_finish; allocator_type& __a = _M_get_Tp_allocator(); const pointer __start = this->_M_allocate(__len); const pointer __mid = __start + __sz; const pointer __back = __mid + __n; _Guard_alloc __guard(__start, __len, *this); std::__uninitialized_copy_a(ranges::begin(__rg), ranges::end(__rg), __mid, __a); if constexpr (_S_use_relocate()) _S_relocate(__old_start, __old_finish, __start, __a); else { struct _Guard_elts { pointer _M_first, _M_last; _Tp_alloc_type& _M_alloc; constexpr _Guard_elts(pointer __f, pointer __l, _Tp_alloc_type& __a) : _M_first(__f), _M_last(__l), _M_alloc(__a) { } constexpr ~_Guard_elts() { std::_Destroy(_M_first, _M_last, _M_alloc); } _Guard_elts(_Guard_elts&&) = delete; }; _Guard_elts __guard_elts{__mid, __back, __a}; std::__uninitialized_move_a(__old_start, __old_finish, __start, __a); __guard_elts._M_first = __old_start; __guard_elts._M_last = __old_finish; } __guard._M_storage = __old_start; __guard._M_len = __capacity; this->_M_impl._M_start = __start; this->_M_impl._M_finish = __back; this->_M_impl._M_end_of_storage = __start + __len; } else { auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); for (auto __free = capacity() - size(); __first != __last && __free > 0; ++__first, (void) --__free) emplace_back(*__first); if (__first == __last) return; vector __tmp(_M_get_Tp_allocator()); for (; __first != __last; ++__first) __tmp.emplace_back(*__first); reserve(_M_check_len(__tmp.size(), "vector::append_range")); ranges::subrange __r(std::make_move_iterator(__tmp.begin()), std::make_move_iterator(__tmp.end())); append_range(__r); } } # 1789 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr iterator erase(const_iterator __position) { return _M_erase(begin() + (__position - cbegin())); } # 1817 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr iterator erase(const_iterator __first, const_iterator __last) { const auto __beg = begin(); const auto __cbeg = cbegin(); return _M_erase(__beg + (__first - __cbeg), __beg + (__last - __cbeg)); } # 1842 "/usr/include/c++/15/bits/stl_vector.h" 3 constexpr void swap(vector& __x) noexcept { do { if (std::__is_constant_evaluated() && !bool(_Alloc_traits::propagate_on_container_swap::value || _M_get_Tp_allocator() == __x._M_get_Tp_allocator())) std::__glibcxx_assert_fail(); } while (false) ; this->_M_impl._M_swap_data(__x._M_impl); _Alloc_traits::_S_on_swap(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } constexpr void clear() noexcept { _M_erase_at_end(this->_M_impl._M_start); } private: struct _Guard_alloc { pointer _M_storage; size_type _M_len; _Base& _M_vect; constexpr _Guard_alloc(pointer __s, size_type __l, _Base& __vect) : _M_storage(__s), _M_len(__l), _M_vect(__vect) { } constexpr ~_Guard_alloc() { if (_M_storage) _M_vect._M_deallocate(_M_storage, _M_len); } constexpr pointer _M_release() { pointer __res = _M_storage; _M_storage = pointer(); return __res; } private: _Guard_alloc(const _Guard_alloc&); }; protected: template constexpr pointer _M_allocate_and_copy(size_type __n, _ForwardIterator __first, _ForwardIterator __last) { _Guard_alloc __guard(this->_M_allocate(__n), __n, *this); std::__uninitialized_copy_a (__first, __last, __guard._M_storage, _M_get_Tp_allocator()); return __guard._M_release(); } # 1948 "/usr/include/c++/15/bits/stl_vector.h" 3 template constexpr void _M_range_initialize(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { try { for (; __first != __last; ++__first) emplace_back(*__first); } catch(...) { clear(); throw; } } template constexpr void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { _M_range_initialize_n(__first, __last, std::distance(__first, __last)); } template constexpr void _M_range_initialize_n(_Iterator __first, _Sentinel __last, size_type __n) { pointer __start = this->_M_allocate(_S_check_init_len(__n, _M_get_Tp_allocator())); this->_M_impl._M_start = this->_M_impl._M_finish = __start; this->_M_impl._M_end_of_storage = __start + __n; this->_M_impl._M_finish = std::__uninitialized_copy_a(std::move(__first), __last, __start, _M_get_Tp_allocator()); } constexpr void _M_fill_initialize(size_type __n, const value_type& __value) { this->_M_impl._M_finish = std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value, _M_get_Tp_allocator()); } constexpr void _M_default_initialize(size_type __n) { this->_M_impl._M_finish = std::__uninitialized_default_n_a(this->_M_impl._M_start, __n, _M_get_Tp_allocator()); } # 2023 "/usr/include/c++/15/bits/stl_vector.h" 3 template constexpr void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) { _M_fill_assign(__n, __val); } template constexpr void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { _M_assign_aux(__first, __last, std::__iterator_category(__first)); } template constexpr void _M_assign_aux(_InputIterator __first, _InputIterator __last, std::input_iterator_tag); template constexpr void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag); constexpr void _M_fill_assign(size_type __n, const value_type& __val); template constexpr void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val, __true_type) { _M_fill_insert(__pos, __n, __val); } template constexpr void _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { _M_range_insert(__pos, __first, __last, std::__iterator_category(__first)); } template constexpr void _M_range_insert(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag); template constexpr void _M_range_insert(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag); constexpr void _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); constexpr void _M_fill_append(size_type __n, const value_type& __x); constexpr void _M_default_append(size_type __n); constexpr bool _M_shrink_to_fit(); # 2130 "/usr/include/c++/15/bits/stl_vector.h" 3 struct _Temporary_value { template constexpr explicit _Temporary_value(vector* __vec, _Args&&... __args) : _M_this(__vec) { _Alloc_traits::construct(_M_this->_M_impl, _M_ptr(), std::forward<_Args>(__args)...); } constexpr ~_Temporary_value() { _Alloc_traits::destroy(_M_this->_M_impl, _M_ptr()); } constexpr value_type& _M_val() noexcept { return _M_storage._M_val; } private: constexpr _Tp* _M_ptr() noexcept { return std::__addressof(_M_storage._M_val); } union _Storage { constexpr _Storage() : _M_byte() { } constexpr ~_Storage() { } _Storage& operator=(const _Storage&) = delete; unsigned char _M_byte; _Tp _M_val; }; vector* _M_this; _Storage _M_storage; }; template constexpr void _M_insert_aux(iterator __position, _Arg&& __arg); template constexpr void _M_realloc_insert(iterator __position, _Args&&... __args); template constexpr void _M_realloc_append(_Args&&... __args); constexpr iterator _M_insert_rval(const_iterator __position, value_type&& __v); template constexpr iterator _M_emplace_aux(const_iterator __position, _Args&&... __args); constexpr iterator _M_emplace_aux(const_iterator __position, value_type&& __v) { return _M_insert_rval(__position, std::move(__v)); } constexpr size_type _M_check_len(size_type __n, const char* __s) const { if (max_size() - size() < __n) __throw_length_error((__s)); const size_type __len = size() + (std::max)(size(), __n); return (__len < size() || __len > max_size()) ? max_size() : __len; } static constexpr size_type _S_check_init_len(size_type __n, const allocator_type& __a) { if (__n > _S_max_size(_Tp_alloc_type(__a))) __throw_length_error( ("cannot create std::vector larger than max_size()")); return __n; } static constexpr size_type _S_max_size(const _Tp_alloc_type& __a) noexcept { const size_t __diffmax = __gnu_cxx::__numeric_traits::__max / sizeof(_Tp); const size_t __allocmax = _Alloc_traits::max_size(__a); return (std::min)(__diffmax, __allocmax); } constexpr void _M_erase_at_end(pointer __pos) noexcept { if (size_type __n = this->_M_impl._M_finish - __pos) { std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __pos; ; } } constexpr iterator _M_erase(iterator __position); constexpr iterator _M_erase(iterator __first, iterator __last); private: constexpr void _M_move_assign(vector&& __x, true_type) noexcept { vector __tmp(get_allocator()); this->_M_impl._M_swap_data(__x._M_impl); __tmp._M_impl._M_swap_data(__x._M_impl); std::__alloc_on_move(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } constexpr void _M_move_assign(vector&& __x, false_type) { if (__x._M_get_Tp_allocator() == this->_M_get_Tp_allocator()) _M_move_assign(std::move(__x), true_type()); else { this->_M_assign_aux(std::make_move_iterator(__x.begin()), std::make_move_iterator(__x.end()), std::random_access_iterator_tag()); __x.clear(); } } template constexpr _Up* _M_data_ptr(_Up* __ptr) const noexcept { return __ptr; } template constexpr typename std::pointer_traits<_Ptr>::element_type* _M_data_ptr(_Ptr __ptr) const { return empty() ? nullptr : std::__to_address(__ptr); } }; template::value_type, typename _Allocator = allocator<_ValT>, typename = _RequireInputIter<_InputIterator>, typename = _RequireAllocator<_Allocator>> vector(_InputIterator, _InputIterator, _Allocator = _Allocator()) -> vector<_ValT, _Allocator>; template>> vector(from_range_t, _Rg&&, _Alloc = _Alloc()) -> vector, _Alloc>; # 2340 "/usr/include/c++/15/bits/stl_vector.h" 3 template [[__nodiscard__]] constexpr inline bool operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return (__x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin())); } # 2359 "/usr/include/c++/15/bits/stl_vector.h" 3 template [[nodiscard]] constexpr __detail::__synth3way_t<_Tp> operator<=>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __detail::__synth3way); } # 2412 "/usr/include/c++/15/bits/stl_vector.h" 3 template constexpr inline void swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } namespace __detail::__variant { template struct _Never_valueless_alt; template struct _Never_valueless_alt> : std::is_nothrow_move_assignable> { }; } } # 69 "/usr/include/c++/15/vector" 2 3 # 1 "/usr/include/c++/15/bits/stl_bvector.h" 1 3 # 68 "/usr/include/c++/15/bits/stl_bvector.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { typedef unsigned long _Bit_type; enum { _S_word_bit = int(8 * sizeof(_Bit_type)) }; __attribute__((__nonnull__)) constexpr void __fill_bvector_n(_Bit_type*, size_t, bool) noexcept; struct _Bit_reference { private: template friend class vector; friend struct _Bit_iterator; friend struct _Bit_const_iterator; constexpr _Bit_reference() noexcept : _M_p(0), _M_mask(0) { } _Bit_type * _M_p; _Bit_type _M_mask; constexpr _Bit_reference(_Bit_type * __x, _Bit_type __y) : _M_p(__x), _M_mask(__y) { } public: _Bit_reference(const _Bit_reference&) = default; [[__nodiscard__]] constexpr operator bool() const noexcept { return !!(*_M_p & _M_mask); } constexpr _Bit_reference& operator=(bool __x) noexcept { if (__x) *_M_p |= _M_mask; else *_M_p &= ~_M_mask; return *this; } constexpr const _Bit_reference& operator=(bool __x) const noexcept { if (__x) *_M_p |= _M_mask; else *_M_p &= ~_M_mask; return *this; } constexpr _Bit_reference& operator=(const _Bit_reference& __x) noexcept { return *this = bool(__x); } [[__nodiscard__]] constexpr bool operator==(const _Bit_reference& __x) const { return bool(*this) == bool(__x); } [[__nodiscard__]] constexpr bool operator<(const _Bit_reference& __x) const { return !bool(*this) && bool(__x); } constexpr void flip() noexcept { *_M_p ^= _M_mask; } constexpr friend void swap(_Bit_reference __x, _Bit_reference __y) noexcept { bool __tmp = __x; __x = __y; __y = __tmp; } constexpr friend void swap(_Bit_reference __x, bool& __y) noexcept { bool __tmp = __x; __x = __y; __y = __tmp; } constexpr friend void swap(bool& __x, _Bit_reference __y) noexcept { bool __tmp = __x; __x = __y; __y = __tmp; } }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" struct _Bit_iterator_base : public std::iterator { _Bit_type * _M_p; unsigned int _M_offset; constexpr inline __attribute__((__always_inline__)) void _M_assume_normalized() const { unsigned int __ofst = _M_offset; __attribute__ ((__assume__ (__ofst < unsigned(_S_word_bit)))); } constexpr _Bit_iterator_base(_Bit_type * __x, unsigned int __y) : _M_p(__x), _M_offset(__y) { } constexpr void _M_bump_up() { _M_assume_normalized(); if (_M_offset++ == int(_S_word_bit) - 1) { _M_offset = 0; ++_M_p; } } constexpr void _M_bump_down() { _M_assume_normalized(); if (_M_offset-- == 0) { _M_offset = int(_S_word_bit) - 1; --_M_p; } } constexpr void _M_incr(ptrdiff_t __i) { _M_assume_normalized(); difference_type __n = __i + _M_offset; _M_p += __n / int(_S_word_bit); __n = __n % int(_S_word_bit); if (__n < 0) { __n += int(_S_word_bit); --_M_p; } _M_offset = static_cast(__n); } [[__nodiscard__]] friend constexpr bool operator==(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) { __x._M_assume_normalized(); __y._M_assume_normalized(); return __x._M_p == __y._M_p && __x._M_offset == __y._M_offset; } [[nodiscard]] friend constexpr strong_ordering operator<=>(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) noexcept { __x._M_assume_normalized(); __y._M_assume_normalized(); if (const auto __cmp = __x._M_p <=> __y._M_p; __cmp != 0) return __cmp; return __x._M_offset <=> __y._M_offset; } # 297 "/usr/include/c++/15/bits/stl_bvector.h" 3 friend constexpr ptrdiff_t operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) { __x._M_assume_normalized(); __y._M_assume_normalized(); return (int(_S_word_bit) * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset); } }; #pragma GCC diagnostic pop struct _Bit_iterator : public _Bit_iterator_base { typedef _Bit_reference reference; typedef void pointer; typedef _Bit_iterator iterator; constexpr _Bit_iterator() : _Bit_iterator_base(0, 0) { } constexpr _Bit_iterator(_Bit_type * __x, unsigned int __y) : _Bit_iterator_base(__x, __y) { } constexpr iterator _M_const_cast() const { return *this; } [[__nodiscard__]] constexpr reference operator*() const { _M_assume_normalized(); return reference(_M_p, 1UL << _M_offset); } constexpr iterator& operator++() { _M_bump_up(); return *this; } constexpr iterator operator++(int) { iterator __tmp = *this; _M_bump_up(); return __tmp; } constexpr iterator& operator--() { _M_bump_down(); return *this; } constexpr iterator operator--(int) { iterator __tmp = *this; _M_bump_down(); return __tmp; } constexpr iterator& operator+=(difference_type __i) { _M_incr(__i); return *this; } constexpr iterator& operator-=(difference_type __i) { *this += -__i; return *this; } [[__nodiscard__]] constexpr reference operator[](difference_type __i) const { return *(*this + __i); } [[__nodiscard__]] friend constexpr iterator operator+(const iterator& __x, difference_type __n) { iterator __tmp = __x; __tmp += __n; return __tmp; } [[__nodiscard__]] friend constexpr iterator operator+(difference_type __n, const iterator& __x) { return __x + __n; } [[__nodiscard__]] friend constexpr iterator operator-(const iterator& __x, difference_type __n) { iterator __tmp = __x; __tmp -= __n; return __tmp; } }; struct _Bit_const_iterator : public _Bit_iterator_base { typedef bool reference; typedef bool const_reference; typedef void pointer; typedef _Bit_const_iterator const_iterator; constexpr _Bit_const_iterator() : _Bit_iterator_base(0, 0) { } constexpr _Bit_const_iterator(_Bit_type * __x, unsigned int __y) : _Bit_iterator_base(__x, __y) { } constexpr _Bit_const_iterator(const _Bit_iterator& __x) : _Bit_iterator_base(__x._M_p, __x._M_offset) { } constexpr _Bit_iterator _M_const_cast() const { return _Bit_iterator(_M_p, _M_offset); } [[__nodiscard__]] constexpr const_reference operator*() const { _M_assume_normalized(); return _Bit_reference(_M_p, 1UL << _M_offset); } constexpr const_iterator& operator++() { _M_bump_up(); return *this; } constexpr const_iterator operator++(int) { const_iterator __tmp = *this; _M_bump_up(); return __tmp; } constexpr const_iterator& operator--() { _M_bump_down(); return *this; } constexpr const_iterator operator--(int) { const_iterator __tmp = *this; _M_bump_down(); return __tmp; } constexpr const_iterator& operator+=(difference_type __i) { _M_incr(__i); return *this; } constexpr const_iterator& operator-=(difference_type __i) { *this += -__i; return *this; } [[__nodiscard__]] constexpr const_reference operator[](difference_type __i) const { return *(*this + __i); } [[__nodiscard__]] friend constexpr const_iterator operator+(const const_iterator& __x, difference_type __n) { const_iterator __tmp = __x; __tmp += __n; return __tmp; } [[__nodiscard__]] friend constexpr const_iterator operator-(const const_iterator& __x, difference_type __n) { const_iterator __tmp = __x; __tmp -= __n; return __tmp; } [[__nodiscard__]] friend constexpr const_iterator operator+(difference_type __n, const const_iterator& __x) { return __x + __n; } }; template struct _Bvector_base { typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Bit_type>::other _Bit_alloc_type; typedef typename __gnu_cxx::__alloc_traits<_Bit_alloc_type> _Bit_alloc_traits; typedef typename _Bit_alloc_traits::pointer _Bit_pointer; struct _Bvector_impl_data { _Bit_iterator _M_start; # 553 "/usr/include/c++/15/bits/stl_bvector.h" 3 _Bit_iterator _M_finish; _Bit_pointer _M_end_of_storage; constexpr _Bvector_impl_data() noexcept : _M_start(), _M_finish(), _M_end_of_storage() { } _Bvector_impl_data(const _Bvector_impl_data&) = default; _Bvector_impl_data& operator=(const _Bvector_impl_data&) = default; constexpr _Bvector_impl_data(_Bvector_impl_data&& __x) noexcept : _Bvector_impl_data(__x) { __x._M_reset(); } constexpr void _M_move_data(_Bvector_impl_data&& __x) noexcept { *this = __x; __x._M_reset(); } constexpr void _M_reset() noexcept { *this = _Bvector_impl_data(); } constexpr void _M_swap_data(_Bvector_impl_data& __x) noexcept { std::swap(*this, __x); } }; struct _Bvector_impl : public _Bit_alloc_type, public _Bvector_impl_data { constexpr _Bvector_impl() noexcept(is_nothrow_default_constructible<_Bit_alloc_type>::value) requires is_default_constructible_v<_Bit_alloc_type> : _Bit_alloc_type() { } constexpr _Bvector_impl(const _Bit_alloc_type& __a) noexcept : _Bit_alloc_type(__a) { } constexpr _Bvector_impl(_Bvector_impl&& __x) noexcept : _Bit_alloc_type(std::move(__x)), _Bvector_impl_data(std::move(__x)) { } constexpr _Bvector_impl(_Bit_alloc_type&& __a, _Bvector_impl&& __x) noexcept : _Bit_alloc_type(std::move(__a)), _Bvector_impl_data(std::move(__x)) { } constexpr _Bit_type* _M_end_addr() const noexcept { if (this->_M_end_of_storage) return std::__addressof(this->_M_end_of_storage[-1]) + 1; return 0; } }; public: typedef _Alloc allocator_type; constexpr _Bit_alloc_type& _M_get_Bit_allocator() noexcept { return this->_M_impl; } constexpr const _Bit_alloc_type& _M_get_Bit_allocator() const noexcept { return this->_M_impl; } constexpr allocator_type get_allocator() const noexcept { return allocator_type(_M_get_Bit_allocator()); } _Bvector_base() = default; constexpr _Bvector_base(const allocator_type& __a) : _M_impl(_Bit_alloc_type(__a)) { } _Bvector_base(_Bvector_base&&) = default; constexpr _Bvector_base(_Bvector_base&& __x, const allocator_type& __a) noexcept : _M_impl(_Bit_alloc_type(__a), std::move(__x._M_impl)) { } constexpr ~_Bvector_base() { this->_M_deallocate(); } protected: _Bvector_impl _M_impl; constexpr _Bit_pointer _M_allocate(size_t __n) { _Bit_pointer __p = _Bit_alloc_traits::allocate(_M_impl, _S_nword(__n)); if (std::is_constant_evaluated()) { __n = _S_nword(__n); for (size_t __i = 0; __i < __n; ++__i) std::construct_at(std::to_address(__p) + __i); } return __p; } constexpr void _M_deallocate() { if (_M_impl._M_start._M_p) { const size_t __n = _M_impl._M_end_addr() - _M_impl._M_start._M_p; _Bit_alloc_traits::deallocate(_M_impl, _M_impl._M_end_of_storage - __n, __n); _M_impl._M_reset(); } } constexpr void _M_move_data(_Bvector_base&& __x) noexcept { _M_impl._M_move_data(std::move(__x._M_impl)); } constexpr static size_t _S_nword(size_t __n) { return (__n + int(_S_word_bit) - 1) / int(_S_word_bit); } }; # 745 "/usr/include/c++/15/bits/stl_bvector.h" 3 template class vector : protected _Bvector_base<_Alloc> { typedef _Bvector_base<_Alloc> _Base; typedef typename _Base::_Bit_pointer _Bit_pointer; typedef typename _Base::_Bit_alloc_traits _Bit_alloc_traits; friend struct std::hash; static_assert(is_same::value, "std::vector must have the same value_type as its allocator"); public: typedef bool value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Bit_reference reference; typedef bool const_reference; typedef _Bit_reference* pointer; typedef const bool* const_pointer; typedef _Bit_iterator iterator; typedef _Bit_const_iterator const_iterator; typedef std::reverse_iterator const_reverse_iterator; typedef std::reverse_iterator reverse_iterator; typedef _Alloc allocator_type; constexpr allocator_type get_allocator() const { return _Base::get_allocator(); } protected: using _Base::_M_allocate; using _Base::_M_deallocate; using _Base::_S_nword; using _Base::_M_get_Bit_allocator; public: vector() = default; constexpr explicit vector(const allocator_type& __a) noexcept : _Base(__a) { } constexpr explicit vector(size_type __n, const allocator_type& __a = allocator_type()) : vector(__n, false, __a) { } constexpr vector(size_type __n, const bool& __value, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize(__n); _M_initialize_value(__value); } constexpr vector(const vector& __x) : _Base(_Bit_alloc_traits::_S_select_on_copy(__x._M_get_Bit_allocator())) { const_iterator __xbegin = __x.begin(), __xend = __x.end(); _M_initialize(__x.size()); _M_copy_aligned(__xbegin, __xend, begin()); } vector(vector&&) = default; private: constexpr vector(vector&& __x, const allocator_type& __a, true_type) noexcept : _Base(std::move(__x), __a) { } constexpr vector(vector&& __x, const allocator_type& __a, false_type) : _Base(__a) { if (__x.get_allocator() == __a) this->_M_move_data(std::move(__x)); else { _M_initialize(__x.size()); _M_copy_aligned(__x.begin(), __x.end(), begin()); __x.clear(); } } public: constexpr vector(vector&& __x, const __type_identity_t& __a) noexcept(_Bit_alloc_traits::_S_always_equal()) : vector(std::move(__x), __a, typename _Bit_alloc_traits::is_always_equal{}) { } constexpr vector(const vector& __x, const __type_identity_t& __a) : _Base(__a) { _M_initialize(__x.size()); _M_copy_aligned(__x.begin(), __x.end(), begin()); } constexpr vector(initializer_list __l, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize_range(__l.begin(), __l.end(), random_access_iterator_tag()); } template> constexpr vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize_range(__first, __last, std::__iterator_category(__first)); } # 905 "/usr/include/c++/15/bits/stl_bvector.h" 3 template<__detail::__container_compatible_range _Rg> constexpr vector(from_range_t, _Rg&& __rg, const _Alloc& __a = _Alloc()) : _Base(__a) { if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>) { _M_initialize(size_type(ranges::distance(__rg))); ranges::copy(__rg, begin()); } else { auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); for (; __first != __last; ++__first) emplace_back(*__first); } } constexpr ~vector() noexcept { } constexpr vector& operator=(const vector& __x) { if (&__x == this) return *this; if (_Bit_alloc_traits::_S_propagate_on_copy_assign()) { if (this->_M_get_Bit_allocator() != __x._M_get_Bit_allocator()) { this->_M_deallocate(); std::__alloc_on_copy(_M_get_Bit_allocator(), __x._M_get_Bit_allocator()); _M_initialize(__x.size()); } else std::__alloc_on_copy(_M_get_Bit_allocator(), __x._M_get_Bit_allocator()); } if (__x.size() > capacity()) { this->_M_deallocate(); _M_initialize(__x.size()); } this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(), begin()); return *this; } constexpr vector& operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move()) { if (_Bit_alloc_traits::_S_propagate_on_move_assign() || this->_M_get_Bit_allocator() == __x._M_get_Bit_allocator()) { this->_M_deallocate(); this->_M_move_data(std::move(__x)); std::__alloc_on_move(_M_get_Bit_allocator(), __x._M_get_Bit_allocator()); } else { if (__x.size() > capacity()) { this->_M_deallocate(); _M_initialize(__x.size()); } this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(), begin()); __x.clear(); } return *this; } constexpr vector& operator=(initializer_list __l) { this->assign(__l.begin(), __l.end()); return *this; } constexpr void assign(size_type __n, const bool& __x) { _M_fill_assign(__n, __x); } template> constexpr void assign(_InputIterator __first, _InputIterator __last) { _M_assign_aux(__first, __last, std::__iterator_category(__first)); } # 1023 "/usr/include/c++/15/bits/stl_bvector.h" 3 constexpr void assign(initializer_list __l) { _M_assign_aux(__l.begin(), __l.end(), random_access_iterator_tag()); } # 1036 "/usr/include/c++/15/bits/stl_bvector.h" 3 template<__detail::__container_compatible_range _Rg> constexpr void assign_range(_Rg&& __rg) { static_assert(assignable_from>); if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>) { if (auto __n = size_type(ranges::distance(__rg))) { reserve(__n); this->_M_impl._M_finish = ranges::copy(std::forward<_Rg>(__rg), begin()).out; } else clear(); } else { clear(); auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); for (; __first != __last; ++__first) emplace_back(*__first); } } [[__nodiscard__]] constexpr iterator begin() noexcept { return iterator(this->_M_impl._M_start._M_p, 0); } [[__nodiscard__]] constexpr const_iterator begin() const noexcept { return const_iterator(this->_M_impl._M_start._M_p, 0); } [[__nodiscard__]] constexpr iterator end() noexcept { return this->_M_impl._M_finish; } [[__nodiscard__]] constexpr const_iterator end() const noexcept { return this->_M_impl._M_finish; } [[__nodiscard__]] constexpr reverse_iterator rbegin() noexcept { return reverse_iterator(end()); } [[__nodiscard__]] constexpr const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); } [[__nodiscard__]] constexpr reverse_iterator rend() noexcept { return reverse_iterator(begin()); } [[__nodiscard__]] constexpr const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); } [[__nodiscard__]] constexpr const_iterator cbegin() const noexcept { return const_iterator(this->_M_impl._M_start._M_p, 0); } [[__nodiscard__]] constexpr const_iterator cend() const noexcept { return this->_M_impl._M_finish; } [[__nodiscard__]] constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); } [[__nodiscard__]] constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); } [[__nodiscard__]] constexpr size_type size() const noexcept { return size_type(end() - begin()); } [[__nodiscard__]] constexpr size_type max_size() const noexcept { const size_type __isize = __gnu_cxx::__numeric_traits::__max - int(_S_word_bit) + 1; const size_type __asize = _Bit_alloc_traits::max_size(_M_get_Bit_allocator()); return (__asize <= __isize / int(_S_word_bit) ? __asize * int(_S_word_bit) : __isize); } [[__nodiscard__]] constexpr size_type capacity() const noexcept { return size_type(const_iterator(this->_M_impl._M_end_addr(), 0) - begin()); } [[__nodiscard__]] constexpr bool empty() const noexcept { return begin() == end(); } [[__nodiscard__]] constexpr reference operator[](size_type __n) { do { if (std::__is_constant_evaluated() && !bool(__n < this->size())) std::__glibcxx_assert_fail(); } while (false); return _Bit_reference (this->_M_impl._M_start._M_p + __n / int(_S_word_bit), 1UL << __n % int(_S_word_bit)); } [[__nodiscard__]] constexpr const_reference operator[](size_type __n) const { do { if (std::__is_constant_evaluated() && !bool(__n < this->size())) std::__glibcxx_assert_fail(); } while (false); return _Bit_reference (this->_M_impl._M_start._M_p + __n / int(_S_word_bit), 1UL << __n % int(_S_word_bit)); } protected: constexpr void _M_range_check(size_type __n) const { if (__n >= this->size()) __throw_out_of_range_fmt(("vector::_M_range_check: __n " "(which is %zu) >= this->size() " "(which is %zu)") , __n, this->size()); } public: [[__nodiscard__]] constexpr reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } [[__nodiscard__]] constexpr const_reference at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; } constexpr void reserve(size_type __n) { if (__n > max_size()) __throw_length_error(("vector::reserve")); if (capacity() < __n) _M_reallocate(__n); } [[__nodiscard__]] constexpr reference front() { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *begin(); } [[__nodiscard__]] constexpr const_reference front() const { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *begin(); } [[__nodiscard__]] constexpr reference back() { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *(end() - 1); } [[__nodiscard__]] constexpr const_reference back() const { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return *(end() - 1); } constexpr void push_back(bool __x) { if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr()) *this->_M_impl._M_finish++ = __x; else _M_insert_aux(end(), __x); } constexpr void swap(vector& __x) noexcept { do { if (std::__is_constant_evaluated() && !bool(_Bit_alloc_traits::propagate_on_container_swap::value || _M_get_Bit_allocator() == __x._M_get_Bit_allocator())) std::__glibcxx_assert_fail(); } while (false) ; this->_M_impl._M_swap_data(__x._M_impl); _Bit_alloc_traits::_S_on_swap(_M_get_Bit_allocator(), __x._M_get_Bit_allocator()); } constexpr static void swap(reference __x, reference __y) noexcept { bool __tmp = __x; __x = __y; __y = __tmp; } constexpr iterator insert(const_iterator __position, const bool& __x) { const difference_type __n = __position - begin(); if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr() && __position == end()) *this->_M_impl._M_finish++ = __x; else _M_insert_aux(__position._M_const_cast(), __x); return begin() + __n; } __attribute__ ((__deprecated__ ("use '" "insert(position, false)" "' instead"))) iterator insert(const_iterator __position) { return this->insert(__position._M_const_cast(), false); } template> constexpr iterator insert(const_iterator __position, _InputIterator __first, _InputIterator __last) { difference_type __offset = __position - cbegin(); _M_insert_range(__position._M_const_cast(), __first, __last, std::__iterator_category(__first)); return begin() + __offset; } # 1329 "/usr/include/c++/15/bits/stl_bvector.h" 3 constexpr iterator insert(const_iterator __position, size_type __n, const bool& __x) { difference_type __offset = __position - cbegin(); _M_fill_insert(__position._M_const_cast(), __n, __x); return begin() + __offset; } constexpr iterator insert(const_iterator __p, initializer_list __l) { return this->insert(__p, __l.begin(), __l.end()); } # 1359 "/usr/include/c++/15/bits/stl_bvector.h" 3 template<__detail::__container_compatible_range _Rg> constexpr iterator insert_range(const_iterator __pos, _Rg&& __rg) { if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>) { if (auto __n = size_type(ranges::distance(__rg))) { if (capacity() - size() >= __n) { std::copy_backward(__pos._M_const_cast(), end(), this->_M_impl._M_finish + difference_type(__n)); ranges::copy(__rg, __pos._M_const_cast()); this->_M_impl._M_finish += difference_type(__n); return __pos._M_const_cast(); } else { const size_type __len = _M_check_len(__n, "vector::insert_range"); const iterator __begin = begin(), __end = end(); _Bit_pointer __q = this->_M_allocate(__len); iterator __start(std::__addressof(*__q), 0); iterator __i = _M_copy_aligned(__begin, __pos._M_const_cast(), __start); iterator __j = ranges::copy(__rg, __i).out; iterator __finish = std::copy(__pos._M_const_cast(), __end, __j); this->_M_deallocate(); this->_M_impl._M_end_of_storage = __q + _S_nword(__len); this->_M_impl._M_start = __start; this->_M_impl._M_finish = __finish; return __i; } } else return __pos._M_const_cast(); } else return insert_range(__pos, vector(from_range, __rg, get_allocator())); } template<__detail::__container_compatible_range _Rg> constexpr void append_range(_Rg&& __rg) { if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>) { const auto __n = size_type(ranges::distance(__rg)); if (capacity() == 0) reserve(__n); const auto __sz = size(); const auto __capacity = capacity(); if ((__capacity - __sz) >= __n) { this->_M_impl._M_finish = ranges::copy(std::forward<_Rg>(__rg), end()).out; return; } vector __tmp(get_allocator()); __tmp.reserve(_M_check_len(__n, "vector::append_range")); __tmp._M_impl._M_finish = _M_copy_aligned(cbegin(), cend(), __tmp.begin()); __tmp._M_impl._M_finish = ranges::copy(std::forward<_Rg>(__rg), __tmp.end()).out; swap(__tmp); } else { auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); for (auto __free = capacity() - size(); __first != __last && __free > 0; ++__first, (void) --__free) emplace_back(*__first); if (__first == __last) return; ranges::subrange __rest(std::move(__first), __last); vector __tmp(from_range, __rest, get_allocator()); insert(end(), __tmp.begin(), __tmp.end()); } } constexpr void pop_back() { --this->_M_impl._M_finish; } constexpr iterator erase(const_iterator __position) { return _M_erase(__position._M_const_cast()); } constexpr iterator erase(const_iterator __first, const_iterator __last) { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); } constexpr void resize(size_type __new_size, bool __x = bool()) { if (__new_size < size()) _M_erase_at_end(begin() + difference_type(__new_size)); else insert(end(), __new_size - size(), __x); } constexpr void shrink_to_fit() { _M_shrink_to_fit(); } constexpr void flip() noexcept { _Bit_type * const __end = this->_M_impl._M_end_addr(); for (_Bit_type * __p = this->_M_impl._M_start._M_p; __p != __end; ++__p) *__p = ~*__p; } constexpr void clear() noexcept { _M_erase_at_end(begin()); } template constexpr reference emplace_back(_Args&&... __args) { push_back(bool(std::forward<_Args>(__args)...)); return back(); } template constexpr iterator emplace(const_iterator __pos, _Args&&... __args) { return insert(__pos, bool(std::forward<_Args>(__args)...)); } protected: constexpr iterator _M_copy_aligned(const_iterator __first, const_iterator __last, iterator __result) { _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p); return std::copy(const_iterator(__last._M_p, 0), __last, iterator(__q, 0)); } constexpr void _M_initialize(size_type __n) { if (__n) { _Bit_pointer __q = this->_M_allocate(__n); this->_M_impl._M_end_of_storage = __q + _S_nword(__n); iterator __start = iterator(std::__addressof(*__q), 0); this->_M_impl._M_start = __start; this->_M_impl._M_finish = __start + difference_type(__n); } } constexpr void _M_initialize_value(bool __x) noexcept { if (_Bit_type* __p = this->_M_impl._M_start._M_p) __fill_bvector_n(__p, this->_M_impl._M_end_addr() - __p, __x); } constexpr void _M_reallocate(size_type __n); constexpr bool _M_shrink_to_fit(); # 1603 "/usr/include/c++/15/bits/stl_bvector.h" 3 template constexpr void _M_initialize_range(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) push_back(*__first); } template constexpr void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); _M_initialize(__n); std::copy(__first, __last, begin()); } # 1639 "/usr/include/c++/15/bits/stl_bvector.h" 3 constexpr void _M_fill_assign(size_t __n, bool __x) { if (__n > size()) { _M_initialize_value(__x); insert(end(), __n - size(), __x); } else { _M_erase_at_end(begin() + __n); _M_initialize_value(__x); } } template constexpr void _M_assign_aux(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { iterator __cur = begin(); for (; __first != __last && __cur != end(); ++__cur, (void)++__first) *__cur = *__first; if (__first == __last) _M_erase_at_end(__cur); else insert(end(), __first, __last); } template constexpr void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __len = std::distance(__first, __last); if (__len < size()) _M_erase_at_end(std::copy(__first, __last, begin())); else { _ForwardIterator __mid = __first; std::advance(__mid, size()); std::copy(__first, __mid, begin()); insert(end(), __mid, __last); } } # 1706 "/usr/include/c++/15/bits/stl_bvector.h" 3 constexpr void _M_fill_insert(iterator __position, size_type __n, bool __x); template constexpr void _M_insert_range(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) { __pos = insert(__pos, *__first); ++__pos; } } template constexpr void _M_insert_range(iterator __position, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag); constexpr void _M_insert_aux(iterator __position, bool __x); constexpr size_type _M_check_len(size_type __n, const char* __s) const { if (max_size() - size() < __n) __throw_length_error((__s)); const size_type __len = size() + std::max(size(), __n); return (__len < size() || __len > max_size()) ? max_size() : __len; } constexpr void _M_erase_at_end(iterator __pos) { this->_M_impl._M_finish = __pos; } constexpr iterator _M_erase(iterator __pos); constexpr iterator _M_erase(iterator __first, iterator __last); protected: void data() = delete; }; constexpr inline void __fill_bvector(_Bit_type* __v, unsigned int __first, unsigned int __last, bool __x) noexcept { const _Bit_type __fmask = ~0ul << __first; const _Bit_type __lmask = ~0ul >> (_S_word_bit - __last); const _Bit_type __mask = __fmask & __lmask; if (__x) *__v |= __mask; else *__v &= ~__mask; } __attribute__((__nonnull__)) constexpr inline void __fill_bvector_n(_Bit_type* __p, size_t __n, bool __x) noexcept { if (std::is_constant_evaluated()) { for (size_t __i = 0; __i < __n; ++__i) __p[__i] = __x ? ~0ul : 0ul; return; } __builtin_memset(__p, __x ? ~0 : 0, __n * sizeof(_Bit_type)); } constexpr inline void __fill_a1(std::_Bit_iterator __first, std::_Bit_iterator __last, const bool& __x) { if (__first._M_p != __last._M_p) { _Bit_type* __first_p = __first._M_p; if (__first._M_offset != 0) __fill_bvector(__first_p++, __first._M_offset, _S_word_bit, __x); __fill_bvector_n(__first_p, __last._M_p - __first_p, __x); if (__last._M_offset != 0) __fill_bvector(__last._M_p, 0, __last._M_offset, __x); } else if (__first._M_offset != __last._M_offset) __fill_bvector(__first._M_p, __first._M_offset, __last._M_offset, __x); } template struct hash> : public __hash_base> { size_t operator()(const std::vector&) const noexcept; }; } # 70 "/usr/include/c++/15/vector" 2 3 # 1 "/usr/include/c++/15/bits/vector.tcc" 1 3 # 59 "/usr/include/c++/15/bits/vector.tcc" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template constexpr void vector<_Tp, _Alloc>:: reserve(size_type __n) { if (__n > this->max_size()) __throw_length_error(("vector::reserve")); if (this->capacity() < __n) { const size_type __old_size = size(); pointer __tmp; if constexpr (_S_use_relocate()) { __tmp = this->_M_allocate(__n); _S_relocate(this->_M_impl._M_start, this->_M_impl._M_finish, __tmp, _M_get_Tp_allocator()); } else { __tmp = _M_allocate_and_copy(__n, std::__make_move_if_noexcept_iterator(this->_M_impl._M_start), std::__make_move_if_noexcept_iterator(this->_M_impl._M_finish)); std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); } ; _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __tmp; this->_M_impl._M_finish = __tmp + __old_size; this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; } } template template constexpr typename vector<_Tp, _Alloc>::reference vector<_Tp, _Alloc>:: emplace_back(_Args&&... __args) { if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) { ; _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, std::forward<_Args>(__args)...); ++this->_M_impl._M_finish; ; } else _M_realloc_append(std::forward<_Args>(__args)...); return back(); } template constexpr typename vector<_Tp, _Alloc>::iterator vector<_Tp, _Alloc>:: insert(const_iterator __position, const value_type& __x) { const size_type __n = __position - begin(); if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) { do { if (std::__is_constant_evaluated() && !bool(__position != const_iterator())) std::__glibcxx_assert_fail(); } while (false); if (!(__position != const_iterator())) __builtin_unreachable(); if (__position == end()) { ; _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, __x); ++this->_M_impl._M_finish; ; } else { const auto __pos = begin() + (__position - cbegin()); _Temporary_value __x_copy(this, __x); _M_insert_aux(__pos, std::move(__x_copy._M_val())); } } else _M_realloc_insert(begin() + (__position - cbegin()), __x); return iterator(this->_M_impl._M_start + __n); } template constexpr typename vector<_Tp, _Alloc>::iterator vector<_Tp, _Alloc>:: _M_erase(iterator __position) { if (__position + 1 != end()) std::move(__position + 1, end(), __position); --this->_M_impl._M_finish; _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish); ; return __position; } template constexpr typename vector<_Tp, _Alloc>::iterator vector<_Tp, _Alloc>:: _M_erase(iterator __first, iterator __last) { if (__first != __last) { if (__last != end()) std::move(__last, end(), __first); _M_erase_at_end(__first.base() + (end() - __last)); } return __first; } template constexpr vector<_Tp, _Alloc>& vector<_Tp, _Alloc>:: operator=(const vector<_Tp, _Alloc>& __x) { if (std::__addressof(__x) != this) { ; if (_Alloc_traits::_S_propagate_on_copy_assign()) { if (!_Alloc_traits::_S_always_equal() && _M_get_Tp_allocator() != __x._M_get_Tp_allocator()) { this->clear(); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = nullptr; this->_M_impl._M_finish = nullptr; this->_M_impl._M_end_of_storage = nullptr; } std::__alloc_on_copy(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } const size_type __xlen = __x.size(); if (__xlen > capacity()) { pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end()); std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __tmp; this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen; } else if (size() >= __xlen) { std::_Destroy(std::copy(__x.begin(), __x.end(), begin()), end(), _M_get_Tp_allocator()); } else { std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(), this->_M_impl._M_start); std::__uninitialized_copy_a(__x._M_impl._M_start + size(), __x._M_impl._M_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); } this->_M_impl._M_finish = this->_M_impl._M_start + __xlen; } return *this; } template constexpr void vector<_Tp, _Alloc>:: _M_fill_assign(size_t __n, const value_type& __val) { const size_type __sz = size(); if (__n > capacity()) { if (__n <= __sz) __builtin_unreachable(); vector __tmp(__n, __val, _M_get_Tp_allocator()); __tmp._M_impl._M_swap_data(this->_M_impl); } else if (__n > __sz) { std::fill(begin(), end(), __val); const size_type __add = __n - __sz; ; this->_M_impl._M_finish = std::__uninitialized_fill_n_a(this->_M_impl._M_finish, __add, __val, _M_get_Tp_allocator()); ; } else _M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val)); } template template constexpr void vector<_Tp, _Alloc>:: _M_assign_aux(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { pointer __cur(this->_M_impl._M_start); for (; __first != __last && __cur != this->_M_impl._M_finish; ++__cur, (void)++__first) *__cur = *__first; if (__first == __last) _M_erase_at_end(__cur); else _M_range_insert(end(), __first, __last, std::__iterator_category(__first)); } template template constexpr void vector<_Tp, _Alloc>:: _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __sz = size(); const size_type __len = std::distance(__first, __last); if (__len > capacity()) { if (__len <= __sz) __builtin_unreachable(); _S_check_init_len(__len, _M_get_Tp_allocator()); pointer __tmp(_M_allocate_and_copy(__len, __first, __last)); std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); ; _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __tmp; this->_M_impl._M_finish = this->_M_impl._M_start + __len; this->_M_impl._M_end_of_storage = this->_M_impl._M_finish; } else if (__sz >= __len) _M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start)); else { _ForwardIterator __mid = __first; std::advance(__mid, __sz); std::copy(__first, __mid, this->_M_impl._M_start); const size_type __attribute__((__unused__)) __n = __len - __sz; ; this->_M_impl._M_finish = std::__uninitialized_copy_a(__mid, __last, this->_M_impl._M_finish, _M_get_Tp_allocator()); ; } } template constexpr auto vector<_Tp, _Alloc>:: _M_insert_rval(const_iterator __position, value_type&& __v) -> iterator { const auto __n = __position - cbegin(); if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) if (__position == cend()) { ; _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, std::move(__v)); ++this->_M_impl._M_finish; ; } else _M_insert_aux(begin() + __n, std::move(__v)); else _M_realloc_insert(begin() + __n, std::move(__v)); return iterator(this->_M_impl._M_start + __n); } template template constexpr auto vector<_Tp, _Alloc>:: _M_emplace_aux(const_iterator __position, _Args&&... __args) -> iterator { const auto __n = __position - cbegin(); if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) if (__position == cend()) { ; _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, std::forward<_Args>(__args)...); ++this->_M_impl._M_finish; ; } else { _Temporary_value __tmp(this, std::forward<_Args>(__args)...); _M_insert_aux(begin() + __n, std::move(__tmp._M_val())); } else _M_realloc_insert(begin() + __n, std::forward<_Args>(__args)...); return iterator(this->_M_impl._M_start + __n); } template template constexpr void vector<_Tp, _Alloc>:: _M_insert_aux(iterator __position, _Arg&& __arg) { ; _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, std::move(*(this->_M_impl._M_finish - 1))); ++this->_M_impl._M_finish; ; std::move_backward(__position.base(), this->_M_impl._M_finish - 2, this->_M_impl._M_finish - 1) ; *__position = std::forward<_Arg>(__arg); } template template constexpr void vector<_Tp, _Alloc>:: _M_realloc_insert(iterator __position, _Args&&... __args) { const size_type __len = _M_check_len(1u, "vector::_M_realloc_insert"); if (__len <= 0) __builtin_unreachable (); pointer __old_start = this->_M_impl._M_start; pointer __old_finish = this->_M_impl._M_finish; const size_type __elems_before = __position - begin(); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); { _Guard_alloc __guard(__new_start, __len, *this); # 481 "/usr/include/c++/15/bits/vector.tcc" 3 _Alloc_traits::construct(this->_M_impl, std::__to_address(__new_start + __elems_before), std::forward<_Args>(__args)...); if constexpr (_S_use_relocate()) { __new_finish = _S_relocate(__old_start, __position.base(), __new_start, _M_get_Tp_allocator()); ++__new_finish; __new_finish = _S_relocate(__position.base(), __old_finish, __new_finish, _M_get_Tp_allocator()); } else { struct _Guard_elts { pointer _M_first, _M_last; _Tp_alloc_type& _M_alloc; constexpr _Guard_elts(pointer __elt, _Tp_alloc_type& __a) : _M_first(__elt), _M_last(__elt + 1), _M_alloc(__a) { } constexpr ~_Guard_elts() { std::_Destroy(_M_first, _M_last, _M_alloc); } private: _Guard_elts(const _Guard_elts&); }; _Guard_elts __guard_elts(__new_start + __elems_before, _M_impl); __new_finish = std::__uninitialized_move_if_noexcept_a( __old_start, __position.base(), __new_start, _M_get_Tp_allocator()); ++__new_finish; __guard_elts._M_first = __new_start; __new_finish = std::__uninitialized_move_if_noexcept_a( __position.base(), __old_finish, __new_finish, _M_get_Tp_allocator()); __guard_elts._M_first = __old_start; __guard_elts._M_last = __old_finish; } __guard._M_storage = __old_start; __guard._M_len = this->_M_impl._M_end_of_storage - __old_start; } this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } template template constexpr void vector<_Tp, _Alloc>:: _M_realloc_append(_Args&&... __args) { const size_type __len = _M_check_len(1u, "vector::_M_realloc_append"); if (__len <= 0) __builtin_unreachable (); pointer __old_start = this->_M_impl._M_start; pointer __old_finish = this->_M_impl._M_finish; const size_type __elems = end() - begin(); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); { _Guard_alloc __guard(__new_start, __len, *this); # 586 "/usr/include/c++/15/bits/vector.tcc" 3 _Alloc_traits::construct(this->_M_impl, std::__to_address(__new_start + __elems), std::forward<_Args>(__args)...); if constexpr (_S_use_relocate()) { __new_finish = _S_relocate(__old_start, __old_finish, __new_start, _M_get_Tp_allocator()); ++__new_finish; } else { struct _Guard_elts { pointer _M_first, _M_last; _Tp_alloc_type& _M_alloc; constexpr _Guard_elts(pointer __elt, _Tp_alloc_type& __a) : _M_first(__elt), _M_last(__elt + 1), _M_alloc(__a) { } constexpr ~_Guard_elts() { std::_Destroy(_M_first, _M_last, _M_alloc); } private: _Guard_elts(const _Guard_elts&); }; _Guard_elts __guard_elts(__new_start + __elems, _M_impl); __new_finish = std::__uninitialized_move_if_noexcept_a( __old_start, __old_finish, __new_start, _M_get_Tp_allocator()); ++__new_finish; __guard_elts._M_first = __old_start; __guard_elts._M_last = __old_finish; } __guard._M_storage = __old_start; __guard._M_len = this->_M_impl._M_end_of_storage - __old_start; } this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } template constexpr void vector<_Tp, _Alloc>:: _M_fill_insert(iterator __position, size_type __n, const value_type& __x) { if (__n != 0) { if (__position.base() == this->_M_impl._M_finish) _M_fill_append(__n, __x); else if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n) { _Temporary_value __tmp(this, __x); value_type& __x_copy = __tmp._M_val(); const size_type __elems_after = end() - __position; pointer __old_finish(this->_M_impl._M_finish); if (__elems_after > __n) { ; std::__uninitialized_move_a(__old_finish - __n, __old_finish, __old_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __n; ; std::move_backward(__position.base(), __old_finish - __n, __old_finish) ; std::fill(__position.base(), __position.base() + __n, __x_copy); } else { ; this->_M_impl._M_finish = std::__uninitialized_fill_n_a(__old_finish, __n - __elems_after, __x_copy, _M_get_Tp_allocator()); ; std::__uninitialized_move_a(__position.base(), __old_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __elems_after; ; std::fill(__position.base(), __old_finish, __x_copy); } } else { pointer __old_start = this->_M_impl._M_start; pointer __old_finish = this->_M_impl._M_finish; const pointer __pos = __position.base(); const size_type __len = _M_check_len(__n, "vector::_M_fill_insert"); const size_type __elems_before = __pos - __old_start; pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); try { std::__uninitialized_fill_n_a(__new_start + __elems_before, __n, __x, _M_get_Tp_allocator()); __new_finish = pointer(); __new_finish = std::__uninitialized_move_if_noexcept_a (__old_start, __pos, __new_start, _M_get_Tp_allocator()); __new_finish += __n; __new_finish = std::__uninitialized_move_if_noexcept_a (__pos, __old_finish, __new_finish, _M_get_Tp_allocator()); } catch(...) { if (!__new_finish) std::_Destroy(__new_start + __elems_before, __new_start + __elems_before + __n, _M_get_Tp_allocator()); else std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator()); _M_deallocate(__new_start, __len); throw; } std::_Destroy(__old_start, __old_finish, _M_get_Tp_allocator()); ; _M_deallocate(__old_start, this->_M_impl._M_end_of_storage - __old_start); this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } } } template constexpr void vector<_Tp, _Alloc>:: _M_fill_append(size_type __n, const value_type& __x) { if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n) { ; this->_M_impl._M_finish = std::__uninitialized_fill_n_a(this->_M_impl._M_finish, __n, __x, _M_get_Tp_allocator()); ; } else { pointer __old_start = this->_M_impl._M_start; pointer __old_finish = this->_M_impl._M_finish; const size_type __old_size = __old_finish - __old_start; const size_type __len = _M_check_len(__n, "vector::_M_fill_append"); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start + __old_size); try { __new_finish = std::__uninitialized_fill_n_a( __new_finish, __n, __x, _M_get_Tp_allocator()); std::__uninitialized_move_if_noexcept_a( __old_start, __old_finish, __new_start, _M_get_Tp_allocator()); } catch(...) { std::_Destroy(__new_start + __old_size, __new_finish, _M_get_Tp_allocator()); _M_deallocate(__new_start, __len); throw; } std::_Destroy(__old_start, __old_finish, _M_get_Tp_allocator()); ; _M_deallocate(__old_start, this->_M_impl._M_end_of_storage - __old_start); this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } } template constexpr void vector<_Tp, _Alloc>:: _M_default_append(size_type __n) { if (__n != 0) { const size_type __size = size(); size_type __navail = size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish); if (__size > max_size() || __navail > max_size() - __size) __builtin_unreachable(); if (__navail >= __n) { if (!this->_M_impl._M_finish) __builtin_unreachable(); ; this->_M_impl._M_finish = std::__uninitialized_default_n_a(this->_M_impl._M_finish, __n, _M_get_Tp_allocator()); ; } else { pointer __old_start = this->_M_impl._M_start; pointer __old_finish = this->_M_impl._M_finish; const size_type __len = _M_check_len(__n, "vector::_M_default_append"); pointer __new_start(this->_M_allocate(__len)); { _Guard_alloc __guard(__new_start, __len, *this); std::__uninitialized_default_n_a(__new_start + __size, __n, _M_get_Tp_allocator()); if constexpr (_S_use_relocate()) { _S_relocate(__old_start, __old_finish, __new_start, _M_get_Tp_allocator()); } else { struct _Guard_elts { pointer _M_first, _M_last; _Tp_alloc_type& _M_alloc; constexpr _Guard_elts(pointer __first, size_type __n, _Tp_alloc_type& __a) : _M_first(__first), _M_last(__first + __n), _M_alloc(__a) { } constexpr ~_Guard_elts() { std::_Destroy(_M_first, _M_last, _M_alloc); } private: _Guard_elts(const _Guard_elts&); }; _Guard_elts __guard_elts(__new_start + __size, __n, _M_impl); std::__uninitialized_move_if_noexcept_a( __old_start, __old_finish, __new_start, _M_get_Tp_allocator()); __guard_elts._M_first = __old_start; __guard_elts._M_last = __old_finish; } ; __guard._M_storage = __old_start; __guard._M_len = this->_M_impl._M_end_of_storage - __old_start; } this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_start + __size + __n; this->_M_impl._M_end_of_storage = __new_start + __len; } } } template constexpr bool vector<_Tp, _Alloc>:: _M_shrink_to_fit() { if (capacity() == size()) return false; ; return std::__shrink_to_fit_aux::_S_do_it(*this); } template template constexpr void vector<_Tp, _Alloc>:: _M_range_insert(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag) { if (__pos == end()) { for (; __first != __last; ++__first) insert(end(), *__first); } else if (__first != __last) { vector __tmp(__first, __last, _M_get_Tp_allocator()); insert(__pos, std::make_move_iterator(__tmp.begin()), std::make_move_iterator(__tmp.end())); } } template template constexpr void vector<_Tp, _Alloc>:: _M_range_insert(iterator __position, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { if (__first != __last) { const size_type __n = std::distance(__first, __last); if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n) { const size_type __elems_after = end() - __position; pointer __old_finish(this->_M_impl._M_finish); if (__elems_after > __n) { ; std::__uninitialized_move_a(this->_M_impl._M_finish - __n, this->_M_impl._M_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __n; ; std::move_backward(__position.base(), __old_finish - __n, __old_finish) ; std::copy(__first, __last, __position); } else { _ForwardIterator __mid = __first; std::advance(__mid, __elems_after); ; std::__uninitialized_copy_a(__mid, __last, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __n - __elems_after; ; std::__uninitialized_move_a(__position.base(), __old_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __elems_after; ; std::copy(__first, __mid, __position); } } else { pointer __old_start = this->_M_impl._M_start; pointer __old_finish = this->_M_impl._M_finish; const size_type __len = _M_check_len(__n, "vector::_M_range_insert"); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); try { __new_finish = std::__uninitialized_move_if_noexcept_a (__old_start, __position.base(), __new_start, _M_get_Tp_allocator()); __new_finish = std::__uninitialized_copy_a(__first, __last, __new_finish, _M_get_Tp_allocator()); __new_finish = std::__uninitialized_move_if_noexcept_a (__position.base(), __old_finish, __new_finish, _M_get_Tp_allocator()); } catch(...) { std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator()); _M_deallocate(__new_start, __len); throw; } std::_Destroy(__old_start, __old_finish, _M_get_Tp_allocator()); ; _M_deallocate(__old_start, this->_M_impl._M_end_of_storage - __old_start); this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } } } template template<__detail::__container_compatible_range<_Tp> _Rg> constexpr auto vector<_Tp, _Alloc>:: insert_range(const_iterator __pos, _Rg&& __rg) -> iterator { if (__pos == cend()) { const auto __ins_idx = size(); append_range(std::forward<_Rg>(__rg)); return begin() + __ins_idx; } if constexpr (ranges::forward_range<_Rg>) { const auto __ins_idx = __pos - cbegin(); const auto __n = size_type(ranges::distance(__rg)); if (__n == 0) return begin() + __ins_idx; pointer __old_start = this->_M_impl._M_start; pointer __old_finish = this->_M_impl._M_finish; pointer __ins = __old_start + __ins_idx; const auto __cap = this->_M_impl._M_end_of_storage - __old_finish; if (__cap >= __n) { const size_type __elems_after = cend() - __pos; if (__elems_after > __n) { ; std::__uninitialized_move_a(__old_finish - __n, __old_finish, __old_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __n; ; std::move_backward(__ins, __old_finish - __n, __old_finish); ranges::copy(__rg, __ins); } else { auto __first = ranges::begin(__rg); const auto __last = ranges::end(__rg); auto __mid = ranges::next(__first, __elems_after); ; _Base::_M_append_range(ranges::subrange(__mid, __last)); ; std::__uninitialized_move_a(__ins, __old_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __elems_after; ; ranges::copy(__first, __mid, __ins); } } else { const size_type __len = _M_check_len(__n, "vector::insert_range"); struct _Guard : _Guard_alloc { pointer _M_finish = _Guard_alloc::_M_storage; using _Guard_alloc::_Guard_alloc; constexpr ~_Guard() { std::_Destroy(this->_M_storage, _M_finish, this->_M_vect._M_get_Tp_allocator()); } }; pointer __new_start(this->_M_allocate(__len)); _Guard __guard(__new_start, __len, *this); auto& __alloc = _M_get_Tp_allocator(); __guard._M_finish = std::__uninitialized_move_if_noexcept_a( __old_start, __ins, __new_start, __alloc); _Base::_M_append_range_to(__rg, __guard._M_finish); __guard._M_finish = std::__uninitialized_move_if_noexcept_a( __ins, __old_finish, __guard._M_finish, __alloc); ; this->_M_impl._M_start = __guard._M_storage; this->_M_impl._M_finish = __guard._M_finish; this->_M_impl._M_end_of_storage = __new_start + __len; __guard._M_storage = __old_start; __guard._M_finish = __old_finish; __guard._M_len = (__old_finish - __old_start) + __cap; } return begin() + __ins_idx; } else return insert_range(__pos, vector(from_range, std::forward<_Rg>(__rg), _M_get_Tp_allocator())); } template constexpr void vector:: _M_reallocate(size_type __n) { const iterator __begin = begin(), __end = end(); if (size_type(__end - __begin) > __n) __builtin_unreachable(); _Bit_pointer __q = this->_M_allocate(__n); iterator __start(std::__addressof(*__q), 0); iterator __finish(_M_copy_aligned(__begin, __end, __start)); this->_M_deallocate(); this->_M_impl._M_start = __start; this->_M_impl._M_finish = __finish; this->_M_impl._M_end_of_storage = __q + _S_nword(__n); } template constexpr void vector:: _M_fill_insert(iterator __position, size_type __n, bool __x) { if (__n == 0) return; if (capacity() - size() >= __n) { std::copy_backward(__position, end(), this->_M_impl._M_finish + difference_type(__n)); std::fill(__position, __position + difference_type(__n), __x); this->_M_impl._M_finish += difference_type(__n); } else { const size_type __len = _M_check_len(__n, "vector::_M_fill_insert"); iterator __begin = begin(), __end = end(); _Bit_pointer __q = this->_M_allocate(__len); iterator __start(std::__addressof(*__q), 0); iterator __i = _M_copy_aligned(__begin, __position, __start); std::fill(__i, __i + difference_type(__n), __x); iterator __finish = std::copy(__position, __end, __i + difference_type(__n)); this->_M_deallocate(); this->_M_impl._M_end_of_storage = __q + _S_nword(__len); this->_M_impl._M_start = __start; this->_M_impl._M_finish = __finish; } } template template constexpr void vector:: _M_insert_range(iterator __position, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { if (__first != __last) { size_type __n = std::distance(__first, __last); if (capacity() - size() >= __n) { std::copy_backward(__position, end(), this->_M_impl._M_finish + difference_type(__n)); std::copy(__first, __last, __position); this->_M_impl._M_finish += difference_type(__n); } else { const size_type __len = _M_check_len(__n, "vector::_M_insert_range"); const iterator __begin = begin(), __end = end(); _Bit_pointer __q = this->_M_allocate(__len); iterator __start(std::__addressof(*__q), 0); iterator __i = _M_copy_aligned(__begin, __position, __start); __i = std::copy(__first, __last, __i); iterator __finish = std::copy(__position, __end, __i); this->_M_deallocate(); this->_M_impl._M_end_of_storage = __q + _S_nword(__len); this->_M_impl._M_start = __start; this->_M_impl._M_finish = __finish; } } } template constexpr void vector:: _M_insert_aux(iterator __position, bool __x) { if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr()) { std::copy_backward(__position, this->_M_impl._M_finish, this->_M_impl._M_finish + 1); *__position = __x; ++this->_M_impl._M_finish; } else { const size_type __len = _M_check_len(size_type(1), "vector::_M_insert_aux"); _Bit_pointer __q = this->_M_allocate(__len); iterator __start(std::__addressof(*__q), 0); iterator __i = _M_copy_aligned(begin(), __position, __start); *__i++ = __x; iterator __finish = std::copy(__position, end(), __i); this->_M_deallocate(); this->_M_impl._M_end_of_storage = __q + _S_nword(__len); this->_M_impl._M_start = __start; this->_M_impl._M_finish = __finish; } } template constexpr typename vector::iterator vector:: _M_erase(iterator __position) { if (__position + 1 != end()) std::copy(__position + 1, end(), __position); --this->_M_impl._M_finish; return __position; } template constexpr typename vector::iterator vector:: _M_erase(iterator __first, iterator __last) { if (__first != __last) _M_erase_at_end(std::copy(__last, end(), __first)); return __first; } template constexpr bool vector:: _M_shrink_to_fit() { if (capacity() - size() < int(_S_word_bit)) return false; try { if (size_type __n = size()) _M_reallocate(__n); else { this->_M_deallocate(); this->_M_impl._M_reset(); } return true; } catch(...) { return false; } } } namespace std __attribute__ ((__visibility__ ("default"))) { template size_t hash>:: operator()(const std::vector& __b) const noexcept { size_t __hash = 0; const size_t __words = __b.size() / _S_word_bit; if (__words) { const size_t __clength = __words * sizeof(_Bit_type); __hash = std::_Hash_impl::hash(__b._M_impl._M_start._M_p, __clength); } const size_t __extrabits = __b.size() % _S_word_bit; if (__extrabits) { _Bit_type __hiword = *__b._M_impl._M_finish._M_p; __hiword &= ~((~static_cast<_Bit_type>(0)) << __extrabits); const size_t __clength = (__extrabits + 8 - 1) / 8; if (__words) __hash = std::_Hash_impl::hash(&__hiword, __clength, __hash); else __hash = std::_Hash_impl::hash(&__hiword, __clength); } return __hash; } } # 75 "/usr/include/c++/15/vector" 2 3 # 88 "/usr/include/c++/15/vector" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 89 "/usr/include/c++/15/vector" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { namespace pmr { template using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; } } namespace std __attribute__ ((__visibility__ ("default"))) { template constexpr inline typename vector<_Tp, _Alloc>::size_type erase_if(vector<_Tp, _Alloc>& __cont, _Predicate __pred) { using namespace __gnu_cxx; std::vector<_Tp, _Alloc>& __ucont = __cont; const auto __osz = __cont.size(); const auto __end = __ucont.end(); auto __removed = std::__remove_if(__ucont.begin(), __end, __ops::__pred_iter(std::ref(__pred))); if (__removed != __end) { __cont.erase(__niter_wrap(__cont.begin(), __removed), __cont.end()); return __osz - __cont.size(); } return 0; } template constexpr inline typename vector<_Tp, _Alloc>::size_type erase(vector<_Tp, _Alloc>& __cont, const _Up& __value) { using namespace __gnu_cxx; std::vector<_Tp, _Alloc>& __ucont = __cont; const auto __osz = __cont.size(); const auto __end = __ucont.end(); auto __removed = std::__remove_if(__ucont.begin(), __end, __ops::__iter_equals_val(__value)); if (__removed != __end) { __cont.erase(__niter_wrap(__cont.begin(), __removed), __cont.end()); return __osz - __cont.size(); } return 0; } } # 1 "/usr/include/c++/15/bits/formatfwd.h" 1 3 # 46 "/usr/include/c++/15/bits/formatfwd.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template class basic_format_context; template class basic_format_parse_context; template struct formatter; namespace __format { template concept __char = same_as<_CharT, char> || same_as<_CharT, wchar_t>; template>, typename _ParseContext = basic_format_parse_context> concept __parsable_with = semiregular<_Formatter> && requires (_Formatter __f, _ParseContext __pc) { { __f.parse(__pc) } -> same_as; }; template>, typename _ParseContext = basic_format_parse_context> concept __formattable_with = semiregular<_Formatter> && requires (const _Formatter __cf, _Tp&& __t, _Context __fc) { { __cf.format(__t, __fc) } -> same_as; }; template struct _Iter_for; template using _Iter_for_t = typename _Iter_for<_CharT>::type; template, _CharT>> concept __formattable_impl = __parsable_with<_Tp, _Context> && __formattable_with<_Tp, _Context>; template concept __has_debug_format = requires(_Formatter __f) { __f.set_debug_format(); }; template<__char _CharT> struct __formatter_int; } template concept formattable = __format::__formattable_impl, _CharT>; template requires same_as, _Tp> && formattable<_Tp, _CharT> class range_formatter; namespace __format { template concept __const_formattable_range = ranges::input_range && formattable, _CharT>; template using __maybe_const_range = __conditional_t<__const_formattable_range<_Rg, _CharT>, const _Rg, _Rg>; template using __maybe_const = __conditional_t, const _Tp, _Tp>; } } # 163 "/usr/include/c++/15/vector" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template<__format::__char _CharT> struct formatter { constexpr typename basic_format_parse_context<_CharT>::iterator parse(basic_format_parse_context<_CharT>& __pc) { return _M_f.template _M_parse(__pc); } template typename basic_format_context<_Out, _CharT>::iterator format(const std::_Bit_reference& __u, basic_format_context<_Out, _CharT>& __fc) const { return _M_f.format(static_cast(__u), __fc); } private: __format::__formatter_int<_CharT> _M_f; }; } # 67 "/usr/include/c++/15/functional" 2 3 # 1 "/usr/include/c++/15/array" 1 3 # 54 "/usr/include/c++/15/array" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 55 "/usr/include/c++/15/array" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template struct __array_traits { using _Type = _Tp[_Nm]; using _Is_swappable = __is_swappable<_Tp>; using _Is_nothrow_swappable = __is_nothrow_swappable<_Tp>; }; template struct __array_traits<_Tp, 0> { struct _Type { __attribute__((__always_inline__,__noreturn__)) _Tp& operator[](size_t) const noexcept { __builtin_trap(); } __attribute__((__always_inline__)) constexpr explicit operator _Tp*() const noexcept { return nullptr; } }; using _Is_swappable = true_type; using _Is_nothrow_swappable = true_type; }; # 101 "/usr/include/c++/15/array" 3 template struct array { typedef _Tp value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; typedef value_type* iterator; typedef const value_type* const_iterator; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; typename __array_traits<_Tp, _Nm>::_Type _M_elems; constexpr void fill(const value_type& __u) { std::fill_n(begin(), size(), __u); } constexpr void swap(array& __other) noexcept(__array_traits<_Tp, _Nm>::_Is_nothrow_swappable::value) { std::swap_ranges(begin(), end(), __other.begin()); } [[__gnu__::__const__, __nodiscard__]] constexpr iterator begin() noexcept { return iterator(data()); } [[__nodiscard__]] constexpr const_iterator begin() const noexcept { return const_iterator(data()); } [[__gnu__::__const__, __nodiscard__]] constexpr iterator end() noexcept { return iterator(data() + _Nm); } [[__nodiscard__]] constexpr const_iterator end() const noexcept { return const_iterator(data() + _Nm); } [[__gnu__::__const__, __nodiscard__]] constexpr reverse_iterator rbegin() noexcept { return reverse_iterator(end()); } [[__nodiscard__]] constexpr const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); } [[__gnu__::__const__, __nodiscard__]] constexpr reverse_iterator rend() noexcept { return reverse_iterator(begin()); } [[__nodiscard__]] constexpr const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); } [[__nodiscard__]] constexpr const_iterator cbegin() const noexcept { return const_iterator(data()); } [[__nodiscard__]] constexpr const_iterator cend() const noexcept { return const_iterator(data() + _Nm); } [[__nodiscard__]] constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); } [[__nodiscard__]] constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); } [[__nodiscard__, __gnu__::__const__, __gnu__::__always_inline__]] constexpr size_type size() const noexcept { return _Nm; } [[__nodiscard__, __gnu__::__const__, __gnu__::__always_inline__]] constexpr size_type max_size() const noexcept { return _Nm; } [[__nodiscard__, __gnu__::__const__, __gnu__::__always_inline__]] constexpr bool empty() const noexcept { return size() == 0; } [[__nodiscard__]] constexpr reference operator[](size_type __n) noexcept { do { if (std::__is_constant_evaluated() && !bool(__n < this->size())) std::__glibcxx_assert_fail(); } while (false); return _M_elems[__n]; } [[__nodiscard__]] constexpr const_reference operator[](size_type __n) const noexcept { do { if (std::__is_constant_evaluated() && !bool(__n < this->size())) std::__glibcxx_assert_fail(); } while (false); return _M_elems[__n]; } constexpr reference at(size_type __n) { if (__n >= _Nm) std::__throw_out_of_range_fmt(("array::at: __n (which is %zu) " ">= _Nm (which is %zu)") , __n, _Nm); return _M_elems[__n]; } constexpr const_reference at(size_type __n) const { return __n < _Nm ? _M_elems[__n] : (std::__throw_out_of_range_fmt(("array::at: __n (which is %zu) " ">= _Nm (which is %zu)") , __n, _Nm), _M_elems[__n]); } [[__nodiscard__]] constexpr reference front() noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return _M_elems[(size_type)0]; } [[__nodiscard__]] constexpr const_reference front() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return _M_elems[(size_type)0]; } [[__nodiscard__]] constexpr reference back() noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return _M_elems[_Nm - 1]; } [[__nodiscard__]] constexpr const_reference back() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!this->empty())) std::__glibcxx_assert_fail(); } while (false); return _M_elems[_Nm - 1]; } [[__nodiscard__, __gnu__::__const__, __gnu__::__always_inline__]] constexpr pointer data() noexcept { return static_cast(_M_elems); } [[__nodiscard__]] constexpr const_pointer data() const noexcept { return static_cast(_M_elems); } }; template array(_Tp, _Up...) -> array && ...), _Tp>, 1 + sizeof...(_Up)>; template [[__nodiscard__]] constexpr inline bool operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) { return std::__equal_aux1(__one.begin(), __one.end(), __two.begin()); } template [[nodiscard]] constexpr __detail::__synth3way_t<_Tp> operator<=>(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b) { if constexpr (_Nm && __is_memcmp_ordered<_Tp>::__value) if (!std::__is_constant_evaluated()) { constexpr size_t __n = _Nm * sizeof(_Tp); return __builtin_memcmp(__a.data(), __b.data(), __n) <=> 0; } for (size_t __i = 0; __i < _Nm; ++__i) { auto __c = __detail::__synth3way(__a[__i], __b[__i]); if (__c != 0) return __c; } return strong_ordering::equal; } # 370 "/usr/include/c++/15/array" 3 template constexpr inline __enable_if_t<__array_traits<_Tp, _Nm>::_Is_swappable::value> swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two) noexcept(noexcept(__one.swap(__two))) { __one.swap(__two); } template __enable_if_t::_Is_swappable::value> swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&) = delete; template [[__nodiscard__]] constexpr _Tp& get(array<_Tp, _Nm>& __arr) noexcept { static_assert(_Int < _Nm, "array index is within bounds"); return __arr._M_elems[_Int]; } template [[__nodiscard__]] constexpr _Tp&& get(array<_Tp, _Nm>&& __arr) noexcept { static_assert(_Int < _Nm, "array index is within bounds"); return std::move(std::get<_Int>(__arr)); } template [[__nodiscard__]] constexpr const _Tp& get(const array<_Tp, _Nm>& __arr) noexcept { static_assert(_Int < _Nm, "array index is within bounds"); return __arr._M_elems[_Int]; } template [[__nodiscard__]] constexpr const _Tp&& get(const array<_Tp, _Nm>&& __arr) noexcept { static_assert(_Int < _Nm, "array index is within bounds"); return std::move(std::get<_Int>(__arr)); } template [[nodiscard]] constexpr array, _Nm> to_array(_Tp (&__a)[_Nm]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) { static_assert(!is_array_v<_Tp>); static_assert(is_constructible_v<_Tp, _Tp&>); if constexpr (is_constructible_v<_Tp, _Tp&>) { if constexpr (is_trivially_copyable_v<_Tp> && is_trivially_default_constructible_v<_Tp> && is_copy_assignable_v<_Tp>) { array, _Nm> __arr; if (!__is_constant_evaluated() && _Nm != 0) __builtin_memcpy((void*)__arr.data(), (void*)__a, sizeof(__a)); else for (size_t __i = 0; __i < _Nm; ++__i) __arr._M_elems[__i] = __a[__i]; return __arr; } else return [&__a](index_sequence<_Idx...>) { return array, _Nm>{{ __a[_Idx]... }}; }(make_index_sequence<_Nm>{}); } else __builtin_unreachable(); } template [[nodiscard]] constexpr array, _Nm> to_array(_Tp (&&__a)[_Nm]) noexcept(is_nothrow_move_constructible_v<_Tp>) { static_assert(!is_array_v<_Tp>); static_assert(is_move_constructible_v<_Tp>); if constexpr (is_move_constructible_v<_Tp>) { if constexpr (is_trivially_copyable_v<_Tp> && is_trivially_default_constructible_v<_Tp> && is_copy_assignable_v<_Tp>) { array, _Nm> __arr; if (!__is_constant_evaluated() && _Nm != 0) __builtin_memcpy((void*)__arr.data(), (void*)__a, sizeof(__a)); else for (size_t __i = 0; __i < _Nm; ++__i) __arr._M_elems[__i] = __a[__i]; return __arr; } else return [&__a](index_sequence<_Idx...>) { return array, _Nm>{{ std::move(__a[_Idx])... }}; }(make_index_sequence<_Nm>{}); } else __builtin_unreachable(); } template struct tuple_size> : public integral_constant { }; template struct tuple_element<_Ind, array<_Tp, _Nm>> { static_assert(_Ind < _Nm, "array index is in range"); using type = _Tp; }; template inline constexpr size_t tuple_size_v> = _Nm; template inline constexpr size_t tuple_size_v> = _Nm; template struct __is_tuple_like_impl> : true_type { }; } # 68 "/usr/include/c++/15/functional" 2 3 # 76 "/usr/include/c++/15/functional" 3 # 1 "/usr/include/c++/15/bits/move_only_function.h" 1 3 # 37 "/usr/include/c++/15/bits/move_only_function.h" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 38 "/usr/include/c++/15/bits/move_only_function.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template class move_only_function; class _Mofunc_base { protected: _Mofunc_base() noexcept : _M_manage(_S_empty) { } _Mofunc_base(_Mofunc_base&& __x) noexcept { _M_manage = std::__exchange(__x._M_manage, _S_empty); _M_manage(_M_storage, &__x._M_storage); } template static constexpr bool _S_nothrow_init() noexcept { if constexpr (__stored_locally<_Tp>) return is_nothrow_constructible_v<_Tp, _Args...>; return false; } template void _M_init(_Args&&... __args) noexcept(_S_nothrow_init<_Tp, _Args...>()) { if constexpr (__stored_locally<_Tp>) ::new (_M_storage._M_addr()) _Tp(std::forward<_Args>(__args)...); else _M_storage._M_p = new _Tp(std::forward<_Args>(__args)...); _M_manage = &_S_manage<_Tp>; } _Mofunc_base& operator=(_Mofunc_base&& __x) noexcept { _M_manage(_M_storage, nullptr); _M_manage = std::__exchange(__x._M_manage, _S_empty); _M_manage(_M_storage, &__x._M_storage); return *this; } _Mofunc_base& operator=(nullptr_t) noexcept { _M_manage(_M_storage, nullptr); _M_manage = _S_empty; return *this; } ~_Mofunc_base() { _M_manage(_M_storage, nullptr); } void swap(_Mofunc_base& __x) noexcept { _Storage __s; __x._M_manage(__s, &__x._M_storage); _M_manage(__x._M_storage, &_M_storage); __x._M_manage(_M_storage, &__s); std::swap(_M_manage, __x._M_manage); } template static _Tp* _S_access(_Self* __self) noexcept { if constexpr (__stored_locally>) return static_cast<_Tp*>(__self->_M_storage._M_addr()); else return static_cast<_Tp*>(__self->_M_storage._M_p); } private: struct _Storage { void* _M_addr() noexcept { return &_M_bytes[0]; } const void* _M_addr() const noexcept { return &_M_bytes[0]; } struct _Delegate { void (_Storage::*__pfm)(); _Storage* __obj; }; union { void* _M_p; alignas(_Delegate) alignas(void(*)()) unsigned char _M_bytes[sizeof(_Delegate)]; }; }; template static constexpr bool __stored_locally = sizeof(_Tp) <= sizeof(_Storage) && alignof(_Tp) <= alignof(_Storage) && is_nothrow_move_constructible_v<_Tp>; using _Manager = void (*)(_Storage& __target, _Storage* __src) noexcept; static void _S_empty(_Storage&, _Storage*) noexcept { } template static void _S_manage(_Storage& __target, _Storage* __src) noexcept { if constexpr (__stored_locally<_Tp>) { if (__src) { _Tp* __rval = static_cast<_Tp*>(__src->_M_addr()); ::new (__target._M_addr()) _Tp(std::move(*__rval)); __rval->~_Tp(); } else static_cast<_Tp*>(__target._M_addr())->~_Tp(); } else { if (__src) __target._M_p = __src->_M_p; else delete static_cast<_Tp*>(__target._M_p); } } _Storage _M_storage; _Manager _M_manage; }; template inline constexpr bool __is_move_only_function_v = false; template constexpr bool __is_move_only_function_v> = true; namespace __detail::__variant { template struct _Never_valueless_alt; template struct _Never_valueless_alt> : true_type { }; } } # 1 "/usr/include/c++/15/bits/mofunc_impl.h" 1 3 # 43 "/usr/include/c++/15/bits/mofunc_impl.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 62 "/usr/include/c++/15/bits/mofunc_impl.h" 3 template class move_only_function<_Res(_ArgTypes...) noexcept(_Noex)> : _Mofunc_base { template using __callable = __conditional_t<_Noex, is_nothrow_invocable_r<_Res, _Tp, _ArgTypes...>, is_invocable_r<_Res, _Tp, _ArgTypes...>>; template static constexpr bool __is_callable_from = __and_v<__callable<_Vt >, __callable<_Vt &>>; public: using result_type = _Res; move_only_function() noexcept { } move_only_function(nullptr_t) noexcept { } move_only_function(move_only_function&& __x) noexcept : _Mofunc_base(static_cast<_Mofunc_base&&>(__x)), _M_invoke(std::__exchange(__x._M_invoke, nullptr)) { } template> requires (!is_same_v<_Vt, move_only_function>) && (!__is_in_place_type_v<_Vt>) && __is_callable_from<_Vt> move_only_function(_Fn&& __f) noexcept(_S_nothrow_init<_Vt, _Fn>()) { if constexpr (is_function_v> || is_member_pointer_v<_Vt> || __is_move_only_function_v<_Vt>) { if (__f == nullptr) return; } _M_init<_Vt>(std::forward<_Fn>(__f)); _M_invoke = &_S_invoke<_Vt>; } template requires is_constructible_v<_Tp, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(std::forward<_Args>(__args)...); } template requires is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, initializer_list<_Up> __il, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, initializer_list<_Up>&, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(__il, std::forward<_Args>(__args)...); } move_only_function& operator=(move_only_function&& __x) noexcept { _Mofunc_base::operator=(static_cast<_Mofunc_base&&>(__x)); _M_invoke = std::__exchange(__x._M_invoke, nullptr); return *this; } move_only_function& operator=(nullptr_t) noexcept { _Mofunc_base::operator=(nullptr); _M_invoke = nullptr; return *this; } template requires is_constructible_v move_only_function& operator=(_Fn&& __f) noexcept(is_nothrow_constructible_v) { move_only_function(std::forward<_Fn>(__f)).swap(*this); return *this; } ~move_only_function() = default; explicit operator bool() const noexcept { return _M_invoke != nullptr; } # 180 "/usr/include/c++/15/bits/mofunc_impl.h" 3 _Res operator()(_ArgTypes... __args) noexcept(_Noex) { do { if (std::__is_constant_evaluated() && !bool(*this != nullptr)) std::__glibcxx_assert_fail(); } while (false); return _M_invoke(this, std::forward<_ArgTypes>(__args)...); } void swap(move_only_function& __x) noexcept { _Mofunc_base::swap(__x); std::swap(_M_invoke, __x._M_invoke); } friend void swap(move_only_function& __x, move_only_function& __y) noexcept { __x.swap(__y); } friend bool operator==(const move_only_function& __x, nullptr_t) noexcept { return __x._M_invoke == nullptr; } private: template using __param_t = __conditional_t, _Tp, _Tp&&>; using _Invoker = _Res (*)(_Mofunc_base *, __param_t<_ArgTypes>...) noexcept(_Noex); template static _Res _S_invoke(_Mofunc_base * __self, __param_t<_ArgTypes>... __args) noexcept(_Noex) { using _TpCv = _Tp ; using _TpInv = _Tp &; return std::__invoke_r<_Res>( std::forward<_TpInv>(*_S_access<_TpCv>(__self)), std::forward<__param_t<_ArgTypes>>(__args)...); } _Invoker _M_invoke = nullptr; }; } # 204 "/usr/include/c++/15/bits/move_only_function.h" 2 3 # 1 "/usr/include/c++/15/bits/mofunc_impl.h" 1 3 # 43 "/usr/include/c++/15/bits/mofunc_impl.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 62 "/usr/include/c++/15/bits/mofunc_impl.h" 3 template class move_only_function<_Res(_ArgTypes...) const noexcept(_Noex)> : _Mofunc_base { template using __callable = __conditional_t<_Noex, is_nothrow_invocable_r<_Res, _Tp, _ArgTypes...>, is_invocable_r<_Res, _Tp, _ArgTypes...>>; template static constexpr bool __is_callable_from = __and_v<__callable<_Vt const >, __callable<_Vt const &>>; public: using result_type = _Res; move_only_function() noexcept { } move_only_function(nullptr_t) noexcept { } move_only_function(move_only_function&& __x) noexcept : _Mofunc_base(static_cast<_Mofunc_base&&>(__x)), _M_invoke(std::__exchange(__x._M_invoke, nullptr)) { } template> requires (!is_same_v<_Vt, move_only_function>) && (!__is_in_place_type_v<_Vt>) && __is_callable_from<_Vt> move_only_function(_Fn&& __f) noexcept(_S_nothrow_init<_Vt, _Fn>()) { if constexpr (is_function_v> || is_member_pointer_v<_Vt> || __is_move_only_function_v<_Vt>) { if (__f == nullptr) return; } _M_init<_Vt>(std::forward<_Fn>(__f)); _M_invoke = &_S_invoke<_Vt>; } template requires is_constructible_v<_Tp, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(std::forward<_Args>(__args)...); } template requires is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, initializer_list<_Up> __il, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, initializer_list<_Up>&, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(__il, std::forward<_Args>(__args)...); } move_only_function& operator=(move_only_function&& __x) noexcept { _Mofunc_base::operator=(static_cast<_Mofunc_base&&>(__x)); _M_invoke = std::__exchange(__x._M_invoke, nullptr); return *this; } move_only_function& operator=(nullptr_t) noexcept { _Mofunc_base::operator=(nullptr); _M_invoke = nullptr; return *this; } template requires is_constructible_v move_only_function& operator=(_Fn&& __f) noexcept(is_nothrow_constructible_v) { move_only_function(std::forward<_Fn>(__f)).swap(*this); return *this; } ~move_only_function() = default; explicit operator bool() const noexcept { return _M_invoke != nullptr; } # 180 "/usr/include/c++/15/bits/mofunc_impl.h" 3 _Res operator()(_ArgTypes... __args) const noexcept(_Noex) { do { if (std::__is_constant_evaluated() && !bool(*this != nullptr)) std::__glibcxx_assert_fail(); } while (false); return _M_invoke(this, std::forward<_ArgTypes>(__args)...); } void swap(move_only_function& __x) noexcept { _Mofunc_base::swap(__x); std::swap(_M_invoke, __x._M_invoke); } friend void swap(move_only_function& __x, move_only_function& __y) noexcept { __x.swap(__y); } friend bool operator==(const move_only_function& __x, nullptr_t) noexcept { return __x._M_invoke == nullptr; } private: template using __param_t = __conditional_t, _Tp, _Tp&&>; using _Invoker = _Res (*)(_Mofunc_base const*, __param_t<_ArgTypes>...) noexcept(_Noex); template static _Res _S_invoke(_Mofunc_base const* __self, __param_t<_ArgTypes>... __args) noexcept(_Noex) { using _TpCv = _Tp const; using _TpInv = _Tp const &; return std::__invoke_r<_Res>( std::forward<_TpInv>(*_S_access<_TpCv>(__self)), std::forward<__param_t<_ArgTypes>>(__args)...); } _Invoker _M_invoke = nullptr; }; } # 206 "/usr/include/c++/15/bits/move_only_function.h" 2 3 # 1 "/usr/include/c++/15/bits/mofunc_impl.h" 1 3 # 43 "/usr/include/c++/15/bits/mofunc_impl.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 62 "/usr/include/c++/15/bits/mofunc_impl.h" 3 template class move_only_function<_Res(_ArgTypes...) & noexcept(_Noex)> : _Mofunc_base { template using __callable = __conditional_t<_Noex, is_nothrow_invocable_r<_Res, _Tp, _ArgTypes...>, is_invocable_r<_Res, _Tp, _ArgTypes...>>; template static constexpr bool __is_callable_from = __and_v<__callable<_Vt &>, __callable<_Vt &>>; public: using result_type = _Res; move_only_function() noexcept { } move_only_function(nullptr_t) noexcept { } move_only_function(move_only_function&& __x) noexcept : _Mofunc_base(static_cast<_Mofunc_base&&>(__x)), _M_invoke(std::__exchange(__x._M_invoke, nullptr)) { } template> requires (!is_same_v<_Vt, move_only_function>) && (!__is_in_place_type_v<_Vt>) && __is_callable_from<_Vt> move_only_function(_Fn&& __f) noexcept(_S_nothrow_init<_Vt, _Fn>()) { if constexpr (is_function_v> || is_member_pointer_v<_Vt> || __is_move_only_function_v<_Vt>) { if (__f == nullptr) return; } _M_init<_Vt>(std::forward<_Fn>(__f)); _M_invoke = &_S_invoke<_Vt>; } template requires is_constructible_v<_Tp, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(std::forward<_Args>(__args)...); } template requires is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, initializer_list<_Up> __il, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, initializer_list<_Up>&, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(__il, std::forward<_Args>(__args)...); } move_only_function& operator=(move_only_function&& __x) noexcept { _Mofunc_base::operator=(static_cast<_Mofunc_base&&>(__x)); _M_invoke = std::__exchange(__x._M_invoke, nullptr); return *this; } move_only_function& operator=(nullptr_t) noexcept { _Mofunc_base::operator=(nullptr); _M_invoke = nullptr; return *this; } template requires is_constructible_v move_only_function& operator=(_Fn&& __f) noexcept(is_nothrow_constructible_v) { move_only_function(std::forward<_Fn>(__f)).swap(*this); return *this; } ~move_only_function() = default; explicit operator bool() const noexcept { return _M_invoke != nullptr; } # 180 "/usr/include/c++/15/bits/mofunc_impl.h" 3 _Res operator()(_ArgTypes... __args) & noexcept(_Noex) { do { if (std::__is_constant_evaluated() && !bool(*this != nullptr)) std::__glibcxx_assert_fail(); } while (false); return _M_invoke(this, std::forward<_ArgTypes>(__args)...); } void swap(move_only_function& __x) noexcept { _Mofunc_base::swap(__x); std::swap(_M_invoke, __x._M_invoke); } friend void swap(move_only_function& __x, move_only_function& __y) noexcept { __x.swap(__y); } friend bool operator==(const move_only_function& __x, nullptr_t) noexcept { return __x._M_invoke == nullptr; } private: template using __param_t = __conditional_t, _Tp, _Tp&&>; using _Invoker = _Res (*)(_Mofunc_base *, __param_t<_ArgTypes>...) noexcept(_Noex); template static _Res _S_invoke(_Mofunc_base * __self, __param_t<_ArgTypes>... __args) noexcept(_Noex) { using _TpCv = _Tp ; using _TpInv = _Tp &; return std::__invoke_r<_Res>( std::forward<_TpInv>(*_S_access<_TpCv>(__self)), std::forward<__param_t<_ArgTypes>>(__args)...); } _Invoker _M_invoke = nullptr; }; } # 208 "/usr/include/c++/15/bits/move_only_function.h" 2 3 # 1 "/usr/include/c++/15/bits/mofunc_impl.h" 1 3 # 43 "/usr/include/c++/15/bits/mofunc_impl.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 62 "/usr/include/c++/15/bits/mofunc_impl.h" 3 template class move_only_function<_Res(_ArgTypes...) && noexcept(_Noex)> : _Mofunc_base { template using __callable = __conditional_t<_Noex, is_nothrow_invocable_r<_Res, _Tp, _ArgTypes...>, is_invocable_r<_Res, _Tp, _ArgTypes...>>; template static constexpr bool __is_callable_from = __and_v<__callable<_Vt &&>, __callable<_Vt &&>>; public: using result_type = _Res; move_only_function() noexcept { } move_only_function(nullptr_t) noexcept { } move_only_function(move_only_function&& __x) noexcept : _Mofunc_base(static_cast<_Mofunc_base&&>(__x)), _M_invoke(std::__exchange(__x._M_invoke, nullptr)) { } template> requires (!is_same_v<_Vt, move_only_function>) && (!__is_in_place_type_v<_Vt>) && __is_callable_from<_Vt> move_only_function(_Fn&& __f) noexcept(_S_nothrow_init<_Vt, _Fn>()) { if constexpr (is_function_v> || is_member_pointer_v<_Vt> || __is_move_only_function_v<_Vt>) { if (__f == nullptr) return; } _M_init<_Vt>(std::forward<_Fn>(__f)); _M_invoke = &_S_invoke<_Vt>; } template requires is_constructible_v<_Tp, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(std::forward<_Args>(__args)...); } template requires is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, initializer_list<_Up> __il, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, initializer_list<_Up>&, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(__il, std::forward<_Args>(__args)...); } move_only_function& operator=(move_only_function&& __x) noexcept { _Mofunc_base::operator=(static_cast<_Mofunc_base&&>(__x)); _M_invoke = std::__exchange(__x._M_invoke, nullptr); return *this; } move_only_function& operator=(nullptr_t) noexcept { _Mofunc_base::operator=(nullptr); _M_invoke = nullptr; return *this; } template requires is_constructible_v move_only_function& operator=(_Fn&& __f) noexcept(is_nothrow_constructible_v) { move_only_function(std::forward<_Fn>(__f)).swap(*this); return *this; } ~move_only_function() = default; explicit operator bool() const noexcept { return _M_invoke != nullptr; } # 180 "/usr/include/c++/15/bits/mofunc_impl.h" 3 _Res operator()(_ArgTypes... __args) && noexcept(_Noex) { do { if (std::__is_constant_evaluated() && !bool(*this != nullptr)) std::__glibcxx_assert_fail(); } while (false); return _M_invoke(this, std::forward<_ArgTypes>(__args)...); } void swap(move_only_function& __x) noexcept { _Mofunc_base::swap(__x); std::swap(_M_invoke, __x._M_invoke); } friend void swap(move_only_function& __x, move_only_function& __y) noexcept { __x.swap(__y); } friend bool operator==(const move_only_function& __x, nullptr_t) noexcept { return __x._M_invoke == nullptr; } private: template using __param_t = __conditional_t, _Tp, _Tp&&>; using _Invoker = _Res (*)(_Mofunc_base *, __param_t<_ArgTypes>...) noexcept(_Noex); template static _Res _S_invoke(_Mofunc_base * __self, __param_t<_ArgTypes>... __args) noexcept(_Noex) { using _TpCv = _Tp ; using _TpInv = _Tp &&; return std::__invoke_r<_Res>( std::forward<_TpInv>(*_S_access<_TpCv>(__self)), std::forward<__param_t<_ArgTypes>>(__args)...); } _Invoker _M_invoke = nullptr; }; } # 210 "/usr/include/c++/15/bits/move_only_function.h" 2 3 # 1 "/usr/include/c++/15/bits/mofunc_impl.h" 1 3 # 43 "/usr/include/c++/15/bits/mofunc_impl.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 62 "/usr/include/c++/15/bits/mofunc_impl.h" 3 template class move_only_function<_Res(_ArgTypes...) const & noexcept(_Noex)> : _Mofunc_base { template using __callable = __conditional_t<_Noex, is_nothrow_invocable_r<_Res, _Tp, _ArgTypes...>, is_invocable_r<_Res, _Tp, _ArgTypes...>>; template static constexpr bool __is_callable_from = __and_v<__callable<_Vt const &>, __callable<_Vt const &>>; public: using result_type = _Res; move_only_function() noexcept { } move_only_function(nullptr_t) noexcept { } move_only_function(move_only_function&& __x) noexcept : _Mofunc_base(static_cast<_Mofunc_base&&>(__x)), _M_invoke(std::__exchange(__x._M_invoke, nullptr)) { } template> requires (!is_same_v<_Vt, move_only_function>) && (!__is_in_place_type_v<_Vt>) && __is_callable_from<_Vt> move_only_function(_Fn&& __f) noexcept(_S_nothrow_init<_Vt, _Fn>()) { if constexpr (is_function_v> || is_member_pointer_v<_Vt> || __is_move_only_function_v<_Vt>) { if (__f == nullptr) return; } _M_init<_Vt>(std::forward<_Fn>(__f)); _M_invoke = &_S_invoke<_Vt>; } template requires is_constructible_v<_Tp, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(std::forward<_Args>(__args)...); } template requires is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, initializer_list<_Up> __il, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, initializer_list<_Up>&, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(__il, std::forward<_Args>(__args)...); } move_only_function& operator=(move_only_function&& __x) noexcept { _Mofunc_base::operator=(static_cast<_Mofunc_base&&>(__x)); _M_invoke = std::__exchange(__x._M_invoke, nullptr); return *this; } move_only_function& operator=(nullptr_t) noexcept { _Mofunc_base::operator=(nullptr); _M_invoke = nullptr; return *this; } template requires is_constructible_v move_only_function& operator=(_Fn&& __f) noexcept(is_nothrow_constructible_v) { move_only_function(std::forward<_Fn>(__f)).swap(*this); return *this; } ~move_only_function() = default; explicit operator bool() const noexcept { return _M_invoke != nullptr; } # 180 "/usr/include/c++/15/bits/mofunc_impl.h" 3 _Res operator()(_ArgTypes... __args) const & noexcept(_Noex) { do { if (std::__is_constant_evaluated() && !bool(*this != nullptr)) std::__glibcxx_assert_fail(); } while (false); return _M_invoke(this, std::forward<_ArgTypes>(__args)...); } void swap(move_only_function& __x) noexcept { _Mofunc_base::swap(__x); std::swap(_M_invoke, __x._M_invoke); } friend void swap(move_only_function& __x, move_only_function& __y) noexcept { __x.swap(__y); } friend bool operator==(const move_only_function& __x, nullptr_t) noexcept { return __x._M_invoke == nullptr; } private: template using __param_t = __conditional_t, _Tp, _Tp&&>; using _Invoker = _Res (*)(_Mofunc_base const*, __param_t<_ArgTypes>...) noexcept(_Noex); template static _Res _S_invoke(_Mofunc_base const* __self, __param_t<_ArgTypes>... __args) noexcept(_Noex) { using _TpCv = _Tp const; using _TpInv = _Tp const &; return std::__invoke_r<_Res>( std::forward<_TpInv>(*_S_access<_TpCv>(__self)), std::forward<__param_t<_ArgTypes>>(__args)...); } _Invoker _M_invoke = nullptr; }; } # 213 "/usr/include/c++/15/bits/move_only_function.h" 2 3 # 1 "/usr/include/c++/15/bits/mofunc_impl.h" 1 3 # 43 "/usr/include/c++/15/bits/mofunc_impl.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 62 "/usr/include/c++/15/bits/mofunc_impl.h" 3 template class move_only_function<_Res(_ArgTypes...) const && noexcept(_Noex)> : _Mofunc_base { template using __callable = __conditional_t<_Noex, is_nothrow_invocable_r<_Res, _Tp, _ArgTypes...>, is_invocable_r<_Res, _Tp, _ArgTypes...>>; template static constexpr bool __is_callable_from = __and_v<__callable<_Vt const &&>, __callable<_Vt const &&>>; public: using result_type = _Res; move_only_function() noexcept { } move_only_function(nullptr_t) noexcept { } move_only_function(move_only_function&& __x) noexcept : _Mofunc_base(static_cast<_Mofunc_base&&>(__x)), _M_invoke(std::__exchange(__x._M_invoke, nullptr)) { } template> requires (!is_same_v<_Vt, move_only_function>) && (!__is_in_place_type_v<_Vt>) && __is_callable_from<_Vt> move_only_function(_Fn&& __f) noexcept(_S_nothrow_init<_Vt, _Fn>()) { if constexpr (is_function_v> || is_member_pointer_v<_Vt> || __is_move_only_function_v<_Vt>) { if (__f == nullptr) return; } _M_init<_Vt>(std::forward<_Fn>(__f)); _M_invoke = &_S_invoke<_Vt>; } template requires is_constructible_v<_Tp, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(std::forward<_Args>(__args)...); } template requires is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> && __is_callable_from<_Tp> explicit move_only_function(in_place_type_t<_Tp>, initializer_list<_Up> __il, _Args&&... __args) noexcept(_S_nothrow_init<_Tp, initializer_list<_Up>&, _Args...>()) : _M_invoke(&_S_invoke<_Tp>) { static_assert(is_same_v, _Tp>); _M_init<_Tp>(__il, std::forward<_Args>(__args)...); } move_only_function& operator=(move_only_function&& __x) noexcept { _Mofunc_base::operator=(static_cast<_Mofunc_base&&>(__x)); _M_invoke = std::__exchange(__x._M_invoke, nullptr); return *this; } move_only_function& operator=(nullptr_t) noexcept { _Mofunc_base::operator=(nullptr); _M_invoke = nullptr; return *this; } template requires is_constructible_v move_only_function& operator=(_Fn&& __f) noexcept(is_nothrow_constructible_v) { move_only_function(std::forward<_Fn>(__f)).swap(*this); return *this; } ~move_only_function() = default; explicit operator bool() const noexcept { return _M_invoke != nullptr; } # 180 "/usr/include/c++/15/bits/mofunc_impl.h" 3 _Res operator()(_ArgTypes... __args) const && noexcept(_Noex) { do { if (std::__is_constant_evaluated() && !bool(*this != nullptr)) std::__glibcxx_assert_fail(); } while (false); return _M_invoke(this, std::forward<_ArgTypes>(__args)...); } void swap(move_only_function& __x) noexcept { _Mofunc_base::swap(__x); std::swap(_M_invoke, __x._M_invoke); } friend void swap(move_only_function& __x, move_only_function& __y) noexcept { __x.swap(__y); } friend bool operator==(const move_only_function& __x, nullptr_t) noexcept { return __x._M_invoke == nullptr; } private: template using __param_t = __conditional_t, _Tp, _Tp&&>; using _Invoker = _Res (*)(_Mofunc_base const*, __param_t<_ArgTypes>...) noexcept(_Noex); template static _Res _S_invoke(_Mofunc_base const* __self, __param_t<_ArgTypes>... __args) noexcept(_Noex) { using _TpCv = _Tp const; using _TpInv = _Tp const &&; return std::__invoke_r<_Res>( std::forward<_TpInv>(*_S_access<_TpCv>(__self)), std::forward<__param_t<_ArgTypes>>(__args)...); } _Invoker _M_invoke = nullptr; }; } # 216 "/usr/include/c++/15/bits/move_only_function.h" 2 3 # 77 "/usr/include/c++/15/functional" 2 3 # 90 "/usr/include/c++/15/functional" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 91 "/usr/include/c++/15/functional" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template struct _Placeholder { }; # 117 "/usr/include/c++/15/functional" 3 template inline constexpr invoke_result_t<_Callable, _Args...> invoke(_Callable&& __fn, _Args&&... __args) noexcept(is_nothrow_invocable_v<_Callable, _Args...>) { return std::__invoke(std::forward<_Callable>(__fn), std::forward<_Args>(__args)...); } # 136 "/usr/include/c++/15/functional" 3 template requires is_invocable_r_v<_Res, _Callable, _Args...> constexpr _Res invoke_r(_Callable&& __fn, _Args&&... __args) noexcept(is_nothrow_invocable_r_v<_Res, _Callable, _Args...>) { return std::__invoke_r<_Res>(std::forward<_Callable>(__fn), std::forward<_Args>(__args)...); } template::value> class _Mem_fn_base : public _Mem_fn_traits<_MemFunPtr>::__maybe_type { using _Traits = _Mem_fn_traits<_MemFunPtr>; using _Arity = typename _Traits::__arity; using _Varargs = typename _Traits::__vararg; template friend struct _Bind_check_arity; _MemFunPtr _M_pmf; public: using result_type = typename _Traits::__result_type; explicit constexpr _Mem_fn_base(_MemFunPtr __pmf) noexcept : _M_pmf(__pmf) { } template constexpr auto operator()(_Args&&... __args) const noexcept(noexcept( std::__invoke(_M_pmf, std::forward<_Args>(__args)...))) -> decltype(std::__invoke(_M_pmf, std::forward<_Args>(__args)...)) { return std::__invoke(_M_pmf, std::forward<_Args>(__args)...); } }; template class _Mem_fn_base<_MemObjPtr, false> { using _Arity = integral_constant; using _Varargs = false_type; template friend struct _Bind_check_arity; _MemObjPtr _M_pm; public: explicit constexpr _Mem_fn_base(_MemObjPtr __pm) noexcept : _M_pm(__pm) { } template constexpr auto operator()(_Tp&& __obj) const noexcept(noexcept(std::__invoke(_M_pm, std::forward<_Tp>(__obj)))) -> decltype(std::__invoke(_M_pm, std::forward<_Tp>(__obj))) { return std::__invoke(_M_pm, std::forward<_Tp>(__obj)); } }; template struct _Mem_fn; template struct _Mem_fn<_Res _Class::*> : _Mem_fn_base<_Res _Class::*> { using _Mem_fn_base<_Res _Class::*>::_Mem_fn_base; }; # 243 "/usr/include/c++/15/functional" 3 template constexpr inline _Mem_fn<_Tp _Class::*> mem_fn(_Tp _Class::* __pm) noexcept { return _Mem_fn<_Tp _Class::*>(__pm); } # 262 "/usr/include/c++/15/functional" 3 template struct is_bind_expression : public false_type { }; # 274 "/usr/include/c++/15/functional" 3 template struct is_placeholder : public integral_constant { }; template inline constexpr bool is_bind_expression_v = is_bind_expression<_Tp>::value; template inline constexpr int is_placeholder_v = is_placeholder<_Tp>::value; namespace placeholders { # 303 "/usr/include/c++/15/functional" 3 inline const _Placeholder<1> _1; inline const _Placeholder<2> _2; inline const _Placeholder<3> _3; inline const _Placeholder<4> _4; inline const _Placeholder<5> _5; inline const _Placeholder<6> _6; inline const _Placeholder<7> _7; inline const _Placeholder<8> _8; inline const _Placeholder<9> _9; inline const _Placeholder<10> _10; inline const _Placeholder<11> _11; inline const _Placeholder<12> _12; inline const _Placeholder<13> _13; inline const _Placeholder<14> _14; inline const _Placeholder<15> _15; inline const _Placeholder<16> _16; inline const _Placeholder<17> _17; inline const _Placeholder<18> _18; inline const _Placeholder<19> _19; inline const _Placeholder<20> _20; inline const _Placeholder<21> _21; inline const _Placeholder<22> _22; inline const _Placeholder<23> _23; inline const _Placeholder<24> _24; inline const _Placeholder<25> _25; inline const _Placeholder<26> _26; inline const _Placeholder<27> _27; inline const _Placeholder<28> _28; inline const _Placeholder<29> _29; } template struct is_placeholder<_Placeholder<_Num> > : public integral_constant { }; template struct is_placeholder > : public integral_constant { }; template using _Safe_tuple_element_t = typename enable_if<(__i < tuple_size<_Tuple>::value), tuple_element<__i, _Tuple>>::type::type; # 371 "/usr/include/c++/15/functional" 3 template::value, bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)> class _Mu; template class _Mu, false, false> { public: template constexpr _Tp& operator()(_CVRef& __arg, _Tuple&) const volatile { return __arg.get(); } }; template class _Mu<_Arg, true, false> { public: template constexpr auto operator()(_CVArg& __arg, tuple<_Args...>& __tuple) const volatile -> decltype(__arg(declval<_Args>()...)) { typedef typename _Build_index_tuple::__type _Indexes; return this->__call(__arg, __tuple, _Indexes()); } private: template constexpr auto __call(_CVArg& __arg, tuple<_Args...>& __tuple, const _Index_tuple<_Indexes...>&) const volatile -> decltype(__arg(declval<_Args>()...)) { return __arg(std::get<_Indexes>(std::move(__tuple))...); } }; template class _Mu<_Arg, false, true> { public: template constexpr _Safe_tuple_element_t<(is_placeholder<_Arg>::value - 1), _Tuple>&& operator()(const volatile _Arg&, _Tuple& __tuple) const volatile { return ::std::get<(is_placeholder<_Arg>::value - 1)>(std::move(__tuple)); } }; template class _Mu<_Arg, false, false> { public: template constexpr _CVArg&& operator()(_CVArg&& __arg, _Tuple&) const volatile { return std::forward<_CVArg>(__arg); } }; template inline auto __volget(volatile tuple<_Tp...>& __tuple) -> __tuple_element_t<_Ind, tuple<_Tp...>> volatile& { return std::get<_Ind>(const_cast&>(__tuple)); } template inline auto __volget(const volatile tuple<_Tp...>& __tuple) -> __tuple_element_t<_Ind, tuple<_Tp...>> const volatile& { return std::get<_Ind>(const_cast&>(__tuple)); } # 496 "/usr/include/c++/15/functional" 3 template class _Bind; template class _Bind<_Functor(_Bound_args...)> : public _Weak_result_type<_Functor> { typedef typename _Build_index_tuple::__type _Bound_indexes; _Functor _M_f; tuple<_Bound_args...> _M_bound_args; template constexpr _Result __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) { return std::__invoke(_M_f, _Mu<_Bound_args>()(std::get<_Indexes>(_M_bound_args), __args)... ); } template constexpr _Result __call_c(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const { return std::__invoke(_M_f, _Mu<_Bound_args>()(std::get<_Indexes>(_M_bound_args), __args)... ); } # 555 "/usr/include/c++/15/functional" 3 template using _Mu_type = decltype( _Mu::type>()( std::declval<_BoundArg&>(), std::declval<_CallArgs&>()) ); template using _Res_type_impl = __invoke_result_t<_Fn&, _Mu_type<_BArgs, _CallArgs>&&...>; template using _Res_type = _Res_type_impl<_Functor, _CallArgs, _Bound_args...>; template using __dependent = typename enable_if::value+1), _Functor>::type; template class __cv_quals> using _Res_type_cv = _Res_type_impl< typename __cv_quals<__dependent<_CallArgs>>::type, _CallArgs, typename __cv_quals<_Bound_args>::type...>; public: template explicit constexpr _Bind(const _Functor& __f, _Args&&... __args) : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...) { } template explicit constexpr _Bind(_Functor&& __f, _Args&&... __args) : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...) { } _Bind(const _Bind&) = default; _Bind(_Bind&&) = default; template>> constexpr _Result operator()(_Args&&... __args) { return this->__call<_Result>( std::forward_as_tuple(std::forward<_Args>(__args)...), _Bound_indexes()); } template, add_const>> constexpr _Result operator()(_Args&&... __args) const { return this->__call_c<_Result>( std::forward_as_tuple(std::forward<_Args>(__args)...), _Bound_indexes()); } # 642 "/usr/include/c++/15/functional" 3 }; template class _Bind_result; template class _Bind_result<_Result, _Functor(_Bound_args...)> { typedef typename _Build_index_tuple::__type _Bound_indexes; _Functor _M_f; tuple<_Bound_args...> _M_bound_args; template constexpr _Res __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) { return std::__invoke_r<_Res>(_M_f, _Mu<_Bound_args>() (std::get<_Indexes>(_M_bound_args), __args)...); } template constexpr _Res __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const { return std::__invoke_r<_Res>(_M_f, _Mu<_Bound_args>() (std::get<_Indexes>(_M_bound_args), __args)...); } # 698 "/usr/include/c++/15/functional" 3 public: typedef _Result result_type; template explicit constexpr _Bind_result(const _Functor& __f, _Args&&... __args) : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...) { } template explicit constexpr _Bind_result(_Functor&& __f, _Args&&... __args) : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...) { } _Bind_result(const _Bind_result&) = default; _Bind_result(_Bind_result&&) = default; template constexpr result_type operator()(_Args&&... __args) { return this->__call<_Result>( std::forward_as_tuple(std::forward<_Args>(__args)...), _Bound_indexes()); } template constexpr result_type operator()(_Args&&... __args) const { return this->__call<_Result>( std::forward_as_tuple(std::forward<_Args>(__args)...), _Bound_indexes()); } # 761 "/usr/include/c++/15/functional" 3 template void operator()(_Args&&...) const volatile = delete; }; # 773 "/usr/include/c++/15/functional" 3 template struct is_bind_expression<_Bind<_Signature> > : public true_type { }; template struct is_bind_expression > : public true_type { }; template struct is_bind_expression > : public true_type { }; template struct is_bind_expression> : public true_type { }; template struct is_bind_expression<_Bind_result<_Result, _Signature>> : public true_type { }; template struct is_bind_expression> : public true_type { }; template struct is_bind_expression> : public true_type { }; template struct is_bind_expression> : public true_type { }; template struct _Bind_check_arity { }; template struct _Bind_check_arity<_Ret (*)(_Args...), _BoundArgs...> { static_assert(sizeof...(_BoundArgs) == sizeof...(_Args), "Wrong number of arguments for function"); }; template struct _Bind_check_arity<_Ret (*)(_Args..., ...), _BoundArgs...> { static_assert(sizeof...(_BoundArgs) >= sizeof...(_Args), "Wrong number of arguments for function"); }; template struct _Bind_check_arity<_Tp _Class::*, _BoundArgs...> { using _Arity = typename _Mem_fn<_Tp _Class::*>::_Arity; using _Varargs = typename _Mem_fn<_Tp _Class::*>::_Varargs; static_assert(_Varargs::value ? sizeof...(_BoundArgs) >= _Arity::value + 1 : sizeof...(_BoundArgs) == _Arity::value + 1, "Wrong number of arguments for pointer-to-member"); }; template::type> using __is_socketlike = __or_, is_enum<_Tp2>>; template struct _Bind_helper : _Bind_check_arity::type, _BoundArgs...> { typedef typename decay<_Func>::type __func_type; typedef _Bind<__func_type(typename decay<_BoundArgs>::type...)> type; }; template struct _Bind_helper { }; template inline constexpr typename _Bind_helper<__is_socketlike<_Func>::value, _Func, _BoundArgs...>::type bind(_Func&& __f, _BoundArgs&&... __args) { typedef _Bind_helper __helper_type; return typename __helper_type::type(std::forward<_Func>(__f), std::forward<_BoundArgs>(__args)...); } template struct _Bindres_helper : _Bind_check_arity::type, _BoundArgs...> { typedef typename decay<_Func>::type __functor_type; typedef _Bind_result<_Result, __functor_type(typename decay<_BoundArgs>::type...)> type; }; template inline constexpr typename _Bindres_helper<_Result, _Func, _BoundArgs...>::type bind(_Func&& __f, _BoundArgs&&... __args) { typedef _Bindres_helper<_Result, _Func, _BoundArgs...> __helper_type; return typename __helper_type::type(std::forward<_Func>(__f), std::forward<_BoundArgs>(__args)...); } template struct _Bind_front { static_assert(is_move_constructible_v<_Fd>); static_assert((is_move_constructible_v<_BoundArgs> && ...)); template explicit constexpr _Bind_front(int, _Fn&& __fn, _Args&&... __args) noexcept(__and_, is_nothrow_constructible<_BoundArgs, _Args>...>::value) : _M_fd(std::forward<_Fn>(__fn)), _M_bound_args(std::forward<_Args>(__args)...) { static_assert(sizeof...(_Args) == sizeof...(_BoundArgs)); } template constexpr invoke_result_t<__like_t<_Self, _Fd>, __like_t<_Self, _BoundArgs>..., _CallArgs...> operator()(this _Self&& __self, _CallArgs&&... __call_args) noexcept(is_nothrow_invocable_v<__like_t<_Self, _Fd>, __like_t<_Self, _BoundArgs>..., _CallArgs...>) { return _S_call(__like_t<_Self, _Bind_front>(__self), _BoundIndices(), std::forward<_CallArgs>(__call_args)...); } # 1012 "/usr/include/c++/15/functional" 3 private: using _BoundIndices = index_sequence_for<_BoundArgs...>; template static constexpr decltype(auto) _S_call(_Tp&& __g, index_sequence<_Ind...>, _CallArgs&&... __call_args) { return std::invoke(std::forward<_Tp>(__g)._M_fd, std::get<_Ind>(std::forward<_Tp>(__g)._M_bound_args)..., std::forward<_CallArgs>(__call_args)...); } [[no_unique_address]] _Fd _M_fd; [[no_unique_address]] std::tuple<_BoundArgs...> _M_bound_args; }; template using _Bind_front_t = _Bind_front, decay_t<_Args>...>; # 1041 "/usr/include/c++/15/functional" 3 template constexpr _Bind_front_t<_Fn, _Args...> bind_front(_Fn&& __fn, _Args&&... __args) noexcept(is_nothrow_constructible_v<_Bind_front_t<_Fn, _Args...>, int, _Fn, _Args...>) { return _Bind_front_t<_Fn, _Args...>(0, std::forward<_Fn>(__fn), std::forward<_Args>(__args)...); } template struct _Bind_back { static_assert(is_move_constructible_v<_Fd>); static_assert((is_move_constructible_v<_BoundArgs> && ...)); template explicit constexpr _Bind_back(int, _Fn&& __fn, _Args&&... __args) noexcept(__and_, is_nothrow_constructible<_BoundArgs, _Args>...>::value) : _M_fd(std::forward<_Fn>(__fn)), _M_bound_args(std::forward<_Args>(__args)...) { static_assert(sizeof...(_Args) == sizeof...(_BoundArgs)); } template constexpr invoke_result_t<__like_t<_Self, _Fd>, _CallArgs..., __like_t<_Self, _BoundArgs>...> operator()(this _Self&& __self, _CallArgs&&... __call_args) noexcept(is_nothrow_invocable_v<__like_t<_Self, _Fd>, _CallArgs..., __like_t<_Self, _BoundArgs>...>) { return _S_call(__like_t<_Self, _Bind_back>(__self), _BoundIndices(), std::forward<_CallArgs>(__call_args)...); } private: using _BoundIndices = index_sequence_for<_BoundArgs...>; template static constexpr decltype(auto) _S_call(_Tp&& __g, index_sequence<_Ind...>, _CallArgs&&... __call_args) { return std::invoke(std::forward<_Tp>(__g)._M_fd, std::forward<_CallArgs>(__call_args)..., std::get<_Ind>(std::forward<_Tp>(__g)._M_bound_args)...); } [[no_unique_address]] _Fd _M_fd; [[no_unique_address]] std::tuple<_BoundArgs...> _M_bound_args; }; template using _Bind_back_t = _Bind_back, decay_t<_Args>...>; # 1110 "/usr/include/c++/15/functional" 3 template constexpr _Bind_back_t<_Fn, _Args...> bind_back(_Fn&& __fn, _Args&&... __args) noexcept(is_nothrow_constructible_v<_Bind_back_t<_Fn, _Args...>, int, _Fn, _Args...>) { return _Bind_back_t<_Fn, _Args...>(0, std::forward<_Fn>(__fn), std::forward<_Args>(__args)...); } template class _Not_fn { template using __inv_res_t = typename __invoke_result<_Fn2, _Args...>::type; template static decltype(!std::declval<_Tp>()) _S_not() noexcept(noexcept(!std::declval<_Tp>())); public: template constexpr _Not_fn(_Fn2&& __fn, int) : _M_fn(std::forward<_Fn2>(__fn)) { } _Not_fn(const _Not_fn& __fn) = default; _Not_fn(_Not_fn&& __fn) = default; ~_Not_fn() = default; # 1163 "/usr/include/c++/15/functional" 3 template::value>> constexpr decltype(_S_not<__inv_res_t<_Fn &, _Args...>>()) operator()(_Args&&... __args) & noexcept(__is_nothrow_invocable<_Fn &, _Args...>::value && noexcept(_S_not<__inv_res_t<_Fn &, _Args...>>())) { return !std::__invoke(std::forward< _Fn & >(_M_fn), std::forward<_Args>(__args)...); } template::value>> void operator()(_Args&&... __args) & = delete; template::value>> constexpr decltype(_S_not<__inv_res_t<_Fn const &, _Args...>>()) operator()(_Args&&... __args) const & noexcept(__is_nothrow_invocable<_Fn const &, _Args...>::value && noexcept(_S_not<__inv_res_t<_Fn const &, _Args...>>())) { return !std::__invoke(std::forward< _Fn const & >(_M_fn), std::forward<_Args>(__args)...); } template::value>> void operator()(_Args&&... __args) const & = delete; template::value>> constexpr decltype(_S_not<__inv_res_t<_Fn &&, _Args...>>()) operator()(_Args&&... __args) && noexcept(__is_nothrow_invocable<_Fn &&, _Args...>::value && noexcept(_S_not<__inv_res_t<_Fn &&, _Args...>>())) { return !std::__invoke(std::forward< _Fn && >(_M_fn), std::forward<_Args>(__args)...); } template::value>> void operator()(_Args&&... __args) && = delete; template::value>> constexpr decltype(_S_not<__inv_res_t<_Fn const &&, _Args...>>()) operator()(_Args&&... __args) const && noexcept(__is_nothrow_invocable<_Fn const &&, _Args...>::value && noexcept(_S_not<__inv_res_t<_Fn const &&, _Args...>>())) { return !std::__invoke(std::forward< _Fn const && >(_M_fn), std::forward<_Args>(__args)...); } template::value>> void operator()(_Args&&... __args) const && = delete; private: _Fn _M_fn; }; template struct __is_byte_like : false_type { }; template struct __is_byte_like<_Tp, equal_to<_Tp>> : __bool_constant::value> { }; template struct __is_byte_like<_Tp, equal_to> : __bool_constant::value> { }; enum class byte : unsigned char; template<> struct __is_byte_like> : true_type { }; template<> struct __is_byte_like> : true_type { }; # 1211 "/usr/include/c++/15/functional" 3 template constexpr inline auto not_fn(_Fn&& __fn) noexcept(std::is_nothrow_constructible, _Fn&&>::value) { return _Not_fn>{std::forward<_Fn>(__fn), 0}; } template> class default_searcher { public: constexpr default_searcher(_ForwardIterator1 __pat_first, _ForwardIterator1 __pat_last, _BinaryPredicate __pred = _BinaryPredicate()) : _M_m(__pat_first, __pat_last, std::move(__pred)) { } template constexpr pair<_ForwardIterator2, _ForwardIterator2> operator()(_ForwardIterator2 __first, _ForwardIterator2 __last) const { _ForwardIterator2 __first_ret = std::search(__first, __last, std::get<0>(_M_m), std::get<1>(_M_m), std::get<2>(_M_m)); auto __ret = std::make_pair(__first_ret, __first_ret); if (__ret.first != __last) std::advance(__ret.second, std::distance(std::get<0>(_M_m), std::get<1>(_M_m))); return __ret; } private: tuple<_ForwardIterator1, _ForwardIterator1, _BinaryPredicate> _M_m; }; template struct __boyer_moore_map_base { template __boyer_moore_map_base(_RAIter __pat, size_t __patlen, _Hash&& __hf, _Pred&& __pred) : _M_bad_char{ __patlen, std::move(__hf), std::move(__pred) } { if (__patlen > 0) for (__diff_type __i = 0; __i < __patlen - 1; ++__i) _M_bad_char[__pat[__i]] = __patlen - 1 - __i; } using __diff_type = _Tp; __diff_type _M_lookup(_Key __key, __diff_type __not_found) const { auto __iter = _M_bad_char.find(__key); if (__iter == _M_bad_char.end()) return __not_found; return __iter->second; } _Pred _M_pred() const { return _M_bad_char.key_eq(); } std::unordered_map<_Key, _Tp, _Hash, _Pred> _M_bad_char; }; template struct __boyer_moore_array_base { template __boyer_moore_array_base(_RAIter __pat, size_t __patlen, _Unused&&, _Pred&& __pred) : _M_bad_char{ array<_Tp, _Len>{}, std::move(__pred) } { std::get<0>(_M_bad_char).fill(__patlen); if (__patlen > 0) for (__diff_type __i = 0; __i < __patlen - 1; ++__i) { auto __ch = __pat[__i]; using _UCh = make_unsigned_t; auto __uch = static_cast<_UCh>(__ch); std::get<0>(_M_bad_char)[__uch] = __patlen - 1 - __i; } } using __diff_type = _Tp; template __diff_type _M_lookup(_Key __key, __diff_type __not_found) const { auto __ukey = static_cast>(__key); if (__ukey >= _Len) return __not_found; return std::get<0>(_M_bad_char)[__ukey]; } const _Pred& _M_pred() const { return std::get<1>(_M_bad_char); } tuple, _Pred> _M_bad_char; }; template::value_type, typename _Diff = typename iterator_traits<_RAIter>::difference_type> using __boyer_moore_base_t = __conditional_t<__is_byte_like<_Val, _Pred>::value, __boyer_moore_array_base<_Diff, 256, _Pred>, __boyer_moore_map_base<_Val, _Diff, _Hash, _Pred>>; template::value_type>, typename _BinaryPredicate = equal_to<>> class boyer_moore_searcher : __boyer_moore_base_t<_RAIter, _Hash, _BinaryPredicate> { using _Base = __boyer_moore_base_t<_RAIter, _Hash, _BinaryPredicate>; using typename _Base::__diff_type; public: boyer_moore_searcher(_RAIter __pat_first, _RAIter __pat_last, _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate()); template pair<_RandomAccessIterator2, _RandomAccessIterator2> operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const; private: bool _M_is_prefix(_RAIter __word, __diff_type __len, __diff_type __pos) { const auto& __pred = this->_M_pred(); __diff_type __suffixlen = __len - __pos; for (__diff_type __i = 0; __i < __suffixlen; ++__i) if (!__pred(__word[__i], __word[__pos + __i])) return false; return true; } __diff_type _M_suffix_length(_RAIter __word, __diff_type __len, __diff_type __pos) { const auto& __pred = this->_M_pred(); __diff_type __i = 0; while (__pred(__word[__pos - __i], __word[__len - 1 - __i]) && __i < __pos) { ++__i; } return __i; } template __diff_type _M_bad_char_shift(_Tp __c) const { return this->_M_lookup(__c, _M_pat_end - _M_pat); } _RAIter _M_pat; _RAIter _M_pat_end; std::vector<__diff_type> _M_good_suffix; }; template::value_type>, typename _BinaryPredicate = equal_to<>> class boyer_moore_horspool_searcher : __boyer_moore_base_t<_RAIter, _Hash, _BinaryPredicate> { using _Base = __boyer_moore_base_t<_RAIter, _Hash, _BinaryPredicate>; using typename _Base::__diff_type; public: boyer_moore_horspool_searcher(_RAIter __pat, _RAIter __pat_end, _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate()) : _Base(__pat, __pat_end - __pat, std::move(__hf), std::move(__pred)), _M_pat(__pat), _M_pat_end(__pat_end) { } template pair<_RandomAccessIterator2, _RandomAccessIterator2> operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const { const auto& __pred = this->_M_pred(); auto __patlen = _M_pat_end - _M_pat; if (__patlen == 0) return std::make_pair(__first, __first); auto __len = __last - __first; while (__len >= __patlen) { for (auto __scan = __patlen - 1; __pred(__first[__scan], _M_pat[__scan]); --__scan) if (__scan == 0) return std::make_pair(__first, __first + __patlen); auto __shift = _M_bad_char_shift(__first[__patlen - 1]); __len -= __shift; __first += __shift; } return std::make_pair(__last, __last); } private: template __diff_type _M_bad_char_shift(_Tp __c) const { return this->_M_lookup(__c, _M_pat_end - _M_pat); } _RAIter _M_pat; _RAIter _M_pat_end; }; template boyer_moore_searcher<_RAIter, _Hash, _BinaryPredicate>:: boyer_moore_searcher(_RAIter __pat, _RAIter __pat_end, _Hash __hf, _BinaryPredicate __pred) : _Base(__pat, __pat_end - __pat, std::move(__hf), std::move(__pred)), _M_pat(__pat), _M_pat_end(__pat_end), _M_good_suffix(__pat_end - __pat) { auto __patlen = __pat_end - __pat; if (__patlen == 0) return; __diff_type __last_prefix = __patlen - 1; for (__diff_type __p = __patlen - 1; __p >= 0; --__p) { if (_M_is_prefix(__pat, __patlen, __p + 1)) __last_prefix = __p + 1; _M_good_suffix[__p] = __last_prefix + (__patlen - 1 - __p); } for (__diff_type __p = 0; __p < __patlen - 1; ++__p) { auto __slen = _M_suffix_length(__pat, __patlen, __p); auto __pos = __patlen - 1 - __slen; if (!__pred(__pat[__p - __slen], __pat[__pos])) _M_good_suffix[__pos] = __patlen - 1 - __p + __slen; } } template template pair<_RandomAccessIterator2, _RandomAccessIterator2> boyer_moore_searcher<_RAIter, _Hash, _BinaryPredicate>:: operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const { auto __patlen = _M_pat_end - _M_pat; if (__patlen == 0) return std::make_pair(__first, __first); const auto& __pred = this->_M_pred(); __diff_type __i = __patlen - 1; auto __stringlen = __last - __first; while (__i < __stringlen) { __diff_type __j = __patlen - 1; while (__j >= 0 && __pred(__first[__i], _M_pat[__j])) { --__i; --__j; } if (__j < 0) { const auto __match = __first + __i + 1; return std::make_pair(__match, __match + __patlen); } __i += std::max(_M_bad_char_shift(__first[__i]), _M_good_suffix[__j]); } return std::make_pair(__last, __last); } } # 9 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Utilities/Hash.hh" 2 # 1 "/usr/include/c++/15/span" 1 3 # 43 "/usr/include/c++/15/span" 3 # 1 "/usr/include/c++/15/bits/version.h" 1 3 # 44 "/usr/include/c++/15/span" 2 3 # 53 "/usr/include/c++/15/span" 3 namespace std __attribute__ ((__visibility__ ("default"))) { inline constexpr size_t dynamic_extent = static_cast(-1); template class span; namespace __detail { template inline constexpr bool __is_span = false; template inline constexpr bool __is_span> = true; template inline constexpr bool __is_std_array = false; template inline constexpr bool __is_std_array> = true; template class __extent_storage { public: constexpr __extent_storage([[maybe_unused]] size_t __n) noexcept { do { if (std::__is_constant_evaluated() && !bool(__n == _Extent)) std::__glibcxx_assert_fail(); } while (false); } consteval __extent_storage(integral_constant) noexcept { } template __extent_storage(integral_constant) = delete; [[__gnu__::__always_inline__]] static constexpr size_t _M_extent() noexcept { return _Extent; } }; template<> class __extent_storage { public: [[__gnu__::__always_inline__]] constexpr __extent_storage(size_t __extent) noexcept : _M_extent_value(__extent) { } [[__gnu__::__always_inline__]] constexpr size_t _M_extent() const noexcept { return this->_M_extent_value; } private: size_t _M_extent_value; }; template struct __span_ptr { _Type* const _M_ptr; }; } template class span { template static constexpr size_t _S_subspan_extent() { if constexpr (_Count != dynamic_extent) return _Count; else if constexpr (extent != dynamic_extent) return _Extent - _Offset; else return dynamic_extent; } template requires (_Extent == dynamic_extent || _ArrayExtent == _Extent) using __is_compatible_array = __is_array_convertible<_Type, _Tp>; template using __is_compatible_ref = __is_array_convertible<_Type, remove_reference_t<_Ref>>; struct __iter_tag; template static inline constexpr integral_constant __v{}; public: using element_type = _Type; using value_type = remove_cv_t<_Type>; using size_type = size_t; using difference_type = ptrdiff_t; using pointer = _Type*; using const_pointer = const _Type*; using reference = element_type&; using const_reference = const element_type&; using iterator = __gnu_cxx::__normal_iterator; using reverse_iterator = std::reverse_iterator; using const_iterator = std::const_iterator; using const_reverse_iterator = std::const_iterator; static constexpr size_t extent = _Extent; constexpr span() noexcept requires (_Extent == dynamic_extent || _Extent == 0) : _M_ptr(nullptr), _M_extent(__v<0>) { } template requires __is_compatible_ref>::value constexpr explicit(extent != dynamic_extent) span(_It __first, size_type __count) noexcept : _M_ptr(std::to_address(__first)), _M_extent(__count) { ; } template _End> requires __is_compatible_ref>::value && (!is_convertible_v<_End, size_type>) constexpr explicit(extent != dynamic_extent) span(_It __first, _End __last) noexcept(noexcept(__last - __first)) : _M_ptr(std::to_address(__first)), _M_extent(static_cast(__last - __first)) { ; } template requires (_Extent == dynamic_extent || _ArrayExtent == _Extent) constexpr span(type_identity_t (&__arr)[_ArrayExtent]) noexcept : _M_ptr(__arr), _M_extent(__v<_ArrayExtent>) { } template requires __is_compatible_array<_Tp, _ArrayExtent>::value constexpr span(array<_Tp, _ArrayExtent>& __arr) noexcept : _M_ptr(__arr.data()), _M_extent(__v<_ArrayExtent>) { } template requires __is_compatible_array::value constexpr span(const array<_Tp, _ArrayExtent>& __arr) noexcept : _M_ptr(__arr.data()), _M_extent(__v<_ArrayExtent>) { } template requires (!__detail::__is_span>) && (!__detail::__is_std_array>) && (!is_array_v>) && ranges::contiguous_range<_Range> && ranges::sized_range<_Range> && (ranges::borrowed_range<_Range> || is_const_v) && __is_compatible_ref>::value constexpr explicit(extent != dynamic_extent) span(_Range&& __range) noexcept(noexcept(ranges::data(__range)) && noexcept(ranges::size(__range))) : _M_ptr(ranges::data(__range)), _M_extent(ranges::size(__range)) { } # 247 "/usr/include/c++/15/span" 3 constexpr span(const span&) noexcept = default; template requires (_Extent == dynamic_extent || _OExtent == dynamic_extent || _Extent == _OExtent) && (__is_array_convertible<_Type, _OType>::value) constexpr explicit(extent != dynamic_extent && _OExtent == dynamic_extent) span(const span<_OType, _OExtent>& __s) noexcept : _M_ptr(__s.data()), _M_extent(__s.size()) { } constexpr span& operator=(const span&) noexcept = default; [[nodiscard]] constexpr size_type size() const noexcept { return this->_M_extent._M_extent(); } [[nodiscard]] constexpr size_type size_bytes() const noexcept { return this->_M_extent._M_extent() * sizeof(element_type); } [[nodiscard]] constexpr bool empty() const noexcept { return size() == 0; } [[nodiscard]] constexpr reference front() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!empty())) std::__glibcxx_assert_fail(); } while (false); return *this->_M_ptr; } [[nodiscard]] constexpr reference back() const noexcept { do { if (std::__is_constant_evaluated() && !bool(!empty())) std::__glibcxx_assert_fail(); } while (false); return *(this->_M_ptr + (size() - 1)); } [[nodiscard]] constexpr reference operator[](size_type __idx) const noexcept { do { if (std::__is_constant_evaluated() && !bool(__idx < size())) std::__glibcxx_assert_fail(); } while (false); return *(this->_M_ptr + __idx); } # 318 "/usr/include/c++/15/span" 3 [[nodiscard]] constexpr pointer data() const noexcept { return this->_M_ptr; } [[nodiscard]] constexpr iterator begin() const noexcept { return iterator(this->_M_ptr); } [[nodiscard]] constexpr iterator end() const noexcept { return iterator(this->_M_ptr + this->size()); } [[nodiscard]] constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator(this->end()); } [[nodiscard]] constexpr reverse_iterator rend() const noexcept { return reverse_iterator(this->begin()); } [[nodiscard]] constexpr const_iterator cbegin() const noexcept { return begin(); } [[nodiscard]] constexpr const_iterator cend() const noexcept { return end(); } [[nodiscard]] constexpr const_reverse_iterator crbegin() const noexcept { return rbegin(); } [[nodiscard]] constexpr const_reverse_iterator crend() const noexcept { return rend(); } template [[nodiscard]] constexpr span first() const noexcept { if constexpr (_Extent == dynamic_extent) do { if (std::__is_constant_evaluated() && !bool(_Count <= size())) std::__glibcxx_assert_fail(); } while (false); else static_assert(_Count <= extent); using _Sp = span; return _Sp(_SizedPtr{this->data()}); } [[nodiscard]] constexpr span first(size_type __count) const noexcept { do { if (std::__is_constant_evaluated() && !bool(__count <= size())) std::__glibcxx_assert_fail(); } while (false); return span(this->data(), __count); } template [[nodiscard]] constexpr span last() const noexcept { if constexpr (_Extent == dynamic_extent) do { if (std::__is_constant_evaluated() && !bool(_Count <= size())) std::__glibcxx_assert_fail(); } while (false); else static_assert(_Count <= extent); using _Sp = span; return _Sp(_SizedPtr{this->data() + (this->size() - _Count)}); } [[nodiscard]] constexpr span last(size_type __count) const noexcept { do { if (std::__is_constant_evaluated() && !bool(__count <= size())) std::__glibcxx_assert_fail(); } while (false); return span(this->data() + (this->size() - __count), __count); } template [[nodiscard]] constexpr auto subspan() const noexcept -> span()> { if constexpr (_Extent == dynamic_extent) { do { if (std::__is_constant_evaluated() && !bool(_Offset <= size())) std::__glibcxx_assert_fail(); } while (false); } else static_assert(_Offset <= extent); using _Sp = span()>; if constexpr (_Count == dynamic_extent) return _Sp(this->data() + _Offset, this->size() - _Offset); else { if constexpr (_Extent == dynamic_extent) { do { if (std::__is_constant_evaluated() && !bool(_Count <= size())) std::__glibcxx_assert_fail(); } while (false); do { if (std::__is_constant_evaluated() && !bool(_Count <= (size() - _Offset))) std::__glibcxx_assert_fail(); } while (false); } else { static_assert(_Count <= extent); static_assert(_Count <= (extent - _Offset)); } return _Sp(_SizedPtr{this->data() + _Offset}); } } [[nodiscard]] constexpr span subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept { do { if (std::__is_constant_evaluated() && !bool(__offset <= size())) std::__glibcxx_assert_fail(); } while (false); if (__count == dynamic_extent) __count = this->size() - __offset; else { do { if (std::__is_constant_evaluated() && !bool(__count <= size())) std::__glibcxx_assert_fail(); } while (false); do { if (std::__is_constant_evaluated() && !bool(__offset + __count <= size())) std::__glibcxx_assert_fail(); } while (false); } return span(this->data() + __offset, __count); } private: template friend class span; using _SizedPtr = __detail::__span_ptr<_Type>; [[__gnu__::__always_inline__]] constexpr explicit span(_SizedPtr __ptr) noexcept requires (extent != dynamic_extent) : _M_ptr(__ptr._M_ptr), _M_extent(__v) { } pointer _M_ptr; [[no_unique_address]] __detail::__extent_storage _M_extent; }; template span(_Type(&)[_ArrayExtent]) -> span<_Type, _ArrayExtent>; template span(array<_Type, _ArrayExtent>&) -> span<_Type, _ArrayExtent>; template span(const array<_Type, _ArrayExtent>&) -> span; template span(_Iter, _End) -> span>>; template span(_Range &&) -> span>>; template [[nodiscard]] inline span as_bytes(span<_Type, _Extent> __sp) noexcept { auto data = reinterpret_cast(__sp.data()); auto size = __sp.size_bytes(); constexpr auto extent = _Extent == dynamic_extent ? dynamic_extent : _Extent * sizeof(_Type); return span{data, size}; } template requires (!is_const_v<_Type>) inline span as_writable_bytes [[nodiscard]] (span<_Type, _Extent> __sp) noexcept { auto data = reinterpret_cast(__sp.data()); auto size = __sp.size_bytes(); constexpr auto extent = _Extent == dynamic_extent ? dynamic_extent : _Extent * sizeof(_Type); return span{data, size}; } namespace ranges { template inline constexpr bool enable_borrowed_range> = true; template inline constexpr bool enable_view> = true; } } # 10 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Utilities/Hash.hh" 2 # 11 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Includes/atom/Utilities/Hash.hh" namespace atom { template void HashCombine(usize& s, const T& v) { s ^= std::hash()(v) + 0x9e3779b9 + (s << 6) + (s >> 2); } __attribute__((visibility("default"))) u32 CRC32(std::span bytes, const u32 seed); } # 5 "/data/emu/gba-python/reference/src/NanoBoyAdvance/ThirdParty/atom/Sources/Utilities/Hash.cc" 2 namespace atom { u32 CRC32(std::span bytes, const u32 seed) { u32 crc = seed; for (usize i = 0; i < bytes.size_bytes(); i++) { u32 v = static_cast(crc) ^ bytes.data()[i]; for (u8 k = 0; k < 8; k++) { v = ((v & 1) ? 0 : (u32)0xedb88320L) ^ (v >> 1); } crc = (v ^ (u32)0xff000000L) ^ (crc >> 8); } return crc; } }