1#if !defined(phmap_config_h_guard_)
2#define phmap_config_h_guard_
37#define PHMAP_VERSION_MAJOR 1
38#define PHMAP_VERSION_MINOR 0
39#define PHMAP_VERSION_PATCH 0
52 #include <Availability.h>
53 #include <TargetConditionals.h>
56#define PHMAP_XSTR(x) PHMAP_STR(x)
57#define PHMAP_STR(x) #x
58#define PHMAP_VAR_NAME_VALUE(var) #var "=" PHMAP_STR(var)
67#if defined(_MSC_FULL_VER) && _MSC_FULL_VER < 190023918 && !defined(__clang__)
68 #error "phmap requires Visual Studio 2015 Update 2 or higher."
72#if defined(__GNUC__) && !defined(__clang__)
73 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
74 #error "phmap requires gcc 4.7 or higher."
80#if defined(__apple_build_version__) && __apple_build_version__ < 4211165
81 #error "phmap requires __apple_build_version__ of 4211165 or higher."
85#if defined(__cplusplus) && !defined(_MSC_VER)
86 #if __cplusplus < 201103L
87 #error "C++ versions less than C++11 are not supported."
92#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
93 #if !__GLIBC_PREREQ(2, 12)
94 #error "Minimum required version of glibc is 2.12."
98#if defined(_STLPORT_VERSION)
99 #error "STLPort is not supported."
103 #error "phmap assumes CHAR_BIT == 8."
107#if INT_MAX < 2147483647
108 #error "phmap assumes that int is at least 4 bytes. "
118 #define PHMAP_HAVE_BUILTIN(x) __has_builtin(x)
120 #define PHMAP_HAVE_BUILTIN(x) 0
123#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703) || __cplusplus >= 201703
124 #define PHMAP_HAVE_CC17 1
126 #define PHMAP_HAVE_CC17 0
129#define PHMAP_BRANCHLESS 1
132#define PHMAP_HAVE_FEATURE(f) __has_feature(f)
134#define PHMAP_HAVE_FEATURE(f) 0
139#if defined(__GNUC__) && defined(__GNUC_MINOR__)
140 #define PHMAP_INTERNAL_HAVE_MIN_GNUC_VERSION(x, y) (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
142 #define PHMAP_INTERNAL_HAVE_MIN_GNUC_VERSION(x, y) 0
145#if defined(__clang__) && defined(__clang_major__) && defined(__clang_minor__)
146 #define PHMAP_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) (__clang_major__ > (x) || __clang_major__ == (x) && __clang_minor__ >= (y))
148 #define PHMAP_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) 0
154#ifdef PHMAP_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE
155 #error PHMAP_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE cannot be directly set
156#elif defined(_LIBCPP_VERSION) || defined(_MSC_VER) || \
157 (!defined(__clang__) && defined(__GNUC__) && defined(__GLIBCXX__) && PHMAP_INTERNAL_HAVE_MIN_GNUC_VERSION(4, 8))
158 #define PHMAP_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE 1
165#if defined(PHMAP_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE)
166 #error PHMAP_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE cannot be directly set
167#elif defined(PHMAP_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE)
168 #error PHMAP_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE cannot directly set
169#elif (defined(__clang__) && defined(_LIBCPP_VERSION)) || \
170 (!defined(__clang__) && defined(__GNUC__) && \
171 PHMAP_INTERNAL_HAVE_MIN_GNUC_VERSION(5, 1) && \
172 (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__))) || \
173 (defined(_MSC_VER) && !defined(__NVCC__))
174 #define PHMAP_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE 1
175 #define PHMAP_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE 1
182#ifdef PHMAP_HAVE_THREAD_LOCAL
183 #error PHMAP_HAVE_THREAD_LOCAL cannot be directly set
184#elif defined(__APPLE__)
185 #if __has_feature(cxx_thread_local) && \
186 !(TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)
187 #define PHMAP_HAVE_THREAD_LOCAL 1
190 #define PHMAP_HAVE_THREAD_LOCAL 1
193#if defined(__ANDROID__) && defined(__clang__)
195 #if __has_include(<android/ndk-version.h>)
196 #include <android/ndk-version.h>
199 #if defined(__ANDROID__) && defined(__clang__) && defined(__NDK_MAJOR__) && \
200 defined(__NDK_MINOR__) && \
201 ((__NDK_MAJOR__ < 12) || ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1)))
202 #undef PHMAP_HAVE_TLS
203 #undef PHMAP_HAVE_THREAD_LOCAL
211#ifdef PHMAP_HAVE_INTRINSIC_INT128
212 #error PHMAP_HAVE_INTRINSIC_INT128 cannot be directly set
213#elif defined(__SIZEOF_INT128__)
214 #if (defined(__clang__) && !defined(_WIN32) && !defined(__aarch64__)) || \
215 (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) || \
216 (defined(__GNUC__) && !defined(__clang__) && !defined(__CUDACC__))
217 #define PHMAP_HAVE_INTRINSIC_INT128 1
218 #elif defined(__CUDACC__)
219 #if __CUDACC_VER__ >= 70000
220 #define PHMAP_HAVE_INTRINSIC_INT128 1
228#ifdef PHMAP_HAVE_EXCEPTIONS
229 #error PHMAP_HAVE_EXCEPTIONS cannot be directly set.
230#elif defined(__clang__)
231 #if defined(__EXCEPTIONS) && __has_feature(cxx_exceptions)
232 #define PHMAP_HAVE_EXCEPTIONS 1
234#elif !(defined(__GNUC__) && (__GNUC__ < 5) && !defined(__EXCEPTIONS)) && \
235 !(defined(__GNUC__) && (__GNUC__ >= 5) && !defined(__cpp_exceptions)) && \
236 !(defined(_MSC_VER) && !defined(_CPPUNWIND))
237 #define PHMAP_HAVE_EXCEPTIONS 1
245#ifdef PHMAP_HAVE_MMAP
246 #error PHMAP_HAVE_MMAP cannot be directly set
247#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
248 defined(__ros__) || defined(__native_client__) || defined(__asmjs__) || \
249 defined(__wasm__) || defined(__Fuchsia__) || defined(__sun) || \
251 #define PHMAP_HAVE_MMAP 1
257#if defined(PHMAP_IS_BIG_ENDIAN)
258 #error "PHMAP_IS_BIG_ENDIAN cannot be directly set."
261#if defined(PHMAP_IS_LITTLE_ENDIAN)
262 #error "PHMAP_IS_LITTLE_ENDIAN cannot be directly set."
265#if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
266 __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
267 #define PHMAP_IS_LITTLE_ENDIAN 1
268#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
269 __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
270 #define PHMAP_IS_BIG_ENDIAN 1
272 #define PHMAP_IS_LITTLE_ENDIAN 1
274 #error "phmap endian detection needs to be set up for your compiler"
277#if defined(__APPLE__) && defined(_LIBCPP_VERSION) && \
278 defined(__MAC_OS_X_VERSION_MIN_REQUIRED__) && \
279 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101400
280 #define PHMAP_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE 1
282 #define PHMAP_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE 0
288#ifdef PHMAP_HAVE_STD_ANY
289 #error "PHMAP_HAVE_STD_ANY cannot be directly set."
293 #if __has_include(<any>) && __cplusplus >= 201703L && \
294 !PHMAP_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE
295 #define PHMAP_HAVE_STD_ANY 1
299#ifdef PHMAP_HAVE_STD_OPTIONAL
300 #error "PHMAP_HAVE_STD_OPTIONAL cannot be directly set."
304 #if __has_include(<optional>) && __cplusplus >= 201703L && \
305 !PHMAP_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE
306 #define PHMAP_HAVE_STD_OPTIONAL 1
310#ifdef PHMAP_HAVE_STD_VARIANT
311 #error "PHMAP_HAVE_STD_VARIANT cannot be directly set."
315 #if __has_include(<variant>) && __cplusplus >= 201703L && \
316 !PHMAP_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE
317 #define PHMAP_HAVE_STD_VARIANT 1
321#ifdef PHMAP_HAVE_STD_STRING_VIEW
322 #error "PHMAP_HAVE_STD_STRING_VIEW cannot be directly set."
326 #if __has_include(<string_view>) && __cplusplus >= 201703L && \
327 (!defined(_MSC_VER) || _MSC_VER >= 1920)
328 #define PHMAP_HAVE_STD_STRING_VIEW 1
334#if defined(_MSC_VER) && _MSC_VER >= 1910 && PHMAP_HAVE_CC17
336 #define PHMAP_HAVE_STD_OPTIONAL 1
337 #define PHMAP_HAVE_STD_VARIANT 1
338 #if !defined(PHMAP_HAVE_STD_STRING_VIEW) && _MSC_VER >= 1920
339 #define PHMAP_HAVE_STD_STRING_VIEW 1
344 #define PHMAP_HAVE_SHARED_MUTEX 1
347#ifndef PHMAP_HAVE_STD_STRING_VIEW
348 #define PHMAP_HAVE_STD_STRING_VIEW 0
355#if defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_DEBUG)
356 #define PHMAP_INTERNAL_MSVC_2017_DBG_MODE
363#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
364#define PHMAP_HAS_NATIVE_WCHAR_T
391#ifdef __has_attribute
392 #define PHMAP_HAVE_ATTRIBUTE(x) __has_attribute(x)
394 #define PHMAP_HAVE_ATTRIBUTE(x) 0
403#if defined(__cplusplus) && defined(__has_cpp_attribute)
404 #define PHMAP_HAVE_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
406 #define PHMAP_HAVE_CPP_ATTRIBUTE(x) 0
412#if PHMAP_HAVE_ATTRIBUTE(format) || (defined(__GNUC__) && !defined(__clang__))
413 #define PHMAP_PRINTF_ATTRIBUTE(string_index, first_to_check) \
414 __attribute__((__format__(__printf__, string_index, first_to_check)))
415 #define PHMAP_SCANF_ATTRIBUTE(string_index, first_to_check) \
416 __attribute__((__format__(__scanf__, string_index, first_to_check)))
418 #define PHMAP_PRINTF_ATTRIBUTE(string_index, first_to_check)
419 #define PHMAP_SCANF_ATTRIBUTE(string_index, first_to_check)
422#if PHMAP_HAVE_ATTRIBUTE(always_inline) || \
423 (defined(__GNUC__) && !defined(__clang__))
424 #define PHMAP_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
425 #define PHMAP_HAVE_ATTRIBUTE_ALWAYS_INLINE 1
427 #define PHMAP_ATTRIBUTE_ALWAYS_INLINE
430#if !defined(__INTEL_COMPILER) && (PHMAP_HAVE_ATTRIBUTE(noinline) || (defined(__GNUC__) && !defined(__clang__)))
431 #define PHMAP_ATTRIBUTE_NOINLINE __attribute__((noinline))
432 #define PHMAP_HAVE_ATTRIBUTE_NOINLINE 1
434 #define PHMAP_ATTRIBUTE_NOINLINE
437#if PHMAP_HAVE_ATTRIBUTE(disable_tail_calls)
438 #define PHMAP_HAVE_ATTRIBUTE_NO_TAIL_CALL 1
439 #define PHMAP_ATTRIBUTE_NO_TAIL_CALL __attribute__((disable_tail_calls))
440#elif defined(__GNUC__) && !defined(__clang__)
441 #define PHMAP_HAVE_ATTRIBUTE_NO_TAIL_CALL 1
442 #define PHMAP_ATTRIBUTE_NO_TAIL_CALL \
443 __attribute__((optimize("no-optimize-sibling-calls")))
445 #define PHMAP_ATTRIBUTE_NO_TAIL_CALL
446 #define PHMAP_HAVE_ATTRIBUTE_NO_TAIL_CALL 0
449#if (PHMAP_HAVE_ATTRIBUTE(weak) || \
450 (defined(__GNUC__) && !defined(__clang__))) && \
451 !(defined(__llvm__) && defined(_WIN32))
452 #undef PHMAP_ATTRIBUTE_WEAK
453 #define PHMAP_ATTRIBUTE_WEAK __attribute__((weak))
454 #define PHMAP_HAVE_ATTRIBUTE_WEAK 1
456 #define PHMAP_ATTRIBUTE_WEAK
457 #define PHMAP_HAVE_ATTRIBUTE_WEAK 0
460#if PHMAP_HAVE_ATTRIBUTE(nonnull) || (defined(__GNUC__) && !defined(__clang__))
461 #define PHMAP_ATTRIBUTE_NONNULL(arg_index) __attribute__((nonnull(arg_index)))
463 #define PHMAP_ATTRIBUTE_NONNULL(...)
466#if PHMAP_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__))
467 #define PHMAP_ATTRIBUTE_NORETURN __attribute__((noreturn))
468#elif defined(_MSC_VER)
469 #define PHMAP_ATTRIBUTE_NORETURN __declspec(noreturn)
471 #define PHMAP_ATTRIBUTE_NORETURN
474#if defined(__GNUC__) && defined(ADDRESS_SANITIZER)
475 #define PHMAP_ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
477 #define PHMAP_ATTRIBUTE_NO_SANITIZE_ADDRESS
480#if defined(__GNUC__) && defined(MEMORY_SANITIZER)
481 #define PHMAP_ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory))
483 #define PHMAP_ATTRIBUTE_NO_SANITIZE_MEMORY
486#if defined(__GNUC__) && defined(THREAD_SANITIZER)
487 #define PHMAP_ATTRIBUTE_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
489 #define PHMAP_ATTRIBUTE_NO_SANITIZE_THREAD
492#if defined(__GNUC__) && \
493 (defined(UNDEFINED_BEHAVIOR_SANITIZER) || defined(ADDRESS_SANITIZER))
494 #define PHMAP_ATTRIBUTE_NO_SANITIZE_UNDEFINED \
495 __attribute__((no_sanitize("undefined")))
497 #define PHMAP_ATTRIBUTE_NO_SANITIZE_UNDEFINED
500#if defined(__GNUC__) && defined(CONTROL_FLOW_INTEGRITY)
501 #define PHMAP_ATTRIBUTE_NO_SANITIZE_CFI __attribute__((no_sanitize("cfi")))
503 #define PHMAP_ATTRIBUTE_NO_SANITIZE_CFI
506#if defined(__GNUC__) && defined(SAFESTACK_SANITIZER)
507 #define PHMAP_ATTRIBUTE_NO_SANITIZE_SAFESTACK \
508 __attribute__((no_sanitize("safe-stack")))
510 #define PHMAP_ATTRIBUTE_NO_SANITIZE_SAFESTACK
513#if PHMAP_HAVE_ATTRIBUTE(returns_nonnull) || \
514 (defined(__GNUC__) && \
515 (__GNUC__ > 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && \
517 #define PHMAP_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull))
519 #define PHMAP_ATTRIBUTE_RETURNS_NONNULL
522#ifdef PHMAP_HAVE_ATTRIBUTE_SECTION
523 #error PHMAP_HAVE_ATTRIBUTE_SECTION cannot be directly set
524#elif (PHMAP_HAVE_ATTRIBUTE(section) || \
525 (defined(__GNUC__) && !defined(__clang__))) && \
526 !defined(__APPLE__) && PHMAP_HAVE_ATTRIBUTE_WEAK
527 #define PHMAP_HAVE_ATTRIBUTE_SECTION 1
528 #ifndef PHMAP_ATTRIBUTE_SECTION
529 #define PHMAP_ATTRIBUTE_SECTION(name) \
530 __attribute__((section(#name))) __attribute__((noinline))
532 #ifndef PHMAP_ATTRIBUTE_SECTION_VARIABLE
533 #define PHMAP_ATTRIBUTE_SECTION_VARIABLE(name) __attribute__((section(#name)))
535 #ifndef PHMAP_DECLARE_ATTRIBUTE_SECTION_VARS
536 #define PHMAP_DECLARE_ATTRIBUTE_SECTION_VARS(name) \
537 extern char __start_##name[] PHMAP_ATTRIBUTE_WEAK; \
538 extern char __stop_##name[] PHMAP_ATTRIBUTE_WEAK
540 #ifndef PHMAP_DEFINE_ATTRIBUTE_SECTION_VARS
541 #define PHMAP_INIT_ATTRIBUTE_SECTION_VARS(name)
542 #define PHMAP_DEFINE_ATTRIBUTE_SECTION_VARS(name)
544 #define PHMAP_ATTRIBUTE_SECTION_START(name) \
545 (reinterpret_cast<void *>(__start_##name))
546 #define PHMAP_ATTRIBUTE_SECTION_STOP(name) \
547 (reinterpret_cast<void *>(__stop_##name))
549 #define PHMAP_HAVE_ATTRIBUTE_SECTION 0
550 #define PHMAP_ATTRIBUTE_SECTION(name)
551 #define PHMAP_ATTRIBUTE_SECTION_VARIABLE(name)
552 #define PHMAP_INIT_ATTRIBUTE_SECTION_VARS(name)
553 #define PHMAP_DEFINE_ATTRIBUTE_SECTION_VARS(name)
554 #define PHMAP_DECLARE_ATTRIBUTE_SECTION_VARS(name)
555 #define PHMAP_ATTRIBUTE_SECTION_START(name) (reinterpret_cast<void *>(0))
556 #define PHMAP_ATTRIBUTE_SECTION_STOP(name) (reinterpret_cast<void *>(0))
559#if PHMAP_HAVE_ATTRIBUTE(force_align_arg_pointer) || \
560 (defined(__GNUC__) && !defined(__clang__))
561 #if defined(__i386__)
562 #define PHMAP_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC \
563 __attribute__((force_align_arg_pointer))
564 #define PHMAP_REQUIRE_STACK_ALIGN_TRAMPOLINE (0)
565 #elif defined(__x86_64__)
566 #define PHMAP_REQUIRE_STACK_ALIGN_TRAMPOLINE (1)
567 #define PHMAP_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC
569 #define PHMAP_REQUIRE_STACK_ALIGN_TRAMPOLINE (0)
570 #define PHMAP_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC
573 #define PHMAP_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC
574 #define PHMAP_REQUIRE_STACK_ALIGN_TRAMPOLINE (0)
577#if PHMAP_HAVE_ATTRIBUTE(nodiscard)
578 #define PHMAP_MUST_USE_RESULT [[nodiscard]]
579#elif defined(__clang__) && PHMAP_HAVE_ATTRIBUTE(warn_unused_result)
580 #define PHMAP_MUST_USE_RESULT __attribute__((warn_unused_result))
582 #define PHMAP_MUST_USE_RESULT
585#if PHMAP_HAVE_ATTRIBUTE(hot) || (defined(__GNUC__) && !defined(__clang__))
586 #define PHMAP_ATTRIBUTE_HOT __attribute__((hot))
588 #define PHMAP_ATTRIBUTE_HOT
591#if PHMAP_HAVE_ATTRIBUTE(cold) || (defined(__GNUC__) && !defined(__clang__))
592 #define PHMAP_ATTRIBUTE_COLD __attribute__((cold))
594 #define PHMAP_ATTRIBUTE_COLD
597#if defined(__clang__)
598 #if PHMAP_HAVE_CPP_ATTRIBUTE(clang::reinitializes)
599 #define PHMAP_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]]
601 #define PHMAP_ATTRIBUTE_REINITIALIZES
604 #define PHMAP_ATTRIBUTE_REINITIALIZES
607#if PHMAP_HAVE_ATTRIBUTE(unused) || (defined(__GNUC__) && !defined(__clang__))
608 #undef PHMAP_ATTRIBUTE_UNUSED
609 #define PHMAP_ATTRIBUTE_UNUSED __attribute__((__unused__))
611 #define PHMAP_ATTRIBUTE_UNUSED
614#if PHMAP_HAVE_ATTRIBUTE(tls_model) || (defined(__GNUC__) && !defined(__clang__))
615 #define PHMAP_ATTRIBUTE_INITIAL_EXEC __attribute__((tls_model("initial-exec")))
617 #define PHMAP_ATTRIBUTE_INITIAL_EXEC
620#if PHMAP_HAVE_ATTRIBUTE(packed) || (defined(__GNUC__) && !defined(__clang__))
621 #define PHMAP_ATTRIBUTE_PACKED __attribute__((__packed__))
623 #define PHMAP_ATTRIBUTE_PACKED
626#if PHMAP_HAVE_ATTRIBUTE(aligned) || (defined(__GNUC__) && !defined(__clang__))
627 #define PHMAP_ATTRIBUTE_FUNC_ALIGN(bytes) __attribute__((aligned(bytes)))
629 #define PHMAP_ATTRIBUTE_FUNC_ALIGN(bytes)
635#ifndef PHMAP_HAVE_SSE2
636 #if defined(__SSE2__) || \
637 (defined(_MSC_VER) && \
638 (defined(_M_X64) || (defined(_M_IX86) && _M_IX86_FP >= 2)))
639 #define PHMAP_HAVE_SSE2 1
641 #define PHMAP_HAVE_SSE2 0
645#ifndef PHMAP_HAVE_SSSE3
646 #if defined(__SSSE3__) || defined(__AVX2__)
647 #define PHMAP_HAVE_SSSE3 1
649 #define PHMAP_HAVE_SSSE3 0
653#if PHMAP_HAVE_SSSE3 && !PHMAP_HAVE_SSE2
654 #error "Bad configuration!"
658 #include <emmintrin.h>
662 #include <tmmintrin.h>
670 #define PHMAP_IF_CONSTEXPR(expr) if constexpr ((expr))
672 #define PHMAP_IF_CONSTEXPR(expr) if ((expr))
684#define PHMAP_ARRAYSIZE(array) \
685 (sizeof(::phmap::macros_internal::ArraySizeHelper(array)))
688namespace macros_internal {
691 template <
typename T,
size_t N>
697#if defined(__clang__) && defined(__has_warning)
698 #if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
699 #define PHMAP_FALLTHROUGH_INTENDED [[clang::fallthrough]]
701#elif defined(__GNUC__) && __GNUC__ >= 7
702 #define PHMAP_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
705#ifndef PHMAP_FALLTHROUGH_INTENDED
706 #define PHMAP_FALLTHROUGH_INTENDED \
724#if defined(__clang__) && __cplusplus >= 201103L
725 #define PHMAP_DEPRECATED(message) __attribute__((deprecated(message)))
728#ifndef PHMAP_DEPRECATED
729 #define PHMAP_DEPRECATED(message)
751#if defined(__clang__)
752 #if __has_attribute(enable_if)
753 #define PHMAP_BAD_CALL_IF(expr, msg) \
754 __attribute__((enable_if(expr, "Bad call trap"), unavailable(msg)))
771 #define PHMAP_ASSERT(expr) (false ? (void)(expr) : (void)0)
773 #define PHMAP_ASSERT(expr) \
774 (PHMAP_PREDICT_TRUE((expr)) ? (void)0 \
775 : [] { assert(false && #expr); }())
778#ifdef PHMAP_HAVE_EXCEPTIONS
779 #define PHMAP_INTERNAL_TRY try
780 #define PHMAP_INTERNAL_CATCH_ANY catch (...)
781 #define PHMAP_INTERNAL_RETHROW do { throw; } while (false)
783 #define PHMAP_INTERNAL_TRY if (true)
784 #define PHMAP_INTERNAL_CATCH_ANY else if (false)
785 #define PHMAP_INTERNAL_RETHROW do {} while (false)
auto ArraySizeHelper(const T(&array)[N]) -> char(&)[N]