# Disable formatting options which may break tests.
SortIncludes: false
ReflowComments: false
+
+# libc++ has some long names so we need more than the 80 column limit imposed by LLVM style, for sensible formatting
+ColumnLimit: 120
---
--- /dev/null
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+#lib/ # We actually have things checked in to lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.cache
+nosetests.xml
+coverage.xml
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# MSVC libraries test harness
+env.lst
+keep.lst
+
+# Editor by-products
+.vscode/
#===============================================================================
# Setup Project
#===============================================================================
-cmake_minimum_required(VERSION 3.4.3)
-
-if(POLICY CMP0042)
- cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
-endif()
-if(POLICY CMP0022)
- cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang
-endif()
-if(POLICY CMP0068)
- cmake_policy(SET CMP0068 NEW)
- set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
-endif()
+cmake_minimum_required(VERSION 3.13.4)
# Add path for custom modules
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
)
+set(CMAKE_FOLDER "libc++")
+
+set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
+
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD)
project(libcxx CXX C)
set(PACKAGE_NAME libcxx)
- set(PACKAGE_VERSION 11.1.0)
+ set(PACKAGE_VERSION 13.0.0git)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")
+ # In a standalone build, we don't have llvm to automatically generate the
+ # llvm-lit script for us. So we need to provide an explicit directory that
+ # the configurator should write the script into.
+ set(LIBCXX_STANDALONE_BUILD 1)
+ set(LLVM_LIT_OUTPUT_DIR "${LIBCXX_BINARY_DIR}/bin")
+
# Find the LLVM sources and simulate LLVM CMake options.
include(HandleOutOfTreeLLVM)
endif()
if (LIBCXX_STANDALONE_BUILD)
- if(CMAKE_VERSION VERSION_LESS 3.12)
- include(FindPythonInterp)
- if( NOT PYTHONINTERP_FOUND )
- message(WARNING "Failed to find python interpreter. "
- "The libc++ test suite will be disabled.")
- set(LLVM_INCLUDE_TESTS OFF)
- else()
- add_executable(Python3::Interpreter IMPORTED)
- set_target_properties(Python3::Interpreter PROPERTIES
- IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
- set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
+ find_package(Python3 COMPONENTS Interpreter)
+ if(NOT Python3_Interpreter_FOUND)
+ message(WARNING "Python3 not found, using python2 as a fallback")
+ find_package(Python2 COMPONENTS Interpreter REQUIRED)
+ if(Python2_VERSION VERSION_LESS 2.7)
+ message(SEND_ERROR "Python 2.7 or newer is required")
endif()
- else()
- find_package(Python3 COMPONENTS Interpreter)
- if(NOT Python3_Interpreter_FOUND)
- message(WARNING "Python3 not found, using python2 as a fallback")
- find_package(Python2 COMPONENTS Interpreter REQUIRED)
- if(Python2_VERSION VERSION_LESS 2.7)
- message(SEND_ERROR "Python 2.7 or newer is required")
- endif()
- # Treat python2 as python3
- add_executable(Python3::Interpreter IMPORTED)
- set_target_properties(Python3::Interpreter PROPERTIES
- IMPORTED_LOCATION ${Python2_EXECUTABLE})
- set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
- endif()
+ # Treat python2 as python3
+ add_executable(Python3::Interpreter IMPORTED)
+ set_target_properties(Python3::Interpreter PROPERTIES
+ IMPORTED_LOCATION ${Python2_EXECUTABLE})
+ set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
endif()
endif()
option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
set(ENABLE_FILESYSTEM_DEFAULT ON)
-if (WIN32)
+if (WIN32 AND NOT MINGW)
+ # Filesystem is buildable for windows, but it requires __int128 helper
+ # functions, that currently are provided by libgcc or compiler_rt builtins.
+ # These are available in MinGW environments, but not currently in MSVC
+ # environments.
set(ENABLE_FILESYSTEM_DEFAULT OFF)
endif()
option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of the main libc++ library"
${ENABLE_FILESYSTEM_DEFAULT})
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
option(LIBCXX_ENABLE_PARALLEL_ALGORITHMS "Enable the parallel algorithms library. This requires the PSTL to be available." OFF)
-option(LIBCXX_TEST_GDB_PRETTY_PRINTERS "Test gdb pretty printers." OFF)
-set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING
+option(LIBCXX_ENABLE_DEBUG_MODE_SUPPORT
+ "Whether to include support for libc++'s debugging mode in the library.
+ By default, this is turned on. If you turn it off and try to enable the
+ debug mode when compiling a program against libc++, it will fail to link
+ since the required support isn't provided in the library." ON)
+option(LIBCXX_ENABLE_RANDOM_DEVICE
+ "Whether to include support for std::random_device in the library. Disabling
+ this can be useful when building the library for platforms that don't have
+ a source of randomness, such as some embedded platforms. When this is not
+ supported, most of <random> will still be available, but std::random_device
+ will not." ON)
+option(LIBCXX_ENABLE_LOCALIZATION
+ "Whether to include support for localization in the library. Disabling
+ localization can be useful when porting to platforms that don't support
+ the C locale API (e.g. embedded). When localization is not supported,
+ several parts of the library will be disabled: <iostream>, <regex>, <locale>
+ will be completely unusable, and other parts may be only partly available." ON)
+option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
+ "Whether to turn on vendor availability annotations on declarations that depend
+ on definitions in a shared library. By default, we assume that we're not building
+ libc++ for any specific vendor, and we disable those annotations. Vendors wishing
+ to provide compile-time errors when using features unavailable on some version of
+ the shared library they shipped should turn this on and see `include/__availability`
+ for more details." OFF)
+option(LIBCXX_ENABLE_INCOMPLETE_FEATURES
+ "Whether to enable support for incomplete library features. Incomplete features
+ are new library features under development. These features don't guarantee
+ ABI stability nor the quality of completed library features. Vendors
+ shipping the library may want to disable this option." ON)
+set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/configs/legacy.cfg.in" CACHE STRING
"The Lit testing configuration to use when running the tests.")
set(LIBCXX_TEST_PARAMS "" CACHE STRING
"A list of parameters to run the Lit test suite with.")
cmake_dependent_option(LIBCXX_INSTALL_SHARED_LIBRARY
"Install the shared libc++ library." ON
"LIBCXX_ENABLE_SHARED;LIBCXX_INSTALL_LIBRARY" OFF)
-option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)
cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY
"Install libc++experimental.a" ON
"LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF)
option(LIBCXX_ABI_FORCE_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.")
option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.")
+set(LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION "default" CACHE STRING
+ "Override the implementation to use for comparing typeinfos. By default, this
+ is detected automatically by the library, but this option allows overriding
+ which implementation is used unconditionally.
-set(LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION "" CACHE STRING "The implementation of typeinfo comparison to use.")
-set(TYPEINFO_COMPARISON_VALUES ";1;2")
-set_property(CACHE LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION PROPERTY STRINGS ${TYPEINFO_COMPARISON_VALUES})
-list(FIND TYPEINFO_COMPARISON_VALUES "${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}" IS_VALID_DEFAULT)
-if (${IS_VALID_DEFAULT} EQUAL -1)
+ See the documentation in <libcxx/include/typeinfo> for details on what each
+ value means.")
+set(TYPEINFO_COMPARISON_VALUES "default;1;2;3")
+if (NOT ("${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}" IN_LIST TYPEINFO_COMPARISON_VALUES))
message(FATAL_ERROR "Value '${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}' is not a valid value for
- LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION")
+ LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION")
endif()
option(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT "Enable per TU ABI insulation by default. To be used by vendors." OFF)
${ENABLE_LINKER_SCRIPT_DEFAULT_VALUE})
option(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS
- "Build libc++ with definitions for operator new/delete. This option can
- be used to disable the definitions when libc++abi is expected to provide
- them" ON)
-
+ "Build libc++ with definitions for operator new/delete. These are normally
+ defined in libc++abi, but this option can be used to define them in libc++
+ instead. If you define them in libc++, make sure they are NOT defined in
+ libc++abi. Doing otherwise is an ODR violation." OFF)
# Build libc++abi with libunwind. We need this option to determine whether to
# link with libunwind or libgcc_s while running the test cases.
option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
# Target options --------------------------------------------------------------
option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++." ${LLVM_BUILD_32_BITS})
-set(LIBCXX_TARGET_TRIPLE "" CACHE STRING "Use alternate target triple.")
+set(LIBCXX_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}" CACHE STRING "Use alternate target triple.")
set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.")
set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC toolchain.")
set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING
"The Profile-rt library used to build with code coverage")
-# Don't allow a user to accidentally overwrite the system libc++ installation on Darwin.
-# If the user specifies -DCMAKE_INSTALL_PREFIX=/usr the install rules for libc++
-# will not be generated and a warning will be issued.
-option(LIBCXX_OVERRIDE_DARWIN_INSTALL "Enable overwriting darwins libc++ installation." OFF)
-mark_as_advanced(LIBCXX_OVERRIDE_DARWIN_INSTALL) # Don't show this option by default.
-
-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT LIBCXX_OVERRIDE_DARWIN_INSTALL)
- if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr")
- message(WARNING "Disabling libc++ install rules because installation would "
- "overwrite the systems installation. Configure with "
- "-DLIBCXX_OVERRIDE_DARWIN_INSTALL=ON to suppress this behaviour.")
- mark_as_advanced(CLEAR LIBCXX_OVERRIDE_DARWIN_INSTALL) # Show the override option.
- set(LIBCXX_INSTALL_HEADERS OFF)
- set(LIBCXX_INSTALL_LIBRARY OFF)
- endif()
-endif()
-
set(LIBCXX_CONFIGURE_IDE_DEFAULT OFF)
if (XCODE OR MSVC_IDE)
set(LIBCXX_CONFIGURE_IDE_DEFAULT ON)
LIBCXX_ENABLE_ABI_LINKER_SCRIPT")
endif()
-if (LIBCXX_HAS_MUSL_LIBC AND NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
- message(FATAL_ERROR "LIBCXX_INSTALL_SUPPORT_HEADERS can not be turned off"
- "when building for Musl with LIBCXX_HAS_MUSL_LIBC.")
-endif()
-
if (LIBCXX_ABI_FORCE_ITANIUM AND LIBCXX_ABI_FORCE_MICROSOFT)
message(FATAL_ERROR "Only one of LIBCXX_ABI_FORCE_ITANIUM and LIBCXX_ABI_FORCE_MICROSOFT can be specified.")
endif ()
# Configure System
#===============================================================================
-set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER})
-set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
-
-string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
- ${PACKAGE_VERSION})
-
+# TODO: Projects that depend on libc++ should use LIBCXX_GENERATED_INCLUDE_DIR
+# instead of hard-coding include/c++/v1.
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
- set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
- set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR})
- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
+ set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
+ set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1")
+ set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
+ set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
+ "Path where built libc++ libraries should be installed.")
+ set(LIBCXX_INSTALL_INCLUDE_DIR "include/c++/v1" CACHE PATH
+ "Path where target-agnostic libc++ headers should be installed.")
+ set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1" CACHE PATH
+ "Path where target-specific libc++ headers should be installed.")
if(LIBCXX_LIBDIR_SUBDIR)
string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR})
string(APPEND LIBCXX_INSTALL_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR})
endif()
elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
- set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR})
- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX})
+ set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1")
+ set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LIBCXX_GENERATED_INCLUDE_DIR}")
+ set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX} CACHE PATH
+ "Path where built libc++ libraries should be installed.")
+ set(LIBCXX_INSTALL_INCLUDE_DIR "include/c++/v1" CACHE PATH
+ "Path where target-agnostic libc++ headers should be installed.")
+ set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${LIBCXX_INSTALL_INCLUDE_DIR}" CACHE PATH
+ "Path where target-specific libc++ headers should be installed.")
else()
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
- set(LIBCXX_HEADER_DIR ${CMAKE_BINARY_DIR})
- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX})
+ set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1")
+ set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LIBCXX_GENERATED_INCLUDE_DIR}")
+ set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX} CACHE PATH
+ "Path where built libc++ libraries should be installed.")
+ set(LIBCXX_INSTALL_INCLUDE_DIR "include/c++/v1" CACHE PATH
+ "Path where target-agnostic libc++ headers should be installed.")
+ set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${LIBCXX_INSTALL_INCLUDE_DIR}" CACHE PATH
+ "Path where target-specific libc++ headers should be installed.")
endif()
file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
-set(LIBCXX_INSTALL_PREFIX "" CACHE STRING "Define libc++ destination prefix.")
-set(LIBCXX_INSTALL_HEADER_PREFIX "" CACHE STRING "Define libc++ header destination prefix.")
-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
add_target_flags_if(LIBCXX_BUILD_32_BITS "-m32")
if(LIBCXX_TARGET_TRIPLE)
- add_target_flags("--target=${LIBCXX_TARGET_TRIPLE}")
+ add_target_flags_if_supported("--target=${LIBCXX_TARGET_TRIPLE}")
elseif(CMAKE_CXX_COMPILER_TARGET)
set(LIBCXX_TARGET_TRIPLE "${CMAKE_CXX_COMPILER_TARGET}")
endif()
if(LIBCXX_SYSROOT)
- add_target_flags("--sysroot=${LIBCXX_SYSROOT}")
+ add_target_flags_if_supported("--sysroot=${LIBCXX_SYSROOT}")
elseif(CMAKE_SYSROOT)
set(LIBCXX_SYSROOT "${CMAKE_SYSROOT}")
endif()
if(LIBCXX_GCC_TOOLCHAIN)
- add_target_flags("--gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
+ add_target_flags_if_supported("--gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
elseif(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN)
set(LIBCXX_GCC_TOOLCHAIN "${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}")
endif()
-if(LIBCXX_TARGET_TRIPLE)
- set(TARGET_TRIPLE "${LIBCXX_TARGET_TRIPLE}")
-endif()
-
# Configure compiler.
include(config-ix)
remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
-lc++abi)
endif()
-remove_flags(-stdlib=libc++ -stdlib=libstdc++)
+remove_flags(--stdlib=libc++ -stdlib=libc++ --stdlib=libstdc++ -stdlib=libstdc++)
# FIXME: Remove all debug flags and flags that change which Windows
# default libraries are linked. Currently we only support linking the
# Required flags ==============================================================
function(cxx_add_basic_build_flags target)
- # Require C++14 for all targets. C++14 is needed to ensure constant
- # initialization for certain globals (ex global memory resources).
+ # Require C++20 for all targets. C++17 is needed to use aligned allocation
+ # in the dylib. C++20 is needed to use char8_t.
set_target_properties(${target} PROPERTIES
- CXX_STANDARD 14
- CXX_STANDARD_REQUIRED YES
+ CXX_STANDARD 20
+ CXX_STANDARD_REQUIRED NO
CXX_EXTENSIONS NO)
+ # When building the dylib, don't warn for unavailable aligned allocation
+ # functions based on the deployment target -- they are always available
+ # because they are provided by the dylib itself with the excepton of z/OS.
+ if (ZOS)
+ target_add_compile_flags_if_supported(${target} PRIVATE -fno-aligned-allocation)
+ else()
+ target_add_compile_flags_if_supported(${target} PRIVATE -faligned-allocation)
+ endif()
+
# On all systems the system c++ standard library headers need to be excluded.
# MSVC only has -X, which disables all default includes; including the crt.
# Thus, we do nothing and hope we don't accidentally include any of the C++
# Warning flags ===============================================================
function(cxx_add_warning_flags target)
target_compile_definitions(${target} PUBLIC -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
- target_add_compile_flags_if_supported(${target} PRIVATE -Wall -Wextra -W -Wwrite-strings
+ if (MSVC)
+ # -W4 is the cl.exe/clang-cl equivalent of -Wall. (In cl.exe and clang-cl,
+ # -Wall is equivalent to -Weverything in GCC style compiler drivers.)
+ target_add_compile_flags_if_supported(${target} PRIVATE -W4)
+ else()
+ target_add_compile_flags_if_supported(${target} PRIVATE -Wall)
+ endif()
+ target_add_compile_flags_if_supported(${target} PRIVATE -Wextra -W -Wwrite-strings
-Wno-unused-parameter -Wno-long-long
- -Werror=return-type -Wextra-semi)
+ -Werror=return-type -Wextra-semi -Wundef)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
target_add_compile_flags_if_supported(${target} PRIVATE
-Wno-user-defined-literals
-Wno-covered-switch-default
+ -Wno-suggest-override
-Wno-ignored-attributes # FIXME: Caused by _LIBCPP_NODEBUG_TYPE not being supported on older clangs
)
if (LIBCXX_TARGETING_CLANG_CL)
target_add_compile_flags_if_supported(${target} PRIVATE
-Wno-literal-suffix
-Wno-c++14-compat
- -Wno-noexcept-type)
+ -Wno-noexcept-type
+ -Wno-suggest-override)
endif()
if (LIBCXX_ENABLE_WERROR)
target_add_compile_flags_if_supported(${target} PRIVATE -Werror)
# Link system libraries =======================================================
function(cxx_link_system_libraries target)
- target_add_link_flags_if_supported(${target} PRIVATE "-nodefaultlibs")
- target_add_compile_flags_if_supported(${target} PRIVATE "/Zl")
- target_add_link_flags_if_supported(${target} PRIVATE "/nodefaultlib")
+
+# In order to remove just libc++ from the link step
+# we need to use -nostdlib++ whenever it is supported.
+# Unfortunately this cannot be used universally because for example g++ supports
+# only -nodefaultlibs in which case all libraries will be removed and
+# all libraries but c++ have to be added in manually.
+ if (LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG)
+ target_add_link_flags_if_supported(${target} PRIVATE "-nostdlib++")
+ else()
+ target_add_link_flags_if_supported(${target} PRIVATE "-nodefaultlibs")
+ target_add_compile_flags_if_supported(${target} PRIVATE "/Zl")
+ target_add_link_flags_if_supported(${target} PRIVATE "/nodefaultlib")
+ endif()
if (LIBCXX_HAS_SYSTEM_LIB)
target_link_libraries(${target} PRIVATE System)
config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS)
config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK)
config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)
-if (NOT LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION STREQUAL "")
+if (NOT LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION STREQUAL "default")
config_define("${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}" _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION)
endif()
-
config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD)
config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL)
config_define_if(LIBCXX_HAS_WIN32_THREAD_API _LIBCPP_HAS_THREAD_API_WIN32)
config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)
config_define_if(LIBCXX_NO_VCRUNTIME _LIBCPP_NO_VCRUNTIME)
config_define_if(LIBCXX_ENABLE_PARALLEL_ALGORITHMS _LIBCPP_HAS_PARALLEL_ALGORITHMS)
+config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
+config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCPP_HAS_NO_RANDOM_DEVICE)
+config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION)
+config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
+# Incomplete features get their own specific disabling flags. This makes it
+# easier to grep for target specific flags once the feature is complete.
+config_define_if_not(LIBCXX_ENABLE_INCOMPLETE_FEATURES _LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+config_define_if_not(LIBCXX_ENABLE_INCOMPLETE_FEATURES _LIBCPP_HAS_NO_INCOMPLETE_RANGES)
if (LIBCXX_ABI_DEFINES)
set(abi_defines)
config_define(ON _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
endif()
+if (WIN32 AND LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+ # If linking libcxxabi statically into libcxx, skip the dllimport attributes
+ # on symbols we refer to from libcxxabi.
+ add_definitions(-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
+endif()
+
# Setup all common build flags =================================================
function(cxx_add_common_build_flags target)
cxx_add_basic_build_flags(${target})
#===============================================================================
add_subdirectory(include)
add_subdirectory(src)
+add_subdirectory(utils)
set(LIBCXX_TEST_DEPS "")
--- /dev/null
+@echo on
+
+if NOT EXIST C:\projects\deps (
+ mkdir C:\projects\deps
+)
+cd C:\projects\deps
+
+::###########################################################################
+:: Setup Compiler
+::###########################################################################
+if NOT EXIST llvm-installer.exe (
+ appveyor DownloadFile https://prereleases.llvm.org/win-snapshots/LLVM-9.0.0-r357435-win32.exe -FileName llvm-installer.exe
+)
+if "%CLANG_VERSION%"=="ToT" (
+ START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM"
+)
+if DEFINED CLANG_VERSION @set PATH="C:\Program Files\LLVM\bin";%PATH%
+if DEFINED CLANG_VERSION clang-cl -v
+
+if DEFINED MINGW_PATH rename "C:\Program Files\Git\usr\bin\sh.exe" "sh-ignored.exe"
+if DEFINED MINGW_PATH @set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%"
+if DEFINED MINGW_PATH @set "PATH=%PATH%;%MINGW_PATH%"
+if DEFINED MINGW_PATH g++ -v
+
+::###########################################################################
+:: Install a recent CMake
+::###########################################################################
+if NOT EXIST cmake (
+ appveyor DownloadFile https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.zip -FileName cmake.zip
+ 7z x cmake.zip -oC:\projects\deps > nul
+ move C:\projects\deps\cmake-* C:\projects\deps\cmake
+ rm cmake.zip
+)
+@set PATH=C:\projects\deps\cmake\bin;%PATH%
+cmake --version
+
+::###########################################################################
+:: Install Ninja
+::###########################################################################
+if NOT EXIST ninja (
+ appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip -FileName ninja.zip
+ 7z x ninja.zip -oC:\projects\deps\ninja > nul
+ rm ninja.zip
+)
+@set PATH=C:\projects\deps\ninja;%PATH%
+ninja --version
+
+::###########################################################################
+:: Setup the cached copy of LLVM
+::###########################################################################
+git clone --depth=1 http://llvm.org/git/llvm.git
+
+@echo off
--- /dev/null
+version: '{build}'
+
+shallow_clone: true
+
+build:
+ verbosity: detailed
+
+configuration:
+ - Debug
+
+environment:
+ matrix:
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+ CMAKE_OPTIONS: -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe
+ CLANG_VERSION: ToT
+ MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
+ MSVC_SETUP_ARG: x86
+ GENERATOR: Ninja
+ MAKE_PROGRAM: ninja
+ APPVEYOR_SAVE_CACHE_ON_ERROR: true
+# TODO: Maybe re-enable this configuration? Do we want to support MSVC 2015's runtime?
+# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+# MINGW_PATH: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
+# GENERATOR: MinGW Makefiles
+# MAKE_PROGRAM: mingw32-make
+# APPVEYOR_SAVE_CACHE_ON_ERROR: true
+
+install:
+ ############################################################################
+ # All external dependencies are installed in C:\projects\deps
+ ############################################################################
+ - call "%APPVEYOR_BUILD_FOLDER%\\appveyor-reqs-install.cmd"
+
+before_build:
+ - if DEFINED MSVC_SETUP_PATH call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG%
+ - cd %APPVEYOR_BUILD_FOLDER%
+
+build_script:
+ - md C:\projects\build-libcxx
+ - cd C:\projects\build-libcxx
+ - echo %configuration%
+
+ #############################################################################
+ # Configuration Step
+ #############################################################################
+ - cmake -G "%GENERATOR%" %CMAKE_OPTIONS%
+ "-DCMAKE_BUILD_TYPE=%configuration%"
+ "-DLLVM_PATH=C:\projects\deps\llvm" -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
+ -DLLVM_LIT_ARGS="-sv --show-xfail --show-unsupported"
+ %APPVEYOR_BUILD_FOLDER%
+
+ #############################################################################
+ # Build Step
+ #############################################################################
+ - "%MAKE_PROGRAM%"
+
+test_script:
+ - "%MAKE_PROGRAM% check-cxx"
+
+on_failure:
+ - appveyor PushArtifact CMakeFiles/CMakeOutput.log
+ - appveyor PushArtifact CMakeFiles/CMakeError.log
+
+artifacts:
+ - path: '_build/CMakeFiles/*.log'
+ name: logs
+
+cache:
+ - C:\projects\deps\ninja
+ - C:\projects\deps\cmake
+ - C:\projects\deps\llvm-installer.exe
# Build Google Benchmark for libc++
#==============================================================================
+set(CMAKE_FOLDER "${CMAKE_FOLDER}/Benchmarks")
+
set(BENCHMARK_LIBCXX_COMPILE_FLAGS
-Wno-unused-command-line-argument
-nostdinc++
- -isystem ${LIBCXX_SOURCE_DIR}/include
+ -isystem "${LIBCXX_GENERATED_INCLUDE_DIR}"
-L${LIBCXX_LIBRARY_DIR}
-Wl,-rpath,${LIBCXX_LIBRARY_DIR}
${SANITIZER_FLAGS}
)
+if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
+ list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS
+ -isystem "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}")
+endif()
if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH)
list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS
-L${LIBCXX_CXX_ABI_LIBRARY_PATH}
-Wl,-rpath,${LIBCXX_CXX_ABI_LIBRARY_PATH})
endif()
-list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS -include "${LIBCXX_BINARY_DIR}/__config_site")
split_list(BENCHMARK_LIBCXX_COMPILE_FLAGS)
ExternalProject_Add(google-benchmark-libcxx
set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx)
set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native)
-check_flag_supported("-std=c++17")
-mangle_name("LIBCXX_SUPPORTS_STD_EQ_c++17_FLAG" BENCHMARK_SUPPORTS_STD_CXX17_FLAG)
-if (${BENCHMARK_SUPPORTS_STD_CXX17_FLAG})
- set(BENCHMARK_DIALECT_FLAG "-std=c++17")
-else()
- # If the compiler doesn't support -std=c++17, attempt to fall back to -std=c++1z while still
- # requiring C++17 language features.
- set(BENCHMARK_DIALECT_FLAG "-std=c++1z")
-endif()
set(BENCHMARK_TEST_COMPILE_FLAGS
- ${BENCHMARK_DIALECT_FLAG} -O2
+ -O2
-fsized-deallocation
-I${BENCHMARK_LIBCXX_INSTALL}/include
-I${LIBCXX_SOURCE_DIR}/test/support
${BENCHMARK_TEST_COMPILE_FLAGS}
${SANITIZER_FLAGS}
-Wno-user-defined-literals
+ -Wno-suggest-override
)
set(BENCHMARK_TEST_LIBCXX_LINK_FLAGS
OUTPUT_NAME "${name}.libcxx.out"
RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}"
COMPILE_FLAGS "${BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS}"
- LINK_FLAGS "${BENCHMARK_TEST_LIBCXX_LINK_FLAGS}")
+ LINK_FLAGS "${BENCHMARK_TEST_LIBCXX_LINK_FLAGS}"
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED YES
+ CXX_EXTENSIONS NO)
cxx_link_system_libraries(${libcxx_target})
if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++" AND NOT DEFINED LIBSTDCXX_FILESYSTEM_LIB
RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}"
INCLUDE_DIRECTORIES ""
COMPILE_FLAGS "${BENCHMARK_TEST_NATIVE_COMPILE_FLAGS}"
- LINK_FLAGS "${BENCHMARK_TEST_NATIVE_LINK_FLAGS}")
+ LINK_FLAGS "${BENCHMARK_TEST_NATIVE_LINK_FLAGS}"
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED YES
+ CXX_EXTENSIONS NO)
endif()
endfunction()
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef BENCHMARK_VARIANT_BENCHMARKS_H
+#define BENCHMARK_VARIANT_BENCHMARKS_H
+
+#include <array>
+#include <cstddef>
+#include <tuple>
+#include <type_traits>
+#include <variant>
+
+#include "benchmark/benchmark.h"
+
+#include "GenerateInput.h"
+
+namespace VariantBenchmarks {
+
+template <std::size_t I>
+struct S {
+ static constexpr size_t v = I;
+};
+
+template <std::size_t N, std::size_t... Is>
+static auto genVariants(std::index_sequence<Is...>) {
+ using V = std::variant<S<Is>...>;
+ using F = V (*)();
+ static constexpr F fs[] = {[] { return V(std::in_place_index<Is>); }...};
+
+ std::array<V, N> result = {};
+ for (auto& v : result) {
+ v = fs[getRandomInteger(0ul, sizeof...(Is) - 1)]();
+ }
+
+ return result;
+}
+
+template <std::size_t N, std::size_t Alts>
+static void BM_Visit(benchmark::State& state) {
+ auto args = genVariants<N>(std::make_index_sequence<Alts>{});
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(std::apply(
+ [](auto... vs) {
+ return std::visit([](auto... is) { return (is.v + ... + 0); }, vs...);
+ },
+ args));
+ }
+}
+
+} // end namespace VariantBenchmarks
+
+#endif // BENCHMARK_VARIANT_BENCHMARKS_H
}
template <class GenInputs>
void BM_PathConstructInputIter(benchmark::State &st, GenInputs gen) {
- BM_PathConstructIter<input_iterator>(st, gen);
+ BM_PathConstructIter<cpp17_input_iterator>(st, gen);
}
template <class GenInputs>
void BM_PathConstructForwardIter(benchmark::State &st, GenInputs gen) {
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <algorithm>
+#include <cstdint>
+#include <map>
+#include <random>
+#include <vector>
+
+#include "CartesianBenchmarks.h"
+#include "benchmark/benchmark.h"
+#include "test_macros.h"
+
+// When VALIDATE is defined the benchmark will run to validate the benchmarks.
+// The time taken by several operations depend on whether or not an element
+// exists. To avoid errors in the benchmark these operations have a validation
+// mode to test the benchmark. Since they are not meant to be benchmarked the
+// number of sizes tested is limited to 1.
+//#define VALIDATE
+
+namespace {
+
+enum class Mode { Hit, Miss };
+
+struct AllModes : EnumValuesAsTuple<AllModes, Mode, 2> {
+ static constexpr const char* Names[] = {"ExistingElement", "NewElement"};
+};
+
+// The positions of the hints to pick:
+// - Begin picks the first item. The item cannot be put before this element.
+// - Thrid picks the third item. This is just an element with a valid entry
+// before and after it.
+// - Correct contains the correct hint.
+// - End contains a hint to the end of the map.
+enum class Hint { Begin, Third, Correct, End };
+struct AllHints : EnumValuesAsTuple<AllHints, Hint, 4> {
+ static constexpr const char* Names[] = {"Begin", "Third", "Correct", "End"};
+};
+
+enum class Order { Sorted, Random };
+struct AllOrders : EnumValuesAsTuple<AllOrders, Order, 2> {
+ static constexpr const char* Names[] = {"Sorted", "Random"};
+};
+
+struct TestSets {
+ std::vector<uint64_t> Keys;
+ std::vector<std::map<uint64_t, int64_t> > Maps;
+ std::vector<
+ std::vector<typename std::map<uint64_t, int64_t>::const_iterator> >
+ Hints;
+};
+
+enum class Shuffle { None, Keys, Hints };
+
+TestSets makeTestingSets(size_t MapSize, Mode mode, Shuffle shuffle,
+ size_t max_maps) {
+ /*
+ * The shuffle does not retain the random number generator to use the same
+ * set of random numbers for every iteration.
+ */
+ TestSets R;
+
+ int MapCount = std::min(max_maps, 1000000 / MapSize);
+
+ for (uint64_t I = 0; I < MapSize; ++I) {
+ R.Keys.push_back(mode == Mode::Hit ? 2 * I + 2 : 2 * I + 1);
+ }
+ if (shuffle == Shuffle::Keys)
+ std::shuffle(R.Keys.begin(), R.Keys.end(), std::mt19937());
+
+ for (int M = 0; M < MapCount; ++M) {
+ auto& map = R.Maps.emplace_back();
+ auto& hints = R.Hints.emplace_back();
+ for (uint64_t I = 0; I < MapSize; ++I) {
+ hints.push_back(map.insert(std::make_pair(2 * I + 2, 0)).first);
+ }
+ if (shuffle == Shuffle::Hints)
+ std::shuffle(hints.begin(), hints.end(), std::mt19937());
+ }
+
+ return R;
+}
+
+struct Base {
+ size_t MapSize;
+ Base(size_t T) : MapSize(T) {}
+
+ std::string baseName() const { return "_MapSize=" + std::to_string(MapSize); }
+};
+
+//*******************************************************************|
+// Member functions |
+//*******************************************************************|
+
+struct ConstructorDefault {
+ void run(benchmark::State& State) const {
+ for (auto _ : State) {
+ benchmark::DoNotOptimize(std::map<uint64_t, int64_t>());
+ }
+ }
+
+ std::string name() const { return "BM_ConstructorDefault"; }
+};
+
+struct ConstructorIterator : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ while (State.KeepRunningBatch(MapSize)) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(
+ std::map<uint64_t, int64_t>(Map.begin(), Map.end()));
+#else
+ std::map<uint64_t, int64_t> M{Map.begin(), Map.end()};
+ if (M != Map)
+ State.SkipWithError("Map copy not identical");
+#endif
+ }
+ }
+
+ std::string name() const { return "BM_ConstructorIterator" + baseName(); }
+};
+
+struct ConstructorCopy : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ while (State.KeepRunningBatch(MapSize)) {
+#ifndef VALIDATE
+ std::map<uint64_t, int64_t> M(Map);
+ benchmark::DoNotOptimize(M);
+#else
+ std::map<uint64_t, int64_t> M(Map);
+ if (M != Map)
+ State.SkipWithError("Map copy not identical");
+#endif
+ }
+ }
+
+ std::string name() const { return "BM_ConstructorCopy" + baseName(); }
+};
+
+struct ConstructorMove : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (auto& Map : Data.Maps) {
+ std::map<uint64_t, int64_t> M(std::move(Map));
+ benchmark::DoNotOptimize(M);
+ }
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const { return "BM_ConstructorMove" + baseName(); }
+};
+
+//*******************************************************************|
+// Capacity |
+//*******************************************************************|
+
+struct Empty : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ for (auto _ : State) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.empty());
+#else
+ if (Map.empty())
+ State.SkipWithError("Map contains an invalid number of elements.");
+#endif
+ }
+ }
+
+ std::string name() const { return "BM_Empty" + baseName(); }
+};
+
+struct Size : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ for (auto _ : State) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.size());
+#else
+ if (Map.size() != MapSize)
+ State.SkipWithError("Map contains an invalid number of elements.");
+#endif
+ }
+ }
+
+ std::string name() const { return "BM_Size" + baseName(); }
+};
+
+//*******************************************************************|
+// Modifiers |
+//*******************************************************************|
+
+struct Clear : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (auto& Map : Data.Maps) {
+ Map.clear();
+ benchmark::DoNotOptimize(Map);
+ }
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const { return "BM_Clear" + baseName(); }
+};
+
+template <class Mode, class Order>
+struct Insert : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (auto& Map : Data.Maps) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.insert(std::make_pair(K, 1)));
+#else
+ bool Inserted = Map.insert(std::make_pair(K, 1)).second;
+ if (Mode() == ::Mode::Hit) {
+ if (Inserted)
+ State.SkipWithError("Inserted a duplicate element");
+ } else {
+ if (!Inserted)
+ State.SkipWithError("Failed to insert e new element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys
+ : Shuffle::None,
+ 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const {
+ return "BM_Insert" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Mode, class Hint>
+struct InsertHint : Base {
+ using Base::Base;
+
+ template < ::Hint hint>
+ typename std::enable_if<hint == ::Hint::Correct>::type
+ run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ auto H = Data.Hints[I].begin();
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.insert(*H, std::make_pair(K, 1)));
+#else
+ auto Inserted = Map.insert(*H, std::make_pair(K, 1));
+ if (Mode() == ::Mode::Hit) {
+ if (Inserted != *H)
+ State.SkipWithError("Inserted a duplicate element");
+ } else {
+ if (++Inserted != *H)
+ State.SkipWithError("Failed to insert a new element");
+ }
+#endif
+ ++H;
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ template < ::Hint hint>
+ typename std::enable_if<hint != ::Hint::Correct>::type
+ run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ auto Third = *(Data.Hints[I].begin() + 2);
+ for (auto K : Data.Keys) {
+ auto Itor = hint == ::Hint::Begin
+ ? Map.begin()
+ : hint == ::Hint::Third ? Third : Map.end();
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.insert(Itor, std::make_pair(K, 1)));
+#else
+ size_t Size = Map.size();
+ Map.insert(Itor, std::make_pair(K, 1));
+ if (Mode() == ::Mode::Hit) {
+ if (Size != Map.size())
+ State.SkipWithError("Inserted a duplicate element");
+ } else {
+ if (Size + 1 != Map.size())
+ State.SkipWithError("Failed to insert a new element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ void run(benchmark::State& State) const {
+ static constexpr auto h = Hint();
+ run<h>(State);
+ }
+
+ std::string name() const {
+ return "BM_InsertHint" + baseName() + Mode::name() + Hint::name();
+ }
+};
+
+template <class Mode, class Order>
+struct InsertAssign : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (auto& Map : Data.Maps) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.insert_or_assign(K, 1));
+#else
+ bool Inserted = Map.insert_or_assign(K, 1).second;
+ if (Mode() == ::Mode::Hit) {
+ if (Inserted)
+ State.SkipWithError("Inserted a duplicate element");
+ } else {
+ if (!Inserted)
+ State.SkipWithError("Failed to insert e new element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys
+ : Shuffle::None,
+ 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const {
+ return "BM_InsertAssign" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Mode, class Hint>
+struct InsertAssignHint : Base {
+ using Base::Base;
+
+ template < ::Hint hint>
+ typename std::enable_if<hint == ::Hint::Correct>::type
+ run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ auto H = Data.Hints[I].begin();
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.insert_or_assign(*H, K, 1));
+#else
+ auto Inserted = Map.insert_or_assign(*H, K, 1);
+ if (Mode() == ::Mode::Hit) {
+ if (Inserted != *H)
+ State.SkipWithError("Inserted a duplicate element");
+ } else {
+ if (++Inserted != *H)
+ State.SkipWithError("Failed to insert a new element");
+ }
+#endif
+ ++H;
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ template < ::Hint hint>
+ typename std::enable_if<hint != ::Hint::Correct>::type
+ run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ auto Third = *(Data.Hints[I].begin() + 2);
+ for (auto K : Data.Keys) {
+ auto Itor = hint == ::Hint::Begin
+ ? Map.begin()
+ : hint == ::Hint::Third ? Third : Map.end();
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.insert_or_assign(Itor, K, 1));
+#else
+ size_t Size = Map.size();
+ Map.insert_or_assign(Itor, K, 1);
+ if (Mode() == ::Mode::Hit) {
+ if (Size != Map.size())
+ State.SkipWithError("Inserted a duplicate element");
+ } else {
+ if (Size + 1 != Map.size())
+ State.SkipWithError("Failed to insert a new element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ void run(benchmark::State& State) const {
+ static constexpr auto h = Hint();
+ run<h>(State);
+ }
+
+ std::string name() const {
+ return "BM_InsertAssignHint" + baseName() + Mode::name() + Hint::name();
+ }
+};
+
+template <class Mode, class Order>
+struct Emplace : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (auto& Map : Data.Maps) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.emplace(K, 1));
+#else
+ bool Inserted = Map.emplace(K, 1).second;
+ if (Mode() == ::Mode::Hit) {
+ if (Inserted)
+ State.SkipWithError("Emplaced a duplicate element");
+ } else {
+ if (!Inserted)
+ State.SkipWithError("Failed to emplace a new element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys
+ : Shuffle::None,
+ 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const {
+ return "BM_Emplace" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Mode, class Hint>
+struct EmplaceHint : Base {
+ using Base::Base;
+
+ template < ::Hint hint>
+ typename std::enable_if<hint == ::Hint::Correct>::type
+ run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ auto H = Data.Hints[I].begin();
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.emplace_hint(*H, K, 1));
+#else
+ auto Inserted = Map.emplace_hint(*H, K, 1);
+ if (Mode() == ::Mode::Hit) {
+ if (Inserted != *H)
+ State.SkipWithError("Emplaced a duplicate element");
+ } else {
+ if (++Inserted != *H)
+ State.SkipWithError("Failed to emplace a new element");
+ }
+#endif
+ ++H;
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ template < ::Hint hint>
+ typename std::enable_if<hint != ::Hint::Correct>::type
+ run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ auto Third = *(Data.Hints[I].begin() + 2);
+ for (auto K : Data.Keys) {
+ auto Itor = hint == ::Hint::Begin
+ ? Map.begin()
+ : hint == ::Hint::Third ? Third : Map.end();
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.emplace_hint(Itor, K, 1));
+#else
+ size_t Size = Map.size();
+ Map.emplace_hint(Itor, K, 1);
+ if (Mode() == ::Mode::Hit) {
+ if (Size != Map.size())
+ State.SkipWithError("Emplaced a duplicate element");
+ } else {
+ if (Size + 1 != Map.size())
+ State.SkipWithError("Failed to emplace a new element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ void run(benchmark::State& State) const {
+ static constexpr auto h = Hint();
+ run<h>(State);
+ }
+
+ std::string name() const {
+ return "BM_EmplaceHint" + baseName() + Mode::name() + Hint::name();
+ }
+};
+
+template <class Mode, class Order>
+struct TryEmplace : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (auto& Map : Data.Maps) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.try_emplace(K, 1));
+#else
+ bool Inserted = Map.try_emplace(K, 1).second;
+ if (Mode() == ::Mode::Hit) {
+ if (Inserted)
+ State.SkipWithError("Emplaced a duplicate element");
+ } else {
+ if (!Inserted)
+ State.SkipWithError("Failed to emplace a new element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys
+ : Shuffle::None,
+ 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const {
+ return "BM_TryEmplace" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Mode, class Hint>
+struct TryEmplaceHint : Base {
+ using Base::Base;
+
+ template < ::Hint hint>
+ typename std::enable_if<hint == ::Hint::Correct>::type
+ run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ auto H = Data.Hints[I].begin();
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.try_emplace(*H, K, 1));
+#else
+ auto Inserted = Map.try_emplace(*H, K, 1);
+ if (Mode() == ::Mode::Hit) {
+ if (Inserted != *H)
+ State.SkipWithError("Emplaced a duplicate element");
+ } else {
+ if (++Inserted != *H)
+ State.SkipWithError("Failed to emplace a new element");
+ }
+#endif
+ ++H;
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ template < ::Hint hint>
+ typename std::enable_if<hint != ::Hint::Correct>::type
+ run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ auto Third = *(Data.Hints[I].begin() + 2);
+ for (auto K : Data.Keys) {
+ auto Itor = hint == ::Hint::Begin
+ ? Map.begin()
+ : hint == ::Hint::Third ? Third : Map.end();
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.try_emplace(Itor, K, 1));
+#else
+ size_t Size = Map.size();
+ Map.try_emplace(Itor, K, 1);
+ if (Mode() == ::Mode::Hit) {
+ if (Size != Map.size())
+ State.SkipWithError("Emplaced a duplicate element");
+ } else {
+ if (Size + 1 != Map.size())
+ State.SkipWithError("Failed to emplace a new element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(), Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ void run(benchmark::State& State) const {
+ static constexpr auto h = Hint();
+ run<h>(State);
+ }
+
+ std::string name() const {
+ return "BM_TryEmplaceHint" + baseName() + Mode::name() + Hint::name();
+ }
+};
+
+template <class Mode, class Order>
+struct Erase : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (auto& Map : Data.Maps) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.erase(K));
+#else
+ size_t I = Map.erase(K);
+ if (Mode() == ::Mode::Hit) {
+ if (I == 0)
+ State.SkipWithError("Did not find the existing element");
+ } else {
+ if (I == 1)
+ State.SkipWithError("Did find the non-existing element");
+ }
+#endif
+ }
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys
+ : Shuffle::None,
+ 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const {
+ return "BM_Erase" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Order>
+struct EraseIterator : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode::Hit,
+ Order::value == ::Order::Random ? Shuffle::Hints : Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (size_t I = 0; I < Data.Maps.size(); ++I) {
+ auto& Map = Data.Maps[I];
+ for (auto H : Data.Hints[I]) {
+ benchmark::DoNotOptimize(Map.erase(H));
+ }
+#ifdef VALIDATE
+ if (!Map.empty())
+ State.SkipWithError("Did not erase the entire map");
+#endif
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode::Hit,
+ Order::value == ::Order::Random ? Shuffle::Hints
+ : Shuffle::None,
+ 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const {
+ return "BM_EraseIterator" + baseName() + Order::name();
+ }
+};
+
+struct EraseRange : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1000);
+ while (State.KeepRunningBatch(MapSize * Data.Maps.size())) {
+ for (auto& Map : Data.Maps) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.erase(Map.begin(), Map.end()));
+#else
+ Map.erase(Map.begin(), Map.end());
+ if (!Map.empty())
+ State.SkipWithError("Did not erase the entire map");
+#endif
+ }
+
+ State.PauseTiming();
+ Data = makeTestingSets(MapSize, Mode::Hit, Shuffle::None, 1000);
+ State.ResumeTiming();
+ }
+ }
+
+ std::string name() const { return "BM_EraseRange" + baseName(); }
+};
+
+//*******************************************************************|
+// Lookup |
+//*******************************************************************|
+
+template <class Mode, class Order>
+struct Count : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ while (State.KeepRunningBatch(MapSize)) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.count(K));
+#else
+ size_t I = Map.count(K);
+ if (Mode() == ::Mode::Hit) {
+ if (I == 0)
+ State.SkipWithError("Did not find the existing element");
+ } else {
+ if (I == 1)
+ State.SkipWithError("Did find the non-existing element");
+ }
+#endif
+ }
+ }
+ }
+
+ std::string name() const {
+ return "BM_Count" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Mode, class Order>
+struct Find : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ while (State.KeepRunningBatch(MapSize)) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.find(K));
+#else
+ auto Itor = Map.find(K);
+ if (Mode() == ::Mode::Hit) {
+ if (Itor == Map.end())
+ State.SkipWithError("Did not find the existing element");
+ } else {
+ if (Itor != Map.end())
+ State.SkipWithError("Did find the non-existing element");
+ }
+#endif
+ }
+ }
+ }
+
+ std::string name() const {
+ return "BM_Find" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Mode, class Order>
+struct EqualRange : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ while (State.KeepRunningBatch(MapSize)) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.equal_range(K));
+#else
+ auto Range = Map.equal_range(K);
+ if (Mode() == ::Mode::Hit) {
+ // Adjust validation for the last element.
+ auto Key = K;
+ if (Range.second == Map.end() && K == 2 * MapSize) {
+ --Range.second;
+ Key -= 2;
+ }
+ if (Range.first == Map.end() || Range.first->first != K ||
+ Range.second == Map.end() || Range.second->first - 2 != Key)
+ State.SkipWithError("Did not find the existing element");
+ } else {
+ if (Range.first == Map.end() || Range.first->first - 1 != K ||
+ Range.second == Map.end() || Range.second->first - 1 != K)
+ State.SkipWithError("Did find the non-existing element");
+ }
+#endif
+ }
+ }
+ }
+
+ std::string name() const {
+ return "BM_EqualRange" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Mode, class Order>
+struct LowerBound : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ while (State.KeepRunningBatch(MapSize)) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.lower_bound(K));
+#else
+ auto Itor = Map.lower_bound(K);
+ if (Mode() == ::Mode::Hit) {
+ if (Itor == Map.end() || Itor->first != K)
+ State.SkipWithError("Did not find the existing element");
+ } else {
+ if (Itor == Map.end() || Itor->first - 1 != K)
+ State.SkipWithError("Did find the non-existing element");
+ }
+#endif
+ }
+ }
+ }
+
+ std::string name() const {
+ return "BM_LowerBound" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+template <class Mode, class Order>
+struct UpperBound : Base {
+ using Base::Base;
+
+ void run(benchmark::State& State) const {
+ auto Data = makeTestingSets(
+ MapSize, Mode(),
+ Order::value == ::Order::Random ? Shuffle::Keys : Shuffle::None, 1);
+ auto& Map = Data.Maps.front();
+ while (State.KeepRunningBatch(MapSize)) {
+ for (auto K : Data.Keys) {
+#ifndef VALIDATE
+ benchmark::DoNotOptimize(Map.upper_bound(K));
+#else
+ std::map<uint64_t, int64_t>::iterator Itor = Map.upper_bound(K);
+ if (Mode() == ::Mode::Hit) {
+ // Adjust validation for the last element.
+ auto Key = K;
+ if (Itor == Map.end() && K == 2 * MapSize) {
+ --Itor;
+ Key -= 2;
+ }
+ if (Itor == Map.end() || Itor->first - 2 != Key)
+ State.SkipWithError("Did not find the existing element");
+ } else {
+ if (Itor == Map.end() || Itor->first - 1 != K)
+ State.SkipWithError("Did find the non-existing element");
+ }
+#endif
+ }
+ }
+ }
+
+ std::string name() const {
+ return "BM_UpperBound" + baseName() + Mode::name() + Order::name();
+ }
+};
+
+} // namespace
+
+int main(int argc, char** argv) {
+ benchmark::Initialize(&argc, argv);
+ if (benchmark::ReportUnrecognizedArguments(argc, argv))
+ return 1;
+
+#ifdef VALIDATE
+ const std::vector<size_t> MapSize{10};
+#else
+ const std::vector<size_t> MapSize{10, 100, 1000, 10000, 100000, 1000000};
+#endif
+
+ // Member functions
+ makeCartesianProductBenchmark<ConstructorDefault>();
+ makeCartesianProductBenchmark<ConstructorIterator>(MapSize);
+ makeCartesianProductBenchmark<ConstructorCopy>(MapSize);
+ makeCartesianProductBenchmark<ConstructorMove>(MapSize);
+
+ // Capacity
+ makeCartesianProductBenchmark<Empty>(MapSize);
+ makeCartesianProductBenchmark<Size>(MapSize);
+
+ // Modifiers
+ makeCartesianProductBenchmark<Clear>(MapSize);
+ makeCartesianProductBenchmark<Insert, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<InsertHint, AllModes, AllHints>(MapSize);
+ makeCartesianProductBenchmark<InsertAssign, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<InsertAssignHint, AllModes, AllHints>(MapSize);
+
+ makeCartesianProductBenchmark<Emplace, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<EmplaceHint, AllModes, AllHints>(MapSize);
+ makeCartesianProductBenchmark<TryEmplace, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<TryEmplaceHint, AllModes, AllHints>(MapSize);
+ makeCartesianProductBenchmark<Erase, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<EraseIterator, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<EraseRange>(MapSize);
+
+ // Lookup
+ makeCartesianProductBenchmark<Count, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<Find, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<EqualRange, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<LowerBound, AllModes, AllOrders>(MapSize);
+ makeCartesianProductBenchmark<UpperBound, AllModes, AllOrders>(MapSize);
+
+ benchmark::RunSpecifiedBenchmarks();
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <array>
+#include <charconv>
+#include <random>
+
+#include "benchmark/benchmark.h"
+#include "test_macros.h"
+
+static const std::array<unsigned, 1000> input = [] {
+ std::mt19937 generator;
+ std::uniform_int_distribution<unsigned> distribution(0, std::numeric_limits<unsigned>::max());
+ std::array<unsigned, 1000> result;
+ std::generate_n(result.begin(), result.size(), [&] { return distribution(generator); });
+ return result;
+}();
+
+static void BM_to_chars_good(benchmark::State& state) {
+ char buffer[128];
+ int base = state.range(0);
+ while (state.KeepRunningBatch(input.size()))
+ for (auto value : input)
+ benchmark::DoNotOptimize(std::to_chars(buffer, &buffer[128], value, base));
+}
+BENCHMARK(BM_to_chars_good)->DenseRange(2, 36, 1);
+
+static void BM_to_chars_bad(benchmark::State& state) {
+ char buffer[128];
+ int base = state.range(0);
+ struct sample {
+ unsigned size;
+ unsigned value;
+ };
+ std::array<sample, 1000> data;
+ // Assume the failure occurs, on average, halfway during the conversion.
+ std::transform(input.begin(), input.end(), data.begin(), [&](unsigned value) {
+ std::to_chars_result result = std::to_chars(buffer, &buffer[128], value, base);
+ return sample{unsigned((result.ptr - buffer) / 2), value};
+ });
+
+ while (state.KeepRunningBatch(data.size()))
+ for (auto element : data)
+ benchmark::DoNotOptimize(std::to_chars(buffer, &buffer[element.size], element.value, base));
+}
+BENCHMARK(BM_to_chars_bad)->DenseRange(2, 36, 1);
+
+int main(int argc, char** argv) {
+ benchmark::Initialize(&argc, argv);
+ if (benchmark::ReportUnrecognizedArguments(argc, argv))
+ return 1;
+
+ benchmark::RunSpecifiedBenchmarks();
+}
--- /dev/null
+#include "benchmark/benchmark.h"
+
+#include "VariantBenchmarks.h"
+
+using namespace VariantBenchmarks;
+
+BENCHMARK_TEMPLATE(BM_Visit, 1, 1);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 2);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 3);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 4);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 5);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 6);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 7);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 8);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 9);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 10);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 20);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 30);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 40);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 50);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 60);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 70);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 80);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 90);
+BENCHMARK_TEMPLATE(BM_Visit, 1, 100);
+
+BENCHMARK_MAIN();
--- /dev/null
+#include "benchmark/benchmark.h"
+
+#include "VariantBenchmarks.h"
+
+using namespace VariantBenchmarks;
+
+BENCHMARK_TEMPLATE(BM_Visit, 2, 1);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 2);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 3);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 4);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 5);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 6);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 7);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 8);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 9);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 10);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 20);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 30);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 40);
+BENCHMARK_TEMPLATE(BM_Visit, 2, 50);
+
+BENCHMARK_MAIN();
--- /dev/null
+#include "benchmark/benchmark.h"
+
+#include "VariantBenchmarks.h"
+
+using namespace VariantBenchmarks;
+
+BENCHMARK_TEMPLATE(BM_Visit, 3, 1);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 2);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 3);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 4);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 5);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 6);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 7);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 8);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 9);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 10);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 15);
+BENCHMARK_TEMPLATE(BM_Visit, 3, 20);
+
+BENCHMARK_MAIN();
if ("${lib}" STREQUAL "cxx-headers")
continue()
endif()
- if (TARGET "${lib}" OR
- (${lib} MATCHES "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI) OR
- (${lib} MATCHES "unwind(_static|_shared)?" AND HAVE_LIBUNWIND))
- list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_PROPERTY:${lib},OUTPUT_NAME>")
- else()
- list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}${lib}")
- endif()
+ # If ${lib} is not a target, we use a dummy target which we know will
+ # have an OUTPUT_NAME property so that CMake doesn't fail when evaluating
+ # the non-selected branch of the `IF`. It doesn't matter what it evaluates
+ # to because it's not selected, but it must not cause an error.
+ # See https://gitlab.kitware.com/cmake/cmake/-/issues/21045.
+ set(output_name_tgt "$<IF:$<TARGET_EXISTS:${lib}>,${lib},${target}>")
+ set(libname "$<IF:$<TARGET_EXISTS:${lib}>,$<TARGET_PROPERTY:${output_name_tgt},OUTPUT_NAME>,${lib}>")
+ list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}${libname}")
endforeach()
endif()
string(REPLACE ";" " " link_libraries "${link_libraries}")
COMMENT "Copying C++ ABI header ${fpath}...")
list(APPEND abilib_headers "${dst}")
- if (LIBCXX_HEADER_DIR)
- set(dst "${LIBCXX_HEADER_DIR}/include/c++/v1/${dstdir}/${fpath}")
- add_custom_command(OUTPUT ${dst}
- DEPENDS ${src}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
- COMMENT "Copying C++ ABI header ${fpath}...")
- list(APPEND abilib_headers "${dst}")
- endif()
+ # TODO: libc++ shouldn't be responsible for copying the libc++abi
+ # headers into the right location.
+ set(dst "${LIBCXX_GENERATED_INCLUDE_DIR}/${dstdir}/${fpath}")
+ add_custom_command(OUTPUT ${dst}
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying C++ ABI header ${fpath}...")
+ list(APPEND abilib_headers "${dst}")
if (LIBCXX_INSTALL_HEADERS)
install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir}
+ DESTINATION include/c++/v1/${dstdir}
COMPONENT cxx-headers
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
if(NOT LIBCXX_CXX_ABI_INCLUDE_PATHS)
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1")
endif()
+ # libcxxrt does not provide aligned new and delete operators
+ set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON)
setup_abi_lib(
"-DLIBCXXRT"
"cxxrt" "cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
endif()
endmacro()
+# Add all the flags supported by the compiler to all of
+# 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBCXX_COMPILE_FLAGS'
+# and 'LIBCXX_LINK_FLAGS'.
+macro(add_target_flags_if_supported)
+ foreach(flag ${ARGN})
+ mangle_name("${flag}" flagname)
+ check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")
+ add_target_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag})
+ endforeach()
+endmacro()
+
# Add a specified list of flags to both 'LIBCXX_COMPILE_FLAGS' and
# 'LIBCXX_LINK_FLAGS'.
macro(add_flags)
endif()
message(STATUS "Configuring for standalone build.")
-set(LIBCXX_STANDALONE_BUILD 1)
+
+# By default, we target the host, but this can be overridden at CMake invocation time.
+include(GetHostTriple)
+get_host_triple(LLVM_INFERRED_HOST_TRIPLE)
+set(LLVM_HOST_TRIPLE "${LLVM_INFERRED_HOST_TRIPLE}" CACHE STRING "Host on which LLVM binaries will run")
+set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_HOST_TRIPLE}" CACHE STRING "Target triple used by default.")
# Add LLVM Functions --------------------------------------------------------
if (WIN32)
set(LLVM_ENABLE_SPHINX OFF)
endif()
-# In a standalone build, we don't have llvm to automatically generate the
-# llvm-lit script for us. So we need to provide an explicit directory that
-# the configurator should write the script into.
-set(LLVM_LIT_OUTPUT_DIR "${libcxx_BINARY_DIR}/bin")
-
if (LLVM_INCLUDE_TESTS)
# Required LIT Configuration ------------------------------------------------
# Define the default arguments to use with 'lit', and an option for the user
--- /dev/null
+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(LIBCXX_TARGET_TRIPLE "aarch64-linux-gnu" CACHE STRING "")
set(LIBCXX_ENABLE_ASSERTIONS OFF CACHE BOOL "")
set(LIBCXX_ABI_VERSION "1" CACHE STRING "")
set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
-set(LIBCXX_ENABLE_STATIC OFF CACHE BOOL "")
+set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "")
-set(LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION "1" CACHE STRING "")
set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "")
-set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
set(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT ON CACHE BOOL "")
+set(LIBCXX_ENABLE_DEBUG_MODE_SUPPORT OFF CACHE BOOL "")
+set(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS ON CACHE BOOL "")
+set(LIBCXX_ENABLE_INCOMPLETE_FEATURES OFF CACHE BOOL "")
+
+set(LIBCXX_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
+set(LIBCXXABI_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
-set(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "")
-set(LIBCXXABI_ENABLE_PIC OFF CACHE BOOL "")
set(LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "")
set(LIBCXXABI_ENABLE_FORGIVING_DYNAMIC_CAST ON CACHE BOOL "")
--- /dev/null
+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(LIBCXX_TARGET_TRIPLE "armv7-linux-gnueabihf" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-marm" CACHE STRING "")
+set(CMAKE_C_FLAGS "-marm" CACHE STRING "")
--- /dev/null
+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(LIBCXX_TARGET_TRIPLE "armv7-linux-gnueabihf" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-mthumb" CACHE STRING "")
+set(CMAKE_C_FLAGS "-mthumb" CACHE STRING "")
+set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
+set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
--- /dev/null
+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(LIBCXX_TARGET_TRIPLE "armv8-linux-gnueabihf" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-marm" CACHE STRING "")
+set(CMAKE_C_FLAGS "-marm" CACHE STRING "")
--- /dev/null
+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(LIBCXX_TARGET_TRIPLE "armv8-linux-gnueabihf" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-mthumb" CACHE STRING "")
+set(CMAKE_C_FLAGS "-mthumb" CACHE STRING "")
+set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
+set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
--- /dev/null
+set(CMAKE_BUILD_TYPE Release CACHE STRING "")
+set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "")
+
+set(LIBCXX_ENABLE_ASSERTIONS OFF CACHE BOOL "")
+set(LIBCXX_ABI_VERSION "1" CACHE STRING "")
+set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
+set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "")
+set(LIBCXX_CXX_ABI libcxxrt CACHE STRING "")
+set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "")
--- /dev/null
+set(LIBCXX_ENABLE_ASSERTIONS ON CACHE BOOL "")
--- /dev/null
+set(LIBCXX_TEST_PARAMS "std=c++20" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
--- /dev/null
+set(LIBCXX_TEST_PARAMS "std=c++2b" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
--- /dev/null
+set(LIBCXX_TEST_PARAMS "debug_level=1" "additional_features=LIBCXX-DEBUG-FIXME" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
--- /dev/null
+set(LIBCXX_TEST_PARAMS "enable_modules=True" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
--- /dev/null
+set(LIBCXX_ENABLE_DEBUG_MODE_SUPPORT OFF CACHE BOOL "")
--- /dev/null
+set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
--- /dev/null
+set(LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "")
--- /dev/null
+set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")
--- /dev/null
+set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
endif()
endif()
-# libc++ is built with -nodefaultlibs, so we want all our checks to also
-# use this option, otherwise we may end up with an inconsistency between
+# libc++ is using -nostdlib++ at the link step when available,
+# otherwise -nodefaultlibs is used. We want all our checks to also
+# use one of these options, otherwise we may end up with an inconsistency between
# the flags we think we require during configuration (if the checks are
-# performed without -nodefaultlibs) and the flags that are actually
-# required during compilation (which has the -nodefaultlibs). libc is
+# performed without one of those options) and the flags that are actually
+# required during compilation (which has the -nostdlib++ or -nodefaultlibs). libc is
# required for the link to go through. We remove sanitizers from the
# configuration checks to avoid spurious link errors.
-check_c_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
-if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
+
+check_c_compiler_flag(-nostdlib++ LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG)
+if (LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++")
+else()
+ check_c_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+ if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
+ endif()
+endif()
+
+if (LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG OR LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
if (LIBCXX_HAS_C_LIB)
list(APPEND CMAKE_REQUIRED_LIBRARIES c)
endif ()
--- /dev/null
+.. _AddingNewCIJobs:
+
+==================
+Adding New CI Jobs
+==================
+
+.. contents::
+ :local:
+
+Adding The Job
+==============
+
+libc++ uses Buildkite for running its CI. Setting up new CI jobs is easy, and
+these jobs can run either on our existing infrastructure, or on your own.
+
+If you need to run the job on your own machines, please follow the
+`Buildkite guide <https://buildkite.com/docs/agent/v3>`_ to setup your
+own agents. Make sure you tag your agents in a way that you'll be able
+to recognize them when defining your job below. Finally, in order for the
+agent to register itself to Buildkite, it will need a BuildKite Agent token.
+Please contact a maintainer to get your token.
+
+Then, simply add a job to the Buildkite pipeline by editing ``libcxx/utils/ci/buildkite-pipeline.yml``.
+Take a look at how the surrounding jobs are defined and do something similar.
+An example of a job definition is:
+
+.. code-block:: yaml
+
+ - label: "C++11"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx11"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+If you create your own agents, put them in the ``libcxx-builders`` queue and
+use agent tags to allow targetting your agents from the Buildkite pipeline
+config appropriately.
+
+We try to keep the pipeline definition file as simple as possible, and to
+keep any script used for CI inside ``libcxx/utils/ci``. This ensures that
+it's possible to reproduce CI issues locally with ease, understanding of
+course that some setups may require access to special hardware that is not
+available.
+
+Testing Your New Job
+====================
+
+Testing your new job is easy -- once your agent is set up (if any), just open
+a code review and the libc++ CI pipeline will run, including any changes you
+might have made to the pipeline definition itself.
+
+Service Level Agreement
+=======================
+
+To keep the libc++ CI useful for everyone, we aim for a quick turnaround time
+for all CI jobs. This allows the overall pipeline to finish in a reasonable
+amount of time, which is important because it directly affects our development
+velocity. We also try to make sure that jobs run on reliable infrastructure in
+order to avoid flaky failures, which reduce the value of CI for everyone.
+
+We may be reluctant to add and support CI jobs that take a long time to finish
+or that are too flaky.
.. _build instructions:
-Getting Started
-===============
+The instructions on this page are aimed at vendors who ship libc++ as part of an
+operating system distribution, a toolchain or similar shipping vehicules. If you
+are a user merely trying to use libc++ in your program, you most likely want to
+refer to your vendor's documentation, or to the general documentation for using
+libc++ :ref:`here <using-libcxx>`.
-On Mac OS 10.7 (Lion) and later, the easiest way to get this library is to install
-Xcode 4.2 or later. However if you want to install tip-of-trunk from here
-(getting the bleeding edge), read on.
+.. warning::
+ If your operating system already provides libc++, it is important to be careful
+ not to replace it. Replacing your system's libc++ installation could render it
+ non-functional. Use the CMake option ``CMAKE_INSTALL_PREFIX`` to select a safe
+ place to install libc++.
-The following instructions describe how to checkout, build, test and
-(optionally) install libc++ and libc++abi.
-If your system already provides a libc++ installation it is important to be
-careful not to replace it. Remember Use the CMake option
-``CMAKE_INSTALL_PREFIX`` to select a safe place to install libc++.
+The default build
+=================
-.. warning::
- * Replacing your systems libc++ installation could render the system non-functional.
- * macOS will not boot without a valid copy of ``libc++.1.dylib`` in ``/usr/lib``.
+By default, libc++ and libc++abi are built as sub-projects of the LLVM project.
+This can be achieved with the usual CMake invocation:
.. code-block:: bash
$ git clone https://github.com/llvm/llvm-project.git
$ cd llvm-project
- $ mkdir build && cd build
- $ cmake -DCMAKE_C_COMPILER=clang \
- -DCMAKE_CXX_COMPILER=clang++ \
- -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
- ../llvm
- $ make # Build
- $ make check-cxx # Test
- $ make install-cxx install-cxxabi # Install
-
-For more information about configuring libc++ see :ref:`CMake Options`. You may
-also want to read the `LLVM getting started
-<https://llvm.org/docs/GettingStarted.html>`_ documentation.
-
-Shared libraries for libc++ and libc++ abi should now be present in
-``build/lib``. See :ref:`using an alternate libc++ installation <alternate
-libcxx>` for information on how to use this libc++.
-
-The instructions are for building libc++ on
-FreeBSD, Linux, or Mac using `libc++abi`_ as the C++ ABI library.
-On Linux, it is also possible to use :ref:`libsupc++ <libsupcxx>` or libcxxrt.
-
-It is possible to build libc++ standalone (i.e. without building other LLVM
-projects). A standalone build would look like this:
+ $ mkdir build
+ $ cmake -G Ninja -S llvm -B build -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" # Configure
+ $ ninja -C build cxx cxxabi # Build
+ $ ninja -C build check-cxx check-cxxabi # Test
+ $ ninja -C build install-cxx install-cxxabi # Install
+
+.. note::
+ See :ref:`CMake Options` below for more configuration options.
+
+After building the ``install-cxx`` and ``install-cxxabi`` targets, shared libraries
+for libc++ and libc++abi should now be present in ``<CMAKE_INSTALL_PREFIX>/lib``, and
+headers in ``<CMAKE_INSTALL_PREFIX>/include/c++/v1``. See :ref:`using an alternate
+libc++ installation <alternate libcxx>` for information on how to use this libc++ over
+the default one.
+
+In the default configuration, libc++ and libc++abi will be built using the compiler available
+by default on your system. It is also possible to bootstrap Clang and build libc++ with it.
+
+
+Bootstrapping build
+===================
+
+It is also possible to build Clang and then build libc++ and libc++abi using that
+just-built compiler. This is the correct way to build libc++ when putting together
+a toolchain, or when the system compiler is not adequate to build libc++ (too old,
+unsupported, etc.). This type of build is also commonly called a "Runtimes build":
.. code-block:: bash
- $ git clone https://github.com/llvm/llvm-project.git llvm-project
- $ cd llvm-project
- $ mkdir build && cd build
- $ cmake -DCMAKE_C_COMPILER=clang \
- -DCMAKE_CXX_COMPILER=clang++ \
- -DLIBCXX_CXX_ABI=libcxxabi \
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/separate/libcxxabi/include \
- ../libcxx
- $ make
- $ make check-cxx # optional
+ $ mkdir build
+ $ cmake -G Ninja -S llvm -B build -DLLVM_ENABLE_PROJECTS="clang" \ # Configure
+ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
+ -DLLVM_RUNTIME_TARGETS="<target-triple>"
+ $ ninja -C build runtimes # Build
+ $ ninja -C build check-runtimes # Test
+ $ ninja -C build install-runtimes # Install
-Experimental Support for Windows
---------------------------------
+Support for Windows
+===================
-The Windows support requires building with clang-cl as cl does not support one
-required extension: `#include_next`. Furthermore, VS 2015 or newer (19.00) is
-required. In the case of clang-cl, we need to specify the "MS Compatibility
-Version" as it defaults to 2014 (18.00).
+libcxx supports being built with clang-cl, but not with MSVC's cl.exe, as
+cl doesn't support the ``#include_next`` extension. Furthermore, VS 2017 or
+newer (19.14) is required.
+
+libcxx also supports being built with clang targeting MinGW environments.
CMake + Visual Studio
-~~~~~~~~~~~~~~~~~~~~~
+---------------------
Building with Visual Studio currently does not permit running tests. However,
it is the simplest way to build.
.. code-block:: batch
- > cmake -G "Visual Studio 14 2015" ^
- -T "LLVM-vs2014" ^
- -DLIBCXX_ENABLE_SHARED=YES ^
- -DLIBCXX_ENABLE_STATIC=NO ^
- -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO ^
- \path\to\libcxx
- > cmake --build .
+ > cmake -G "Visual Studio 16 2019" -S libcxx -B build ^
+ -T "ClangCL" ^
+ -DLIBCXX_ENABLE_SHARED=YES ^
+ -DLIBCXX_ENABLE_STATIC=NO ^
+ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO
+ > cmake --build build
-CMake + ninja
-~~~~~~~~~~~~~
+CMake + ninja (MSVC)
+--------------------
Building with ninja is required for development to enable tests.
-Unfortunately, doing so requires additional configuration as we cannot
-just specify a toolset.
+A couple of tests require Bash to be available, and a couple dozens
+of tests require other posix tools (cp, grep and similar - LLVM's tests
+require the same). Without those tools the vast majority of tests
+can still be ran successfully.
+
+If Git for Windows is available, that can be used to provide the bash
+shell by adding the right bin directory to the path, e.g.
+``set PATH=%PATH%;C:\Program Files\Git\usr\bin``.
+
+Alternatively, one can also choose to run the whole build in a MSYS2
+shell. That can be set up e.g. by starting a Visual Studio Tools Command
+Prompt (for getting the environment variables pointing to the headers and
+import libraries), and making sure that clang-cl is available in the
+path. From there, launch an MSYS2 shell via e.g.
+``C:\msys64\msys2_shell.cmd -full-path -mingw64`` (preserving the earlier
+environment, allowing the MSVC headers/libraries and clang-cl to be found).
+
+In either case, then run:
.. code-block:: batch
- > cmake -G Ninja ^
- -DCMAKE_MAKE_PROGRAM=/path/to/ninja ^
- -DCMAKE_SYSTEM_NAME=Windows ^
+ > cmake -G Ninja -S libcxx -B build ^
-DCMAKE_C_COMPILER=clang-cl ^
- -DCMAKE_C_FLAGS="-fms-compatibility-version=19.00 --target=i686--windows" ^
- -DCMAKE_CXX_COMPILER=clang-cl ^
- -DCMAKE_CXX_FLAGS="-fms-compatibility-version=19.00 --target=i686--windows" ^
- -DLLVM_PATH=/path/to/llvm/tree ^
- -DLIBCXX_ENABLE_SHARED=YES ^
- -DLIBCXX_ENABLE_STATIC=NO ^
- -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO ^
- \path\to\libcxx
- > /path/to/ninja cxx
- > /path/to/ninja check-cxx
-
-Note that the paths specified with backward slashes must use the `\\` as the
-directory separator as clang-cl may otherwise parse the path as an argument.
+ -DCMAKE_CXX_COMPILER=clang-cl ^
+ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO
+ > ninja -C build cxx
+ > ninja -C build check-cxx
+
+If you are running in an MSYS2 shell and you have installed the
+MSYS2-provided clang package (which defaults to a non-MSVC target), you
+should add e.g. ``-DLIBCXX_TARGET_TRIPLE=x86_64-windows-msvc`` (replacing
+``x86_64`` with the architecture you're targeting) to the ``cmake`` command
+line above. This will instruct ``check-cxx`` to use the right target triple
+when invoking ``clang++``.
+
+Also note that if not building in Release mode, a failed assert in the tests
+pops up a blocking dialog box, making it hard to run a larger number of tests.
+
+CMake + ninja (MinGW)
+---------------------
+
+libcxx can also be built in MinGW environments, e.g. with the MinGW
+compilers in MSYS2. This requires clang to be available (installed with
+e.g. the ``mingw-w64-x86_64-clang`` package), together with CMake and ninja.
+
+.. code-block:: bash
+
+ > cmake -G Ninja -S libcxx -B build \
+ -DCMAKE_C_COMPILER=clang \
+ -DCMAKE_CXX_COMPILER=clang++ \
+ -DLIBCXX_HAS_WIN32_THREAD_API=ON \
+ -DLIBCXX_CXX_ABI=libstdc++ \
+ -DLIBCXX_TARGET_INFO="libcxx.test.target_info.MingwLocalTI"
+ > ninja -C build cxx
+ > cp /mingw64/bin/{libstdc++-6,libgcc_s_seh-1,libwinpthread-1}.dll lib
+ > ninja -C build check-cxx
+
+As this build configuration ends up depending on a couple other DLLs that
+aren't available in path while running tests, copy them into the same
+directory as the tested libc++ DLL.
+
+(Building a libc++ that depends on libstdc++ isn't necessarily a config one
+would want to deploy, but it simplifies the config for testing purposes.)
.. _`libc++abi`: http://libcxxabi.llvm.org/
Extra suffix to append to the directory where libraries are to be installed.
This option overrides `LLVM_LIBDIR_SUFFIX`.
-.. option:: LIBCXX_INSTALL_PREFIX:STRING
-
- **Default**: ``""``
-
- Define libc++ destination prefix.
-
.. option:: LIBCXX_HERMETIC_STATIC_LIBRARY:BOOL
**Default**: ``OFF``
.. option:: LIBCXX_ENABLE_FILESYSTEM:BOOL
- **Default**: ``ON`` except on Windows.
+ **Default**: ``ON`` except on Windows when using MSVC.
This option can be used to enable or disable the filesystem components on
- platforms that may not support them. For example on Windows.
+ platforms that may not support them. For example on Windows when using MSVC.
+
+.. option:: LIBCXX_ENABLE_INCOMPLETE_FEATURES:BOOL
+
+ **Default**: ``ON``
+
+ Whether to enable support for incomplete library features. Incomplete features
+ are new library features under development. These features don't guarantee
+ ABI stability nor the quality of completed library features. Vendors
+ shipping the library may want to disable this option.
+
+.. option:: LIBCXX_INSTALL_LIBRARY_DIR:PATH
+
+ **Default**: ``lib${LIBCXX_LIBDIR_SUFFIX}``
+
+ Path where built libc++ libraries should be installed. If a relative path,
+ relative to ``CMAKE_INSTALL_PREFIX``.
+
+.. option:: LIBCXX_INSTALL_INCLUDE_DIR:PATH
+
+ **Default**: ``include/c++/v1``
+
+ Path where target-agnostic libc++ headers should be installed. If a relative
+ path, relative to ``CMAKE_INSTALL_PREFIX``.
+
+.. option:: LIBCXX_INSTALL_INCLUDE_TARGET_DIR:PATH
+
+ **Default**: ``include/c++/v1`` or
+ ``include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1``
+
+ Path where target-specific libc++ headers should be installed. If a relative
+ path, relative to ``CMAKE_INSTALL_PREFIX``.
.. _libc++experimental options:
.. option:: LIBCXX_INCLUDE_TESTS:BOOL
- **Default**: ``ON`` (or value of ``LLVM_INCLUDE_DIR``)
+ **Default**: ``ON`` (or value of ``LLVM_INCLUDE_TESTS``)
Build the libc++ tests.
See ``include/__config`` for the list of ABI macros.
-.. option:: LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION
-
- **Default**: ``None``, which lets the library figure out which implementation
- to use based on the object format.
-
- This setting defines what implementation to use for comparing typeinfo objects.
- There are two main implementations, which differ on whether we make the assumption
- that type info names for a type have been fully merged are unique across the entire
- program. This may not be the case for libraries built with ``-Bsymbolic`` or due to
- compiler or linker bugs (Ex. llvm.org/PR37398).
-
-
- When the value is set to ``1``, we assume that typeinfos are unique across the
- whole program, and typeinfo comparisons compare only the pointer value.
-
- When the value is set to ``2``, we do not assume that typeinfos are unique across
- the whole program. We first compare the pointers, and then use ``strcmp`` on the
- typeinfo names as a fallback.
-
-
.. _LLVM-specific variables:
LLVM-specific options
Using Alternate ABI libraries
=============================
+In order to implement various features like exceptions, RTTI, ``dynamic_cast`` and
+more, libc++ requires what we refer to as an ABI library. Typically, that library
+implements the `Itanium C++ ABI <https://itanium-cxx-abi.github.io/cxx-abi/abi.html>`_.
-.. _libsupcxx:
+By default, libc++ uses libc++abi as an ABI library. However, it is possible to use
+other ABI libraries too.
Using libsupc++ on Linux
------------------------
End of search list.
Note that the first two entries happen to be what we are looking for. This
-may not be correct on other platforms.
+may not be correct on all platforms.
We can now run CMake:
.. code-block:: bash
- $ CC=clang CXX=clang++ cmake -G "Unix Makefiles" \
- -DLIBCXX_CXX_ABI=libstdc++ \
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/" \
- -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
- <libc++-source-dir>
+ $ cmake -G Ninja -S llvm -B build \
+ -DLLVM_ENABLE_PROJECTS="libcxx" \
+ -DLIBCXX_CXX_ABI=libstdc++ \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/"
+ $ ninja -C build install-cxx
You can also substitute ``-DLIBCXX_CXX_ABI=libsupc++``
program also needs to link against libstdc++, it will provide its
own copy of libsupc++ and this can lead to subtle problems.
-.. code-block:: bash
-
- $ make cxx
- $ make install
-
-You can now run clang with -stdlib=libc++.
-
-
-.. _libcxxrt_ref:
-
Using libcxxrt on Linux
------------------------
.. code-block:: bash
- $ CC=clang CXX=clang++ cmake -G "Unix Makefiles" \
- -DLIBCXX_CXX_ABI=libcxxrt \
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxrt-sources/src \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=/usr \
- <libc++-source-directory>
- $ make cxx
- $ make install
+ $ cmake -G Ninja -S llvm -B build \
+ -DLLVM_ENABLE_PROJECTS="libcxx" \
+ -DLIBCXX_CXX_ABI=libcxxrt \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxrt-sources/src
+ $ ninja -C build install-cxx
Unfortunately you can't simply run clang with "-stdlib=libc++" at this point, as
clang is set up to link for libc++ linked to libsupc++. To get around this
$ clang++ -stdlib=libc++ helloworld.cpp -lcxxrt
-.. _`libcxxrt`: https://github.com/pathscale/libcxxrt/
-
-
-Using a local ABI library installation
----------------------------------------
-
-.. warning::
- This is not recommended in almost all cases.
-
-These instructions should only be used when you can't install your ABI library.
-
-Normally you must link libc++ against a ABI shared library that the
-linker can find. If you want to build and test libc++ against an ABI
-library not in the linker's path you need to set
-``-DLIBCXX_CXX_ABI_LIBRARY_PATH=/path/to/abi/lib`` when configuring CMake.
-
-An example build using libc++abi would look like:
-
-.. code-block:: bash
-
- $ CC=clang CXX=clang++ cmake \
- -DLIBCXX_CXX_ABI=libc++abi \
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/path/to/libcxxabi/include" \
- -DLIBCXX_CXX_ABI_LIBRARY_PATH="/path/to/libcxxabi-build/lib" \
- path/to/libcxx
- $ make
-
-When testing libc++ LIT will automatically link against the proper ABI
-library.
+.. _`libcxxrt`: https://github.com/libcxxrt/libcxxrt
--- /dev/null
+.. _ContributingToLibcxx:
+
+======================
+Contributing to libc++
+======================
+
+This file contains notes about various tasks and processes specific to contributing
+to libc++. If this is your first time contributing, please also read `this document
+<https://www.llvm.org/docs/Contributing.html>`__ on general rules for contributing to LLVM.
+
+For libc++, please make sure you follow `these instructions <https://www.llvm.org/docs/Phabricator.html#requesting-a-review-via-the-command-line>`_
+for submitting a code review from the command-line using ``arc``, since we have some
+automation (e.g. CI) that depends on the review being submitted that way.
+
+Looking for pre-existing reviews
+================================
+
+Before you start working on any feature, please take a look at the open reviews
+to avoid duplicating someone else's work. You can do that by going to the website
+where code reviews are held, `Differential <https://reviews.llvm.org/differential>`__,
+and clicking on ``Libc++ Open Reviews`` in the sidebar to the left. If you see
+that your feature is already being worked on, please consider chiming in instead
+of duplicating work!
+
+Pre-commit check list
+=====================
+
+Before committing or creating a review, please go through this check-list to make
+sure you don't forget anything:
+
+- Do you have tests for every public class and/or function you're adding or modifying?
+- Did you update the synopsis of the relevant headers?
+- Did you update the relevant files to track implementation status (in ``docs/Status/``)?
+- Did you mark all functions and type declarations with the :ref:`proper visibility macro <visibility-macros>`?
+- If you added a header:
+
+ - Did you add it to ``include/module.modulemap``?
+ - Did you add it to ``include/CMakeLists.txt``?
+ - If it's a public header, did you add a test under ``test/libcxx`` that the new header defines ``_LIBCPP_VERSION``? See ``test/libcxx/algorithms/version.pass.cpp`` for an example. NOTE: This should be automated.
+ - If it's a public header, did you update ``utils/generate_header_inclusion_tests.py``?
+
+- Did you add the relevant feature test macro(s) for your feature? Did you update the ``generate_feature_test_macro_components.py`` script with it?
+- Did you run the ``libcxx-generate-files`` target and verify its output?
+
+Post-release check list
+=======================
+
+After branching for an LLVM release:
+
+1. Update ``_LIBCPP_VERSION`` in ``include/__config``
+2. Update the ``include/__libcpp_version`` file
+3. Update the version number in ``docs/conf.py``
+
+Exporting new symbols from the library
+======================================
+
+When exporting new symbols from libc++, you must update the ABI lists located in ``lib/abi``.
+To test whether the lists are up-to-date, please run the target ``check-cxx-abilist``.
+To regenerate the lists, use the target ``generate-cxx-abilist``.
+The ABI lists must be updated for all supported platforms; currently Linux and
+Apple. If you don't have access to one of these platforms, you can download an
+updated list from the failed build at
+`Buildkite <https://buildkite.com/llvm-project/libcxx-ci>`__.
+Look for the failed build and select the ``artifacts`` tab. There, download the
+abilist for the platform, e.g.:
+
+* C++20 for the Linux platform.
+* MacOS C++20 for the Apple platform.
Libc++ ABI stability
====================
-Libc++ aims to preserve stable ABI to avoid subtle bugs when code built to the old ABI
-is linked with the code build to the new ABI. At the same time, libc++ allows ABI-breaking
-improvements and bugfixes for the scenarios when ABI change is not a issue.
+Libc++ aims to preserve a stable ABI to avoid subtle bugs when code built under the old ABI
+is linked with code built under the new ABI. At the same time, libc++ wants to make
+ABI-breaking improvements and bugfixes in scenarios where the user doesn't mind ABI breaks.
-To support both cases, libc++ allows specifying the ABI version at the
-build time. The version is defined with a cmake option
-LIBCXX_ABI_VERSION. Another option LIBCXX_ABI_UNSTABLE can be used to
-include all present ABI breaking features. These options translate
-into C++ macro definitions _LIBCPP_ABI_VERSION, _LIBCPP_ABI_UNSTABLE.
+To support both cases, libc++ allows specifying an ABI version at
+build time. The version is defined with CMake option ``LIBCXX_ABI_VERSION``.
+Currently supported values are ``1`` (the stable default)
+and ``2`` (the unstable "next" version). At some point "ABI version 2" will be
+frozen and new ABI-breaking changes will start being applied to version ``3``;
+but this has not happened yet.
-Any ABI-changing feature is placed under it's own macro, _LIBCPP_ABI_XXX, which is enabled
-based on the value of _LIBCPP_ABI_VERSION. _LIBCPP_ABI_UNSTABLE, if set, enables all features at once.
+To always use the most cutting-edge, most unstable ABI (which is currently ``2``
+but at some point will become ``3``), set the CMake option ``LIBCXX_ABI_UNSTABLE``.
+
+Internally, each ABI-changing feature is placed under its own C++ macro,
+``_LIBCPP_ABI_XXX``. These macros' definitions are controlled by the C++ macro
+``_LIBCPP_ABI_VERSION``, which is controlled by the ``LIBCXX_ABI_VERSION`` set
+at build time. Libc++ does not intend users to interact with these C++ macros
+directly.
--- /dev/null
+
+====================
+``<atomic>`` Design
+====================
+
+There were originally 3 designs under consideration. They differ in where most
+of the implementation work is done. The functionality exposed to the customer
+should be identical (and conforming) for all three designs.
+
+
+Design A: Minimal work for the library
+======================================
+The compiler supplies all of the intrinsics as described below. This list of
+intrinsics roughly parallels the requirements of the C and C++ atomics proposals.
+The C and C++ library implementations simply drop through to these intrinsics.
+Anything the platform does not support in hardware, the compiler
+arranges for a (compiler-rt) library call to be made which will do the job with
+a mutex, and in this case ignoring the memory ordering parameter (effectively
+implementing ``memory_order_seq_cst``).
+
+Ultimate efficiency is preferred over run time error checking. Undefined
+behavior is acceptable when the inputs do not conform as defined below.
+
+.. code-block:: cpp
+
+ // In every intrinsic signature below, type* atomic_obj may be a pointer to a
+ // volatile-qualified type. Memory ordering values map to the following meanings:
+ // memory_order_relaxed == 0
+ // memory_order_consume == 1
+ // memory_order_acquire == 2
+ // memory_order_release == 3
+ // memory_order_acq_rel == 4
+ // memory_order_seq_cst == 5
+
+ // type must be trivially copyable
+ // type represents a "type argument"
+ bool __atomic_is_lock_free(type);
+
+ // type must be trivially copyable
+ // Behavior is defined for mem_ord = 0, 1, 2, 5
+ type __atomic_load(const type* atomic_obj, int mem_ord);
+
+ // type must be trivially copyable
+ // Behavior is defined for mem_ord = 0, 3, 5
+ void __atomic_store(type* atomic_obj, type desired, int mem_ord);
+
+ // type must be trivially copyable
+ // Behavior is defined for mem_ord = [0 ... 5]
+ type __atomic_exchange(type* atomic_obj, type desired, int mem_ord);
+
+ // type must be trivially copyable
+ // Behavior is defined for mem_success = [0 ... 5],
+ // mem_failure <= mem_success
+ // mem_failure != 3
+ // mem_failure != 4
+ bool __atomic_compare_exchange_strong(type* atomic_obj,
+ type* expected, type desired,
+ int mem_success, int mem_failure);
+
+ // type must be trivially copyable
+ // Behavior is defined for mem_success = [0 ... 5],
+ // mem_failure <= mem_success
+ // mem_failure != 3
+ // mem_failure != 4
+ bool __atomic_compare_exchange_weak(type* atomic_obj,
+ type* expected, type desired,
+ int mem_success, int mem_failure);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ // Behavior is defined for mem_ord = [0 ... 5]
+ type __atomic_fetch_add(type* atomic_obj, type operand, int mem_ord);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ // Behavior is defined for mem_ord = [0 ... 5]
+ type __atomic_fetch_sub(type* atomic_obj, type operand, int mem_ord);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ // Behavior is defined for mem_ord = [0 ... 5]
+ type __atomic_fetch_and(type* atomic_obj, type operand, int mem_ord);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ // Behavior is defined for mem_ord = [0 ... 5]
+ type __atomic_fetch_or(type* atomic_obj, type operand, int mem_ord);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ // Behavior is defined for mem_ord = [0 ... 5]
+ type __atomic_fetch_xor(type* atomic_obj, type operand, int mem_ord);
+
+ // Behavior is defined for mem_ord = [0 ... 5]
+ void* __atomic_fetch_add(void** atomic_obj, ptrdiff_t operand, int mem_ord);
+ void* __atomic_fetch_sub(void** atomic_obj, ptrdiff_t operand, int mem_ord);
+
+ // Behavior is defined for mem_ord = [0 ... 5]
+ void __atomic_thread_fence(int mem_ord);
+ void __atomic_signal_fence(int mem_ord);
+
+If desired the intrinsics taking a single ``mem_ord`` parameter can default
+this argument to 5.
+
+If desired the intrinsics taking two ordering parameters can default ``mem_success``
+to 5, and ``mem_failure`` to ``translate_memory_order(mem_success)`` where
+``translate_memory_order(mem_success)`` is defined as:
+
+.. code-block:: cpp
+
+ int translate_memory_order(int o) {
+ switch (o) {
+ case 4:
+ return 2;
+ case 3:
+ return 0;
+ }
+ return o;
+ }
+
+Below are representative C++ implementations of all of the operations. Their
+purpose is to document the desired semantics of each operation, assuming
+``memory_order_seq_cst``. This is essentially the code that will be called
+if the front end calls out to compiler-rt.
+
+.. code-block:: cpp
+
+ template <class T>
+ T __atomic_load(T const volatile* obj) {
+ unique_lock<mutex> _(some_mutex);
+ return *obj;
+ }
+
+ template <class T>
+ void __atomic_store(T volatile* obj, T desr) {
+ unique_lock<mutex> _(some_mutex);
+ *obj = desr;
+ }
+
+ template <class T>
+ T __atomic_exchange(T volatile* obj, T desr) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj = desr;
+ return r;
+ }
+
+ template <class T>
+ bool __atomic_compare_exchange_strong(T volatile* obj, T* exp, T desr) {
+ unique_lock<mutex> _(some_mutex);
+ if (std::memcmp(const_cast<T*>(obj), exp, sizeof(T)) == 0) // if (*obj == *exp)
+ {
+ std::memcpy(const_cast<T*>(obj), &desr, sizeof(T)); // *obj = desr;
+ return true;
+ }
+ std::memcpy(exp, const_cast<T*>(obj), sizeof(T)); // *exp = *obj;
+ return false;
+ }
+
+ // May spuriously return false (even if *obj == *exp)
+ template <class T>
+ bool __atomic_compare_exchange_weak(T volatile* obj, T* exp, T desr) {
+ unique_lock<mutex> _(some_mutex);
+ if (std::memcmp(const_cast<T*>(obj), exp, sizeof(T)) == 0) // if (*obj == *exp)
+ {
+ std::memcpy(const_cast<T*>(obj), &desr, sizeof(T)); // *obj = desr;
+ return true;
+ }
+ std::memcpy(exp, const_cast<T*>(obj), sizeof(T)); // *exp = *obj;
+ return false;
+ }
+
+ template <class T>
+ T __atomic_fetch_add(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj += operand;
+ return r;
+ }
+
+ template <class T>
+ T __atomic_fetch_sub(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj -= operand;
+ return r;
+ }
+
+ template <class T>
+ T __atomic_fetch_and(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj &= operand;
+ return r;
+ }
+
+ template <class T>
+ T __atomic_fetch_or(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj |= operand;
+ return r;
+ }
+
+ template <class T>
+ T __atomic_fetch_xor(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj ^= operand;
+ return r;
+ }
+
+ void* __atomic_fetch_add(void* volatile* obj, ptrdiff_t operand) {
+ unique_lock<mutex> _(some_mutex);
+ void* r = *obj;
+ (char*&)(*obj) += operand;
+ return r;
+ }
+
+ void* __atomic_fetch_sub(void* volatile* obj, ptrdiff_t operand) {
+ unique_lock<mutex> _(some_mutex);
+ void* r = *obj;
+ (char*&)(*obj) -= operand;
+ return r;
+ }
+
+ void __atomic_thread_fence() {
+ unique_lock<mutex> _(some_mutex);
+ }
+
+ void __atomic_signal_fence() {
+ unique_lock<mutex> _(some_mutex);
+ }
+
+
+Design B: Something in between
+==============================
+This is a variation of design A which puts the burden on the library to arrange
+for the correct manipulation of the run time memory ordering arguments, and only
+calls the compiler for well-defined memory orderings. I think of this design as
+the worst of A and C, instead of the best of A and C. But I offer it as an
+option in the spirit of completeness.
+
+.. code-block:: cpp
+
+ // type must be trivially copyable
+ bool __atomic_is_lock_free(const type* atomic_obj);
+
+ // type must be trivially copyable
+ type __atomic_load_relaxed(const volatile type* atomic_obj);
+ type __atomic_load_consume(const volatile type* atomic_obj);
+ type __atomic_load_acquire(const volatile type* atomic_obj);
+ type __atomic_load_seq_cst(const volatile type* atomic_obj);
+
+ // type must be trivially copyable
+ type __atomic_store_relaxed(volatile type* atomic_obj, type desired);
+ type __atomic_store_release(volatile type* atomic_obj, type desired);
+ type __atomic_store_seq_cst(volatile type* atomic_obj, type desired);
+
+ // type must be trivially copyable
+ type __atomic_exchange_relaxed(volatile type* atomic_obj, type desired);
+ type __atomic_exchange_consume(volatile type* atomic_obj, type desired);
+ type __atomic_exchange_acquire(volatile type* atomic_obj, type desired);
+ type __atomic_exchange_release(volatile type* atomic_obj, type desired);
+ type __atomic_exchange_acq_rel(volatile type* atomic_obj, type desired);
+ type __atomic_exchange_seq_cst(volatile type* atomic_obj, type desired);
+
+ // type must be trivially copyable
+ bool __atomic_compare_exchange_strong_relaxed_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_consume_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_consume_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_acquire_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_acquire_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_acquire_acquire(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_release_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_release_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_release_acquire(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_acq_rel_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_acq_rel_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_acq_rel_acquire(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_seq_cst_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_seq_cst_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_seq_cst_acquire(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_strong_seq_cst_seq_cst(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+
+ // type must be trivially copyable
+ bool __atomic_compare_exchange_weak_relaxed_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_consume_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_consume_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_acquire_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_acquire_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_acquire_acquire(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_release_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_release_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_release_acquire(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_acq_rel_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_acq_rel_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_acq_rel_acquire(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_seq_cst_relaxed(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_seq_cst_consume(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_seq_cst_acquire(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+ bool __atomic_compare_exchange_weak_seq_cst_seq_cst(volatile type* atomic_obj,
+ type* expected,
+ type desired);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ type __atomic_fetch_add_relaxed(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_add_consume(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_add_acquire(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_add_release(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_add_acq_rel(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_add_seq_cst(volatile type* atomic_obj, type operand);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ type __atomic_fetch_sub_relaxed(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_sub_consume(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_sub_acquire(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_sub_release(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_sub_acq_rel(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_sub_seq_cst(volatile type* atomic_obj, type operand);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ type __atomic_fetch_and_relaxed(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_and_consume(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_and_acquire(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_and_release(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_and_acq_rel(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_and_seq_cst(volatile type* atomic_obj, type operand);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ type __atomic_fetch_or_relaxed(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_or_consume(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_or_acquire(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_or_release(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_or_acq_rel(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_or_seq_cst(volatile type* atomic_obj, type operand);
+
+ // type is one of: char, signed char, unsigned char, short, unsigned short, int,
+ // unsigned int, long, unsigned long, long long, unsigned long long,
+ // char16_t, char32_t, wchar_t
+ type __atomic_fetch_xor_relaxed(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_xor_consume(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_xor_acquire(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_xor_release(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_xor_acq_rel(volatile type* atomic_obj, type operand);
+ type __atomic_fetch_xor_seq_cst(volatile type* atomic_obj, type operand);
+
+ void* __atomic_fetch_add_relaxed(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_add_consume(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_add_acquire(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_add_release(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_add_acq_rel(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_add_seq_cst(void* volatile* atomic_obj, ptrdiff_t operand);
+
+ void* __atomic_fetch_sub_relaxed(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_sub_consume(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_sub_acquire(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_sub_release(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_sub_acq_rel(void* volatile* atomic_obj, ptrdiff_t operand);
+ void* __atomic_fetch_sub_seq_cst(void* volatile* atomic_obj, ptrdiff_t operand);
+
+ void __atomic_thread_fence_relaxed();
+ void __atomic_thread_fence_consume();
+ void __atomic_thread_fence_acquire();
+ void __atomic_thread_fence_release();
+ void __atomic_thread_fence_acq_rel();
+ void __atomic_thread_fence_seq_cst();
+
+ void __atomic_signal_fence_relaxed();
+ void __atomic_signal_fence_consume();
+ void __atomic_signal_fence_acquire();
+ void __atomic_signal_fence_release();
+ void __atomic_signal_fence_acq_rel();
+ void __atomic_signal_fence_seq_cst();
+
+Design C: Minimal work for the front end
+========================================
+The ``<atomic>`` header is one of the most closely coupled headers to the compiler.
+Ideally when you invoke any function from ``<atomic>``, it should result in highly
+optimized assembly being inserted directly into your application -- assembly that
+is not otherwise representable by higher level C or C++ expressions. The design of
+the libc++ ``<atomic>`` header started with this goal in mind. A secondary, but
+still very important goal is that the compiler should have to do minimal work to
+facilitate the implementation of ``<atomic>``. Without this second goal, then
+practically speaking, the libc++ ``<atomic>`` header would be doomed to be a
+barely supported, second class citizen on almost every platform.
+
+Goals:
+
+- Optimal code generation for atomic operations
+- Minimal effort for the compiler to achieve goal 1 on any given platform
+- Conformance to the C++0X draft standard
+
+The purpose of this document is to inform compiler writers what they need to do
+to enable a high performance libc++ ``<atomic>`` with minimal effort.
+
+The minimal work that must be done for a conforming ``<atomic>``
+----------------------------------------------------------------
+The only "atomic" operations that must actually be lock free in
+``<atomic>`` are represented by the following compiler intrinsics:
+
+.. code-block:: cpp
+
+ __atomic_flag__ __atomic_exchange_seq_cst(__atomic_flag__ volatile* obj, __atomic_flag__ desr) {
+ unique_lock<mutex> _(some_mutex);
+ __atomic_flag__ result = *obj;
+ *obj = desr;
+ return result;
+ }
+
+ void __atomic_store_seq_cst(__atomic_flag__ volatile* obj, __atomic_flag__ desr) {
+ unique_lock<mutex> _(some_mutex);
+ *obj = desr;
+ }
+
+Where:
+
+- If ``__has_feature(__atomic_flag)`` evaluates to 1 in the preprocessor then
+ the compiler must define ``__atomic_flag__`` (e.g. as a typedef to ``int``).
+- If ``__has_feature(__atomic_flag)`` evaluates to 0 in the preprocessor then
+ the library defines ``__atomic_flag__`` as a typedef to ``bool``.
+- To communicate that the above intrinsics are available, the compiler must
+ arrange for ``__has_feature`` to return 1 when fed the intrinsic name
+ appended with an '_' and the mangled type name of ``__atomic_flag__``.
+
+For example if ``__atomic_flag__`` is ``unsigned int``:
+
+.. code-block:: cpp
+
+ // __has_feature(__atomic_flag) == 1
+ // __has_feature(__atomic_exchange_seq_cst_j) == 1
+ // __has_feature(__atomic_store_seq_cst_j) == 1
+
+ typedef unsigned int __atomic_flag__;
+
+ unsigned int __atomic_exchange_seq_cst(unsigned int volatile*, unsigned int) {
+ // ...
+ }
+
+ void __atomic_store_seq_cst(unsigned int volatile*, unsigned int) {
+ // ...
+ }
+
+That's it! Compiler writers do the above and you've got a fully conforming
+(though sub-par performance) ``<atomic>`` header!
+
+
+Recommended work for a higher performance ``<atomic>``
+------------------------------------------------------
+It would be good if the above intrinsics worked with all integral types plus
+``void*``. Because this may not be possible to do in a lock-free manner for
+all integral types on all platforms, a compiler must communicate each type that
+an intrinsic works with. For example, if ``__atomic_exchange_seq_cst`` works
+for all types except for ``long long`` and ``unsigned long long`` then:
+
+.. code-block:: cpp
+
+ __has_feature(__atomic_exchange_seq_cst_b) == 1 // bool
+ __has_feature(__atomic_exchange_seq_cst_c) == 1 // char
+ __has_feature(__atomic_exchange_seq_cst_a) == 1 // signed char
+ __has_feature(__atomic_exchange_seq_cst_h) == 1 // unsigned char
+ __has_feature(__atomic_exchange_seq_cst_Ds) == 1 // char16_t
+ __has_feature(__atomic_exchange_seq_cst_Di) == 1 // char32_t
+ __has_feature(__atomic_exchange_seq_cst_w) == 1 // wchar_t
+ __has_feature(__atomic_exchange_seq_cst_s) == 1 // short
+ __has_feature(__atomic_exchange_seq_cst_t) == 1 // unsigned short
+ __has_feature(__atomic_exchange_seq_cst_i) == 1 // int
+ __has_feature(__atomic_exchange_seq_cst_j) == 1 // unsigned int
+ __has_feature(__atomic_exchange_seq_cst_l) == 1 // long
+ __has_feature(__atomic_exchange_seq_cst_m) == 1 // unsigned long
+ __has_feature(__atomic_exchange_seq_cst_Pv) == 1 // void*
+
+Note that only the ``__has_feature`` flag is decorated with the argument
+type. The name of the compiler intrinsic is not decorated, but instead works
+like a C++ overloaded function.
+
+Additionally, there are other intrinsics besides ``__atomic_exchange_seq_cst``
+and ``__atomic_store_seq_cst``. They are optional. But if the compiler can
+generate faster code than provided by the library, then clients will benefit
+from the compiler writer's expertise and knowledge of the targeted platform.
+
+Below is the complete list of *sequentially consistent* intrinsics, and
+their library implementations. Template syntax is used to indicate the desired
+overloading for integral and ``void*`` types. The template does not represent a
+requirement that the intrinsic operate on **any** type!
+
+.. code-block:: cpp
+
+ // T is one of:
+ // bool, char, signed char, unsigned char, short, unsigned short,
+ // int, unsigned int, long, unsigned long,
+ // long long, unsigned long long, char16_t, char32_t, wchar_t, void*
+
+ template <class T>
+ T __atomic_load_seq_cst(T const volatile* obj) {
+ unique_lock<mutex> _(some_mutex);
+ return *obj;
+ }
+
+ template <class T>
+ void __atomic_store_seq_cst(T volatile* obj, T desr) {
+ unique_lock<mutex> _(some_mutex);
+ *obj = desr;
+ }
+
+ template <class T>
+ T __atomic_exchange_seq_cst(T volatile* obj, T desr) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj = desr;
+ return r;
+ }
+
+ template <class T>
+ bool __atomic_compare_exchange_strong_seq_cst_seq_cst(T volatile* obj, T* exp, T desr) {
+ unique_lock<mutex> _(some_mutex);
+ if (std::memcmp(const_cast<T*>(obj), exp, sizeof(T)) == 0) {
+ std::memcpy(const_cast<T*>(obj), &desr, sizeof(T));
+ return true;
+ }
+ std::memcpy(exp, const_cast<T*>(obj), sizeof(T));
+ return false;
+ }
+
+ template <class T>
+ bool __atomic_compare_exchange_weak_seq_cst_seq_cst(T volatile* obj, T* exp, T desr) {
+ unique_lock<mutex> _(some_mutex);
+ if (std::memcmp(const_cast<T*>(obj), exp, sizeof(T)) == 0)
+ {
+ std::memcpy(const_cast<T*>(obj), &desr, sizeof(T));
+ return true;
+ }
+ std::memcpy(exp, const_cast<T*>(obj), sizeof(T));
+ return false;
+ }
+
+ // T is one of:
+ // char, signed char, unsigned char, short, unsigned short,
+ // int, unsigned int, long, unsigned long,
+ // long long, unsigned long long, char16_t, char32_t, wchar_t
+
+ template <class T>
+ T __atomic_fetch_add_seq_cst(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj += operand;
+ return r;
+ }
+
+ template <class T>
+ T __atomic_fetch_sub_seq_cst(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj -= operand;
+ return r;
+ }
+
+ template <class T>
+ T __atomic_fetch_and_seq_cst(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj &= operand;
+ return r;
+ }
+
+ template <class T>
+ T __atomic_fetch_or_seq_cst(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj |= operand;
+ return r;
+ }
+
+ template <class T>
+ T __atomic_fetch_xor_seq_cst(T volatile* obj, T operand) {
+ unique_lock<mutex> _(some_mutex);
+ T r = *obj;
+ *obj ^= operand;
+ return r;
+ }
+
+ void* __atomic_fetch_add_seq_cst(void* volatile* obj, ptrdiff_t operand) {
+ unique_lock<mutex> _(some_mutex);
+ void* r = *obj;
+ (char*&)(*obj) += operand;
+ return r;
+ }
+
+ void* __atomic_fetch_sub_seq_cst(void* volatile* obj, ptrdiff_t operand) {
+ unique_lock<mutex> _(some_mutex);
+ void* r = *obj;
+ (char*&)(*obj) -= operand;
+ return r;
+ }
+
+ void __atomic_thread_fence_seq_cst() {
+ unique_lock<mutex> _(some_mutex);
+ }
+
+ void __atomic_signal_fence_seq_cst() {
+ unique_lock<mutex> _(some_mutex);
+ }
+
+One should consult the (currently draft) `C++ Standard <https://wg21.link/n3126>`_
+for the details of the definitions for these operations. For example,
+``__atomic_compare_exchange_weak_seq_cst_seq_cst`` is allowed to fail
+spuriously while ``__atomic_compare_exchange_strong_seq_cst_seq_cst`` is not.
+
+If on your platform the lock-free definition of ``__atomic_compare_exchange_weak_seq_cst_seq_cst``
+would be the same as ``__atomic_compare_exchange_strong_seq_cst_seq_cst``, you may omit the
+``__atomic_compare_exchange_weak_seq_cst_seq_cst`` intrinsic without a performance cost. The
+library will prefer your implementation of ``__atomic_compare_exchange_strong_seq_cst_seq_cst``
+over its own definition for implementing ``__atomic_compare_exchange_weak_seq_cst_seq_cst``.
+That is, the library will arrange for ``__atomic_compare_exchange_weak_seq_cst_seq_cst`` to call
+``__atomic_compare_exchange_strong_seq_cst_seq_cst`` if you supply an intrinsic for the strong
+version but not the weak.
+
+Taking advantage of weaker memory synchronization
+-------------------------------------------------
+So far, all of the intrinsics presented require a **sequentially consistent** memory ordering.
+That is, no loads or stores can move across the operation (just as if the library had locked
+that internal mutex). But ``<atomic>`` supports weaker memory ordering operations. In all,
+there are six memory orderings (listed here from strongest to weakest):
+
+.. code-block:: cpp
+
+ memory_order_seq_cst
+ memory_order_acq_rel
+ memory_order_release
+ memory_order_acquire
+ memory_order_consume
+ memory_order_relaxed
+
+(See the `C++ Standard <https://wg21.link/n3126>`_ for the detailed definitions of each of these orderings).
+
+On some platforms, the compiler vendor can offer some or even all of the above
+intrinsics at one or more weaker levels of memory synchronization. This might
+lead for example to not issuing an ``mfence`` instruction on the x86.
+
+If the compiler does not offer any given operation, at any given memory ordering
+level, the library will automatically attempt to call the next highest memory
+ordering operation. This continues up to ``seq_cst``, and if that doesn't
+exist, then the library takes over and does the job with a ``mutex``. This
+is a compile-time search and selection operation. At run time, the application
+will only see the few inlined assembly instructions for the selected intrinsic.
+
+Each intrinsic is appended with the 7-letter name of the memory ordering it
+addresses. For example a ``load`` with ``relaxed`` ordering is defined by:
+
+.. code-block:: cpp
+
+ T __atomic_load_relaxed(const volatile T* obj);
+
+And announced with:
+
+.. code-block:: cpp
+
+ __has_feature(__atomic_load_relaxed_b) == 1 // bool
+ __has_feature(__atomic_load_relaxed_c) == 1 // char
+ __has_feature(__atomic_load_relaxed_a) == 1 // signed char
+ ...
+
+The ``__atomic_compare_exchange_strong(weak)`` intrinsics are parameterized
+on two memory orderings. The first ordering applies when the operation returns
+``true`` and the second ordering applies when the operation returns ``false``.
+
+Not every memory ordering is appropriate for every operation. ``exchange``
+and the ``fetch_XXX`` operations support all 6. But ``load`` only supports
+``relaxed``, ``consume``, ``acquire`` and ``seq_cst``. ``store`` only supports
+``relaxed``, ``release``, and ``seq_cst``. The ``compare_exchange`` operations
+support the following 16 combinations out of the possible 36:
+
+.. code-block:: cpp
+
+ relaxed_relaxed
+ consume_relaxed
+ consume_consume
+ acquire_relaxed
+ acquire_consume
+ acquire_acquire
+ release_relaxed
+ release_consume
+ release_acquire
+ acq_rel_relaxed
+ acq_rel_consume
+ acq_rel_acquire
+ seq_cst_relaxed
+ seq_cst_consume
+ seq_cst_acquire
+ seq_cst_seq_cst
+
+Again, the compiler supplies intrinsics only for the strongest orderings where
+it can make a difference. The library takes care of calling the weakest
+supplied intrinsic that is as strong or stronger than the customer asked for.
+
+Note about ABI
+==============
+With any design, the (back end) compiler writer should note that the decision to
+implement lock-free operations on any given type (or not) is an ABI-binding decision.
+One can not change from treating a type as not lock free, to lock free (or vice-versa)
+without breaking your ABI.
+
+For example:
+
+**TU1.cpp**:
+
+.. code-block:: cpp
+
+ extern atomic<long long> A;
+ int foo() { return A.compare_exchange_strong(w, x); }
+
+
+**TU2.cpp**:
+
+.. code-block:: cpp
+
+ extern atomic<long long> A;
+ void bar() { return A.compare_exchange_strong(y, z); }
+
+If only **one** of these calls to ``compare_exchange_strong`` is implemented with
+mutex-locked code, then that mutex-locked code will not be executed mutually
+exclusively of the one implemented in a lock-free manner.
.. _using-debug-mode:
-Using Debug Mode
-================
+Using the debug mode
+====================
-Libc++ provides a debug mode that enables assertions meant to detect incorrect
-usage of the standard library. By default these assertions are disabled but
+Libc++ provides a debug mode that enables special debugging checks meant to detect
+incorrect usage of the standard library. These checks are disabled by default, but
they can be enabled using the ``_LIBCPP_DEBUG`` macro.
-**_LIBCPP_DEBUG** Macro
------------------------
+Note that using the debug mode discussed in this document requires that the library
+has been compiled with support for the debug mode (see ``LIBCXX_ENABLE_DEBUG_MODE_SUPPORT``).
-**_LIBCPP_DEBUG**:
- This macro is used to enable assertions and iterator debugging checks within
- libc++. By default it is undefined.
+Also note that while the debug mode has no effect on libc++'s ABI, it does have broad ODR
+implications. Users should compile their whole program at the same debugging level.
- **Values**: ``0``, ``1``
+The various levels of checking provided by the debug mode follow.
- Defining ``_LIBCPP_DEBUG`` to ``0`` or greater enables most of libc++'s
- assertions. Defining ``_LIBCPP_DEBUG`` to ``1`` enables "iterator debugging"
- which provides additional assertions about the validity of iterators used by
- the program.
+No debugging checks (``_LIBCPP_DEBUG`` not defined)
+---------------------------------------------------
+When ``_LIBCPP_DEBUG`` is not defined, there are no debugging checks performed by
+the library. This is the default.
- Note that this option has no effect on libc++'s ABI; but it does have broad
- ODR implications. Users should compile their whole program at the same
- debugging level.
+Basic checks (``_LIBCPP_DEBUG == 0``)
+-------------------------------------
+When ``_LIBCPP_DEBUG`` is defined to ``0`` (to be understood as level ``0``), some
+debugging checks are enabled. The non-exhaustive list of things is:
-Handling Assertion Failures
----------------------------
+- Many algorithms, such as ``binary_search``, ``merge``, ``next_permutation``, and ``sort``,
+ wrap the user-provided comparator to assert that `!comp(y, x)` whenever
+ `comp(x, y)`. This can cause the user-provided comparator to be evaluated
+ up to twice as many times as it would be without ``_LIBCPP_DEBUG``, and
+ causes the library to violate some of the Standard's complexity clauses.
+
+- FIXME: Update this list
+
+Iterator debugging checks (``_LIBCPP_DEBUG == 1``)
+--------------------------------------------------
+Defining ``_LIBCPP_DEBUG`` to ``1`` enables "iterator debugging", which provides
+additional assertions about the validity of iterators used by the program.
+The following containers and classes support iterator debugging:
+
+- ``std::string``
+- ``std::vector<T>`` (``T != bool``)
+- ``std::list``
+- ``std::unordered_map``
+- ``std::unordered_multimap``
+- ``std::unordered_set``
+- ``std::unordered_multiset``
+
+The remaining containers do not currently support iterator debugging.
+Patches welcome.
+
+Handling Assertion Failures
+===========================
When a debug assertion fails the assertion handler is called via the
``std::__libcpp_debug_function`` function pointer. It is possible to override
this function pointer using a different handler function. Libc++ provides a
str.insert(bad_it, '!'); // causes debug assertion
// control flow doesn't return
}
-
-Debug Mode Checks
-=================
-
-Libc++'s debug mode offers two levels of checking. The first enables various
-precondition checks throughout libc++. The second additionally enables
-"iterator debugging" which checks the validity of iterators used by the program.
-
-Basic Checks
-============
-
-These checks are enabled when ``_LIBCPP_DEBUG`` is defined to either 0 or 1.
-
-The following checks are enabled by ``_LIBCPP_DEBUG``:
-
- * FIXME: Update this list
-
-Iterator Debugging Checks
-=========================
-
-These checks are enabled when ``_LIBCPP_DEBUG`` is defined to 1.
-
-The following containers and STL classes support iterator debugging:
-
- * ``std::string``
- * ``std::vector<T>`` (``T != bool``)
- * ``std::list``
- * ``std::unordered_map``
- * ``std::unordered_multimap``
- * ``std::unordered_set``
- * ``std::unordered_multiset``
-
-The remaining containers do not currently support iterator debugging.
-Patches welcome.
Overview
========
-Libc++ implements the C++ feature test macros as specified in the C++2a standard,
+Libc++ implements the C++ feature test macros as specified in the C++20 standard,
and before that in non-normative guiding documents
(`See cppreference <https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros>`_)
update feature test macros in libc++.
Whenever a feature test macro is added or changed, the table should be updated
-and the script should be re-ran. The script will clobber the existing test files
-and the documentation and it will generate a new `<version>` header as a
-temporary file. The generated `<version>` header should be merged with the
-existing one.
+and the script should be re-ran. The script will clobber the existing test files,
+the documentation and the `<version>` header.
trivial-clock is an implementation-defined type that satisfies the
Cpp17TrivialClock requirements ([time.clock.req]) and that is capable of
representing and measuring file time values. Implementations should ensure
- that the resolution and range of file_Âtime_Âtype reflect the operating
+ that the resolution and range of file_time_type reflect the operating
system dependent resolution and range of file time values.
--- /dev/null
+====================
+``noexcept`` Policy
+====================
+
+Extended applications of ``noexcept``
+------------------------------------------
+
+As of version 13 libc++ may mark functions that do not throw (i.e.,
+"Throws: Nothing") as ``noexcept``. This has two primary consequences:
+first, functions might not report precondition violations by throwing.
+Second, user-provided functions, such as custom predicates or custom
+traits, which throw might not be propagated up to the caller (unless
+specified otherwise by the Standard).
--- /dev/null
+=============================================
+Enable std::unique_ptr [[clang::trivial_abi]]
+=============================================
+
+Background
+==========
+
+Consider the follow snippets
+
+
+.. code-block:: cpp
+
+ void raw_func(Foo* raw_arg) { ... }
+ void smart_func(std::unique_ptr<Foo> smart_arg) { ... }
+
+ Foo* raw_ptr_retval() { ... }
+ std::unique_ptr<Foo*> smart_ptr_retval() { ... }
+
+
+
+The argument ``raw_arg`` could be passed in a register but ``smart_arg`` could not, due to current
+implementation.
+
+Specifically, in the ``smart_arg`` case, the caller secretly constructs a temporary ``std::unique_ptr``
+in its stack-frame, and then passes a pointer to it to the callee in a hidden parameter.
+Similarly, the return value from ``smart_ptr_retval`` is secretly allocated in the caller and
+passed as a secret reference to the callee.
+
+
+Goal
+===================
+
+``std::unique_ptr`` is passed directly in a register.
+
+Design
+======
+
+* Annotate the two definitions of ``std::unique_ptr`` with ``clang::trivial_abi`` attribute.
+* Put the attribuate behind a flag because this change has potential compilation and runtime breakages.
+
+
+This comes with some side effects:
+
+* ``std::unique_ptr`` parameters will now be destroyed by callees, rather than callers.
+ It is worth noting that destruction by callee is not unique to the use of trivial_abi attribute.
+ In most Microsoft's ABIs, arguments are always destroyed by the callee.
+
+ Consequently, this may change the destruction order for function parameters to an order that is non-conforming to the standard.
+ For example:
+
+
+ .. code-block:: cpp
+
+ struct A { ~A(); };
+ struct B { ~B(); };
+ struct C { C(A, unique_ptr<B>, A) {} };
+ C c{{}, make_unique<B>, {}};
+
+
+ In a conforming implementation, the destruction order for C::C's parameters is required to be ``~A(), ~B(), ~A()`` but with this mode enabled, we'll instead see ``~B(), ~A(), ~A()``.
+
+* Reduced code-size.
+
+
+Performance impact
+------------------
+
+Google has measured performance improvements of up to 1.6% on some large server macrobenchmarks, and a small reduction in binary sizes.
+
+This also affects null pointer optimization
+
+Clang's optimizer can now figure out when a `std::unique_ptr` is known to contain *non*-null.
+(Actually, this has been a *missed* optimization all along.)
+
+
+.. code-block:: cpp
+
+ struct Foo {
+ ~Foo();
+ };
+ std::unique_ptr<Foo> make_foo();
+ void do_nothing(const Foo&)
+
+ void bar() {
+ auto x = make_foo();
+ do_nothing(*x);
+ }
+
+
+With this change, ``~Foo()`` will be called even if ``make_foo`` returns ``unique_ptr<Foo>(nullptr)``.
+The compiler can now assume that ``x.get()`` cannot be null by the end of ``bar()``, because
+the deference of ``x`` would be UB if it were ``nullptr``. (This dereference would not have caused
+a segfault, because no load is generated for dereferencing a pointer to a reference. This can be detected with ``-fsanitize=null``).
+
+
+Potential breakages
+-------------------
+
+The following breakages were discovered by enabling this change and fixing the resulting issues in a large code base.
+
+- Compilation failures
+
+ - Function definitions now require complete type ``T`` for parameters with type ``std::unique_ptr<T>``. The following code will no longer compile.
+
+ .. code-block:: cpp
+
+ class Foo;
+ void func(std::unique_ptr<Foo> arg) { /* never use `arg` directly */ }
+
+ - Fix: Remove forward-declaration of ``Foo`` and include its proper header.
+
+- Runtime Failures
+
+ - Lifetime of ``std::unique_ptr<>`` arguments end earlier (at the end of the callee's body, rather than at the end of the full expression containing the call).
+
+ .. code-block:: cpp
+
+ util::Status run_worker(std::unique_ptr<Foo>);
+ void func() {
+ std::unique_ptr<Foo> smart_foo = ...;
+ Foo* owned_foo = smart_foo.get();
+ // Currently, the following would "work" because the argument to run_worker() is deleted at the end of func()
+ // With the new calling convention, it will be deleted at the end of run_worker(),
+ // making this an access to freed memory.
+ owned_foo->Bar(run_worker(std::move(smart_foo)));
+ ^
+ // <<<Crash expected here
+ }
+
+ - Lifetime of local *returned* ``std::unique_ptr<>`` ends earlier.
+
+ Spot the bug:
+
+ .. code-block:: cpp
+
+ std::unique_ptr<Foo> create_and_subscribe(Bar* subscriber) {
+ auto foo = std::make_unique<Foo>();
+ subscriber->sub([&foo] { foo->do_thing();} );
+ return foo;
+ }
+
+ One could point out this is an obvious stack-use-after return bug.
+ With the current calling convention, running this code with ASAN enabled, however, would not yield any "issue".
+ So is this a bug in ASAN? (Spoiler: No)
+
+ This currently would "work" only because the storage for ``foo`` is in the caller's stackframe.
+ In other words, ``&foo`` in callee and ``&foo`` in the caller are the same address.
+
+ASAN can be used to detect both of these.
.. contents::
:local:
+.. _visibility-macros:
+
Overview
========
Mark a function as not being part of the ABI of any final linked image that
uses it.
+**_LIBCPP_INLINE_VISIBILITY**
+ Historical predecessor of ``_LIBCPP_HIDE_FROM_ABI`` -- please use
+ ``_LIBCPP_HIDE_FROM_ABI`` instead.
+
**_LIBCPP_HIDE_FROM_ABI_AFTER_V1**
Mark a function as being hidden from the ABI (per `_LIBCPP_HIDE_FROM_ABI`)
when libc++ is built with an ABI version after ABI v1. This macro is used to
specified on the primary template and to export the member functions produced
by the explicit instantiation in the dylib.
- **GCC Behavior**: GCC ignores visibility attributes applied the type in
- extern template declarations and applying an attribute results in a warning.
- However since `_LIBCPP_TEMPLATE_VIS` is the same as
- `__attribute__((visibility("default"))` the visibility is already correct.
- The macro has an empty definition with GCC.
-
**Windows Behavior**: `extern template` and `dllexport` are fundamentally
incompatible *on a class template* on Windows; the former suppresses
instantiation, while the latter forces it. Specifying both on the same
:widths: auto
================================================= =================
- Macro Name Value
+ Macro Name Value
================================================= =================
- **C++ 14**
+ **C++ 14**
-------------------------------------------------------------------
- ``__cpp_lib_chrono_udls`` ``201304L``
+ ``__cpp_lib_chrono_udls`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_complex_udls`` ``201309L``
+ ``__cpp_lib_complex_udls`` ``201309L``
------------------------------------------------- -----------------
- ``__cpp_lib_exchange_function`` ``201304L``
+ ``__cpp_lib_exchange_function`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_generic_associative_lookup`` ``201304L``
+ ``__cpp_lib_generic_associative_lookup`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_integer_sequence`` ``201304L``
+ ``__cpp_lib_integer_sequence`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_integral_constant_callable`` ``201304L``
+ ``__cpp_lib_integral_constant_callable`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_is_final`` ``201402L``
+ ``__cpp_lib_is_final`` ``201402L``
------------------------------------------------- -----------------
- ``__cpp_lib_is_null_pointer`` ``201309L``
+ ``__cpp_lib_is_null_pointer`` ``201309L``
------------------------------------------------- -----------------
- ``__cpp_lib_make_reverse_iterator`` ``201402L``
+ ``__cpp_lib_make_reverse_iterator`` ``201402L``
------------------------------------------------- -----------------
- ``__cpp_lib_make_unique`` ``201304L``
+ ``__cpp_lib_make_unique`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_null_iterators`` ``201304L``
+ ``__cpp_lib_null_iterators`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_quoted_string_io`` ``201304L``
+ ``__cpp_lib_quoted_string_io`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_result_of_sfinae`` ``201210L``
+ ``__cpp_lib_result_of_sfinae`` ``201210L``
------------------------------------------------- -----------------
- ``__cpp_lib_robust_nonmodifying_seq_ops`` ``201304L``
+ ``__cpp_lib_robust_nonmodifying_seq_ops`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_shared_timed_mutex`` ``201402L``
+ ``__cpp_lib_shared_timed_mutex`` ``201402L``
------------------------------------------------- -----------------
- ``__cpp_lib_string_udls`` ``201304L``
+ ``__cpp_lib_string_udls`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_transformation_trait_aliases`` ``201304L``
+ ``__cpp_lib_transformation_trait_aliases`` ``201304L``
------------------------------------------------- -----------------
- ``__cpp_lib_transparent_operators`` ``201210L``
+ ``__cpp_lib_transparent_operators`` ``201210L``
------------------------------------------------- -----------------
- ``__cpp_lib_tuple_element_t`` ``201402L``
+ ``__cpp_lib_tuple_element_t`` ``201402L``
------------------------------------------------- -----------------
- ``__cpp_lib_tuples_by_type`` ``201304L``
+ ``__cpp_lib_tuples_by_type`` ``201304L``
------------------------------------------------- -----------------
- **C++ 17**
+ **C++ 17**
-------------------------------------------------------------------
- ``__cpp_lib_addressof_constexpr`` ``201603L``
+ ``__cpp_lib_addressof_constexpr`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_allocator_traits_is_always_equal`` ``201411L``
+ ``__cpp_lib_allocator_traits_is_always_equal`` ``201411L``
------------------------------------------------- -----------------
- ``__cpp_lib_any`` ``201606L``
+ ``__cpp_lib_any`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_apply`` ``201603L``
+ ``__cpp_lib_apply`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_array_constexpr`` ``201603L``
+ ``__cpp_lib_array_constexpr`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_as_const`` ``201510L``
+ ``__cpp_lib_as_const`` ``201510L``
------------------------------------------------- -----------------
- ``__cpp_lib_atomic_is_always_lock_free`` ``201603L``
+ ``__cpp_lib_atomic_is_always_lock_free`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_bool_constant`` ``201505L``
+ ``__cpp_lib_bool_constant`` ``201505L``
------------------------------------------------- -----------------
- ``__cpp_lib_boyer_moore_searcher`` *unimplemented*
+ ``__cpp_lib_boyer_moore_searcher`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_byte`` ``201603L``
+ ``__cpp_lib_byte`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_chrono`` ``201611L``
+ ``__cpp_lib_chrono`` ``201611L``
------------------------------------------------- -----------------
- ``__cpp_lib_clamp`` ``201603L``
+ ``__cpp_lib_clamp`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_enable_shared_from_this`` ``201603L``
+ ``__cpp_lib_enable_shared_from_this`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_execution`` *unimplemented*
+ ``__cpp_lib_execution`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_filesystem`` ``201703L``
+ ``__cpp_lib_filesystem`` ``201703L``
------------------------------------------------- -----------------
- ``__cpp_lib_gcd_lcm`` ``201606L``
+ ``__cpp_lib_gcd_lcm`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_hardware_interference_size`` *unimplemented*
+ ``__cpp_lib_hardware_interference_size`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_has_unique_object_representations`` ``201606L``
+ ``__cpp_lib_has_unique_object_representations`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_hypot`` ``201603L``
+ ``__cpp_lib_hypot`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_incomplete_container_elements`` ``201505L``
+ ``__cpp_lib_incomplete_container_elements`` ``201505L``
------------------------------------------------- -----------------
- ``__cpp_lib_invoke`` ``201411L``
+ ``__cpp_lib_invoke`` ``201411L``
------------------------------------------------- -----------------
- ``__cpp_lib_is_aggregate`` ``201703L``
+ ``__cpp_lib_is_aggregate`` ``201703L``
------------------------------------------------- -----------------
- ``__cpp_lib_is_invocable`` ``201703L``
+ ``__cpp_lib_is_invocable`` ``201703L``
------------------------------------------------- -----------------
- ``__cpp_lib_is_swappable`` ``201603L``
+ ``__cpp_lib_is_swappable`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_launder`` ``201606L``
+ ``__cpp_lib_launder`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_logical_traits`` ``201510L``
+ ``__cpp_lib_logical_traits`` ``201510L``
------------------------------------------------- -----------------
- ``__cpp_lib_make_from_tuple`` ``201606L``
+ ``__cpp_lib_make_from_tuple`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_map_try_emplace`` ``201411L``
+ ``__cpp_lib_map_try_emplace`` ``201411L``
------------------------------------------------- -----------------
- ``__cpp_lib_math_special_functions`` *unimplemented*
+ ``__cpp_lib_math_special_functions`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_memory_resource`` *unimplemented*
+ ``__cpp_lib_memory_resource`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_node_extract`` ``201606L``
+ ``__cpp_lib_node_extract`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_nonmember_container_access`` ``201411L``
+ ``__cpp_lib_nonmember_container_access`` ``201411L``
------------------------------------------------- -----------------
- ``__cpp_lib_not_fn`` ``201603L``
+ ``__cpp_lib_not_fn`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_optional`` ``201606L``
+ ``__cpp_lib_optional`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_parallel_algorithm`` *unimplemented*
+ ``__cpp_lib_parallel_algorithm`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_raw_memory_algorithms`` ``201606L``
+ ``__cpp_lib_raw_memory_algorithms`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_sample`` ``201603L``
+ ``__cpp_lib_sample`` ``201603L``
------------------------------------------------- -----------------
- ``__cpp_lib_scoped_lock`` ``201703L``
+ ``__cpp_lib_scoped_lock`` ``201703L``
------------------------------------------------- -----------------
- ``__cpp_lib_shared_mutex`` ``201505L``
+ ``__cpp_lib_shared_mutex`` ``201505L``
------------------------------------------------- -----------------
- ``__cpp_lib_shared_ptr_arrays`` *unimplemented*
+ ``__cpp_lib_shared_ptr_arrays`` ``201611L``
------------------------------------------------- -----------------
- ``__cpp_lib_shared_ptr_weak_type`` ``201606L``
+ ``__cpp_lib_shared_ptr_weak_type`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_string_view`` ``201606L``
+ ``__cpp_lib_string_view`` ``201606L``
------------------------------------------------- -----------------
- ``__cpp_lib_to_chars`` *unimplemented*
+ ``__cpp_lib_to_chars`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_transparent_operators`` ``201510L``
+ ``__cpp_lib_transparent_operators`` ``201510L``
------------------------------------------------- -----------------
- ``__cpp_lib_type_trait_variable_templates`` ``201510L``
+ ``__cpp_lib_type_trait_variable_templates`` ``201510L``
------------------------------------------------- -----------------
- ``__cpp_lib_uncaught_exceptions`` ``201411L``
+ ``__cpp_lib_uncaught_exceptions`` ``201411L``
------------------------------------------------- -----------------
- ``__cpp_lib_unordered_map_try_emplace`` ``201411L``
+ ``__cpp_lib_unordered_map_try_emplace`` ``201411L``
------------------------------------------------- -----------------
- ``__cpp_lib_variant`` ``201606L``
+ ``__cpp_lib_variant`` ``202102L``
------------------------------------------------- -----------------
- ``__cpp_lib_void_t`` ``201411L``
+ ``__cpp_lib_void_t`` ``201411L``
------------------------------------------------- -----------------
- **C++ 2a**
+ **C++ 20**
-------------------------------------------------------------------
- ``__cpp_lib_array_constexpr`` ``201811L``
+ ``__cpp_lib_array_constexpr`` ``201811L``
------------------------------------------------- -----------------
- ``__cpp_lib_atomic_ref`` *unimplemented*
+ ``__cpp_lib_assume_aligned`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_bind_front`` *unimplemented*
+ ``__cpp_lib_atomic_flag_test`` ``201907L``
------------------------------------------------- -----------------
- ``__cpp_lib_bit_cast`` *unimplemented*
+ ``__cpp_lib_atomic_float`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_char8_t`` ``201811L``
+ ``__cpp_lib_atomic_lock_free_type_aliases`` ``201907L``
------------------------------------------------- -----------------
- ``__cpp_lib_concepts`` *unimplemented*
+ ``__cpp_lib_atomic_ref`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_constexpr_misc`` *unimplemented*
+ ``__cpp_lib_atomic_shared_ptr`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_constexpr_swap_algorithms`` *unimplemented*
+ ``__cpp_lib_atomic_value_initialization`` ``201911L``
------------------------------------------------- -----------------
- ``__cpp_lib_destroying_delete`` ``201806L``
+ ``__cpp_lib_atomic_wait`` ``201907L``
------------------------------------------------- -----------------
- ``__cpp_lib_endian`` ``201907L``
+ ``__cpp_lib_barrier`` ``201907L``
------------------------------------------------- -----------------
- ``__cpp_lib_erase_if`` ``202002L``
+ ``__cpp_lib_bind_front`` ``201907L``
------------------------------------------------- -----------------
- ``__cpp_lib_generic_unordered_lookup`` *unimplemented*
+ ``__cpp_lib_bit_cast`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_interpolate`` ``201902L``
+ ``__cpp_lib_bitops`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_is_constant_evaluated`` ``201811L``
+ ``__cpp_lib_bounded_array_traits`` ``201902L``
------------------------------------------------- -----------------
- ``__cpp_lib_list_remove_return_type`` ``201806L``
+ ``__cpp_lib_char8_t`` ``201811L``
------------------------------------------------- -----------------
- ``__cpp_lib_math_constants`` ``201907L``
+ ``__cpp_lib_concepts`` ``202002L``
------------------------------------------------- -----------------
- ``__cpp_lib_ranges`` *unimplemented*
+ ``__cpp_lib_constexpr_algorithms`` ``201806L``
------------------------------------------------- -----------------
- ``__cpp_lib_span`` ``202002L``
+ ``__cpp_lib_constexpr_complex`` *unimplemented*
------------------------------------------------- -----------------
- ``__cpp_lib_three_way_comparison`` *unimplemented*
+ ``__cpp_lib_constexpr_dynamic_alloc`` ``201907L``
------------------------------------------------- -----------------
- ``__cpp_lib_to_array`` ``201907L``
+ ``__cpp_lib_constexpr_functional`` ``201907L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_iterator`` ``201811L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_memory`` ``201811L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_numeric`` ``201911L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_string`` ``201811L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_string_view`` ``201811L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_tuple`` ``201811L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_utility`` ``201811L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_vector`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_coroutine`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_destroying_delete`` ``201806L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_endian`` ``201907L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_erase_if`` ``202002L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_execution`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_format`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_generic_unordered_lookup`` ``201811L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_int_pow2`` ``202002L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_integer_comparison_functions`` ``202002L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_interpolate`` ``201902L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_is_constant_evaluated`` ``201811L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_is_layout_compatible`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_is_nothrow_convertible`` ``201806L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_is_pointer_interconvertible`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_jthread`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_latch`` ``201907L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_list_remove_return_type`` ``201806L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_math_constants`` ``201907L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_polymorphic_allocator`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_ranges`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_remove_cvref`` ``201711L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_semaphore`` ``201907L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_shift`` ``201806L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_smart_ptr_for_overwrite`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_source_location`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_span`` ``202002L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_ssize`` ``201902L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_starts_ends_with`` ``201711L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_string_view`` ``201803L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_syncbuf`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_three_way_comparison`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_to_address`` ``201711L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_to_array`` ``201907L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_unwrap_ref`` ``201811L``
+ ------------------------------------------------- -----------------
+ **C++ 2b**
+ -------------------------------------------------------------------
+ ``__cpp_lib_is_scoped_enum`` ``202011L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_stacktrace`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_stdatomic_h`` *unimplemented*
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_string_contains`` ``202011L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_to_underlying`` ``202102L``
================================================= =================
-
--- /dev/null
+.. raw:: html\r
+\r
+ <style type="text/css">\r
+ .nothingtodo {\r
+ background-color: #99FF99;\r
+ font-style: italic;\r
+ }\r
+ .inprogress {\r
+ background-color: #FFFF99;\r
+ font-style: italic;\r
+ }\r
+ .partial {\r
+ background-color: #2CCCFF;\r
+ font-style: italic;\r
+ }\r
+ .complete { background-color: #99FF99; }\r
+ </style>\r
+\r
+.. role:: nothingtodo\r
+.. role:: inprogress\r
+.. role:: partial\r
+.. role:: complete\r
+\r
+\r
+.. |Nothing To Do| replace:: :nothingtodo:`Nothing To Do`\r
+.. |In Progress| replace:: :inprogress:`In Progress`\r
+.. |Partial| replace:: :partial:`Partial`\r
+.. |Complete| replace:: :complete:`Complete`\r
+\r
+.. |sect| unicode:: U+00A7\r
+.. |hellip| unicode:: U+2026\r
After configuring libc++ with these options the make rule `docs-libcxx-html`
should be available.
+
+The documentation in this directory is published at https://libcxx.llvm.org. It is kept up-to-date
+by a build bot: https://lab.llvm.org/buildbot/#/builders/publish-sphinx-docs. If you notice that the
+documentation is not updating anymore, please contact one of the maintainers.
-===========================
-Libc++ 11.0.0 Release Notes
-===========================
+=========================================
+Libc++ 13.0.0 (In-Progress) Release Notes
+=========================================
.. contents::
:local:
Written by the `Libc++ Team <https://libcxx.llvm.org>`_
+.. warning::
+
+ These are in-progress notes for the upcoming libc++ 13 release.
+ Release notes for previous releases can be found on
+ `the Download Page <https://releases.llvm.org/download.html>`_.
+
Introduction
============
This document contains the release notes for the libc++ C++ Standard Library,
-part of the LLVM Compiler Infrastructure, release 11.0.0. Here we describe the
+part of the LLVM Compiler Infrastructure, release 13.0.0. Here we describe the
status of libc++ in some detail, including major improvements from the previous
release and new feature work. For the general LLVM release notes, see `the LLVM
documentation <https://llvm.org/docs/ReleaseNotes.html>`_. All LLVM releases may
For more information about libc++, please see the `Libc++ Web Site
<https://libcxx.llvm.org>`_ or the `LLVM Web Site <https://llvm.org>`_.
-What's New in Libc++ 11.0.0?
+Note that if you are reading this file from a Git checkout or the
+main Libc++ web page, this document applies to the *next* release, not
+the current one. To see the release notes for a specific release, please
+see the `releases page <https://llvm.org/releases/>`_.
+
+What's New in Libc++ 13.0.0?
============================
+- Support for older compilers has been removed. Several additional platforms
+ are now officially supported. :ref:`platform_and_compiler_support` contains
+ the complete overview of platforms and compilers supported by libc++.
+- The large headers ``<algorithm>``, ``<iterator>``, and ``<utility>`` have
+ been split in more granular headers. This reduces the size of included code
+ when using libc++. This may lead to missing includes after upgrading to
+ libc++13.
+
New Features
------------
-- ``<numbers>``
+- ``std::filesystem`` is now feature complete for the Windows platform using
+ MinGW. MSVC isn't supported since it lacks 128-bit integer support.
+- The implementation of the C++20 concepts library has been completed.
+- Several C++20 ``constexpr`` papers have been completed:
+
+ - `P0879R0 <https://wg21.link/P0879R0>`_ ``constexpr`` for ``std::swap()``
+ and swap related functions
+ - `P1032R1 <https://wg21.link/P1032R1>`_ Misc ``constexpr`` bits
+ - `P0883 <https://wg21.link/P0883>`_ Fixing Atomic Initialization
+
+- More C++20 features have been implemented. :doc:`Status/Cxx20` has the full
+ overview of libc++'s C++20 implementation status.
+- More C++2b features have been implemented. :doc:`Status/Cxx2b` has the
+ full overview of libc++'s C++2b implementation status.
+- The CMake option ``LIBCXX_ENABLE_INCOMPLETE_FEATURES`` has been added. This
+ option allows libc++ vendors to disable headers that aren't production
+ quality yet. Currently, turning the option off disables the headers
+ ``<format>`` and ``<ranges>``.
+- The documentation conversion from html to restructured text has been
+ completed.
+
+API Changes
+-----------
+
+- There has been several changes in the tuple constructors provided by libc++.
+ Those changes were made as part of an effort to regularize libc++'s tuple
+ implementation, which contained several subtle bugs due to these extensions.
+ If you notice a build breakage when initializing a tuple, make sure you
+ properly initialize all the tuple elements - this is probably the culprit.
+
+ In particular, the extension allowing tuples to be constructed from fewer
+ elements than the number of elements in the tuple (in which case the remaining
+ elements would be default-constructed) has been removed. See https://godbolt.org/z/sqozjd.
+
+ Also, the extension allowing a tuple to be constructed from an array has been
+ removed. See https://godbolt.org/z/5esqbW.
+
+- The ``std::pointer_safety`` utility and related functions are not available
+ in C++03 anymore. Furthermore, in other standard modes, it has changed from
+ a struct to a scoped enumeration, which is an ABI break. Finally, the
+ ``std::get_pointer_safety`` function was previously in the dylib, but it
+ is now defined as inline in the headers.
+
+ While this is technically both an API and an ABI break, we do not expect
+ ``std::pointer_safety`` to have been used at all in real code, since we
+ never implemented the underlying support for garbage collection.
+
+- The `LIBCXXABI_ENABLE_PIC` CMake option was removed. If you are building your
+ own libc++abi from source and were using `LIBCXXABI_ENABLE_PIC`, please use
+ `CMAKE_POSITION_INDEPENDENT_CODE=ON` instead.
+
+- When the header <variant> is included, it will no longer include <array> transitively.
+
+- The ``std::result_of`` and ``std::is_literal_type`` type traits have been removed in
+ C++20 mode.
--- /dev/null
+.. _cxx14-status:\r
+\r
+================================\r
+libc++ C++14 Status\r
+================================\r
+\r
+.. include:: ../Helpers/Styles.rst\r
+\r
+.. contents::\r
+ :local:\r
+\r
+\r
+Overview\r
+================================\r
+\r
+In April 2013, the C++ standard committee approved the draft for the next version of the C++ standard, initially known as "C++1y".\r
+\r
+The draft standard includes papers and issues that were voted on at the previous three meetings (Kona, Portland, and Bristol).\r
+\r
+In August 2014, this draft was approved by ISO as C++14.\r
+\r
+This page shows the status of libc++; the status of clang's support of the language features is `here <https://clang.llvm.org/cxx_status.html#cxx14>`__.\r
+\r
+The groups that have contributed papers:\r
+\r
+- CWG - Core Language Working group\r
+- LWG - Library working group\r
+- SG1 - Study group #1 (Concurrency working group)\r
+\r
+\r
+.. _paper-status-cxx14:\r
+\r
+Paper Status\r
+====================================\r
+\r
+.. csv-table::\r
+ :file: Cxx14Papers.csv\r
+ :header-rows: 1\r
+ :widths: auto\r
+\r
+\r
+.. _issues-status-cxx14:\r
+\r
+Library Working Group Issues Status\r
+====================================\r
+\r
+.. csv-table::\r
+ :file: Cxx14Issues.csv\r
+ :header-rows: 1\r
+ :widths: auto\r
+\r
+Last Updated: 25-Mar-2014\r
--- /dev/null
+"Issue #","Issue Name","Meeting","Status"
+"`1214 <https://wg21.link/lwg1214>`__","Insufficient/inconsistent key immutability requirements for associative containers","Kona","|Complete|"
+"`2009 <https://wg21.link/lwg2009>`__","Reporting out-of-bound values on numeric string conversions","Kona","|Complete|"
+"`2010 <https://wg21.link/lwg2010>`__","``is_*``\ traits for binding operations can't be meaningfully specialized","Kona","|Complete|"
+"`2015 <https://wg21.link/lwg2015>`__","Incorrect pre-conditions for some type traits","Kona","|Complete|"
+"`2021 <https://wg21.link/lwg2021>`__","Further incorrect usages of result_of","Kona","|Complete|"
+"`2028 <https://wg21.link/lwg2028>`__","messages_base::catalog overspecified","Kona","|Complete|"
+"`2033 <https://wg21.link/lwg2033>`__","Preconditions of reserve, shrink_to_fit, and resize functions","Kona","|Complete|"
+"`2039 <https://wg21.link/lwg2039>`__","Issues with std::reverse and std::copy_if","Kona","|Complete|"
+"`2044 <https://wg21.link/lwg2044>`__","No definition of ""Stable"" for copy algorithms","Kona","|Complete|"
+"`2045 <https://wg21.link/lwg2045>`__","forward_list::merge and forward_list::splice_after with unequal allocators","Kona","|Complete|"
+"`2047 <https://wg21.link/lwg2047>`__","Incorrect ""mixed"" move-assignment semantics of unique_ptr","Kona","|Complete|"
+"`2050 <https://wg21.link/lwg2050>`__","Unordered associative containers do not use allocator_traits to define member types","Kona","|Complete|"
+"`2053 <https://wg21.link/lwg2053>`__","Errors in regex bitmask types","Kona","|Complete|"
+"`2061 <https://wg21.link/lwg2061>`__","make_move_iterator and arrays","Kona","|Complete|"
+"`2064 <https://wg21.link/lwg2064>`__","More noexcept issues in basic_string","Kona","|Complete|"
+"`2065 <https://wg21.link/lwg2065>`__","Minimal allocator interface","Kona","|Complete|"
+"`2067 <https://wg21.link/lwg2067>`__","packaged_task should have deleted copy c'tor with const parameter","Kona","|Complete|"
+"`2069 <https://wg21.link/lwg2069>`__","Inconsistent exception spec for basic_string move constructor","Kona","|Complete|"
+"`2096 <https://wg21.link/lwg2096>`__","Incorrect constraints of future::get in regard to MoveAssignable","Kona","|Complete|"
+"`2102 <https://wg21.link/lwg2102>`__","Why is std::launch an implementation-defined type?","Kona","|Complete|"
+"","","",""
+"`2071 <https://wg21.link/lwg2071>`__","std::valarray move-assignment","Portland","|Complete|"
+"`2074 <https://wg21.link/lwg2074>`__","Off by one error in std::reverse_copy","Portland","|Complete|"
+"`2081 <https://wg21.link/lwg2081>`__","Allocator requirements should include CopyConstructible","Portland","|Complete|"
+"`2083 <https://wg21.link/lwg2083>`__","const-qualification on weak_ptr::owner_before","Portland","|Complete|"
+"`2086 <https://wg21.link/lwg2086>`__","Overly generic type support for math functions","Portland","|Complete|"
+"`2099 <https://wg21.link/lwg2099>`__","Unnecessary constraints of va_start() usage","Portland","|Complete|"
+"`2103 <https://wg21.link/lwg2103>`__","std::allocator_traits<std::allocator<T>>::propagate_on_container_move_assignment","Portland","|Complete|"
+"`2105 <https://wg21.link/lwg2105>`__","Inconsistent requirements on ``const_iterator``'s value_type","Portland","|Complete|"
+"`2110 <https://wg21.link/lwg2110>`__","remove can't swap but note says it might","Portland","|Complete|"
+"`2123 <https://wg21.link/lwg2123>`__","merge() allocator requirements for lists versus forward lists","Portland","|Complete|"
+"`2005 <https://wg21.link/lwg2005>`__","unordered_map::insert(T&&) protection should apply to map too","Portland","|Complete|"
+"`2011 <https://wg21.link/lwg2011>`__","Unexpected output required of strings","Portland","|Complete|"
+"`2048 <https://wg21.link/lwg2048>`__","Unnecessary mem_fn overloads","Portland","|Complete|"
+"`2049 <https://wg21.link/lwg2049>`__","``is_destructible``\ is underspecified","Portland","|Complete|"
+"`2056 <https://wg21.link/lwg2056>`__","future_errc enums start with value 0 (invalid value for broken_promise)","Portland","|Complete|"
+"`2058 <https://wg21.link/lwg2058>`__","valarray and begin/end","Portland","|Complete|"
+"","","",""
+"`2091 <https://wg21.link/lwg2091>`__","Misplaced effect in m.try_lock_for()","Bristol","|Complete|"
+"`2092 <https://wg21.link/lwg2092>`__","Vague Wording for condition_variable_any","Bristol","|Complete|"
+"`2093 <https://wg21.link/lwg2093>`__","Throws clause of condition_variable::wait with predicate","Bristol","|Complete|"
+"`2094 <https://wg21.link/lwg2094>`__","duration conversion overflow shouldn't participate in overload resolution","Bristol","|Complete|"
+"`2122 <https://wg21.link/lwg2122>`__","merge() stability for lists versus forward lists","Bristol","|Complete|"
+"`2128 <https://wg21.link/lwg2128>`__","Absence of global functions cbegin/cend","Bristol","|Complete|"
+"`2145 <https://wg21.link/lwg2145>`__","error_category default constructor","Bristol","|Complete|"
+"`2147 <https://wg21.link/lwg2147>`__","Unclear hint type in Allocator's allocate function","Bristol","|Complete|"
+"`2148 <https://wg21.link/lwg2148>`__","Hashing enums should be supported directly by std::hash","Bristol","|Complete|"
+"`2149 <https://wg21.link/lwg2149>`__","Concerns about 20.8/5","Bristol","|Complete|"
+"`2162 <https://wg21.link/lwg2162>`__","allocator_traits::max_size missing noexcept","Bristol","|Complete|"
+"`2163 <https://wg21.link/lwg2163>`__","nth_element requires inconsistent post-conditions","Bristol","|Complete|"
+"`2169 <https://wg21.link/lwg2169>`__","Missing reset() requirements in unique_ptr specialization","Bristol","|Complete|"
+"`2172 <https://wg21.link/lwg2172>`__","Does ``atomic_compare_exchange_*``\ accept v == nullptr arguments?","Bristol","|Complete|"
+"`2080 <https://wg21.link/lwg2080>`__","Specify when once_flag becomes invalid","Bristol","|Complete|"
+"`2098 <https://wg21.link/lwg2098>`__","promise throws clauses","Bristol","|Complete|"
+"`2109 <https://wg21.link/lwg2109>`__","Incorrect requirements for hash specializations","Bristol","|Complete|"
+"`2130 <https://wg21.link/lwg2130>`__","missing ordering constraints for fences","Bristol","|Complete|"
+"`2138 <https://wg21.link/lwg2138>`__","atomic_flag::clear ordering constraints","Bristol","|Complete|"
+"`2140 <https://wg21.link/lwg2140>`__","notify_all_at_thread_exit synchronization","Bristol","|Complete|"
+"`2144 <https://wg21.link/lwg2144>`__","Missing noexcept specification in type_index","Bristol","|Complete|"
+"`2174 <https://wg21.link/lwg2174>`__","wstring_convert::converted() should be noexcept","Bristol","|Complete|"
+"`2175 <https://wg21.link/lwg2175>`__","string_convert and wbuffer_convert validity","Bristol","|Complete|"
+"`2176 <https://wg21.link/lwg2176>`__","Special members for wstring_convert and wbuffer_convert","Bristol","|Complete|"
+"`2177 <https://wg21.link/lwg2177>`__","Requirements on Copy/MoveInsertable","Bristol","|Complete|"
+"`2185 <https://wg21.link/lwg2185>`__","Missing throws clause for future/shared_future::wait_for/wait_until","Bristol","|Complete|"
+"`2187 <https://wg21.link/lwg2187>`__","vector<bool> is missing emplace and emplace_back member functions","Bristol","|Complete|"
+"`2190 <https://wg21.link/lwg2190>`__","ordering of condition variable operations, reflects Posix discussion","Bristol","|Complete|"
+"`2196 <https://wg21.link/lwg2196>`__","Specification of ``is_*[copy/move]_[constructible/assignable]``\ unclear for non-referencable types","Bristol","|Complete|"
+"`2197 <https://wg21.link/lwg2197>`__","Specification of ``is_[un]signed``\ unclear for non-arithmetic types","Bristol","|Complete|"
+"`2200 <https://wg21.link/lwg2200>`__","Data race avoidance for all containers, not only for sequences","Bristol","|Complete|"
+"`2203 <https://wg21.link/lwg2203>`__","scoped_allocator_adaptor uses wrong argument types for piecewise construction","Bristol","|Complete|"
+"`2207 <https://wg21.link/lwg2207>`__","basic_string::at should not have a Requires clause","Bristol","|Complete|"
+"`2209 <https://wg21.link/lwg2209>`__","assign() overspecified for sequence containers","Bristol","|Complete|"
+"`2210 <https://wg21.link/lwg2210>`__","Missing allocator-extended constructor for allocator-aware containers","Bristol","|Complete|"
+"`2211 <https://wg21.link/lwg2211>`__","Replace ambiguous use of ""Allocator"" in container requirements","Bristol","|Complete|"
+"`2222 <https://wg21.link/lwg2222>`__","Inconsistency in description of forward_list::splice_after single-element overload","Bristol","|Complete|"
+"`2225 <https://wg21.link/lwg2225>`__","Unrealistic header inclusion checks required","Bristol","|Complete|"
+"`2229 <https://wg21.link/lwg2229>`__","Standard code conversion facets underspecified","Bristol","|Complete|"
+"`2231 <https://wg21.link/lwg2231>`__","DR 704 removes complexity guarantee for clear()","Bristol","|Complete|"
+"`2235 <https://wg21.link/lwg2235>`__","Undefined behavior without proper requirements on basic_string constructors","Bristol","|Complete|"
+"","","",""
+"`2141 <https://wg21.link/lwg2141>`__","common_type trait produces reference types","Chicago","|Complete|"
+"`2246 <https://wg21.link/lwg2246>`__","unique_ptr assignment effects w.r.t. deleter","Chicago","|Complete|"
+"`2247 <https://wg21.link/lwg2247>`__","Type traits and std::nullptr_t","Chicago","|Complete|"
+"`2085 <https://wg21.link/lwg2085>`__","Wrong description of effect 1 of basic_istream::ignore","Chicago","|Complete|"
+"`2087 <https://wg21.link/lwg2087>`__","iostream_category() and noexcept","Chicago","|Complete|"
+"`2143 <https://wg21.link/lwg2143>`__","ios_base::xalloc should be thread-safe","Chicago","|Complete|"
+"`2150 <https://wg21.link/lwg2150>`__","Unclear specification of find_end","Chicago","|Complete|"
+"`2180 <https://wg21.link/lwg2180>`__","Exceptions from std::seed_seq operations","Chicago","|Complete|"
+"`2194 <https://wg21.link/lwg2194>`__","Impossible container requirements for adaptor types","Chicago","|Complete|"
+"`2013 <https://wg21.link/lwg2013>`__","Do library implementers have the freedom to add constexpr?","Chicago","|Complete|"
+"`2018 <https://wg21.link/lwg2018>`__","regex_traits::isctype Returns clause is wrong","Chicago","|Complete|"
+"`2078 <https://wg21.link/lwg2078>`__","Throw specification of async() incomplete","Chicago","|Complete|"
+"`2097 <https://wg21.link/lwg2097>`__","packaged_task constructors should be constrained","Chicago","|Complete|"
+"`2100 <https://wg21.link/lwg2100>`__","Timed waiting functions cannot timeout if launch::async policy used","Chicago","|Complete|"
+"`2120 <https://wg21.link/lwg2120>`__","What should async do if neither 'async' nor 'deferred' is set in policy?","Chicago","|Complete|"
+"`2159 <https://wg21.link/lwg2159>`__","atomic_flag initialization","Chicago","|Complete|"
+"`2275 <https://wg21.link/lwg2275>`__","Why is forward_as_tuple not constexpr?","Chicago","|Complete|"
+"`2284 <https://wg21.link/lwg2284>`__","Inconsistency in allocator_traits::max_size","Chicago","|Complete|"
+"`2298 <https://wg21.link/lwg2298>`__","``is_nothrow_constructible``\ is always false because of create<>","Chicago","|Complete|"
+"`2300 <https://wg21.link/lwg2300>`__","Redundant sections for map and multimap members should be removed","Chicago","|Complete|"
+"NB comment: GB9","Remove gets from C++14","Chicago","|Complete|"
+"","","",""
+"`2135 <https://wg21.link/lwg2135>`__","Unclear requirement for exceptions thrown in condition_variable::wait()","Issaquah","|Complete|"
+"`2291 <https://wg21.link/lwg2291>`__","std::hash is vulnerable to collision DoS attack","Issaquah","|Complete|"
+"`2142 <https://wg21.link/lwg2142>`__","packaged_task::operator() synchronization too broad?","Issaquah","|Complete|"
+"`2240 <https://wg21.link/lwg2240>`__","Probable misuse of term ""function scope"" in [thread.condition]","Issaquah","|Complete|"
+"`2252 <https://wg21.link/lwg2252>`__","Strong guarantee on vector::push_back() still broken with C++11?","Issaquah","|Complete|"
+"`2257 <https://wg21.link/lwg2257>`__","Simplify container requirements with the new algorithms","Issaquah","|Complete|"
+"`2268 <https://wg21.link/lwg2268>`__","Setting a default argument in the declaration of a member function assign of std::basic_string","Issaquah","|Complete|"
+"`2271 <https://wg21.link/lwg2271>`__","regex_traits::lookup_classname specification unclear","Issaquah","|Complete|"
+"`2272 <https://wg21.link/lwg2272>`__","quoted should use char_traits::eq for character comparison","Issaquah","|Complete|"
+"`2278 <https://wg21.link/lwg2278>`__","User-defined literals for Standard Library types","Issaquah","|Complete|"
+"`2280 <https://wg21.link/lwg2280>`__","begin / end for arrays should be constexpr and noexcept","Issaquah","|Complete|"
+"`2285 <https://wg21.link/lwg2285>`__","make_reverse_iterator","Issaquah","|Complete|"
+"`2299 <https://wg21.link/lwg2299>`__","Effects of inaccessible ``key_compare::is_transparent``\ type are not clear","Issaquah","|Complete|"
+"`1450 <https://wg21.link/lwg1450>`__","Contradiction in regex_constants","Issaquah","|Complete|"
+"`2003 <https://wg21.link/lwg2003>`__","String exception inconsistency in erase.","Issaquah","|Complete|"
+"`2112 <https://wg21.link/lwg2112>`__","User-defined classes that cannot be derived from","Issaquah","|Complete|"
+"`2132 <https://wg21.link/lwg2132>`__","std::function ambiguity","Issaquah","|Complete|"
+"`2182 <https://wg21.link/lwg2182>`__","``Container::[const_]reference`` types are misleadingly specified","Issaquah","|Complete|"
+"`2188 <https://wg21.link/lwg2188>`__","Reverse iterator does not fully support targets that overload operator&","Issaquah","|Complete|"
+"`2193 <https://wg21.link/lwg2193>`__","Default constructors for standard library containers are explicit","Issaquah","|Complete|"
+"`2205 <https://wg21.link/lwg2205>`__","Problematic postconditions of regex_match and regex_search","Issaquah","|Complete|"
+"`2213 <https://wg21.link/lwg2213>`__","Return value of std::regex_replace","Issaquah","|Complete|"
+"`2258 <https://wg21.link/lwg2258>`__","a.erase(q1, q2) unable to directly return q2","Issaquah","|Complete|"
+"`2263 <https://wg21.link/lwg2263>`__","Comparing iterators and allocator pointers with different const-character","Issaquah","|Complete|"
+"`2293 <https://wg21.link/lwg2293>`__","Wrong facet used by num_put::do_put","Issaquah","|Complete|"
+"`2301 <https://wg21.link/lwg2301>`__","Why is std::tie not constexpr?","Issaquah","|Complete|"
+"`2304 <https://wg21.link/lwg2304>`__","Complexity of count in unordered associative containers","Issaquah","|Complete|"
+"`2306 <https://wg21.link/lwg2306>`__","match_results::reference should be value_type&, not const value_type&","Issaquah","|Complete|"
+"`2308 <https://wg21.link/lwg2308>`__","Clarify container destructor requirements w.r.t. std::array","Issaquah","|Complete|"
+"`2313 <https://wg21.link/lwg2313>`__","tuple_size should always derive from integral_constant<size_t, N>","Issaquah","|Complete|"
+"`2314 <https://wg21.link/lwg2314>`__","apply() should return decltype(auto) and use decay_t before tuple_size","Issaquah","|Complete|"
+"`2315 <https://wg21.link/lwg2315>`__","weak_ptr should be movable","Issaquah","|Complete|"
+"`2316 <https://wg21.link/lwg2316>`__","weak_ptr::lock() should be atomic","Issaquah","|Complete|"
+"`2317 <https://wg21.link/lwg2317>`__","The type property queries should be UnaryTypeTraits returning size_t","Issaquah","|Complete|"
+"`2320 <https://wg21.link/lwg2320>`__","select_on_container_copy_construction() takes allocators, not containers","Issaquah","|Complete|"
+"`2322 <https://wg21.link/lwg2322>`__","Associative(initializer_list, stuff) constructors are underspecified","Issaquah","|Complete|"
+"`2323 <https://wg21.link/lwg2323>`__","vector::resize(n, t)'s specification should be simplified","Issaquah","|Complete|"
+"`2324 <https://wg21.link/lwg2324>`__","Insert iterator constructors should use addressof()","Issaquah","|Complete|"
+"`2329 <https://wg21.link/lwg2329>`__","regex_match()/regex_search() with match_results should forbid temporary strings","Issaquah","|Complete|"
+"`2330 <https://wg21.link/lwg2330>`__","regex(""meow"", regex::icase) is technically forbidden but should be permitted","Issaquah","|Complete|"
+"`2332 <https://wg21.link/lwg2332>`__","regex_iterator/regex_token_iterator should forbid temporary regexes","Issaquah","|Complete|"
+"`2339 <https://wg21.link/lwg2339>`__","Wording issue in nth_element","Issaquah","|Complete|"
+"`2341 <https://wg21.link/lwg2341>`__","Inconsistency between basic_ostream::seekp(pos) and basic_ostream::seekp(off, dir)","Issaquah","|Complete|"
+"`2344 <https://wg21.link/lwg2344>`__","quoted()'s interaction with padding is unclear","Issaquah","|Complete|"
+"`2346 <https://wg21.link/lwg2346>`__","integral_constant's member functions should be marked noexcept","Issaquah","|Complete|"
+"`2350 <https://wg21.link/lwg2350>`__","min, max, and minmax should be constexpr","Issaquah","|Complete|"
+"`2356 <https://wg21.link/lwg2356>`__","Stability of erasure in unordered associative containers","Issaquah","|Complete|"
+"`2357 <https://wg21.link/lwg2357>`__","Remaining ""Assignable"" requirement","Issaquah","|Complete|"
+"`2359 <https://wg21.link/lwg2359>`__","How does regex_constants::nosubs affect basic_regex::mark_count()?","Issaquah","|Complete|"
+"`2360 <https://wg21.link/lwg2360>`__","``reverse_iterator::operator*()``\ is unimplementable","Issaquah","|Complete|"
+"`2104 <https://wg21.link/lwg2104>`__","unique_lock move-assignment should not be noexcept","Issaquah","|Complete|"
+"`2186 <https://wg21.link/lwg2186>`__","Incomplete action on async/launch::deferred","Issaquah","|Complete|"
+"`2075 <https://wg21.link/lwg2075>`__","Progress guarantees, lock-free property, and scheduling assumptions","Issaquah","|Complete|"
+"`2288 <https://wg21.link/lwg2288>`__","Inconsistent requirements for shared mutexes","Issaquah","|Complete|"
--- /dev/null
+"Paper #","Group","Paper Name","Meeting","Status","First released version"
+"`3346 <https://wg21.link/n3346>`__","LWG","Terminology for Container Element Requirements - Rev 1","Kona","|Complete|","3.4"
+"","","","","",""
+"`3421 <https://wg21.link/n3421>`__","LWG","Making Operator Functors greater<>","Portland","|Complete|","3.4"
+"`3462 <https://wg21.link/n3462>`__","LWG","std::result_of and SFINAE","Portland","|Complete|","3.4"
+"`3469 <https://wg21.link/n3469>`__","LWG","Constexpr Library Additions: chrono, v3","Portland","|Complete|","3.4"
+"`3470 <https://wg21.link/n3470>`__","LWG","Constexpr Library Additions: containers, v2","Portland","|Complete|","3.4"
+"`3471 <https://wg21.link/n3471>`__","LWG","Constexpr Library Additions: utilities, v3","Portland","|Complete|","3.4"
+"`3302 <https://wg21.link/n3302>`__","LWG","Constexpr Library Additions: complex, v2","Portland","|Complete|","3.4"
+"","","","","",""
+"`3545 <https://wg21.link/n3545>`__","LWG","An Incremental Improvement to integral_constant","Bristol","|Complete|","3.4"
+"`3644 <https://wg21.link/n3644>`__","LWG","Null Forward Iterators","Bristol","|Complete|","3.4"
+"`3668 <https://wg21.link/n3668>`__","LWG","std::exchange()","Bristol","|Complete|","3.4"
+"`3658 <https://wg21.link/n3658>`__","LWG","Compile-time integer sequences","Bristol","|Complete|","3.4"
+"`3670 <https://wg21.link/n3670>`__","LWG","Addressing Tuples by Type","Bristol","|Complete|","3.4"
+"`3671 <https://wg21.link/n3671>`__","LWG","Making non-modifying sequence operations more robust","Bristol","|Complete|","3.4"
+"`3656 <https://wg21.link/n3656>`__","LWG","make_unique","Bristol","|Complete|","3.4"
+"`3654 <https://wg21.link/n3654>`__","LWG","Quoted Strings","Bristol","|Complete|","3.4"
+"`3642 <https://wg21.link/n3642>`__","LWG","User-defined Literals","Bristol","|Complete|","3.4"
+"`3655 <https://wg21.link/n3655>`__","LWG","TransformationTraits Redux (excluding part 4)","Bristol","|Complete|","3.4"
+"`3657 <https://wg21.link/n3657>`__","LWG","Adding heterogeneous comparison lookup to associative containers","Bristol","|Complete|","3.4"
+"`3672 <https://wg21.link/n3672>`__","LWG","A proposal to add a utility class to represent optional objects","Bristol","*Removed from Draft Standard*","n/a"
+"`3669 <https://wg21.link/n3669>`__","LWG","Fixing constexpr member functions without const","Bristol","|Complete|","3.4"
+"`3662 <https://wg21.link/n3662>`__","LWG","C++ Dynamic Arrays (dynarray)","Bristol","*Removed from Draft Standard*","n/a"
+"`3659 <https://wg21.link/n3659>`__","SG1","Shared Locking in C++","Bristol","|Complete|","3.4"
+"","","","","",""
+"`3779 <https://wg21.link/n3779>`__","LWG","User-defined Literals for std::complex","Chicago","|Complete|","3.4"
+"`3789 <https://wg21.link/n3789>`__","LWG","Constexpr Library Additions: functional","Chicago","|Complete|","3.4"
+"","","","","",""
+"`3924 <https://wg21.link/n3924>`__","LWG","Discouraging rand() in C++14","Issaquah","|Complete|","3.5"
+"`3887 <https://wg21.link/n3887>`__","LWG","Consistent Metafunction Aliases","Issaquah","|Complete|","3.5"
+"`3891 <https://wg21.link/n3891>`__","SG1","A proposal to rename shared_mutex to shared_timed_mutex","Issaquah","|Complete|","3.5"
--- /dev/null
+.. _cxx17-status:\r
+\r
+================================\r
+libc++ C++17 Status\r
+================================\r
+\r
+.. include:: ../Helpers/Styles.rst\r
+\r
+.. contents::\r
+ :local:\r
+\r
+\r
+Overview\r
+================================\r
+\r
+In November 2014, the C++ standard committee created a draft for the next version of the C++ standard, initially known as "C++1z".\r
+In February 2017, the C++ standard committee approved this draft, and sent it to ISO for approval as C++17.\r
+\r
+This page shows the status of libc++; the status of clang's support of the language features is `here <https://clang.llvm.org/cxx_status.html#cxx17>`__.\r
+\r
+.. attention:: Features in unreleased drafts of the standard are subject to change.\r
+\r
+The groups that have contributed papers:\r
+\r
+- CWG - Core Language Working group\r
+- LWG - Library working group\r
+- SG1 - Study group #1 (Concurrency working group)\r
+\r
+.. note:: "Nothing to do" means that no library changes were needed to implement this change.\r
+\r
+.. _paper-status-cxx17:\r
+\r
+Paper Status\r
+====================================\r
+\r
+.. csv-table::\r
+ :file: Cxx17Papers.csv\r
+ :header-rows: 1\r
+ :widths: auto\r
+\r
+.. note::\r
+\r
+ .. [#note-P0433] P0433: So far, only the ``<string>``, sequence containers, container adaptors and ``<regex>`` portions of P0433 have been implemented.\r
+ .. [#note-P0607] P0607: The parts of P0607 that are not done are the ``<regex>`` bits.\r
+\r
+\r
+.. _issues-status-cxx17:\r
+\r
+Library Working Group Issues Status\r
+====================================\r
+\r
+.. csv-table::\r
+ :file: Cxx17Issues.csv\r
+ :header-rows: 1\r
+ :widths: auto\r
+\r
+Last Updated: 17-Nov-2020\r
--- /dev/null
+"Issue #","Issue Name","Meeting","Status","First released version"
+"`2016 <https://wg21.link/LWG2016>`__","Allocators must be no-throw swappable","Urbana","|Complete|",""
+"`2118 <https://wg21.link/LWG2376>`__","``unique_ptr``\ for array does not support cv qualification conversion of actual argument","Urbana","|Complete|",""
+"`2170 <https://wg21.link/LWG2170>`__","Aggregates cannot be ``DefaultConstructible``\ ","Urbana","|Complete|",""
+"`2308 <https://wg21.link/LWG2308>`__","Clarify container destructor requirements w.r.t. ``std::array``\ ","Urbana","|Complete|",""
+"`2340 <https://wg21.link/LWG2340>`__","Replacement allocation functions declared as inline","Urbana","|Complete|",""
+"`2354 <https://wg21.link/LWG2354>`__","Unnecessary copying when inserting into maps with braced-init syntax","Urbana","|Complete|",""
+"`2377 <https://wg21.link/LWG2377>`__","``std::align``\ requirements overly strict","Urbana","|Complete|",""
+"`2396 <https://wg21.link/LWG2396>`__","``underlying_type``\ doesn't say what to do for an incomplete enumeration type","Urbana","|Complete|",""
+"`2399 <https://wg21.link/LWG2399>`__","``shared_ptr``\ 's constructor from ``unique_ptr``\ should be constrained","Urbana","|Complete|",""
+"`2400 <https://wg21.link/LWG2400>`__","``shared_ptr``\ 's ``get_deleter()``\ should use ``addressof()``\ ","Urbana","|Complete|",""
+"`2401 <https://wg21.link/LWG2401>`__","``std::function``\ needs more noexcept","Urbana","|Complete|",""
+"`2404 <https://wg21.link/LWG2404>`__","``mismatch()``\ 's complexity needs to be updated","Urbana","|Complete|",""
+"`2408 <https://wg21.link/LWG2408>`__","SFINAE-friendly ``common_type``\ / ``iterator_traits``\ is missing in C++14","Urbana","|Complete|",""
+"","","","",""
+"`2106 <https://wg21.link/LWG2106>`__","``move_iterator``\ wrapping iterators returning prvalues","Urbana","|Complete|",""
+"`2129 <https://wg21.link/LWG2129>`__","User specializations of ``std::initializer_list``\ ","Urbana","|Complete|",""
+"`2212 <https://wg21.link/LWG2212>`__","``tuple_size``\ for ``const pair``\ request <tuple> header","Urbana","|Complete|",""
+"`2217 <https://wg21.link/LWG2217>`__","``operator==(sub_match, string)``\ slices on embedded '\0's","Urbana","|Complete|",""
+"`2230 <https://wg21.link/LWG2230>`__","""see below"" for ``initializer_list``\ constructors of unordered containers","Urbana","|Complete|",""
+"`2233 <https://wg21.link/LWG2233>`__","``bad_function_call::what()``\ unhelpful","Urbana","|Complete|",""
+"`2266 <https://wg21.link/LWG2266>`__","``vector``\ and ``deque``\ have incorrect insert requirements","Urbana","|Complete|",""
+"`2325 <https://wg21.link/LWG2325>`__","``minmax_element()``\ 's behavior differing from ``max_element()``\ 's should be noted","Urbana","|Complete|",""
+"`2361 <https://wg21.link/LWG2361>`__","Apply 2299 resolution throughout library","Urbana","|Complete|",""
+"`2365 <https://wg21.link/LWG2365>`__","Missing noexcept in ``shared_ptr::shared_ptr(nullptr_t)``\ ","Urbana","|Complete|",""
+"`2376 <https://wg21.link/LWG2376>`__","``bad_weak_ptr::what()``\ overspecified","Urbana","|Complete|",""
+"`2387 <https://wg21.link/LWG2387>`__","More nested types that must be accessible and unambiguous","Urbana","|Complete|",""
+"","","","",""
+"`2059 <https://wg21.link/LWG2059>`__","C++0x ambiguity problem with map::erase","Lenexa","|Complete|",""
+"`2063 <https://wg21.link/LWG2063>`__","Contradictory requirements for string move assignment","Lenexa","|Complete|",""
+"`2076 <https://wg21.link/LWG2076>`__","Bad CopyConstructible requirement in set constructors","Lenexa","|Complete|",""
+"`2160 <https://wg21.link/LWG2160>`__","Unintended destruction ordering-specification of resize","Lenexa","|Complete|",""
+"`2168 <https://wg21.link/LWG2168>`__","Inconsistent specification of uniform_real_distribution constructor","Lenexa","|Complete|",""
+"`2239 <https://wg21.link/LWG2239>`__","min/max/minmax requirements","Lenexa","|Complete|",""
+"`2364 <https://wg21.link/LWG2364>`__","deque and vector pop_back don't specify iterator invalidation requirements","Lenexa","|Complete|",""
+"`2369 <https://wg21.link/LWG2369>`__","constexpr max(initializer_list) vs max_element","Lenexa","|Complete|",""
+"`2378 <https://wg21.link/LWG2378>`__","Behaviour of standard exception types","Lenexa","|Complete|",""
+"`2403 <https://wg21.link/LWG2403>`__","stof() should call strtof() and wcstof()","Lenexa","|Complete|",""
+"`2406 <https://wg21.link/LWG2406>`__","negative_binomial_distribution should reject p == 1","Lenexa","|Complete|",""
+"`2407 <https://wg21.link/LWG2407>`__","packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit","Lenexa","|Complete|",""
+"`2411 <https://wg21.link/LWG2411>`__","shared_ptr is only contextually convertible to bool","Lenexa","|Complete|",""
+"`2415 <https://wg21.link/LWG2415>`__","Inconsistency between unique_ptr and shared_ptr","Lenexa","|Complete|",""
+"`2420 <https://wg21.link/LWG2420>`__","function<void(ArgTypes...)> does not discard the return value of the target object","Lenexa","|Complete|",""
+"`2425 <https://wg21.link/LWG2425>`__","``operator delete(void*, size_t)``\ doesn't invalidate pointers sufficiently","Lenexa","|Complete|",""
+"`2427 <https://wg21.link/LWG2427>`__","Container adaptors as sequence containers, redux","Lenexa","|Complete|",""
+"`2428 <https://wg21.link/LWG2428>`__","""External declaration"" used without being defined","Lenexa","|Complete|",""
+"`2433 <https://wg21.link/LWG2433>`__","``uninitialized_copy()``\ /etc. should tolerate overloaded operator&","Lenexa","|Complete|",""
+"`2434 <https://wg21.link/LWG2434>`__","``shared_ptr::use_count()``\ is efficient","Lenexa","|Complete|",""
+"`2437 <https://wg21.link/LWG2437>`__","``iterator_traits::reference``\ can and can't be void","Lenexa","|Complete|",""
+"`2438 <https://wg21.link/LWG2438>`__","``std::iterator``\ inheritance shouldn't be mandated","Lenexa","|Complete|",""
+"`2439 <https://wg21.link/LWG2439>`__","``unique_copy()``\ sometimes can't fall back to reading its output","Lenexa","|Complete|",""
+"`2440 <https://wg21.link/LWG2440>`__","``seed_seq::size()``\ should be noexcept","Lenexa","|Complete|",""
+"`2442 <https://wg21.link/LWG2442>`__","``call_once()``\ shouldn't DECAY_COPY()","Lenexa","|Complete|",""
+"`2448 <https://wg21.link/LWG2448>`__","Non-normative Container destructor specification","Lenexa","|Complete|",""
+"`2454 <https://wg21.link/LWG2454>`__","Add ``raw_storage_iterator::base()``\ member","Lenexa","|Complete|",""
+"`2455 <https://wg21.link/LWG2455>`__","Allocator default construction should be allowed to throw","Lenexa","|Complete|",""
+"`2458 <https://wg21.link/LWG2458>`__","N3778 and new library deallocation signatures","Lenexa","|Complete|",""
+"`2459 <https://wg21.link/LWG2459>`__","``std::polar``\ should require a non-negative rho","Lenexa","|Complete|",""
+"`2464 <https://wg21.link/LWG2464>`__","``try_emplace``\ and ``insert_or_assign``\ misspecified","Lenexa","|Complete|",""
+"`2467 <https://wg21.link/LWG2467>`__","``is_always_equal``\ has slightly inconsistent default","Lenexa","|Complete|",""
+"`2470 <https://wg21.link/LWG2470>`__","Allocator's destroy function should be allowed to fail to instantiate","Lenexa","|Complete|",""
+"`2482 <https://wg21.link/LWG2482>`__","[c.strings] Table 73 mentions nonexistent functions","Lenexa","|Complete|",""
+"`2488 <https://wg21.link/LWG2488>`__","Placeholders should be allowed and encouraged to be constexpr","Lenexa","|Complete|",""
+"","","","",""
+"`1169 <https://wg21.link/LWG1169>`__","``num_get``\ not fully compatible with ``strto*``\ ","Kona","|Complete|",""
+"`2072 <https://wg21.link/LWG2072>`__","Unclear wording about capacity of temporary buffers","Kona","|Complete|",""
+"`2101 <https://wg21.link/LWG2101>`__","Some transformation types can produce impossible types","Kona","|Complete|",""
+"`2111 <https://wg21.link/LWG2111>`__","Which ``unexpected``\ /``terminate``\ handler is called from the exception handling runtime?","Kona","|Complete|",""
+"`2119 <https://wg21.link/LWG2119>`__","Missing ``hash``\ specializations for extended integer types","Kona","|Complete|",""
+"`2127 <https://wg21.link/LWG2127>`__","Move-construction with ``raw_storage_iterator``\ ","Kona","|Complete|",""
+"`2133 <https://wg21.link/LWG2133>`__","Attitude to overloaded comma for iterators","Kona","|Complete|",""
+"`2156 <https://wg21.link/LWG2156>`__","Unordered containers' ``reserve(n)``\ reserves for ``n-1``\ elements","Kona","|Complete|",""
+"`2218 <https://wg21.link/LWG2218>`__","Unclear how containers use ``allocator_traits::construct()``\ ","Kona","|Complete|",""
+"`2219 <https://wg21.link/LWG2219>`__","``*INVOKE*``\ -ing a pointer to member with a ``reference_wrapper``\ as the object expression","Kona","|Complete|",""
+"`2224 <https://wg21.link/LWG2224>`__","Ambiguous status of access to non-live objects","Kona","|Complete|",""
+"`2234 <https://wg21.link/LWG2234>`__","``assert()``\ should allow usage in constant expressions","Kona","|Complete|",""
+"`2244 <https://wg21.link/LWG2244>`__","Issue on ``basic_istream::seekg``\ ","Kona","|Complete|",""
+"`2250 <https://wg21.link/LWG2250>`__","Follow-up On Library Issue 2207","Kona","|Complete|",""
+"`2259 <https://wg21.link/LWG2259>`__","Issues in 17.6.5.5 rules for member functions","Kona","|Complete|",""
+"`2273 <https://wg21.link/LWG2273>`__","``regex_match``\ ambiguity","Kona","|Complete|",""
+"`2336 <https://wg21.link/LWG2336>`__","``is_trivially_constructible``\ /``is_trivially_assignable``\ traits are always false","Kona","|Complete|",""
+"`2353 <https://wg21.link/LWG2353>`__","``std::next``\ is over-constrained","Kona","|Complete|",""
+"`2367 <https://wg21.link/LWG2367>`__","``pair``\ and ``tuple``\ are not correctly implemented for ``is_constructible``\ with no args","Kona","|Complete|",""
+"`2380 <https://wg21.link/LWG2380>`__","May ``<cstdlib>``\ provide ``long ::abs(long)``\ and ``long long ::abs(long long)``\ ?","Kona","|Complete|",""
+"`2384 <https://wg21.link/LWG2384>`__","Allocator's ``deallocate``\ function needs better specification","Kona","|Complete|",""
+"`2385 <https://wg21.link/LWG2385>`__","``function::assign``\ allocator argument doesn't make sense","Kona","|Complete|",""
+"`2435 <https://wg21.link/LWG2435>`__","``reference_wrapper::operator()``\ 's Remark should be deleted","Kona","|Complete|",""
+"`2447 <https://wg21.link/LWG2447>`__","Allocators and ``volatile``\ -qualified value types","Kona","|Complete|",""
+"`2462 <https://wg21.link/LWG2462>`__","``std::ios_base::failure``\ is overspecified","Kona","|Complete|",""
+"`2466 <https://wg21.link/LWG2466>`__","``allocator_traits::max_size()``\ default behavior is incorrect","Kona","|Complete|",""
+"`2469 <https://wg21.link/LWG2469>`__","Wrong specification of Requires clause of ``operator[]``\ for ``map``\ and ``unordered_map``\ ","Kona","|Complete|",""
+"`2473 <https://wg21.link/LWG2473>`__","``basic_filebuf``\ 's relation to C ``FILE``\ semantics","Kona","|Complete|",""
+"`2476 <https://wg21.link/LWG2476>`__","``scoped_allocator_adaptor``\ is not assignable","Kona","|Complete|",""
+"`2477 <https://wg21.link/LWG2477>`__","Inconsistency of wordings in ``std::vector::erase()``\ and ``std::deque::erase()``\ ","Kona","|Complete|",""
+"`2483 <https://wg21.link/LWG2483>`__","``throw_with_nested()``\ should use ``is_final``\ ","Kona","|Complete|",""
+"`2484 <https://wg21.link/LWG2484>`__","``rethrow_if_nested()``\ is doubly unimplementable","Kona","|Complete|",""
+"`2485 <https://wg21.link/LWG2485>`__","``get()``\ should be overloaded for ``const tuple&&``\ ","Kona","|Complete|",""
+"`2486 <https://wg21.link/LWG2486>`__","``mem_fn()``\ should be required to use perfect forwarding","Kona","|Complete|",""
+"`2487 <https://wg21.link/LWG2487>`__","``bind()``\ should be ``const``\ -overloaded, not *cv*-overloaded","Kona","|Complete|",""
+"`2489 <https://wg21.link/LWG2489>`__","``mem_fn()``\ should be ``noexcept``\ ","Kona","|Complete|",""
+"`2492 <https://wg21.link/LWG2492>`__","Clarify requirements for ``comp``\ ","Kona","|Complete|",""
+"`2495 <https://wg21.link/LWG2495>`__","There is no such thing as an Exception Safety element","Kona","|Complete|",""
+"","","","",""
+"`2192 <https://wg21.link/LWG2192>`__","Validity and return type of ``std::abs(0u)``\ is unclear","Jacksonville","|Complete|",""
+"`2276 <https://wg21.link/LWG2276>`__","Missing requirement on ``std::promise::set_exception``\ ","Jacksonville","|Complete|",""
+"`2296 <https://wg21.link/LWG2296>`__","``std::addressof``\ should be ``constexpr``\ ","Jacksonville","|Complete|",""
+"`2450 <https://wg21.link/LWG2450>`__","``(greater|less|greater_equal|less_equal)<void>``\ do not yield a total order for pointers","Jacksonville","|Complete|",""
+"`2520 <https://wg21.link/LWG2520>`__","N4089 broke initializing ``unique_ptr<T[]>``\ from a ``nullptr``\ ","Jacksonville","|Complete|",""
+"`2522 <https://wg21.link/LWG2522>`__","[fund.ts.v2] Contradiction in ``set_default_resource``\ specification","Jacksonville","|Complete|",""
+"`2523 <https://wg21.link/LWG2523>`__","``std::promise``\ synopsis shows two ``set_value_at_thread_exit()``\ 's for no apparent reason","Jacksonville","|Complete|",""
+"`2537 <https://wg21.link/LWG2537>`__","Constructors for ``priority_queue``\ taking allocators should call ``make_heap``\ ","Jacksonville","|Complete|",""
+"`2539 <https://wg21.link/LWG2539>`__","[fund.ts.v2] ``invocation_trait``\ definition definition doesn't work for surrogate call functions","Jacksonville","",""
+"`2545 <https://wg21.link/LWG2545>`__","Simplify wording for ``bind``\ without explicitly specified return type","Jacksonville","|Complete|",""
+"`2557 <https://wg21.link/LWG2557>`__","Logical operator traits are broken in the zero-argument case","Jacksonville","|Complete|",""
+"`2558 <https://wg21.link/LWG2558>`__","[fund.ts.v2] Logical operator traits are broken in the zero-argument case","Jacksonville","|Complete|",""
+"`2559 <https://wg21.link/LWG2559>`__","Error in LWG 2234's resolution","Jacksonville","|Complete|",""
+"`2560 <https://wg21.link/LWG2560>`__","``is_constructible``\ underspecified when applied to a function type","Jacksonville","Broken in 3.6; See r261653.",""
+"`2565 <https://wg21.link/LWG2565>`__","``std::function``\ 's move constructor should guarantee nothrow for ``reference_wrapper``\ s and function pointers","Jacksonville","|Complete|",""
+"`2566 <https://wg21.link/LWG2566>`__","Requirements on the first template parameter of container adaptors","Jacksonville","|Complete|",""
+"`2571 <https://wg21.link/LWG2571>`__","|sect|\ [map.modifiers]/2 imposes nonsensical requirement on ``insert(InputIterator, InputIterator)``\ ","Jacksonville","|Complete|",""
+"`2572 <https://wg21.link/LWG2572>`__","The remarks for ``shared_ptr::operator*``\ should apply to *cv*-qualified ``void``\ as well","Jacksonville","|Complete|",""
+"`2574 <https://wg21.link/LWG2574>`__","[fund.ts.v2] ``std::experimental::function::operator=(F&&)``\ should be constrained","Jacksonville","|Complete|",""
+"`2575 <https://wg21.link/LWG2575>`__","[fund.ts.v2] ``experimental::function::assign``\ should be removed","Jacksonville","",""
+"`2576 <https://wg21.link/LWG2576>`__","``istream_iterator``\ and ``ostream_iterator``\ should use ``std::addressof``\ ","Jacksonville","|Complete|",""
+"`2577 <https://wg21.link/LWG2577>`__","``{shared,unique}_lock``\ should use ``std::addressof``\ ","Jacksonville","|Complete|",""
+"`2579 <https://wg21.link/LWG2579>`__","Inconsistency wrt Allocators in ``basic_string``\ assignment vs. ``basic_string::assign``\ ","Jacksonville","|Complete|",""
+"`2581 <https://wg21.link/LWG2581>`__","Specialization of ``<type_traits>``\ variable templates should be prohibited","Jacksonville","|Complete|",""
+"`2582 <https://wg21.link/LWG2582>`__","|sect|\ [res.on.functions]/2's prohibition against incomplete types shouldn't apply to type traits","Jacksonville","|Complete|",""
+"`2583 <https://wg21.link/LWG2583>`__","There is no way to supply an allocator for ``basic_string(str, pos)``\ ","Jacksonville","|Complete|",""
+"`2585 <https://wg21.link/LWG2585>`__","``forward_list::resize(size_type, const value_type&)``\ effects incorrect","Jacksonville","|Complete|",""
+"`2586 <https://wg21.link/LWG2586>`__","Wrong value category used in ``scoped_allocator_adaptor::construct()``\ ","Jacksonville","|Complete|",""
+"`2590 <https://wg21.link/LWG2590>`__","Aggregate initialization for ``std::array``\ ","Jacksonville","|Complete|",""
+"","","","",""
+"`2181 <https://wg21.link/LWG2181>`__","Exceptions from seed sequence operations","Oulu","|Complete|",""
+"`2309 <https://wg21.link/LWG2309>`__","mutex::lock() should not throw device_or_resource_busy","Oulu","|Complete|",""
+"`2310 <https://wg21.link/LWG2310>`__","Public exposition only member in std::array","Oulu","|Complete|",""
+"`2312 <https://wg21.link/LWG2312>`__","tuple's constructor constraints need to be phrased more precisely","Oulu","|Complete|",""
+"`2328 <https://wg21.link/LWG2328>`__","Rvalue stream extraction should use perfect forwarding","Oulu","|Complete|",""
+"`2393 <https://wg21.link/LWG2393>`__","std::function's Callable definition is broken","Oulu","|Complete|",""
+"`2422 <https://wg21.link/LWG2422>`__","``std::numeric_limits<T>::is_modulo``\ description: ""most machines"" errata","Oulu","|Complete|",""
+"`2426 <https://wg21.link/LWG2426>`__","Issue about compare_exchange","Oulu","",""
+"`2436 <https://wg21.link/LWG2436>`__","Comparators for associative containers should always be CopyConstructible","Oulu","|Complete|",""
+"`2441 <https://wg21.link/LWG2441>`__","Exact-width atomic typedefs should be provided","Oulu","|Complete|",""
+"`2451 <https://wg21.link/LWG2451>`__","[fund.ts.v2] optional should 'forward' T's implicit conversions","Oulu","|Nothing To Do|",""
+"`2509 <https://wg21.link/LWG2509>`__","[fund.ts.v2] any_cast doesn't work with rvalue reference targets and cannot move with a value target","Oulu","|Complete|",""
+"`2516 <https://wg21.link/LWG2516>`__","[fund.ts.v2] Public ""exposition only"" members in observer_ptr","Oulu","",""
+"`2542 <https://wg21.link/LWG2542>`__","Missing const requirements for associative containers","Oulu","",""
+"`2549 <https://wg21.link/LWG2549>`__","Tuple EXPLICIT constructor templates that take tuple parameters end up taking references to temporaries and will create dangling references","Oulu","|Complete|",""
+"`2550 <https://wg21.link/LWG2550>`__","Wording of unordered container's clear() method complexity","Oulu","|Complete|",""
+"`2551 <https://wg21.link/LWG2551>`__","[fund.ts.v2] ""Exception safety"" cleanup in library fundamentals required","Oulu","|Complete|",""
+"`2555 <https://wg21.link/LWG2555>`__","[fund.ts.v2] No handling for over-aligned types in optional","Oulu","|Complete|",""
+"`2573 <https://wg21.link/LWG2573>`__","[fund.ts.v2] std::hash<std::experimental::shared_ptr> does not work for arrays","Oulu","",""
+"`2596 <https://wg21.link/LWG2596>`__","vector::data() should use addressof","Oulu","|Complete|",""
+"`2667 <https://wg21.link/LWG2667>`__","path::root_directory() description is confusing","Oulu","|Complete|",""
+"`2669 <https://wg21.link/LWG2669>`__","recursive_directory_iterator effects refers to non-existent functions","Oulu","|Complete|",""
+"`2670 <https://wg21.link/LWG2670>`__","system_complete refers to undefined variable 'base'","Oulu","|Complete|",""
+"`2671 <https://wg21.link/LWG2671>`__","Errors in Copy","Oulu","|Complete|",""
+"`2673 <https://wg21.link/LWG2673>`__","status() effects cannot be implemented as specified","Oulu","|Complete|",""
+"`2674 <https://wg21.link/LWG2674>`__","Bidirectional iterator requirement on path::iterator is very expensive","Oulu","|Complete|",""
+"`2683 <https://wg21.link/LWG2683>`__","filesystem::copy() says ""no effects""","Oulu","|Complete|",""
+"`2684 <https://wg21.link/LWG2684>`__","priority_queue lacking comparator typedef","Oulu","|Complete|",""
+"`2685 <https://wg21.link/LWG2685>`__","shared_ptr deleters must not throw on move construction","Oulu","|Complete|",""
+"`2687 <https://wg21.link/LWG2687>`__","{inclusive,exclusive}_scan misspecified","Oulu","",""
+"`2688 <https://wg21.link/LWG2688>`__","clamp misses preconditions and has extraneous condition on result","Oulu","|Complete|",""
+"`2689 <https://wg21.link/LWG2689>`__","Parallel versions of std::copy and std::move shouldn't be in order","Oulu","",""
+"`2698 <https://wg21.link/LWG2698>`__","Effect of assign() on iterators/pointers/references","Oulu","|Complete|",""
+"`2704 <https://wg21.link/LWG2704>`__","recursive_directory_iterator's members should require '``*this`` is dereferenceable'","Oulu","|Complete|",""
+"`2706 <https://wg21.link/LWG2706>`__","Error reporting for recursive_directory_iterator::pop() is under-specified","Oulu","|Complete|",""
+"`2707 <https://wg21.link/LWG2707>`__","path construction and assignment should have ""string_type&&"" overloads","Oulu","|Complete|",""
+"`2709 <https://wg21.link/LWG2709>`__","offsetof is unnecessarily imprecise","Oulu","",""
+"`2710 <https://wg21.link/LWG2710>`__","""Effects: Equivalent to ..."" doesn't count ""Synchronization:"" as determined semantics","Oulu","|Complete|",""
+"`2711 <https://wg21.link/LWG2711>`__","path is convertible from approximately everything under the sun","Oulu","|Complete|",""
+"`2716 <https://wg21.link/LWG2716>`__","Specification of shuffle and sample disallows lvalue URNGs","Oulu","|Complete|",""
+"`2718 <https://wg21.link/LWG2718>`__","Parallelism bug in [algorithms.parallel.exec] p2","Oulu","",""
+"`2719 <https://wg21.link/LWG2719>`__","permissions function should not be noexcept due to narrow contract","Oulu","|Complete|",""
+"`2720 <https://wg21.link/LWG2720>`__","permissions function incorrectly specified for symlinks","Oulu","|Complete|",""
+"`2721 <https://wg21.link/LWG2721>`__","remove_all has incorrect post conditions","Oulu","|Complete|",""
+"`2723 <https://wg21.link/LWG2723>`__","Do directory_iterator and recursive_directory_iterator become the end iterator upon error?","Oulu","|Complete|",""
+"`2724 <https://wg21.link/LWG2724>`__","The protected virtual member functions of memory_resource should be private","Oulu","",""
+"`2725 <https://wg21.link/LWG2725>`__","filesystem::exists(const path&, error_code&) error reporting","Oulu","|Complete|",""
+"`2726 <https://wg21.link/LWG2726>`__","``[recursive_]directory_iterator::increment(error_code&)`` is underspecified","Oulu","|Complete|",""
+"`2727 <https://wg21.link/LWG2727>`__","Parallel algorithms with constexpr specifier","Oulu","",""
+"`2728 <https://wg21.link/LWG2728>`__","status(p).permissions() and symlink_status(p).permissions() are not specified","Oulu","|Complete|",""
+"","","","",""
+"`2062 <https://wg21.link/LWG2062>`__","Effect contradictions w/o no-throw guarantee of std::function swaps","Issaquah","|Complete|",""
+"`2166 <https://wg21.link/LWG2166>`__","Heap property underspecified?","Issaquah","",""
+"`2221 <https://wg21.link/LWG2221>`__","No formatted output operator for nullptr","Issaquah","|Complete|",""
+"`2223 <https://wg21.link/LWG2223>`__","shrink_to_fit effect on iterator validity","Issaquah","|Complete|",""
+"`2261 <https://wg21.link/LWG2261>`__","Are containers required to use their 'pointer' type internally?","Issaquah","",""
+"`2394 <https://wg21.link/LWG2394>`__","locale::name specification unclear - what is implementation-defined?","Issaquah","|Complete|",""
+"`2460 <https://wg21.link/LWG2460>`__","LWG issue 2408 and value categories","Issaquah","|Complete|",""
+"`2468 <https://wg21.link/LWG2468>`__","Self-move-assignment of library types","Issaquah","",""
+"`2475 <https://wg21.link/LWG2475>`__","Allow overwriting of std::basic_string terminator with charT() to allow cleaner interoperation with legacy APIs","Issaquah","|Complete|",""
+"`2503 <https://wg21.link/LWG2503>`__","multiline option should be added to syntax_option_type","Issaquah","|Complete|",""
+"`2510 <https://wg21.link/LWG2510>`__","Tag types should not be DefaultConstructible","Issaquah","|Complete|",""
+"`2514 <https://wg21.link/LWG2514>`__","Type traits must not be final","Issaquah","|Complete|",""
+"`2518 <https://wg21.link/LWG2518>`__","[fund.ts.v2] Non-member swap for propagate_const should call member swap","Issaquah","|Complete|",""
+"`2519 <https://wg21.link/LWG2519>`__","Iterator operator-= has gratuitous undefined behaviour","Issaquah","|Complete|",""
+"`2521 <https://wg21.link/LWG2521>`__","[fund.ts.v2] weak_ptr's converting move constructor should be modified as well for array support","Issaquah","",""
+"`2525 <https://wg21.link/LWG2525>`__","[fund.ts.v2] get_memory_resource should be const and noexcept","Issaquah","",""
+"`2527 <https://wg21.link/LWG2527>`__","[fund.ts.v2] ALLOCATOR_OF for function::operator= has incorrect default","Issaquah","",""
+"`2531 <https://wg21.link/LWG2531>`__","future::get should explicitly state that the shared state is released","Issaquah","",""
+"`2534 <https://wg21.link/LWG2534>`__","Constrain rvalue stream operators","Issaquah","|Complete|",""
+"`2536 <https://wg21.link/LWG2536>`__","What should <complex.h> do?","Issaquah","|Complete|",""
+"`2540 <https://wg21.link/LWG2540>`__","unordered_multimap::insert hint iterator","Issaquah","|Complete|",""
+"`2543 <https://wg21.link/LWG2543>`__","LWG 2148 (hash support for enum types) seems under-specified","Issaquah","|Complete|",""
+"`2544 <https://wg21.link/LWG2544>`__","``istreambuf_iterator(basic_streambuf<charT, traits>* s)``\ effects unclear when s is 0","Issaquah","|Complete|",""
+"`2556 <https://wg21.link/LWG2556>`__","Wide contract for future::share()","Issaquah","|Complete|",""
+"`2562 <https://wg21.link/LWG2562>`__","Consistent total ordering of pointers by comparison functors","Issaquah","",""
+"`2567 <https://wg21.link/LWG2567>`__","Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits","Issaquah","|Complete|",""
+"`2568 <https://wg21.link/LWG2568>`__","[fund.ts.v2] Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits","Issaquah","",""
+"`2569 <https://wg21.link/LWG2569>`__","conjunction and disjunction requirements are too strict","Issaquah","|Complete|",""
+"`2570 <https://wg21.link/LWG2570>`__","[fund.ts.v2] conjunction and disjunction requirements are too strict","Issaquah","",""
+"`2578 <https://wg21.link/LWG2578>`__","Iterator requirements should reference iterator traits","Issaquah","|Complete|",""
+"`2584 <https://wg21.link/LWG2584>`__","<regex> ECMAScript IdentityEscape is ambiguous","Issaquah","",""
+"`2587 <https://wg21.link/LWG2587>`__","""Convertible to bool"" requirement in conjunction and disjunction","Issaquah","Resolved by 2567",""
+"`2588 <https://wg21.link/LWG2588>`__","[fund.ts.v2] ""Convertible to bool"" requirement in conjunction and disjunction","Issaquah","",""
+"`2589 <https://wg21.link/LWG2589>`__","match_results can't satisfy the requirements of a container","Issaquah","|Complete|",""
+"`2591 <https://wg21.link/LWG2591>`__","std::function's member template target() should not lead to undefined behaviour","Issaquah","|Complete|",""
+"`2598 <https://wg21.link/LWG2598>`__","addressof works on temporaries","Issaquah","|Complete|",""
+"`2664 <https://wg21.link/LWG2664>`__","operator/ (and other append) semantics not useful if argument has root","Issaquah","|Complete|",""
+"`2665 <https://wg21.link/LWG2665>`__","remove_filename() post condition is incorrect","Issaquah","|Complete|",""
+"`2672 <https://wg21.link/LWG2672>`__","Should ``is_empty``\ use error_code in its specification?","Issaquah","|Complete|",""
+"`2678 <https://wg21.link/LWG2678>`__","std::filesystem enum classes overspecified","Issaquah","|Complete|",""
+"`2679 <https://wg21.link/LWG2679>`__","Inconsistent Use of Effects and Equivalent To","Issaquah","|Complete|",""
+"`2680 <https://wg21.link/LWG2680>`__","Add ""Equivalent to"" to filesystem","Issaquah","|Complete|",""
+"`2681 <https://wg21.link/LWG2681>`__","filesystem::copy() cannot copy symlinks","Issaquah","|Complete|",""
+"`2682 <https://wg21.link/LWG2682>`__","filesystem::copy() won't create a symlink to a directory","Issaquah","|Complete|",""
+"`2686 <https://wg21.link/LWG2686>`__","Why is std::hash specialized for error_code, but not error_condition?","Issaquah","|Complete|",""
+"`2694 <https://wg21.link/LWG2694>`__","Application of LWG 436 accidentally deleted definition of ""facet""","Issaquah","|Complete|",""
+"`2696 <https://wg21.link/LWG2696>`__","Interaction between make_shared and enable_shared_from_this is underspecified","Issaquah","|Nothing To Do|",""
+"`2699 <https://wg21.link/LWG2699>`__","Missing restriction in [numeric.requirements]","Issaquah","|Complete|",""
+"`2712 <https://wg21.link/LWG2712>`__","copy_file(from, to, ...) has a number of unspecified error conditions","Issaquah","|Complete|",""
+"`2722 <https://wg21.link/LWG2722>`__","equivalent incorrectly specifies throws clause","Issaquah","|Complete|",""
+"`2729 <https://wg21.link/LWG2729>`__","Missing SFINAE on std::pair::operator=","Issaquah","|Complete|",""
+"`2732 <https://wg21.link/LWG2732>`__","Questionable specification of path::operator/= and path::append","Issaquah","|Complete|",""
+"`2733 <https://wg21.link/LWG2733>`__","[fund.ts.v2] gcd / lcm and bool","Issaquah","|Complete|",""
+"`2735 <https://wg21.link/LWG2735>`__","std::abs(short), std::abs(signed char) and others should return int instead of double in order to be compatible with C++98 and C","Issaquah","|Complete|",""
+"`2736 <https://wg21.link/LWG2736>`__","nullopt_t insufficiently constrained","Issaquah","|Complete|",""
+"`2738 <https://wg21.link/LWG2738>`__","``is_constructible``\ with void types","Issaquah","|Complete|",""
+"`2739 <https://wg21.link/LWG2739>`__","Issue with time_point non-member subtraction with an unsigned duration","Issaquah","|Complete|",""
+"`2740 <https://wg21.link/LWG2740>`__","constexpr optional<T>::operator->","Issaquah","|Complete|",""
+"`2742 <https://wg21.link/LWG2742>`__","Inconsistent string interface taking string_view","Issaquah","|Complete|",""
+"`2744 <https://wg21.link/LWG2744>`__","any's in_place constructors","Issaquah","|Complete|",""
+"`2745 <https://wg21.link/LWG2745>`__","[fund.ts.v2] Implementability of LWG 2451","Issaquah","|Complete|",""
+"`2747 <https://wg21.link/LWG2747>`__","Possibly redundant std::move in [alg.foreach]","Issaquah","|Complete|",""
+"`2748 <https://wg21.link/LWG2748>`__","swappable traits for optionals","Issaquah","|Complete|",""
+"`2749 <https://wg21.link/LWG2749>`__","swappable traits for variants","Issaquah","|Complete|",""
+"`2750 <https://wg21.link/LWG2750>`__","[fund.ts.v2] LWG 2451 conversion constructor constraint","Issaquah","|Nothing To Do|",""
+"`2752 <https://wg21.link/LWG2752>`__","""Throws:"" clauses of async and packaged_task are unimplementable","Issaquah","",""
+"`2755 <https://wg21.link/LWG2755>`__","[string.view.io] uses non-existent basic_string_view::to_string function","Issaquah","|Complete|",""
+"`2756 <https://wg21.link/LWG2756>`__","C++ WP optional<T> should 'forward' T's implicit conversions","Issaquah","|Complete|",""
+"`2758 <https://wg21.link/LWG2758>`__","std::string{}.assign(""ABCDE"", 0, 1) is ambiguous","Issaquah","|Complete|",""
+"`2759 <https://wg21.link/LWG2759>`__","gcd / lcm and bool for the WP","Issaquah","|Complete|",""
+"`2760 <https://wg21.link/LWG2760>`__","non-const basic_string::data should not invalidate iterators","Issaquah","|Complete|",""
+"`2765 <https://wg21.link/LWG2765>`__","Did LWG 1123 go too far?","Issaquah","|Complete|",""
+"`2767 <https://wg21.link/LWG2767>`__","not_fn call_wrapper can form invalid types","Issaquah","|Complete|",""
+"`2769 <https://wg21.link/LWG2769>`__","Redundant const in the return type of any_cast(const any&)","Issaquah","|Complete|",""
+"`2771 <https://wg21.link/LWG2771>`__","Broken Effects of some basic_string::compare functions in terms of basic_string_view","Issaquah","|Complete|",""
+"`2773 <https://wg21.link/LWG2773>`__","Making std::ignore constexpr","Issaquah","|Complete|",""
+"`2777 <https://wg21.link/LWG2777>`__","basic_string_view::copy should use char_traits::copy","Issaquah","|Complete|",""
+"`2778 <https://wg21.link/LWG2778>`__","basic_string_view is missing constexpr","Issaquah","|Complete|",""
+"","","","",""
+"`2260 <https://wg21.link/LWG2260>`__","Missing requirement for Allocator::pointer","Kona","|Complete|",""
+"`2676 <https://wg21.link/LWG2676>`__","Provide filesystem::path overloads for File-based streams","Kona","|Complete|",""
+"`2768 <https://wg21.link/LWG2768>`__","any_cast and move semantics","Kona","|Complete|",""
+"`2769 <https://wg21.link/LWG2769>`__","Redundant const in the return type of any_cast(const any&)","Kona","|Complete|",""
+"`2781 <https://wg21.link/LWG2781>`__","Contradictory requirements for std::function and std::reference_wrapper","Kona","|Complete|",""
+"`2782 <https://wg21.link/LWG2782>`__","scoped_allocator_adaptor constructors must be constrained","Kona","|Complete|",""
+"`2784 <https://wg21.link/LWG2784>`__","Resolution to LWG 2484 is missing ""otherwise, no effects"" and is hard to parse","Kona","|Complete|",""
+"`2785 <https://wg21.link/LWG2785>`__","quoted should work with basic_string_view","Kona","|Complete|",""
+"`2786 <https://wg21.link/LWG2786>`__","Annex C should mention shared_ptr changes for array support","Kona","|Complete|",""
+"`2787 <https://wg21.link/LWG2787>`__","|sect|\ [file_status.cons] doesn't match class definition","Kona","|Complete|",""
+"`2788 <https://wg21.link/LWG2788>`__","basic_string range mutators unintentionally require a default constructible allocator","Kona","|Complete|",""
+"`2789 <https://wg21.link/LWG2789>`__","Equivalence of contained objects","Kona","|Complete|",""
+"`2790 <https://wg21.link/LWG2790>`__","Missing specification of istreambuf_iterator::operator->","Kona","|Complete|",""
+"`2794 <https://wg21.link/LWG2794>`__","Missing requirements for allocator pointers","Kona","|Nothing To Do|",""
+"`2795 <https://wg21.link/LWG2795>`__","|sect|\ [global.functions] provides incorrect example of ADL use","Kona","|Complete|",""
+"`2796 <https://wg21.link/LWG2796>`__","tuple should be a literal type","Kona","|Complete|",""
+"`2801 <https://wg21.link/LWG2801>`__","Default-constructibility of unique_ptr","Kona","|Complete|",""
+"`2802 <https://wg21.link/LWG2802>`__","shared_ptr constructor requirements for a deleter","Kona","|Complete|",""
+"`2804 <https://wg21.link/LWG2804>`__","Unconditional constexpr default constructor for istream_iterator","Kona","|Complete|",""
+"`2806 <https://wg21.link/LWG2806>`__","Base class of bad_optional_access","Kona","|Complete|",""
+"`2807 <https://wg21.link/LWG2807>`__","std::invoke should use ``std::is_nothrow_callable``\ ","Kona","|Complete|",""
+"`2812 <https://wg21.link/LWG2812>`__","Range access is available with <string_view>","Kona","|Complete|",""
+"`2824 <https://wg21.link/LWG2824>`__","list::sort should say that the order of elements is unspecified if an exception is thrown","Kona","|Complete|",""
+"`2826 <https://wg21.link/LWG2826>`__","string_view iterators use old wording","Kona","|Complete|",""
+"`2834 <https://wg21.link/LWG2834>`__","Resolution LWG 2223 is missing wording about end iterators","Kona","|Complete|",""
+"`2835 <https://wg21.link/LWG2835>`__","LWG 2536 seems to misspecify <tgmath.h>","Kona","|Complete|",""
+"`2837 <https://wg21.link/LWG2837>`__","gcd and lcm should support a wider range of input values","Kona","|Complete|",""
+"`2838 <https://wg21.link/LWG2838>`__","is_literal_type specification needs a little cleanup","Kona","|Complete|",""
+"`2842 <https://wg21.link/LWG2842>`__","in_place_t check for optional::optional(U&&) should decay U","Kona","|Complete|",""
+"`2850 <https://wg21.link/LWG2850>`__","std::function move constructor does unnecessary work","Kona","|Complete|",""
+"`2853 <https://wg21.link/LWG2853>`__","Possible inconsistency in specification of erase in [vector.modifiers]","Kona","|Complete|",""
+"`2855 <https://wg21.link/LWG2855>`__","std::throw_with_nested(""string_literal"")","Kona","|Complete|",""
+"`2857 <https://wg21.link/LWG2857>`__","{variant,optional,any}::emplace should return the constructed value","Kona","|Complete|",""
+"`2861 <https://wg21.link/LWG2861>`__","basic_string should require that charT match traits::char_type","Kona","|Complete|",""
+"`2866 <https://wg21.link/LWG2866>`__","Incorrect derived classes constraints","Kona","|Nothing To Do|",""
+"`2868 <https://wg21.link/LWG2868>`__","Missing specification of bad_any_cast::what()","Kona","|Complete|",""
+"`2872 <https://wg21.link/LWG2872>`__","Add definition for direct-non-list-initialization","Kona","|Complete|",""
+"`2873 <https://wg21.link/LWG2873>`__","Add noexcept to several shared_ptr related functions","Kona","|Complete|",""
+"`2874 <https://wg21.link/LWG2874>`__","Constructor ``shared_ptr::shared_ptr(Y*)``\ should be constrained","Kona","|Complete|","13.0"
+"`2875 <https://wg21.link/LWG2875>`__","shared_ptr::shared_ptr(Y\*, D, [|hellip|\ ]) constructors should be constrained","Kona","|Complete|",""
+"`2876 <https://wg21.link/LWG2876>`__","``shared_ptr::shared_ptr(const weak_ptr<Y>&)``\ constructor should be constrained","Kona","",""
+"`2878 <https://wg21.link/LWG2878>`__","Missing DefaultConstructible requirement for istream_iterator default constructor","Kona","|Complete|",""
+"`2890 <https://wg21.link/LWG2890>`__","The definition of 'object state' applies only to class types","Kona","|Complete|",""
+"`2900 <https://wg21.link/LWG2900>`__","The copy and move constructors of optional are not constexpr","Kona","|Complete|",""
+"`2903 <https://wg21.link/LWG2903>`__","The form of initialization for the emplace-constructors is not specified","Kona","|Complete|",""
+"`2904 <https://wg21.link/LWG2904>`__","Make variant move-assignment more exception safe","Kona","|Complete|",""
+"`2905 <https://wg21.link/LWG2905>`__","is_constructible_v<unique_ptr<P, D>, P, D const &> should be false when D is not copy constructible","Kona","|Complete|",""
+"`2908 <https://wg21.link/LWG2908>`__","The less-than operator for shared pointers could do more","Kona","|Complete|",""
+"`2911 <https://wg21.link/LWG2911>`__","An is_aggregate type trait is needed","Kona","|Complete|",""
+"`2921 <https://wg21.link/LWG2921>`__","packaged_task and type-erased allocators","Kona","|Complete|",""
+"`2934 <https://wg21.link/LWG2934>`__","optional<const T> doesn't compare with T","Kona","|Complete|",""
+"","","","",""
+"`2901 <https://wg21.link/LWG2901>`__","Variants cannot properly support allocators","Toronto","|Complete|",""
+"`2955 <https://wg21.link/LWG2955>`__","``to_chars / from_chars``\ depend on ``std::string``\ ","Toronto","Resolved by `P0682R1 <https://wg21.link/P0682R1>`__",""
+"`2956 <https://wg21.link/LWG2956>`__","``filesystem::canonical()``\ still defined in terms of ``absolute(p, base)``\ ","Toronto","|Complete|",""
--- /dev/null
+"Paper #","Group","Paper Name","Meeting","Status","First released version"
+"`N3911 <https://wg21.link/n3911>`__","LWG","TransformationTrait Alias ``void_t``\ .","Urbana","|Complete|","3.6"
+"`N4089 <https://wg21.link/n4089>`__","LWG","Safe conversions in ``unique_ptr<T[]>``\ .","Urbana","|In Progress|","3.9"
+"`N4169 <https://wg21.link/n4169>`__","LWG","A proposal to add invoke function template","Urbana","|Complete|","3.7"
+"`N4190 <https://wg21.link/n4190>`__","LWG","Removing auto_ptr, random_shuffle(), And Old <functional> Stuff.","Urbana","|In Progress|",""
+"`N4258 <https://wg21.link/n4258>`__","LWG","Cleaning-up noexcept in the Library.","Urbana","|In Progress|","3.7"
+"`N4259 <https://wg21.link/n4259>`__","CWG","Wording for std::uncaught_exceptions","Urbana","|Complete|","3.7"
+"`N4277 <https://wg21.link/n4277>`__","LWG","TriviallyCopyable ``reference_wrapper``\ .","Urbana","|Complete|","3.2"
+"`N4279 <https://wg21.link/n4279>`__","LWG","Improved insertion interface for unique-key maps.","Urbana","|Complete|","3.7"
+"`N4280 <https://wg21.link/n4280>`__","LWG","Non-member size() and more","Urbana","|Complete|","3.6"
+"`N4284 <https://wg21.link/n4284>`__","LWG","Contiguous Iterators.","Urbana","|Complete|","3.6"
+"`N4285 <https://wg21.link/n4285>`__","CWG","Cleanup for exception-specification and throw-expression.","Urbana","|Complete|","4.0"
+"","","","","",""
+"`N4387 <https://wg21.link/n4387>`__","LWG","improving pair and tuple","Lenexa","|Complete|","4.0"
+"`N4389 <https://wg21.link/n4389>`__","LWG","bool_constant","Lenexa","|Complete|","3.7"
+"`N4508 <https://wg21.link/n4508>`__","LWG","shared_mutex for C++17","Lenexa","|Complete|","3.7"
+"`N4366 <https://wg21.link/n4366>`__","LWG","LWG 2228 missing SFINAE rule","Lenexa","|Complete|","3.1"
+"`N4510 <https://wg21.link/n4510>`__","LWG","Minimal incomplete type support for standard containers, revision 4","Lenexa","|Complete|","3.6"
+"","","","","",""
+"`P0004R1 <https://wg21.link/p0004r1>`__","LWG","Remove Deprecated iostreams aliases.","Kona","|Complete|","3.8"
+"`P0006R0 <https://wg21.link/p0006r0>`__","LWG","Adopt Type Traits Variable Templates for C++17.","Kona","|Complete|","3.8"
+"`P0092R1 <https://wg21.link/p0092r1>`__","LWG","Polishing <chrono>","Kona","|Complete|","3.8"
+"`P0007R1 <https://wg21.link/p0007r1>`__","LWG","Constant View: A proposal for a ``std::as_const``\ helper function template.","Kona","|Complete|","3.8"
+"`P0156R0 <https://wg21.link/p0156r0>`__","LWG","Variadic lock_guard(rev 3).","Kona","*Reverted in Kona*","3.9"
+"`P0074R0 <https://wg21.link/p0074r0>`__","LWG","Making ``std::owner_less``\ more flexible","Kona","|Complete|","3.8"
+"`P0013R1 <https://wg21.link/p0013r1>`__","LWG","Logical type traits rev 2","Kona","|Complete|","3.8"
+"","","","","",""
+"`P0024R2 <https://wg21.link/P0024R2>`__","LWG","The Parallelism TS Should be Standardized","Jacksonville","",""
+"`P0226R1 <https://wg21.link/P0226R1>`__","LWG","Mathematical Special Functions for C++17","Jacksonville","",""
+"`P0220R1 <https://wg21.link/P0220R1>`__","LWG","Adopt Library Fundamentals V1 TS Components for C++17","Jacksonville","|In Progress|",""
+"`P0218R1 <https://wg21.link/P0218R1>`__","LWG","Adopt the File System TS for C++17","Jacksonville","|Complete|","7.0"
+"`P0033R1 <https://wg21.link/P0033R1>`__","LWG","Re-enabling shared_from_this","Jacksonville","|Complete|","3.9"
+"`P0005R4 <https://wg21.link/P0005R4>`__","LWG","Adopt not_fn from Library Fundamentals 2 for C++17","Jacksonville","|Complete|","3.9"
+"`P0152R1 <https://wg21.link/P0152R1>`__","LWG","constexpr ``atomic::is_always_lock_free``\ ","Jacksonville","|Complete|","3.9"
+"`P0185R1 <https://wg21.link/P0185R1>`__","LWG","Adding [nothrow-]swappable traits","Jacksonville","|Complete|","3.9"
+"`P0253R1 <https://wg21.link/P0253R1>`__","LWG","Fixing a design mistake in the searchers interface","Jacksonville","|Complete|","3.9"
+"`P0025R0 <https://wg21.link/P0025R0>`__","LWG","An algorithm to ""clamp"" a value between a pair of boundary values","Jacksonville","|Complete|","3.9"
+"`P0154R1 <https://wg21.link/P0154R1>`__","LWG","constexpr std::hardware_{constructive,destructive}_interference_size","Jacksonville","",""
+"`P0030R1 <https://wg21.link/P0030R1>`__","LWG","Proposal to Introduce a 3-Argument Overload to std::hypot","Jacksonville","|Complete|","3.9"
+"`P0031R0 <https://wg21.link/P0031R0>`__","LWG","A Proposal to Add Constexpr Modifiers to reverse_iterator, move_iterator, array and Range Access","Jacksonville","|Complete|","4.0"
+"`P0272R1 <https://wg21.link/P0272R1>`__","LWG","Give ``std::string``\ a non-const ``.data()``\ member function","Jacksonville","|Complete|","3.9"
+"`P0077R2 <https://wg21.link/P0077R2>`__","LWG","``is_callable``\ , the missing INVOKE related trait","Jacksonville","|Complete|","3.9"
+"","","","","",""
+"`p0032r3 <https://wg21.link/p0032r3>`__","LWG","Homogeneous interface for variant, any and optional","Oulu","|Complete|","4.0"
+"`p0040r3 <https://wg21.link/p0040r3>`__","LWG","Extending memory management tools","Oulu","|Complete|","4.0"
+"`p0063r3 <https://wg21.link/p0063r3>`__","LWG","C++17 should refer to C11 instead of C99","Oulu","|Complete|","7.0"
+"`p0067r3 <https://wg21.link/p0067r3>`__","LWG","Elementary string conversions","Oulu","Now `P0067R5 <https://wg21.link/P0067R5>`__","n/a"
+"`p0083r3 <https://wg21.link/p0083r3>`__","LWG","Splicing Maps and Sets","Oulu","|Complete|","8.0"
+"`p0084r2 <https://wg21.link/p0084r2>`__","LWG","Emplace Return Type","Oulu","|Complete|","4.0"
+"`p0088r3 <https://wg21.link/p0088r3>`__","LWG","Variant: a type-safe union for C++17","Oulu","|Complete|","4.0"
+"`p0137r1 <https://wg21.link/p0137r1>`__","CWG","Core Issue 1776: Replacement of class objects containing reference members","Oulu","|Complete|","6.0"
+"`p0163r0 <https://wg21.link/p0163r0>`__","LWG","shared_ptr::weak_type","Oulu","|Complete|","3.9"
+"`p0174r2 <https://wg21.link/p0174r2>`__","LWG","Deprecating Vestigial Library Parts in C++17","Oulu","|Partial|",""
+"`p0175r1 <https://wg21.link/p0175r1>`__","LWG","Synopses for the C library","Oulu","",""
+"`p0180r2 <https://wg21.link/p0180r2>`__","LWG","Reserve a New Library Namespace for Future Standardization","Oulu","|Nothing To Do|","n/a"
+"`p0181r1 <https://wg21.link/p0181r1>`__","LWG","Ordered by Default","Oulu","*Removed in Kona*","n/a"
+"`p0209r2 <https://wg21.link/p0209r2>`__","LWG","make_from_tuple: apply for construction","Oulu","|Complete|","3.9"
+"`p0219r1 <https://wg21.link/p0219r1>`__","LWG","Relative Paths for Filesystem","Oulu","|Complete|","7.0"
+"`p0254r2 <https://wg21.link/p0254r2>`__","LWG","Integrating std::string_view and std::string","Oulu","|Complete|","4.0"
+"`p0258r2 <https://wg21.link/p0258r2>`__","LWG","has_unique_object_representations","Oulu","|Complete|","6.0"
+"`p0295r0 <https://wg21.link/p0295r0>`__","LWG","Adopt Selected Library Fundamentals V2 Components for C++17","Oulu","|Complete|","4.0"
+"`p0302r1 <https://wg21.link/p0302r1>`__","LWG","Removing Allocator Support in std::function","Oulu","|Complete|","4.0"
+"`p0307r2 <https://wg21.link/p0307r2>`__","LWG","Making Optional Greater Equal Again","Oulu","|Complete|","4.0"
+"`p0336r1 <https://wg21.link/p0336r1>`__","LWG","Better Names for Parallel Execution Policies in C++17","Oulu","",""
+"`p0337r0 <https://wg21.link/p0337r0>`__","LWG","Delete ``operator=``\ for polymorphic_allocator","Oulu","|Complete|","3.9"
+"`p0346r1 <https://wg21.link/p0346r1>`__","LWG","A <random> Nomenclature Tweak","Oulu","|Complete|","3.9"
+"`p0358r1 <https://wg21.link/p0358r1>`__","LWG","Fixes for not_fn","Oulu","|Complete|","3.9"
+"`p0371r1 <https://wg21.link/p0371r1>`__","LWG","Temporarily discourage memory_order_consume","Oulu","|Nothing To Do|","n/a"
+"`p0392r0 <https://wg21.link/p0392r0>`__","LWG","Adapting string_view by filesystem paths","Oulu","|Complete|","4.0"
+"`p0393r3 <https://wg21.link/p0393r3>`__","LWG","Making Variant Greater Equal","Oulu","|Complete|","4.0"
+"`P0394r4 <https://wg21.link/P0394r4>`__","LWG","Hotel Parallelifornia: terminate() for Parallel Algorithms Exception Handling","Oulu","",""
+"","","","","",""
+"`P0003R5 <https://wg21.link/P0003R5>`__","LWG","Removing Deprecated Exception Specifications from C++17","Issaquah","|Complete|","5.0"
+"`P0067R5 <https://wg21.link/P0067R5>`__","LWG","Elementary string conversions, revision 5","Issaquah","|Partial|",""
+"`P0403R1 <https://wg21.link/P0403R1>`__","LWG","Literal suffixes for ``basic_string_view``\ ","Issaquah","|Complete|","4.0"
+"`P0414R2 <https://wg21.link/P0414R2>`__","LWG","Merging shared_ptr changes from Library Fundamentals to C++17","Issaquah","|Complete|","11.0"
+"`P0418R2 <https://wg21.link/P0418R2>`__","LWG","Fail or succeed: there is no atomic lattice","Issaquah","",""
+"`P0426R1 <https://wg21.link/P0426R1>`__","LWG","Constexpr for ``std::char_traits``\ ","Issaquah","|Complete|","4.0"
+"`P0435R1 <https://wg21.link/P0435R1>`__","LWG","Resolving LWG Issues re ``common_type``\ ","Issaquah","|Complete|","4.0"
+"`P0502R0 <https://wg21.link/P0502R0>`__","LWG","Throwing out of a parallel algorithm terminates - but how?","Issaquah","",""
+"`P0503R0 <https://wg21.link/P0503R0>`__","LWG","Correcting library usage of ""literal type""","Issaquah","|Complete|","4.0"
+"`P0504R0 <https://wg21.link/P0504R0>`__","LWG","Revisiting in-place tag types for any/optional/variant","Issaquah","|Complete|","4.0"
+"`P0505R0 <https://wg21.link/P0505R0>`__","LWG","Wording for GB 50 - constexpr for chrono","Issaquah","|Complete|","4.0"
+"`P0508R0 <https://wg21.link/P0508R0>`__","LWG","Wording for GB 58 - structured bindings for node_handles","Issaquah","",""
+"`P0509R1 <https://wg21.link/P0509R1>`__","LWG","Updating ""Restrictions on exception handling""","Issaquah","|Nothing To Do|","n/a"
+"`P0510R0 <https://wg21.link/P0510R0>`__","LWG","Disallowing references, incomplete types, arrays, and empty variants","Issaquah","|Complete|","4.0"
+"`P0513R0 <https://wg21.link/P0513R0>`__","LWG","Poisoning the Hash","Issaquah","|Complete|","5.0"
+"`P0516R0 <https://wg21.link/P0516R0>`__","LWG","Clarify That shared_future's Copy Operations have Wide Contracts","Issaquah","|Complete|","4.0"
+"`P0517R0 <https://wg21.link/P0517R0>`__","LWG","Make future_error Constructible","Issaquah","|Complete|","4.0"
+"`P0521R0 <https://wg21.link/P0521R0>`__","LWG","Proposed Resolution for CA 14 (shared_ptr use_count/unique)","Issaquah","|Nothing To Do|","n/a"
+"","","","","",""
+"`P0156R2 <https://wg21.link/P0156R2>`__","LWG","Variadic Lock guard(rev 5)","Kona","|Complete|","5.0"
+"`P0270R3 <https://wg21.link/P0270R3>`__","CWG","Removing C dependencies from signal handler wording","Kona","",""
+"`P0298R3 <https://wg21.link/P0298R3>`__","CWG","A byte type definition","Kona","|Complete|","5.0"
+"`P0317R1 <https://wg21.link/P0317R1>`__","LWG","Directory Entry Caching for Filesystem","Kona","|Complete|","7.0"
+"`P0430R2 <https://wg21.link/P0430R2>`__","LWG","File system library on non-POSIX-like operating systems","Kona","|Complete|","7.0"
+"`P0433R2 <https://wg21.link/P0433R2>`__","LWG","Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library","Kona","|In Progress| [#note-P0433]_","7.0"
+"`P0452R1 <https://wg21.link/P0452R1>`__","LWG","Unifying <numeric> Parallel Algorithms","Kona","",""
+"`P0467R2 <https://wg21.link/P0467R2>`__","LWG","Iterator Concerns for Parallel Algorithms","Kona","",""
+"`P0492R2 <https://wg21.link/P0492R2>`__","LWG","Proposed Resolution of C++17 National Body Comments for Filesystems","Kona","|Complete|","7.0"
+"`P0518R1 <https://wg21.link/P0518R1>`__","LWG","Allowing copies as arguments to function objects given to parallel algorithms in response to CH11","Kona","",""
+"`P0523R1 <https://wg21.link/P0523R1>`__","LWG","Wording for CH 10: Complexity of parallel algorithms","Kona","",""
+"`P0548R1 <https://wg21.link/P0548R1>`__","LWG","common_type and duration","Kona","|Complete|","5.0"
+"`P0558R1 <https://wg21.link/P0558R1>`__","LWG","Resolving atomic<T> named base class inconsistencies","Kona","",""
+"`P0574R1 <https://wg21.link/P0574R1>`__","LWG","Algorithm Complexity Constraints and Parallel Overloads","Kona","",""
+"`P0599R1 <https://wg21.link/P0599R1>`__","LWG","noexcept for hash functions","Kona","|Complete|","5.0"
+"`P0604R0 <https://wg21.link/P0604R0>`__","LWG","Resolving GB 55, US 84, US 85, US 86","Kona","|Complete|",""
+"`P0607R0 <https://wg21.link/P0607R0>`__","LWG","Inline Variables for the Standard Library","Kona","|In Progress| [#note-P0607]_","6.0"
+"`P0618R0 <https://wg21.link/P0618R0>`__","LWG","Deprecating <codecvt>","Kona","",""
+"`P0623R0 <https://wg21.link/P0623R0>`__","LWG","Final C++17 Parallel Algorithms Fixes","Kona","",""
+"","","","","",""
+"`P0682R1 <https://wg21.link/P0682R1>`__","LWG","Repairing elementary string conversions","Toronto","",""
+"`P0739R0 <https://wg21.link/P0739R0>`__","LWG","Some improvements to class template argument deduction integration into the standard library","Toronto","|Complete|","5.0"
--- /dev/null
+.. _cxx20-status:\r
+\r
+================================\r
+libc++ C++20 Status\r
+================================\r
+\r
+.. include:: ../Helpers/Styles.rst\r
+\r
+.. contents::\r
+ :local:\r
+\r
+\r
+Overview\r
+================================\r
+\r
+In July 2017, the C++ standard committee created a draft for the next version of the C++ standard, initially known as "C++2a".\r
+In September 2020, the C++ standard committee approved this draft, and sent it to ISO for approval as C++20.\r
+\r
+This page shows the status of libc++; the status of clang's support of the language features is `here <https://clang.llvm.org/cxx_status.html#cxx20>`__.\r
+\r
+.. attention:: Features in unreleased drafts of the standard are subject to change.\r
+\r
+The groups that have contributed papers:\r
+\r
+- CWG - Core Language Working group\r
+- LWG - Library working group\r
+- SG1 - Study group #1 (Concurrency working group)\r
+\r
+.. note:: "Nothing to do" means that no library changes were needed to implement this change.\r
+\r
+.. _paper-status-cxx20:\r
+\r
+Paper Status\r
+====================================\r
+\r
+.. csv-table::\r
+ :file: Cxx20Papers.csv\r
+ :header-rows: 1\r
+ :widths: auto\r
+\r
+.. note::\r
+\r
+ .. [#note-P0600] P0600: The missing bits in P0600 are in |sect|\ [mem.res.class], |sect|\ [mem.poly.allocator.class], and |sect|\ [container.node.overview].\r
+ .. [#note-P0966] P0966: It was previously erroneously marked as complete in version 8.0. See `bug 45368 <https://llvm.org/PR45368>`__.\r
+ .. [#note-P0619] P0619: Only sections D.8, D.9, D.10 and D.13 are implemented. Sections D.4, D.7, D.11, D.12, and D.14 remain undone.\r
+ .. [#note-P0883] P0883: shared_ptr and floating-point changes weren't applied as they themselves aren't implemented yet.\r
+\r
+\r
+.. _issues-status-cxx20:\r
+\r
+Library Working Group Issues Status\r
+====================================\r
+\r
+.. csv-table::\r
+ :file: Cxx20Issues.csv\r
+ :header-rows: 1\r
+ :widths: auto\r
+\r
+Last Updated: 24-May-2021\r
--- /dev/null
+"Issue #","Issue Name","Meeting","Status","First released version"
+"`2070 <https://wg21.link/LWG2070>`__","``allocate_shared``\ should use ``allocator_traits<A>::construct``\ ","Toronto","Resolved by `P0674R1 <https://wg21.link/P0674R1>`__",""
+"`2444 <https://wg21.link/LWG2444>`__","Inconsistent complexity for ``std::sort_heap``\ ","Toronto","",""
+"`2593 <https://wg21.link/LWG2593>`__","Moved-from state of Allocators","Toronto","",""
+"`2597 <https://wg21.link/LWG2597>`__","``std::log``\ misspecified for complex numbers","Toronto","",""
+"`2783 <https://wg21.link/LWG2783>`__","``stack::emplace()``\ and ``queue::emplace()``\ should return ``decltype(auto)``\ ","Toronto","|Complete|",""
+"`2932 <https://wg21.link/LWG2932>`__","Constraints on parallel algorithm implementations are underspecified","Toronto","",""
+"`2937 <https://wg21.link/LWG2937>`__","Is ``equivalent(""existing_thing"", ""not_existing_thing"")``\ an error","Toronto","|Complete|",""
+"`2940 <https://wg21.link/LWG2940>`__","``result_of``\ specification also needs a little cleanup","Toronto","",""
+"`2942 <https://wg21.link/LWG2942>`__","LWG 2873's resolution missed ``weak_ptr::owner_before``\ ","Toronto","|Complete|",""
+"`2954 <https://wg21.link/LWG2954>`__","Specialization of the convenience variable templates should be prohibited","Toronto","|Complete|",""
+"`2961 <https://wg21.link/LWG2961>`__","Bad postcondition for ``set_default_resource``\ ","Toronto","",""
+"`2966 <https://wg21.link/LWG2966>`__","Incomplete resolution of US 74","Toronto","|Nothing To Do|",""
+"`2974 <https://wg21.link/LWG2974>`__","Diagnose out of bounds ``tuple_element/variant_alternative``\ ","Toronto","|Complete|",""
+"","","","",""
+"`2779 <https://wg21.link/LWG2779>`__","[networking.ts] Relax requirements on buffer sequence iterators","Albuquerque","",""
+"`2870 <https://wg21.link/LWG2870>`__","Default value of parameter theta of polar should be dependent","Albuquerque","|Complete|",""
+"`2935 <https://wg21.link/LWG2935>`__","What should create_directories do when p already exists but is not a directory?","Albuquerque","|Nothing To Do|",""
+"`2941 <https://wg21.link/LWG2941>`__","[thread.req.timing] wording should apply to both member and namespace-level functions","Albuquerque","|Nothing To Do|",""
+"`2944 <https://wg21.link/LWG2944>`__","LWG 2905 accidentally removed requirement that construction of the deleter doesn't throw an exception","Albuquerque","|Nothing To Do|",""
+"`2945 <https://wg21.link/LWG2945>`__","Order of template parameters in optional comparisons","Albuquerque","|Complete|",""
+"`2948 <https://wg21.link/LWG2948>`__","unique_ptr does not define operator<< for stream output","Albuquerque","|Complete|",""
+"`2950 <https://wg21.link/LWG2950>`__","std::byte operations are misspecified","Albuquerque","|Complete|",""
+"`2952 <https://wg21.link/LWG2952>`__","iterator_traits should work for pointers to cv T","Albuquerque","|Complete|",""
+"`2953 <https://wg21.link/LWG2953>`__","LWG 2853 should apply to deque::erase too","Albuquerque","|Complete|",""
+"`2958 <https://wg21.link/LWG2958>`__","Moves improperly defined as deleted","Albuquerque","*We already do this*",""
+"`2964 <https://wg21.link/LWG2964>`__","Apparently redundant requirement for dynamic_pointer_cast","Albuquerque","",""
+"`2965 <https://wg21.link/LWG2965>`__","Non-existing path::native_string() in filesystem_error::what() specification","Albuquerque","|Nothing To Do|",""
+"`2972 <https://wg21.link/LWG2972>`__","What is ``is_trivially_destructible_v<int>``\ ?","Albuquerque","|Complete|",""
+"`2976 <https://wg21.link/LWG2976>`__","Dangling uses_allocator specialization for packaged_task","Albuquerque","|Complete|",""
+"`2977 <https://wg21.link/LWG2977>`__","unordered_meow::merge() has incorrect Throws: clause","Albuquerque","|Nothing To Do|",""
+"`2978 <https://wg21.link/LWG2978>`__","Hash support for pmr::string and friends","Albuquerque","",""
+"`2979 <https://wg21.link/LWG2979>`__","aligned_union should require complete object types","Albuquerque","|Complete|",""
+"`2980 <https://wg21.link/LWG2980>`__","Cannot compare_exchange empty pointers","Albuquerque","",""
+"`2981 <https://wg21.link/LWG2981>`__","Remove redundant deduction guides from standard library","Albuquerque","",""
+"`2982 <https://wg21.link/LWG2982>`__","Making size_type consistent in associative container deduction guides","Albuquerque","",""
+"`2988 <https://wg21.link/LWG2988>`__","Clause 32 cleanup missed one typename","Albuquerque","",""
+"`2993 <https://wg21.link/LWG2993>`__","reference_wrapper<T> conversion from T&&","Albuquerque","|Complete|","13.0"
+"`2998 <https://wg21.link/LWG2998>`__","Requirements on function objects passed to {``forward_``,}list-specific algorithms","Albuquerque","|Nothing To Do|",""
+"`3001 <https://wg21.link/LWG3001>`__","weak_ptr::element_type needs remove_extent_t","Albuquerque","",""
+"`3024 <https://wg21.link/LWG3024>`__","variant's copies must be deleted instead of disabled via SFINAE","Albuquerque","|Complete|",""
+"","","","",""
+"`2164 <https://wg21.link/LWG2164>`__","What are the semantics of ``vector.emplace(vector.begin(), vector.back())``\ ?","Jacksonville","|Complete|",""
+"`2243 <https://wg21.link/LWG2243>`__","``istream::putback``\ problem","Jacksonville","|Complete|",""
+"`2816 <https://wg21.link/LWG2816>`__","``resize_file``\ has impossible postcondition","Jacksonville","|Nothing To Do|",""
+"`2843 <https://wg21.link/LWG2843>`__","Unclear behavior of ``std::pmr::memory_resource::do_allocate()``\ ","Jacksonville","|Complete|",""
+"`2849 <https://wg21.link/LWG2849>`__","Why does ``!is_regular_file(from)``\ cause ``copy_file``\ to report a ""file already exists"" error?","Jacksonville","|Nothing To Do|",""
+"`2851 <https://wg21.link/LWG2851>`__","``std::filesystem``\ enum classes are now underspecified","Jacksonville","|Nothing To Do|",""
+"`2946 <https://wg21.link/LWG2946>`__","LWG 2758's resolution missed further corrections","Jacksonville","|Complete|",""
+"`2969 <https://wg21.link/LWG2969>`__","``polymorphic_allocator::construct()``\ shouldn't pass ``resource()``\ ","Jacksonville","|Complete|",""
+"`2975 <https://wg21.link/LWG2975>`__","Missing case for ``pair``\ construction in scoped and polymorphic allocators","Jacksonville","",""
+"`2989 <https://wg21.link/LWG2989>`__","``path``\ 's stream insertion operator lets you insert everything under the sun","Jacksonville","|Complete|",""
+"`3000 <https://wg21.link/LWG3000>`__","``monotonic_memory_resource::do_is_equal``\ uses ``dynamic_cast``\ unnecessarily","Jacksonville","",""
+"`3002 <https://wg21.link/LWG3002>`__","[networking.ts] ``basic_socket_acceptor::is_open()``\ isn't ``noexcept``\ ","Jacksonville","",""
+"`3004 <https://wg21.link/LWG3004>`__","|sect|\ [string.capacity] and |sect|\ [vector.capacity] should specify time complexity for ``capacity()``\ ","Jacksonville","|Nothing To Do|",""
+"`3005 <https://wg21.link/LWG3005>`__","Destruction order of arrays by ``make_shared/allocate_shared``\ only recommended?","Jacksonville","",""
+"`3007 <https://wg21.link/LWG3007>`__","``allocate_shared``\ should rebind allocator to *cv*-unqualified ``value_type``\ for construction","Jacksonville","",""
+"`3009 <https://wg21.link/LWG3009>`__","Including ``<string_view>``\ doesn't provide ``std::size/empty/data``\ ","Jacksonville","|Complete|",""
+"`3010 <https://wg21.link/LWG3010>`__","[networking.ts] ``uses_executor``\ says ""if a type ``T::executor_type``\ exists""","Jacksonville","",""
+"`3013 <https://wg21.link/LWG3013>`__","``(recursive_)directory_iterator``\ construction and traversal should not be ``noexcept``\ ","Jacksonville","|Complete|",""
+"`3014 <https://wg21.link/LWG3014>`__","More ``noexcept``\ issues with filesystem operations","Jacksonville","|Complete|",""
+"`3015 <https://wg21.link/LWG3015>`__","``copy_options::*unspecified*``\ underspecified","Jacksonville","|Nothing To Do|",""
+"`3017 <https://wg21.link/LWG3017>`__","``list splice``\ functions should use ``addressof``\ ","Jacksonville","|Complete|",""
+"`3020 <https://wg21.link/LWG3020>`__","[networking.ts] Remove spurious nested ``value_type``\ buffer sequence requirement","Jacksonville","",""
+"`3026 <https://wg21.link/LWG3026>`__","``filesystem::weakly_canonical``\ still defined in terms of ``canonical(p, base)``\ ","Jacksonville","|Complete|",""
+"`3030 <https://wg21.link/LWG3030>`__","Who shall meet the requirements of ``try_lock``\ ?","Jacksonville","|Nothing To Do|",""
+"`3034 <https://wg21.link/LWG3034>`__","P0767R1 breaks previously-standard-layout types","Jacksonville","|Complete|",""
+"`3035 <https://wg21.link/LWG3035>`__","``std::allocator``\ 's constructors should be ``constexpr``\ ","Jacksonville","|Complete|",""
+"`3039 <https://wg21.link/LWG3039>`__","Unnecessary ``decay``\ in ``thread``\ and ``packaged_task``\ ","Jacksonville","|Complete|",""
+"`3041 <https://wg21.link/LWG3041>`__","Unnecessary ``decay``\ in ``reference_wrapper``\ ","Jacksonville","|Complete|",""
+"`3042 <https://wg21.link/LWG3042>`__","``is_literal_type_v``\ should be inline","Jacksonville","|Complete|",""
+"`3043 <https://wg21.link/LWG3043>`__","Bogus postcondition for ``filesystem_error``\ constructor","Jacksonville","|Complete|",""
+"`3045 <https://wg21.link/LWG3045>`__","``atomic<*floating-point*>``\ doesn't have ``value_type``\ or ``difference_type``\ ","Jacksonville","",""
+"`3048 <https://wg21.link/LWG3048>`__","``transform_reduce(exec, first1, last1, first2, init)``\ discards execution policy","Jacksonville","",""
+"`3051 <https://wg21.link/LWG3051>`__","Floating point classifications were inadvertently changed in P0175","Jacksonville","|Nothing To Do|",""
+"`3075 <https://wg21.link/LWG3075>`__","``basic_string``\ needs deduction guides from ``basic_string_view``\ ","Jacksonville","|Complete|",""
+"","","","",""
+"`2139 <https://wg21.link/LWG2139>`__","What is a user-defined type?","Rapperswil","",""
+"`2970 <https://wg21.link/LWG2970>`__","Return type of std::visit misspecified","Rapperswil","",""
+"`3058 <https://wg21.link/LWG3058>`__","Parallel adjacent_difference shouldn't require creating temporaries","Rapperswil","",""
+"`3062 <https://wg21.link/LWG3062>`__","Unnecessary decay_t in is_execution_policy_v should be remove_cvref_t","Rapperswil","",""
+"`3067 <https://wg21.link/LWG3067>`__","recursive_directory_iterator::pop must invalidate","Rapperswil","|Nothing To Do|",""
+"`3071 <https://wg21.link/LWG3071>`__","[networking.ts] read_until still refers to ""input sequence""","Rapperswil","|Nothing To Do|",""
+"`3074 <https://wg21.link/LWG3074>`__","Non-member functions for valarray should only deduce from the valarray","Rapperswil","",""
+"`3076 <https://wg21.link/LWG3076>`__","basic_string CTAD ambiguity","Rapperswil","|Complete|",""
+"`3079 <https://wg21.link/LWG3079>`__","LWG 2935 forgot to fix the existing_p overloads of create_directory","Rapperswil","|Nothing To Do|",""
+"`3080 <https://wg21.link/LWG3080>`__","Floating point from_chars pattern specification breaks round-tripping","Rapperswil","",""
+"`3083 <https://wg21.link/LWG3083>`__","What should ios::iword(-1) do?","Rapperswil","|Nothing To Do|",""
+"`3094 <https://wg21.link/LWG3094>`__","[time.duration.io]p4 makes surprising claims about encoding","Rapperswil","",""
+"`3100 <https://wg21.link/LWG3100>`__","Unnecessary and confusing ""empty span"" wording","Rapperswil","|Nothing To Do|",""
+"`3102 <https://wg21.link/LWG3102>`__","Clarify span iterator and ``const_iterator`` behavior","Rapperswil","|Complete|",""
+"`3104 <https://wg21.link/LWG3104>`__","Fixing duration division","Rapperswil","|Complete|",""
+"","","","",""
+"`2183 <https://wg21.link/LWG2183>`__","Muddled allocator requirements for ``match_results``\ constructors","San Diego","|Complete|",""
+"`2184 <https://wg21.link/LWG2184>`__","Muddled allocator requirements for ``match_results``\ assignments","San Diego","|Complete|",""
+"`2412 <https://wg21.link/LWG2412>`__","``promise::set_value()``\ and ``promise::get_future()``\ should not race","San Diego","",""
+"`2499 <https://wg21.link/LWG2499>`__","``operator>>(basic_istream&, CharT*)``\ makes it hard to avoid buffer overflows","San Diego","Resolved by P0487R1",""
+"`2682 <https://wg21.link/LWG2682>`__","``filesystem::copy()``\ won't create a symlink to a directory","San Diego","|Nothing To Do|",""
+"`2697 <https://wg21.link/LWG2697>`__","[concurr.ts] Behavior of ``future/shared_future``\ unwrapping constructor when given an invalid ``future``\ ","San Diego","",""
+"`2797 <https://wg21.link/LWG2797>`__","Trait precondition violations","San Diego","Resolved by 1285R0",""
+"`2936 <https://wg21.link/LWG2936>`__","Path comparison is defined in terms of the generic format","San Diego","|Complete|",""
+"`2943 <https://wg21.link/LWG2943>`__","Problematic specification of the wide version of ``basic_filebuf::open``\ ","San Diego","|Nothing To Do|",""
+"`2960 <https://wg21.link/LWG2960>`__","[fund.ts.v3] ``nonesuch``\ is insufficiently useless","San Diego","|Complete|",""
+"`2995 <https://wg21.link/LWG2995>`__","``basic_stringbuf``\ default constructor forbids it from using SSO capacity","San Diego","",""
+"`2996 <https://wg21.link/LWG2996>`__","Missing rvalue overloads for ``shared_ptr``\ operations","San Diego","",""
+"`3008 <https://wg21.link/LWG3008>`__","``make_shared``\ (sub)object destruction semantics are not specified","San Diego","",""
+"`3022 <https://wg21.link/LWG3022>`__","``is_convertible<derived*, base*>``\ may lead to ODR","San Diego","Resolved by 1285R0",""
+"`3025 <https://wg21.link/LWG3025>`__","Map-like container deduction guides should use ``pair<Key, T>``\ , not ``pair<const Key, T>``\ ","San Diego","|Complete|",""
+"`3031 <https://wg21.link/LWG3031>`__","Algorithms and predicates with non-const reference arguments","San Diego","",""
+"`3037 <https://wg21.link/LWG3037>`__","``polymorphic_allocator``\ and incomplete types","San Diego","",""
+"`3038 <https://wg21.link/LWG3038>`__","``polymorphic_allocator::allocate``\ should not allow integer overflow to create vulnerabilities","San Diego","",""
+"`3054 <https://wg21.link/LWG3054>`__","``uninitialized_copy``\ appears to not be able to meet its exception-safety guarantee","San Diego","",""
+"`3065 <https://wg21.link/LWG3065>`__","LWG 2989 missed that all ``path``\ 's other operators should be hidden friends as well","San Diego","|Complete|",""
+"`3096 <https://wg21.link/LWG3096>`__","``path::lexically_relative``\ is confused by trailing slashes","San Diego","|Complete|",""
+"`3116 <https://wg21.link/LWG3116>`__","``*OUTERMOST_ALLOC_TRAITS*``\ needs ``remove_reference_t``\ ","San Diego","",""
+"`3122 <https://wg21.link/LWG3122>`__","``__cpp_lib_chrono_udls``\ was accidentally dropped","San Diego","|Complete|",""
+"`3127 <https://wg21.link/LWG3127>`__","``basic_osyncstream::rdbuf``\ needs a ````const_cast````\ ","San Diego","",""
+"`3128 <https://wg21.link/LWG3128>`__","``strstream::rdbuf``\ needs a ````const_cast````\ ","San Diego","|Nothing To Do|",""
+"`3129 <https://wg21.link/LWG3129>`__","``regex_token_iterator``\ constructor uses wrong pointer arithmetic","San Diego","",""
+"`3130 <https://wg21.link/LWG3130>`__","|sect|\ [input.output] needs many ``addressof``\ ","San Diego","",""
+"`3131 <https://wg21.link/LWG3131>`__","``addressof``\ all the things","San Diego","",""
+"`3132 <https://wg21.link/LWG3132>`__","Library needs to ban macros named ``expects``\ or ``ensures``\ ","San Diego","|Nothing To Do|",""
+"`3134 <https://wg21.link/LWG3134>`__","[fund.ts.v3] LFTSv3 contains extraneous [meta] variable templates that should have been deleted by P09961","San Diego","Resolved by P1210R0",""
+"`3137 <https://wg21.link/LWG3137>`__","Header for ``__cpp_lib_to_chars``\ ","San Diego","|Complete|",""
+"`3145 <https://wg21.link/LWG3145>`__","``file_clock``\ breaks ABI for C++17 implementations","San Diego","|Complete|",""
+"`3147 <https://wg21.link/LWG3147>`__","Definitions of ""likely"" and ""unlikely"" are likely to cause problems","San Diego","",""
+"`3148 <https://wg21.link/LWG3148>`__","``<concepts>``\ should be freestanding","San Diego","",""
+"`3153 <https://wg21.link/LWG3153>`__","``Common``\ and ``common_type``\ have too little in common","San Diego","",""
+"`3154 <https://wg21.link/LWG3154>`__","``Common``\ and ``CommonReference``\ have a common defect","San Diego","",""
+"","","","",""
+"`3012 <https://wg21.link/LWG3012>`__","``atomic<T>``\ is unimplementable for non-``is_trivially_copy_constructible T``\ ","Kona","",""
+"`3040 <https://wg21.link/LWG3040>`__","``basic_string_view::starts_with``\ *Effects* are incorrect","Kona","|Complete|",""
+"`3077 <https://wg21.link/LWG3077>`__","``(push|emplace)_back``\ should invalidate the ``end``\ iterator","Kona","|Nothing To Do|",""
+"`3087 <https://wg21.link/LWG3087>`__","One final ``&x``\ in |sect|\ [list.ops]","Kona","|Nothing To Do|",""
+"`3101 <https://wg21.link/LWG3101>`__","``span``\ 's ``Container``\ constructors need another constraint","Kona","|Complete|",""
+"`3112 <https://wg21.link/LWG3112>`__","``system_error``\ and ``filesystem_error``\ constructors taking a ``string``\ may not be able to meet their postconditions","Kona","",""
+"`3119 <https://wg21.link/LWG3119>`__","Program-definedness of closure types","Kona","|Nothing To Do|",""
+"`3133 <https://wg21.link/LWG3133>`__","Modernizing numeric type requirements","Kona","",""
+"`3144 <https://wg21.link/LWG3144>`__","``span``\ does not have a ````const_pointer````\ typedef","Kona","|Complete|",""
+"`3173 <https://wg21.link/LWG3173>`__","Enable CTAD for *``ref-view``*\ ","Kona","",""
+"`3179 <https://wg21.link/LWG3179>`__","``subrange``\ should always model ``Range``\ ","Kona","",""
+"`3180 <https://wg21.link/LWG3180>`__","Inconsistently named return type for ``ranges::minmax_element``\ ","Kona","",""
+"`3182 <https://wg21.link/LWG3182>`__","Specification of ``Same``\ could be clearer","Kona","",""
+"","","","",""
+"`2899 <https://wg21.link/LWG2899>`__","``is_(nothrow_)move_constructible``\ and ``tuple``\ , ``optional``\ and ``unique_ptr``\ ","Cologne","",""
+"`3055 <https://wg21.link/LWG3055>`__","``path::operator+=(*single-character*)``\ misspecified","Cologne","|Complete|","7.0"
+"`3158 <https://wg21.link/LWG3158>`__","``tuple(allocator_arg_t, const Alloc&)``\ should be conditionally explicit","Cologne","",""
+"`3169 <https://wg21.link/LWG3169>`__","``ranges``\ permutation generators discard useful information","Cologne","",""
+"`3183 <https://wg21.link/LWG3183>`__","Normative permission to specialize Ranges variable templates","Cologne","",""
+"`3184 <https://wg21.link/LWG3184>`__","Inconsistencies in ``bind_front``\ wording","Cologne","|Complete|","13.0"
+"`3185 <https://wg21.link/LWG3185>`__","Uses-allocator construction functions missing ``constexpr``\ and ``noexcept``\ ","Cologne","",""
+"`3186 <https://wg21.link/LWG3186>`__","``ranges``\ removal, partition, and ``partial_sort_copy``\ algorithms discard useful information","Cologne","",""
+"`3187 <https://wg21.link/LWG3187>`__","`P0591R4 <https://wg21.link/p0591r4>`__ reverted DR 2586 fixes to ``scoped_allocator_adaptor::construct()``\ ","Cologne","",""
+"`3191 <https://wg21.link/LWG3191>`__","``std::ranges::shuffle``\ synopsis does not match algorithm definition","Cologne","",""
+"`3196 <https://wg21.link/LWG3196>`__","``std::optional<T>``\ is ill-formed is ``T``\ is an array","Cologne","|Complete|",""
+"`3198 <https://wg21.link/LWG3198>`__","Bad constraint on ``std::span::span()``\ ","Cologne","|Complete|",""
+"`3199 <https://wg21.link/LWG3199>`__","``istream >> bitset<0>``\ fails","Cologne","",""
+"`3202 <https://wg21.link/LWG3202>`__","P0318R1 was supposed to be revised","Cologne","|Complete|",""
+"`3206 <https://wg21.link/LWG3206>`__","``year_month_day``\ conversion to ``sys_days``\ uses not-existing member function","Cologne","|Complete|",""
+"`3208 <https://wg21.link/LWG3208>`__","``Boolean``\ 's expression requirements are ordered inconsistently","Cologne","|Nothing To Do|",""
+"`3209 <https://wg21.link/LWG3209>`__","Expression in ``year::ok()``\ returns clause is ill-formed","Cologne","|Complete|",""
+"","","","",""
+"`3231 <https://wg21.link/LWG3231>`__","``year_month_day_last::day``\ specification does not cover ``!ok()``\ values","Belfast","|Nothing To Do|",""
+"`3225 <https://wg21.link/LWG3225>`__","``zoned_time``\ converting constructor shall not be ``noexcept``\ ","Belfast","",""
+"`3190 <https://wg21.link/LWG3190>`__","``std::allocator::allocate``\ sometimes returns too little storage","Belfast","",""
+"`3218 <https://wg21.link/LWG3218>`__","Modifier for ``%d``\ parse flag does not match POSIX and ``format``\ specification","Belfast","",""
+"`3224 <https://wg21.link/LWG3224>`__","``zoned_time``\ constructor from ``TimeZonePtr``\ does not specify initialization of ``tp_``\ ","Belfast","",""
+"`3230 <https://wg21.link/LWG3230>`__","Format specifier ``%y/%Y``\ is missing locale alternative versions","Belfast","",""
+"`3232 <https://wg21.link/LWG3232>`__","Inconsistency in ``zoned_time``\ deduction guides","Belfast","",""
+"`3222 <https://wg21.link/LWG3222>`__","P0574R1 introduced preconditions on non-existent parameters","Belfast","",""
+"`3221 <https://wg21.link/LWG3221>`__","Result of ``year_month``\ arithmetic with ``months``\ is ambiguous","Belfast","|Complete|","8.0"
+"`3235 <https://wg21.link/LWG3235>`__","``parse``\ manipulator without abbreviation is not callable","Belfast","",""
+"`3246 <https://wg21.link/LWG3246>`__","What are the constraints on the template parameter of ``basic_format_arg``\ ?","Belfast","",""
+"`3253 <https://wg21.link/LWG3253>`__","``basic_syncbuf::basic_syncbuf()``\ should not be explicit","Belfast","",""
+"`3245 <https://wg21.link/LWG3245>`__","Unnecessary restriction on ``'%p'``\ parse specifier","Belfast","",""
+"`3244 <https://wg21.link/LWG3244>`__","Constraints for ``Source``\ in |sect|\ [fs.path.req] insufficiently constrainty","Belfast","",""
+"`3241 <https://wg21.link/LWG3241>`__","``chrono-spec``\ grammar ambiguity in |sect|\ [time.format]","Belfast","",""
+"`3257 <https://wg21.link/LWG3257>`__","Missing feature testing macro update from P0858","Belfast","",""
+"`3256 <https://wg21.link/LWG3256>`__","Feature testing macro for ``constexpr``\ algorithms","Belfast","|Complete|","13.0"
+"`3273 <https://wg21.link/LWG3273>`__","Specify ``weekday_indexed``\ to range of ``[0, 7]``\ ","Belfast","",""
+"`3070 <https://wg21.link/LWG3070>`__","``path::lexically_relative``\ causes surprising results if a filename can also be a *root-name*","Belfast","",""
+"`3266 <https://wg21.link/LWG3266>`__","``to_chars(bool)``\ should be deleted","Belfast","",""
+"`3272 <https://wg21.link/LWG3272>`__","``%I%p``\ should parse/format ``duration``\ since midnight","Belfast","",""
+"`3259 <https://wg21.link/LWG3259>`__","The definition of *constexpr iterators* should be adjusted","Belfast","",""
+"`3103 <https://wg21.link/LWG3103>`__","Errors in taking subview of ``span``\ should be ill-formed where possible","Belfast","",""
+"`3274 <https://wg21.link/LWG3274>`__","Missing feature test macro for ``<span>``\ ","Belfast","",""
+"`3276 <https://wg21.link/LWG3276>`__","Class ``split_view::outer_iterator::value_type``\ should inherit from ``view_interface``\ ","Belfast","",""
+"`3277 <https://wg21.link/LWG3277>`__","Pre-increment on prvalues is not a requirement of ``weakly_incrementable``\ ","Belfast","",""
+"`3149 <https://wg21.link/LWG3149>`__","``DefaultConstructible``\ should require default initialization","Belfast","|Complete|","13.0"
+"","","","",""
+"`1203 <https://wg21.link/LWG1203>`__","More useful rvalue stream insertion","Prague","|Complete|","12.0"
+"`2859 <https://wg21.link/LWG2859>`__","Definition of *reachable* in [ptr.launder] misses pointer arithmetic from pointer-interconvertible object","Prague","",""
+"`3018 <https://wg21.link/LWG3018>`__","``shared_ptr``\ of function type","Prague","",""
+"`3050 <https://wg21.link/LWG3050>`__","Conversion specification problem in ``chrono::duration``\ constructor","Prague","",""
+"`3141 <https://wg21.link/LWG3141>`__","``CopyConstructible``\ doesn't preserve source values","Prague","|Nothing to do|",""
+"`3150 <https://wg21.link/LWG3150>`__","``UniformRandomBitGenerator``\ should validate ``min``\ and ``max``\ ","Prague","|Complete|","13.0"
+"`3175 <https://wg21.link/LWG3175>`__","The ``CommonReference``\ requirement of concept ``SwappableWith``\ is not satisfied in the example","Prague","|Complete|","13.0"
+"`3194 <https://wg21.link/LWG3194>`__","``ConvertibleTo``\ prose does not match code","Prague","|Complete|","13.0"
+"`3200 <https://wg21.link/LWG3200>`__","``midpoint``\ should not constrain ``T``\ is complete","Prague","|Nothing To Do|",""
+"`3201 <https://wg21.link/LWG3201>`__","``lerp``\ should be marked as ``noexcept``\ ","Prague","|Complete|",""
+"`3226 <https://wg21.link/LWG3226>`__","``zoned_time``\ constructor from ``string_view``\ should accept ``zoned_time<Duration2, TimeZonePtr2>``\ ","Prague","",""
+"`3233 <https://wg21.link/LWG3233>`__","Broken requirements for ``shared_ptr``\ converting constructors","Prague","",""
+"`3237 <https://wg21.link/LWG3237>`__","LWG 3038 and 3190 have inconsistent PRs","Prague","",""
+"`3238 <https://wg21.link/LWG3238>`__","Insufficiently-defined behavior of ``std::function``\ deduction guides","Prague","",""
+"`3242 <https://wg21.link/LWG3242>`__","``std::format``\ : missing rules for ``arg-id``\ in ``width``\ and ``precision``\ ","Prague","",""
+"`3243 <https://wg21.link/LWG3243>`__","``std::format``\ and negative zeroes","Prague","",""
+"`3247 <https://wg21.link/LWG3247>`__","``ranges::iter_move``\ should perform ADL-only lookup of ``iter_move``\ ","Prague","",""
+"`3248 <https://wg21.link/LWG3248>`__","``std::format``\ ``#b``\ , ``#B``\ , ``#o``\ , ``#x``\ , and ``#X``\ presentation types misformat negative numbers","Prague","",""
+"`3250 <https://wg21.link/LWG3250>`__","``std::format``\ : ``#``\ (alternate form) for NaN and inf","Prague","",""
+"`3251 <https://wg21.link/LWG3251>`__","Are ``std::format``\ alignment specifiers applied to string arguments?","Prague","",""
+"`3252 <https://wg21.link/LWG3252>`__","Parse locale's aware modifiers for commands are not consistent with POSIX spec","Prague","",""
+"`3254 <https://wg21.link/LWG3254>`__","Strike ``stop_token``\ 's ``operator!=``\ ","Prague","",""
+"`3255 <https://wg21.link/LWG3255>`__","``span``\ 's ``array``\ constructor is too strict","Prague","|Complete|",""
+"`3260 <https://wg21.link/LWG3260>`__","``year_month*``\ arithmetic rejects durations convertible to years","Prague","",""
+"`3262 <https://wg21.link/LWG3262>`__","Formatting of negative durations is not specified","Prague","",""
+"`3264 <https://wg21.link/LWG3264>`__","``sized_range``\ and ``ranges::size``\ redundantly use ``disable_sized_range``\ ","Prague","",""
+"`3269 <https://wg21.link/LWG3269>`__","Parse manipulators do not specify the result of the extraction from stream","Prague","",""
+"`3270 <https://wg21.link/LWG3270>`__","Parsing and formatting ``%j``\ with ``duration``\ s","Prague","",""
+"`3280 <https://wg21.link/LWG3280>`__","View converting constructors can cause constraint recursion and are unneeded","Prague","",""
+"`3281 <https://wg21.link/LWG3281>`__","Conversion from ``*pair-like*``\ types to ``subrange``\ is a silent semantic promotion","Prague","",""
+"`3282 <https://wg21.link/LWG3282>`__","``subrange``\ converting constructor should disallow derived to base conversions","Prague","",""
+"`3284 <https://wg21.link/LWG3284>`__","``random_access_iterator``\ semantic constraints accidentally promote difference type using unary negate","Prague","",""
+"`3285 <https://wg21.link/LWG3285>`__","The type of a customization point object shall satisfy ``semiregular``\ ","Prague","",""
+"`3286 <https://wg21.link/LWG3286>`__","``ranges::size``\ is not required to be valid after a call to ``ranges::begin``\ on an input range","Prague","",""
+"`3291 <https://wg21.link/LWG3291>`__","``iota_view::iterator``\ has the wrong ``iterator_category``\ ","Prague","",""
+"`3292 <https://wg21.link/LWG3292>`__","``iota_view``\ is under-constrained","Prague","",""
+"`3294 <https://wg21.link/LWG3294>`__","``zoned_time``\ deduction guides misinterprets ``string``\ /``char*``\ ","Prague","",""
+"`3296 <https://wg21.link/LWG3296>`__","Inconsistent default argument for ``basic_regex<>::assign``\ ","Prague","|Complete|",""
+"`3299 <https://wg21.link/LWG3299>`__","Pointers don't need customized iterator behavior","Prague","",""
+"`3300 <https://wg21.link/LWG3300>`__","Non-array ``ssize``\ overload is underconstrained","Prague","",""
+"`3301 <https://wg21.link/LWG3301>`__","``transform_view::iterator``\ has incorrect ``iterator_category``\ ","Prague","",""
+"`3302 <https://wg21.link/LWG3302>`__","Range adaptor objects ``keys``\ and ``values``\ are unspecified","Prague","",""
+"`3303 <https://wg21.link/LWG3303>`__","Bad ""``constexpr``\ "" marker for ``destroy/destroy_n``\ ","Prague","",""
+"`3304 <https://wg21.link/LWG3304>`__","Allocate functions of ``std::polymorphic_allocator``\ should require ``[[nodiscard]]``\ ","Prague","",""
+"`3307 <https://wg21.link/LWG3307>`__","``std::allocator<void>().allocate(n)``\ ","Prague","",""
+"`3310 <https://wg21.link/LWG3310>`__","Replace ``SIZE_MAX``\ with ``numeric_limits<size_t>::max()``\ ","Prague","",""
+"`3313 <https://wg21.link/LWG3313>`__","``join_view::iterator::operator--``\ is incorrectly constrained","Prague","",""
+"`3314 <https://wg21.link/LWG3314>`__","Is stream insertion behavior locale dependent when ``Period::type``\ is ``micro``\ ?","Prague","",""
+"`3315 <https://wg21.link/LWG3315>`__","Correct Allocator Default Behavior","Prague","",""
+"`3316 <https://wg21.link/LWG3316>`__","Correctly define epoch for ``utc_clock``\ / ``utc_timepoint``\ ","Prague","",""
+"`3317 <https://wg21.link/LWG3317>`__","Incorrect ``operator<<``\ for floating-point durations","Prague","",""
+"`3318 <https://wg21.link/LWG3318>`__","Clarify whether clocks can represent time before their epoch","Prague","",""
+"`3319 <https://wg21.link/LWG3319>`__","Properly reference specification of IANA time zone database","Prague","",""
+"`3320 <https://wg21.link/LWG3320>`__","``span::cbegin/cend``\ methods produce different results than ``std::[ranges::]cbegin/cend``\ ","Prague","|Complete|",""
+"`3321 <https://wg21.link/LWG3321>`__","``uninitialized_construct_using_allocator``\ should use ``construct_at``\ ","Prague","",""
+"`3323 <https://wg21.link/LWG3323>`__","``*has-tuple-element*``\ helper concept needs ``convertible_to``\ ","Prague","",""
+"`3324 <https://wg21.link/LWG3324>`__","Special-case ``std::strong/weak/partial_order``\ for pointers","Prague","",""
+"`3325 <https://wg21.link/LWG3325>`__","Constrain return type of transformation function for ``transform_view``\ ","Prague","",""
+"`3326 <https://wg21.link/LWG3326>`__","``enable_view``\ has false positives","Prague","|In progress|",""
+"`3327 <https://wg21.link/LWG3327>`__","Format alignment specifiers vs. text direction","Prague","|Nothing To Do|",""
+"`3328 <https://wg21.link/LWG3328>`__","Clarify that ``std::string``\ is not good for UTF-8","Prague","",""
+"`3329 <https://wg21.link/LWG3329>`__","``totally_ordered_with``\ both directly and indirectly requires ``common_reference_with``\ ","Prague","|Complete|","13.0"
+"`3330 <https://wg21.link/LWG3330>`__","Include ``<compare>``\ from most library headers","Prague","",""
+"`3331 <https://wg21.link/LWG3331>`__","Define ``totally_ordered/_with``\ in terms of ``*partially-ordered-with*``\ ","Prague","|Complete|","13.0"
+"`3332 <https://wg21.link/LWG3332>`__","Issue in |sect|\ [time.format]","Prague","",""
+"`3334 <https://wg21.link/LWG3334>`__","``basic_osyncstream``\ move assignment and destruction calls ``basic_syncbuf::emit()``\ twice","Prague","",""
+"`3335 <https://wg21.link/LWG3335>`__","Resolve C++20 NB comments US 273 and GB 274","Prague","",""
+"`3338 <https://wg21.link/LWG3338>`__","Rename ``default_constructible``\ to ``default_initializable``\ ","Prague","|Complete|","13.0"
+"`3340 <https://wg21.link/LWG3340>`__","Formatting functions should throw on argument/format string mismatch in |sect|\ [format.functions]","Prague","",""
+"`3346 <https://wg21.link/LWG3346>`__","``pair``\ and ``tuple``\ copy and move constructor have backwards specification","Prague","",""
+"`3347 <https://wg21.link/LWG3347>`__","``std::pair<T, U>``\ now requires ``T``\ and ``U``\ to be less-than-comparable","Prague","",""
+"`3348 <https://wg21.link/LWG3348>`__","``__cpp_lib_unwrap_ref``\ in wrong header","Prague","",""
+"`3349 <https://wg21.link/LWG3349>`__","Missing ``__cpp_lib_constexpr_complex``\ for P0415R1","Prague","",""
+"`3350 <https://wg21.link/LWG3350>`__","Simplify return type of ``lexicographical_compare_three_way``\ ","Prague","",""
+"`3351 <https://wg21.link/LWG3351>`__","``ranges::enable_safe_range``\ should not be constrained","Prague","",""
+"`3352 <https://wg21.link/LWG3352>`__","``strong_equality``\ isn't a thing","Prague","",""
+"`3354 <https://wg21.link/LWG3354>`__","``has_strong_structural_equality``\ has a meaningless definition","Prague","",""
+"`3355 <https://wg21.link/LWG3355>`__","The memory algorithms should support move-only input iterators introduced by P1207","Prague","",""
+"`3356 <https://wg21.link/LWG3356>`__","``__cpp_lib_nothrow_convertible``\ should be ``__cpp_lib_is_nothrow_convertible``\ ","Prague","",""
+"`3358 <https://wg21.link/LWG3358>`__","|sect|\ [span.cons] is mistaken that ``to_address``\ can throw","Prague","",""
+"`3359 <https://wg21.link/LWG3359>`__","``<chrono>``\ leap second support should allow for negative leap seconds","Prague","",""
+"`3360 <https://wg21.link/LWG3360>`__","``three_way_comparable_with``\ is inconsistent with similar concepts","Prague","",""
+"`3362 <https://wg21.link/LWG3362>`__","Strike ``stop_source``\ 's ``operator!=``\ ","Prague","",""
+"`3363 <https://wg21.link/LWG3363>`__","``drop_while_view``\ should opt-out of ``sized_range``\ ","Prague","",""
+"`3364 <https://wg21.link/LWG3364>`__","Initialize data members of ranges and their iterators","Prague","",""
+"`3367 <https://wg21.link/LWG3367>`__","Integer-class conversions should not throw","Prague","",""
+"`3369 <https://wg21.link/LWG3369>`__","``span``\ 's deduction-guide for built-in arrays doesn't work","Prague","",""
+"`3371 <https://wg21.link/LWG3371>`__","``visit_format_arg``\ and ``make_format_args``\ are not hidden friends","Prague","",""
+"`3372 <https://wg21.link/LWG3372>`__","``vformat_to``\ should not try to deduce ``Out``\ twice","Prague","",""
+"`3373 <https://wg21.link/LWG3373>`__","``{to,from}_chars_result``\ and ``format_to_n_result``\ need the ""we really mean what we say"" wording","Prague","",""
+"`3374 <https://wg21.link/LWG3374>`__","P0653 + P1006 should have made the other ``std::to_address``\ overload ``constexpr``\ ","Prague","|Complete|","12.0"
+"`3375 <https://wg21.link/LWG3375>`__","``decay``\ in ``viewable_range``\ should be ``remove_cvref``\ ","Prague","",""
+"`3377 <https://wg21.link/LWG3377>`__","``elements_view::iterator``\ befriends a specialization of itself","Prague","",""
+"`3379 <https://wg21.link/LWG3379>`__","""``safe``\ "" in several library names is misleading","Prague","|In Progress|",""
+"`3380 <https://wg21.link/LWG3380>`__","``common_type``\ and comparison categories","Prague","",""
+"`3381 <https://wg21.link/LWG3381>`__","``begin``\ and ``data``\ must agree for ``contiguous_range``\ ","Prague","",""
+"`3382 <https://wg21.link/LWG3382>`__","NTTP for ``pair``\ and ``array``\ ","Prague","",""
+"`3383 <https://wg21.link/LWG3383>`__","|sect|\ [time.zone.leap.nonmembers] ``sys_seconds``\ should be replaced with ``seconds``\ ","Prague","",""
+"`3384 <https://wg21.link/LWG3384>`__","``transform_view::*sentinel*``\ has an incorrect ``operator-``\ ","Prague","",""
+"`3385 <https://wg21.link/LWG3385>`__","``common_iterator``\ is not sufficiently constrained for non-copyable iterators","Prague","",""
+"`3387 <https://wg21.link/LWG3387>`__","|sect|\ [range.reverse.view] ``reverse_view<V>``\ unintentionally requires ``range<const V>``\ ","Prague","",""
+"`3388 <https://wg21.link/LWG3388>`__","``view``\ iterator types have ill-formed ``<=>``\ operators","Prague","",""
+"`3389 <https://wg21.link/LWG3389>`__","A move-only iterator still does not have a ``counted_iterator``\ ","Prague","",""
+"`3390 <https://wg21.link/LWG3390>`__","``make_move_iterator()``\ cannot be used to construct a ``move_iterator``\ for a move-only iterator","Prague","",""
+"`3393 <https://wg21.link/LWG3393>`__","Missing/incorrect feature test macro for coroutines","Prague","",""
+"`3395 <https://wg21.link/LWG3395>`__","Definition for three-way comparison needs to be updated (US 152)","Prague","",""
+"`3396 <https://wg21.link/LWG3396>`__","Clarify point of reference for ``source_location::current()``\ (DE 169)","Prague","",""
+"`3397 <https://wg21.link/LWG3397>`__","``ranges::basic_istream_view::iterator``\ should not provide ``iterator_category``\ ","Prague","",""
+"`3398 <https://wg21.link/LWG3398>`__","``tuple_element_t``\ is also wrong for ``const subrange``\ ","Prague","",""
+"`3446 <https://wg21.link/LWG3446>`__","``indirectly_readable_traits``\ ambiguity for types with both ``value_type``\ and ``element_type``\ ","November virtual meeting","|Complete|","13.0"
--- /dev/null
+"Paper #","Group","Paper Name","Meeting","Status","First released version"
+"`P0463R1 <https://wg21.link/P0463R1>`__","LWG","Endian just Endian","Toronto","|Complete|","7.0"
+"`P0674R1 <https://wg21.link/P0674R1>`__","LWG","Extending make_shared to Support Arrays","Toronto","",""
+"","","","","",""
+"`P0020R6 <https://wg21.link/P0020R6>`__","LWG","Floating Point Atomic","Albuquerque","",""
+"`P0053R7 <https://wg21.link/P0053R7>`__","LWG","C++ Synchronized Buffered Ostream","Albuquerque","",""
+"`P0202R3 <https://wg21.link/P0202R3>`__","LWG","Add constexpr modifiers to functions in <algorithm> and <utility> Headers","Albuquerque","|Complete|","12.0"
+"`P0415R1 <https://wg21.link/P0415R1>`__","LWG","Constexpr for ``std::complex``\ ","Albuquerque","|In Progress|","7.0"
+"`P0439R0 <https://wg21.link/P0439R0>`__","LWG","Make ``std::memory_order``\ a scoped enumeration","Albuquerque","|Complete|",""
+"`P0457R2 <https://wg21.link/P0457R2>`__","LWG","String Prefix and Suffix Checking","Albuquerque","|Complete|","6.0"
+"`P0550R2 <https://wg21.link/P0550R2>`__","LWG","Transformation Trait ``remove_cvref``\ ","Albuquerque","|Complete|","6.0"
+"`P0600R1 <https://wg21.link/P0600R1>`__","LWG","nodiscard in the Library","Albuquerque","|In Progress| [#note-P0600]_","7.0"
+"`P0616R0 <https://wg21.link/P0616R0>`__","LWG","de-pessimize legacy <numeric> algorithms with std::move","Albuquerque","|Complete|","12.0"
+"`P0653R2 <https://wg21.link/P0653R2>`__","LWG","Utility to convert a pointer to a raw pointer","Albuquerque","|Complete|","6.0"
+"`P0718R2 <https://wg21.link/P0718R2>`__","LWG","Atomic shared_ptr","Albuquerque","",""
+"`P0767R1 <https://wg21.link/P0767R1>`__","CWG","Deprecate POD","Albuquerque","|Complete|","7.0"
+"`P0768R1 <https://wg21.link/P0768R1>`__","CWG","Library Support for the Spaceship (Comparison) Operator","Albuquerque","|Complete|",""
+"`P0777R1 <https://wg21.link/P0777R1>`__","LWG","Treating Unnecessary ``decay``\ ","Albuquerque","|Complete|","7.0"
+"`P0122R7 <https://wg21.link/P0122R7>`__","LWG","<span>","Jacksonville","|Complete|","7.0"
+"`P0355R7 <https://wg21.link/P0355R7>`__","LWG","Extending chrono to Calendars and Time Zones","Jacksonville","|In Progress|",""
+"`P0551R3 <https://wg21.link/P0551R3>`__","LWG","Thou Shalt Not Specialize ``std``\ Function Templates!","Jacksonville","|Complete|","11.0"
+"`P0753R2 <https://wg21.link/P0753R2>`__","LWG","Manipulators for C++ Synchronized Buffered Ostream","Jacksonville","",""
+"`P0754R2 <https://wg21.link/P0754R2>`__","LWG","<version>","Jacksonville","|Complete|","7.0"
+"`P0809R0 <https://wg21.link/P0809R0>`__","LWG","Comparing Unordered Containers","Jacksonville","|Nothing To Do|",""
+"`P0858R0 <https://wg21.link/P0858R0>`__","LWG","Constexpr iterator requirements","Jacksonville","",""
+"`P0905R1 <https://wg21.link/P0905R1>`__","CWG","Symmetry for spaceship","Jacksonville","",""
+"`P0966R1 <https://wg21.link/P0966R1>`__","LWG","``string::reserve``\ Should Not Shrink","Jacksonville","|Complete| [#note-P0966]_","12.0"
+"","","","","",""
+"`P0019R8 <https://wg21.link/P0019R8>`__","LWG","Atomic Ref","Rapperswil","",""
+"`P0458R2 <https://wg21.link/P0458R2>`__","LWG","Checking for Existence of an Element in Associative Containers","Rapperswil","|Complete|","13.0"
+"`P0475R1 <https://wg21.link/P0475R1>`__","LWG","LWG 2511: guaranteed copy elision for piecewise construction","Rapperswil","|Complete|",""
+"`P0476R2 <https://wg21.link/P0476R2>`__","LWG","Bit-casting object representations","Rapperswil","",""
+"`P0528R3 <https://wg21.link/P0528R3>`__","CWG","The Curious Case of Padding Bits, Featuring Atomic Compare-and-Exchange","Rapperswil","",""
+"`P0542R5 <https://wg21.link/P0542R5>`__","CWG","Support for contract based programming in C++","Rapperswil","*Removed in Cologne*","n/a"
+"`P0556R3 <https://wg21.link/P0556R3>`__","LWG","Integral power-of-2 operations","Rapperswil","|Complete|","9.0"
+"`P0619R4 <https://wg21.link/P0619R4>`__","LWG","Reviewing Deprecated Facilities of C++17 for C++20","Rapperswil","|Partial| [#note-P0619]_",""
+"`P0646R1 <https://wg21.link/P0646R1>`__","LWG","Improving the Return Value of Erase-Like Algorithms","Rapperswil","|Complete|","10.0"
+"`P0722R3 <https://wg21.link/P0722R3>`__","CWG","Efficient sized delete for variable sized classes","Rapperswil","|Complete|","9.0"
+"`P0758R1 <https://wg21.link/P0758R1>`__","LWG","Implicit conversion traits and utility functions","Rapperswil","|Complete|",""
+"`P0759R1 <https://wg21.link/P0759R1>`__","LWG","fpos Requirements","Rapperswil","|Complete|","11.0"
+"`P0769R2 <https://wg21.link/P0769R2>`__","LWG","Add shift to <algorithm>","Rapperswil","|Complete|","12.0"
+"`P0788R3 <https://wg21.link/P0788R3>`__","LWG","Standard Library Specification in a Concepts and Contracts World","Rapperswil","*Removed in Cologne*","n/a"
+"`P0879R0 <https://wg21.link/P0879R0>`__","LWG","Constexpr for swap and swap related functions Also resolves LWG issue 2800.","Rapperswil","|Complete|","13.0"
+"`P0887R1 <https://wg21.link/P0887R1>`__","LWG","The identity metafunction","Rapperswil","|Complete|","8.0"
+"`P0892R2 <https://wg21.link/P0892R2>`__","CWG","explicit(bool)","Rapperswil","",""
+"`P0898R3 <https://wg21.link/P0898R3>`__","LWG","Standard Library Concepts","Rapperswil","|Complete|","13.0"
+"`P0935R0 <https://wg21.link/P0935R0>`__","LWG","Eradicating unnecessarily explicit default constructors from the standard library","Rapperswil","|Complete|","12.0"
+"`P0941R2 <https://wg21.link/P0941R2>`__","CWG","Integrating feature-test macros into the C++ WD","Rapperswil","|In Progress|",""
+"`P1023R0 <https://wg21.link/P1023R0>`__","LWG","constexpr comparison operators for std::array","Rapperswil","|Complete|","8.0"
+"`P1025R1 <https://wg21.link/P1025R1>`__","CWG","Update The Reference To The Unicode Standard","Rapperswil","",""
+"`P1120R0 <https://wg21.link/P1120R0>`__","CWG","Consistency improvements for <=> and other comparison operators","Rapperswil","",""
+"","","","","",""
+"`P0318R1 <https://wg21.link/P0318R1>`__","LWG","unwrap_ref_decay and unwrap_reference","San Diego","|Complete|","8.0"
+"`P0356R5 <https://wg21.link/P0356R5>`__","LWG","Simplified partial function application","San Diego","|Complete|","13.0"
+"`P0357R3 <https://wg21.link/P0357R3>`__","LWG","reference_wrapper for incomplete types","San Diego","|Complete|","8.0"
+"`P0482R6 <https://wg21.link/P0482R6>`__","CWG","char8_t: A type for UTF-8 characters and strings","San Diego","|In Progress|",""
+"`P0487R1 <https://wg21.link/P0487R1>`__","LWG","Fixing ``operator>>(basic_istream&, CharT*)``\ (LWG 2499)","San Diego","|Complete|","8.0"
+"`P0591R4 <https://wg21.link/P0591R4>`__","LWG","Utility functions to implement uses-allocator construction","San Diego","* *",""
+"`P0595R2 <https://wg21.link/P0595R2>`__","CWG","P0595R2 std::is_constant_evaluated()","San Diego","|Complete|","9.0"
+"`P0602R4 <https://wg21.link/P0602R4>`__","LWG","variant and optional should propagate copy/move triviality","San Diego","|Complete|","8.0"
+"`P0608R3 <https://wg21.link/P0608R3>`__","LWG","A sane variant converting constructor","San Diego","|Complete|","9.0"
+"`P0655R1 <https://wg21.link/P0655R1>`__","LWG","visit<R>: Explicit Return Type for visit","San Diego","|Complete|","12.0"
+"`P0771R1 <https://wg21.link/P0771R1>`__","LWG","std::function move constructor should be noexcept","San Diego","|Complete|","6.0"
+"`P0896R4 <https://wg21.link/P0896R4>`__","LWG","The One Ranges Proposal","San Diego","|In Progress|",""
+"`P0899R1 <https://wg21.link/P0899R1>`__","LWG","P0899R1 - LWG 3016 is not a defect","San Diego","|Nothing To Do|",""
+"`P0919R3 <https://wg21.link/P0919R3>`__","LWG","Heterogeneous lookup for unordered containers","San Diego","|Complete|","12.0"
+"`P0972R0 <https://wg21.link/P0972R0>`__","LWG","<chrono> ``zero()``\ , ``min()``\ , and ``max()``\ should be noexcept","San Diego","|Complete|","8.0"
+"`P1006R1 <https://wg21.link/P1006R1>`__","LWG","Constexpr in std::pointer_traits","San Diego","|Complete|","8.0"
+"`P1007R3 <https://wg21.link/P1007R3>`__","LWG","``std::assume_aligned``\ ","San Diego","* *",""
+"`P1020R1 <https://wg21.link/P1020R1>`__","LWG","Smart pointer creation with default initialization","San Diego","* *",""
+"`P1032R1 <https://wg21.link/P1032R1>`__","LWG","Misc constexpr bits","San Diego","|Complete|","13.0"
+"`P1085R2 <https://wg21.link/P1085R2>`__","LWG","Should Span be Regular?","San Diego","|Complete|","8.0"
+"`P1123R0 <https://wg21.link/P1123R0>`__","LWG","Editorial Guidance for merging P0019r8 and P0528r3","San Diego","* *",""
+"`P1148R0 <https://wg21.link/P1148R0>`__","LWG","Cleaning up Clause 20","San Diego","* *",""
+"`P1165R1 <https://wg21.link/P1165R1>`__","LWG","Make stateful allocator propagation more consistent for ``operator+(basic_string)``\ ","San Diego","* *",""
+"`P1209R0 <https://wg21.link/P1209R0>`__","LWG","Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20","San Diego","|Complete|","8.0"
+"`P1210R0 <https://wg21.link/P1210R0>`__","LWG","Completing the Rebase of Library Fundamentals, Version 3, Working Draft","San Diego","* *",""
+"`P1236R1 <https://wg21.link/P1236R1>`__","CWG","Alternative Wording for P0907R4 Signed Integers are Two's Complement","San Diego","* *",""
+"`P1248R1 <https://wg21.link/P1248R1>`__","LWG","Remove CommonReference requirement from StrictWeakOrdering (a.k.a Fixing Relations)","San Diego","|Complete|","13.0"
+"`P1285R0 <https://wg21.link/P1285R0>`__","LWG","Improving Completeness Requirements for Type Traits","San Diego","* *",""
+"`P1353R0 <https://wg21.link/P1353R0>`__","CWG","Missing feature test macros","San Diego","* *",""
+"","","","","",""
+"`P0339R6 <https://wg21.link/P0339R6>`__","LWG","polymorphic_allocator<> as a vocabulary type","Kona","",""
+"`P0340R3 <https://wg21.link/P0340R3>`__","LWG","Making std::underlying_type SFINAE-friendly","Kona","|Complete|","9.0"
+"`P0738R2 <https://wg21.link/P0738R2>`__","LWG","I Stream, You Stream, We All Stream for istream_iterator","Kona","",""
+"`P0811R3 <https://wg21.link/P0811R3>`__","LWG","Well-behaved interpolation for numbers and pointers","Kona","|Complete|","9.0"
+"`P0920R2 <https://wg21.link/P0920R2>`__","LWG","Precalculated hash values in lookup","Kona","Reverted by `P1661 <https://wg21.link/P1661>`__",""
+"`P1001R2 <https://wg21.link/P1001R2>`__","LWG","Target Vectorization Policies from Parallelism V2 TS to C++20","Kona","",""
+"`P1024R3 <https://wg21.link/P1024R3>`__","LWG","Usability Enhancements for std::span","Kona","|Complete|","9.0"
+"`P1164R1 <https://wg21.link/P1164R1>`__","LWG","Make create_directory() Intuitive","Kona","|Complete|","12.0"
+"`P1227R2 <https://wg21.link/P1227R2>`__","LWG","Signed ssize() functions, unsigned size() functions","Kona","|Complete|","9.0"
+"`P1252R2 <https://wg21.link/P1252R2>`__","LWG","Ranges Design Cleanup","Kona","",""
+"`P1286R2 <https://wg21.link/P1286R2>`__","CWG","Contra CWG DR1778","Kona","",""
+"`P1357R1 <https://wg21.link/P1357R1>`__","LWG","Traits for [Un]bounded Arrays","Kona","|Complete|","9.0"
+"`P1458R1 <https://wg21.link/P1458R1>`__","LWG","Mandating the Standard Library: Clause 16 - Language support library","Kona","|Complete|","9.0"
+"`P1459R1 <https://wg21.link/P1459R1>`__","LWG","Mandating the Standard Library: Clause 18 - Diagnostics library","Kona","|Complete|","9.0"
+"`P1462R1 <https://wg21.link/P1462R1>`__","LWG","Mandating the Standard Library: Clause 20 - Strings library","Kona","|Complete|","9.0"
+"`P1463R1 <https://wg21.link/P1463R1>`__","LWG","Mandating the Standard Library: Clause 21 - Containers library","Kona","",""
+"`P1464R1 <https://wg21.link/P1464R1>`__","LWG","Mandating the Standard Library: Clause 22 - Iterators library","Kona","|Complete|","9.0"
+"","","","","",""
+"`P0325 <https://wg21.link/P0325>`__","LWG","to_array from LFTS with updates","Cologne","|Complete|","10.0"
+"`P0408 <https://wg21.link/P0408>`__","LWG","Efficient Access to basic_stringbuf's Buffer","Cologne","",""
+"`P0466 <https://wg21.link/P0466>`__","LWG","Layout-compatibility and Pointer-interconvertibility Traits","Cologne","",""
+"`P0553 <https://wg21.link/P0553>`__","LWG","Bit operations","Cologne","|Complete|","9.0"
+"`P0631 <https://wg21.link/P0631>`__","LWG","Math Constants","Cologne","|Complete|","11.0"
+"`P0645 <https://wg21.link/P0645>`__","LWG","Text Formatting","Cologne","|In Progress|",""
+"`P0660 <https://wg21.link/P0660>`__","LWG","Stop Token and Joining Thread, Rev 10","Cologne","",""
+"`P0784 <https://wg21.link/P0784>`__","CWG","More constexpr containers","Cologne","|Complete|","12.0"
+"`P0980 <https://wg21.link/P0980>`__","LWG","Making std::string constexpr","Cologne","",""
+"`P1004 <https://wg21.link/P1004>`__","LWG","Making std::vector constexpr","Cologne","",""
+"`P1035 <https://wg21.link/P1035>`__","LWG","Input Range Adaptors","Cologne","",""
+"`P1065 <https://wg21.link/P1065>`__","LWG","Constexpr INVOKE","Cologne","|Complete|","12.0"
+"`P1135 <https://wg21.link/P1135>`__","LWG","The C++20 Synchronization Library","Cologne","|Complete|","11.0"
+"`P1207 <https://wg21.link/P1207>`__","LWG","Movability of Single-pass Iterators","Cologne","",""
+"`P1208 <https://wg21.link/P1208>`__","LWG","Adopt source_location for C++20","Cologne","",""
+"`P1355 <https://wg21.link/P1355>`__","LWG","Exposing a narrow contract for ceil2","Cologne","|Complete|","9.0"
+"`P1361 <https://wg21.link/P1361>`__","LWG","Integration of chrono with text formatting","Cologne","",""
+"`P1423 <https://wg21.link/P1423>`__","LWG","char8_t backward compatibility remediation","Cologne","|In Progress|",""
+"`P1424 <https://wg21.link/P1424>`__","LWG","'constexpr' feature macro concerns","Cologne","Superseded by `P1902 <https://wg21.link/P1902>`__",""
+"`P1466 <https://wg21.link/P1466>`__","LWG","Miscellaneous minor fixes for chrono","Cologne","",""
+"`P1474 <https://wg21.link/P1474>`__","LWG","Helpful pointers for ContiguousIterator","Cologne","",""
+"`P1502 <https://wg21.link/P1502>`__","LWG","Standard library header units for C++20","Cologne","",""
+"`P1522 <https://wg21.link/P1522>`__","LWG","Iterator Difference Type and Integer Overflow","Cologne","",""
+"`P1523 <https://wg21.link/P1523>`__","LWG","Views and Size Types","Cologne","",""
+"`P1612 <https://wg21.link/P1612>`__","LWG","Relocate Endian's Specification","Cologne","|Complete|","10.0"
+"`P1614 <https://wg21.link/P1614>`__","LWG","The Mothership has Landed","Cologne","|In Progress|",""
+"`P1638 <https://wg21.link/P1638>`__","LWG","basic_istream_view::iterator should not be copyable","Cologne","",""
+"`P1643 <https://wg21.link/P1643>`__","LWG","Add wait/notify to atomic_ref","Cologne","",""
+"`P1644 <https://wg21.link/P1644>`__","LWG","Add wait/notify to atomic<shared_ptr>","Cologne","",""
+"`P1650 <https://wg21.link/P1650>`__","LWG","Output std::chrono::days with 'd' suffix","Cologne","",""
+"`P1651 <https://wg21.link/P1651>`__","LWG","bind_front should not unwrap reference_wrapper","Cologne","|Complete|","13.0"
+"`P1652 <https://wg21.link/P1652>`__","LWG","Printf corner cases in std::format","Cologne","",""
+"`P1661 <https://wg21.link/P1661>`__","LWG","Remove dedicated precalculated hash lookup interface","Cologne","|Nothing To Do|",""
+"`P1754 <https://wg21.link/P1754>`__","LWG","Rename concepts to standard_case for C++20, while we still can","Cologne","|In Progress|",""
+"","","","","",""
+"`P0883 <https://wg21.link/P0883>`__","LWG","Fixing Atomic Initialization","Belfast","|Complete| [#note-P0883]_","13.0"
+"`P1391 <https://wg21.link/P1391>`__","LWG","Range constructor for std::string_view","Belfast","* *",""
+"`P1394 <https://wg21.link/P1394>`__","LWG","Range constructor for std::span","Belfast","* *",""
+"`P1456 <https://wg21.link/P1456>`__","LWG","Move-only views","Belfast","* *",""
+"`P1622 <https://wg21.link/P1622>`__","LWG","Mandating the Standard Library: Clause 32 - Thread support library","Belfast","* *",""
+"`P1645 <https://wg21.link/P1645>`__","LWG","constexpr for numeric algorithms","Belfast","|Complete|","12.0"
+"`P1664 <https://wg21.link/P1664>`__","LWG","reconstructible_range - a concept for putting ranges back together","Belfast","* *",""
+"`P1686 <https://wg21.link/P1686>`__","LWG","Mandating the Standard Library: Clause 27 - Time library","Belfast","* *",""
+"`P1690 <https://wg21.link/P1690>`__","LWG","Refinement Proposal for P0919 Heterogeneous lookup for unordered containers","Belfast","|Complete|","12.0"
+"`P1716 <https://wg21.link/P1716>`__","LWG","ranges compare algorithm are over-constrained","Belfast","* *",""
+"`P1718 <https://wg21.link/P1718>`__","LWG","Mandating the Standard Library: Clause 25 - Algorithms library","Belfast","* *",""
+"`P1719 <https://wg21.link/P1719>`__","LWG","Mandating the Standard Library: Clause 26 - Numerics library","Belfast","* *",""
+"`P1720 <https://wg21.link/P1720>`__","LWG","Mandating the Standard Library: Clause 28 - Localization library","Belfast","* *",""
+"`P1721 <https://wg21.link/P1721>`__","LWG","Mandating the Standard Library: Clause 29 - Input/Output library","Belfast","* *",""
+"`P1722 <https://wg21.link/P1722>`__","LWG","Mandating the Standard Library: Clause 30 - Regular Expression library","Belfast","* *",""
+"`P1723 <https://wg21.link/P1723>`__","LWG","Mandating the Standard Library: Clause 31 - Atomics library","Belfast","* *",""
+"`P1855 <https://wg21.link/P1855>`__","LWG","Make ``<compare>``\ freestanding","Belfast","* *",""
+"`P1862 <https://wg21.link/P1862>`__","LWG","Ranges adaptors for non-copyable iterators","Belfast","* *",""
+"`P1865 <https://wg21.link/P1865>`__","LWG","Add max() to latch and barrier","Belfast","|Complete|","11.0"
+"`P1869 <https://wg21.link/P1869>`__","LWG","Rename 'condition_variable_any' interruptible wait methods","Belfast","* *",""
+"`P1870 <https://wg21.link/P1870>`__","LWG","forwarding-range is too subtle","Belfast","|In Progress|",""
+"`P1871 <https://wg21.link/P1871>`__","LWG","Should concepts be enabled or disabled?","Belfast","* *",""
+"`P1872 <https://wg21.link/P1872>`__","LWG","span should have size_type, not index_type","Belfast","|Complete|","10.0"
+"`P1878 <https://wg21.link/P1878>`__","LWG","Constraining Readable Types","Belfast","* *",""
+"`P1892 <https://wg21.link/P1892>`__","LWG","Extended locale-specific presentation specifiers for std::format","Belfast","* *",""
+"`P1902 <https://wg21.link/P1902>`__","LWG","Missing feature-test macros 2018-2019","Belfast","* *",""
+"`P1959 <https://wg21.link/P1959>`__","LWG","Remove std::weak_equality and std::strong_equality","Belfast","* *",""
+"`P1960 <https://wg21.link/P1960>`__","LWG","NB Comment Changes Reviewed by SG1","Belfast","* *",""
+"`P1961 <https://wg21.link/P1961>`__","LWG","Harmonizing the definitions of total order for pointers","Belfast","* *",""
+"`P1965 <https://wg21.link/P1965>`__","LWG","Blanket Wording for Specifying ""Hidden Friends""","Belfast","* *",""
+"","","","","",""
+"`P0586 <https://wg21.link/P0586>`__","LWG","Safe integral comparisons","Prague","|Complete|","13.0"
+"`P0593 <https://wg21.link/P0593>`__","CWG","Implicit creation of objects for low-level object manipulation","Prague","* *",""
+"`P1115 <https://wg21.link/P1115>`__","LWG","Improving the Return Value of Erase-Like Algorithms II: Free erase/erase if","Prague","|Complete|","11.0"
+"`P1243 <https://wg21.link/P1243>`__","LWG","Rangify New Algorithms","Prague","* *",""
+"`P1460 <https://wg21.link/P1460>`__","LWG","Mandating the Standard Library: Clause 20 - Utilities library","Prague","* *",""
+"`P1739 <https://wg21.link/P1739>`__","LWG","Avoid template bloat for safe_ranges in combination with ""subrange-y"" view adaptors","Prague","* *",""
+"`P1831 <https://wg21.link/P1831>`__","LWG","Deprecating volatile: library","Prague","* *",""
+"`P1868 <https://wg21.link/P1868>`__","LWG","width: clarifying units of width and precision in std::format","Prague","* *",""
+"`P1908 <https://wg21.link/P1908>`__","CWG","Reserving Attribute Namespaces for Future Use","Prague","* *",""
+"`P1937 <https://wg21.link/P1937>`__","CWG","Fixing inconsistencies between constexpr and consteval functions","Prague","* *",""
+"`P1956 <https://wg21.link/P1956>`__","LWG","On the names of low-level bit manipulation functions","Prague","|Complete|","12.0"
+"`P1957 <https://wg21.link/P1957>`__","CWG","Converting from ``T*``\ to bool should be considered narrowing (re: US 212)","Prague","* *",""
+"`P1963 <https://wg21.link/P1963>`__","LWG","Fixing US 313","Prague","* *",""
+"`P1964 <https://wg21.link/P1964>`__","LWG","Wording for boolean-testable","Prague","|Complete|","13.0"
+"`P1970 <https://wg21.link/P1970>`__","LWG","Consistency for size() functions: Add ranges::ssize","Prague","* *",""
+"`P1973 <https://wg21.link/P1973>`__","LWG","Rename ""_default_init"" Functions, Rev1","Prague","* *",""
+"`P1976 <https://wg21.link/P1976>`__","LWG","Fixed-size span construction from dynamic range","Prague","|Complete|","11.0"
+"`P1981 <https://wg21.link/P1981>`__","LWG","Rename leap to leap_second","Prague","* *",""
+"`P1982 <https://wg21.link/P1982>`__","LWG","Rename link to time_zone_link","Prague","* *",""
+"`P1983 <https://wg21.link/P1983>`__","LWG","Wording for GB301, US296, US292, US291, and US283","Prague","* *",""
+"`P1994 <https://wg21.link/P1994>`__","LWG","elements_view needs its own sentinel","Prague","* *",""
+"`P2002 <https://wg21.link/P2002>`__","CWG","Defaulted comparison specification cleanups","Prague","* *",""
+"`P2045 <https://wg21.link/P2045>`__","LWG","Missing Mandates for the standard library","Prague","* *",""
+"`P2085 <https://wg21.link/P2085>`__","CWG","Consistent defaulted comparisons","Prague","* *",""
+"`P2091 <https://wg21.link/P2091>`__","LWG","Issues with range access CPOs","Prague","* *",""
+"`P2101 <https://wg21.link/P2101>`__","LWG","'Models' subsumes 'satisfies' (Wording for US298 and US300)","Prague","* *",""
+"`P2102 <https://wg21.link/P2102>`__","LWG","Make 'implicit expression variations' more explicit (Wording for US185)","Prague","* *",""
+"`P2106 <https://wg21.link/P2106>`__","LWG","Alternative wording for GB315 and GB316","Prague","* *",""
+"`P2116 <https://wg21.link/P2116>`__","LWG","Remove tuple-like protocol support from fixed-extent span","Prague","|Complete|","11.0"
+"`P2231 <https://wg21.link/P2231>`__","LWG","Missing constexpr in std::optional and std::variant","February 2021","|In progress|","13.0"
+"`P2325 <https://wg21.link/P2325>`__","LWG","Views should not be required to be default constructible","June 2021","|In progress|",""
+"`P2210R2 <https://wg21.link/P2210R2>`__","LWG",Superior String Splitting,"June 2021","",""
+"`P2216R3 <https://wg21.link/P2216R3>`__","LWG",std::format improvements,"June 2021","",""
+"`P2281R1 <https://wg21.link/P2281R1>`__","LWG",Clarifying range adaptor objects,"June 2021","",""
+"`P2328R1 <https://wg21.link/P2328R1>`__","LWG",join_view should join all views of ranges,"June 2021","",""
+"`P2367R0 <https://wg21.link/P2367R0>`__","LWG",Remove misuses of list-initialization from Clause 24,"June 2021","",""
\ No newline at end of file
--- /dev/null
+.. _cxx2b-status:\r
+\r
+================================\r
+libc++ C++2b Status\r
+================================\r
+\r
+.. include:: ../Helpers/Styles.rst\r
+\r
+.. contents::\r
+ :local:\r
+\r
+\r
+Overview\r
+================================\r
+\r
+In November 2020, the C++ standard committee adopted the first changes to the next version of the C++ standard, known here as "C++2b" (probably to be C++23).\r
+\r
+This page shows the status of libc++; the status of clang's support of the language features is `here <https://clang.llvm.org/cxx_status.html#cxx23>`__.\r
+\r
+.. attention:: Features in unreleased drafts of the standard are subject to change.\r
+\r
+The groups that have contributed papers:\r
+\r
+- CWG - Core Language Working group\r
+- LWG - Library working group\r
+- SG1 - Study group #1 (Concurrency working group)\r
+\r
+.. note:: "Nothing to do" means that no library changes were needed to implement this change.\r
+\r
+.. _paper-status-cxx2b:\r
+\r
+Paper Status\r
+====================================\r
+\r
+.. csv-table::\r
+ :file: Cxx2bPapers.csv\r
+ :header-rows: 1\r
+ :widths: auto\r
+\r
+.. _issues-status-cxx2b:\r
+\r
+Library Working Group Issues Status\r
+====================================\r
+\r
+.. csv-table::\r
+ :file: Cxx2bIssues.csv\r
+ :header-rows: 1\r
+ :widths: auto\r
+\r
+Last Updated: 22-July-2021\r
--- /dev/null
+"Issue #","Issue Name","Meeting","Status","First released version"
+"`2839 <https://wg21.link/LWG2839>`__","Self-move-assignment of library types, again","November 2020","",""
+"`3117 <https://wg21.link/LWG3117>`__","Missing ``packaged_task`` deduction guides","November 2020","",""
+"`3143 <https://wg21.link/LWG3143>`__","``monotonic_buffer_resource`` growth policy is unclear","November 2020","",""
+"`3195 <https://wg21.link/LWG3195>`__","What is the stored pointer value of an empty weak_ptr?","November 2020","",""
+"`3211 <https://wg21.link/LWG3211>`__","``std::tuple<>`` should be trivially constructible","November 2020","",""
+"`3236 <https://wg21.link/LWG3236>`__","Random access iterator requirements lack limiting relational operators domain to comparing those from the same range","November 2020","",""
+"`3265 <https://wg21.link/LWG3265>`__","``move_iterator``'s conversions are more broken after P1207","November 2020","Fixed by `LWG3435 <https://wg21.link/LWG3435>`__",""
+"`3435 <https://wg21.link/LWG3435>`__","``three_way_comparable_with<reverse_iterator<int*>, reverse_iterator<const int*>>``","November 2020","|Complete|","13.0"
+"`3432 <https://wg21.link/LWG3432>`__","Missing requirement for comparison_category","November 2020","",""
+"`3447 <https://wg21.link/LWG3447>`__","Deduction guides for ``take_view`` and ``drop_view`` have different constraints","November 2020","",""
+"`3450 <https://wg21.link/LWG3450>`__","The const overloads of ``take_while_view::begin/end`` are underconstrained","November 2020","",""
+"`3464 <https://wg21.link/LWG3464>`__","``istream::gcount()`` can overflow","November 2020","",""
+"`2731 <https://wg21.link/LWG2731>`__","Existence of ``lock_guard<MutexTypes...>::mutex_type`` typedef unclear","November 2020","",""
+"`2743 <https://wg21.link/LWG2743>`__","P0083R3 ``node_handle`` private members missing ""exposition only"" comment","November 2020","",""
+"`2820 <https://wg21.link/LWG2820>`__","Clarify ``<cstdint>`` macros","November 2020","",""
+"`3120 <https://wg21.link/LWG3120>`__","Unclear behavior of ``monotonic_buffer_resource::release()``","November 2020","",""
+"`3170 <https://wg21.link/LWG3170>`__","``is_always_equal`` added to ``std::allocator`` makes the standard library treat derived types as always equal","November 2020","",""
+"`3036 <https://wg21.link/LWG3036>`__","``polymorphic_allocator::destroy`` is extraneous","November 2020","",""
+"`3171 <https://wg21.link/LWG3171>`__","LWG2989 breaks ``directory_entry`` stream insertion","November 2020","",""
+"`3306 <https://wg21.link/LWG3306>`__","``ranges::advance`` violates its preconditions","November 2020","",""
+"`3403 <https://wg21.link/LWG3403>`__","Domain of ``ranges::ssize(E)`` doesn't ``match ranges::size(E)``","November 2020","",""
+"`3404 <https://wg21.link/LWG3404>`__","Finish removing subrange's conversions from pair-like","November 2020","",""
+"`3405 <https://wg21.link/LWG3405>`__","``common_view``'s converting constructor is bad, too","November 2020","",""
+"`3406 <https://wg21.link/LWG3406>`__","``elements_view::begin()`` and ``elements_view::end()`` have incompatible constraints","November 2020","",""
+"`3419 <https://wg21.link/LWG3419>`__","[algorithms.requirements]/15 doesn't reserve as many rights as it intends to","November 2020","",""
+"`3420 <https://wg21.link/LWG3420>`__","cpp17-iterator should check that the type looks like an iterator first","November 2020","",""
+"`3421 <https://wg21.link/LWG3421>`__","Imperfect ADL emulation for boolean-testable","November 2020","",""
+"`3425 <https://wg21.link/LWG3425>`__","``condition_variable_any`` fails to constrain its Lock parameters","November 2020","",""
+"`3426 <https://wg21.link/LWG3426>`__","``operator<=>(const unique_ptr<T, D>&, nullptr_t)`` can't get no satisfaction","November 2020","",""
+"`3427 <https://wg21.link/LWG3427>`__","``operator<=>(const shared_ptr<T>&, nullptr_t)`` definition ill-formed","November 2020","",""
+"`3428 <https://wg21.link/LWG3428>`__","``single_view``'s in place constructor should be explicit","November 2020","",""
+"`3434 <https://wg21.link/LWG3434>`__","``ios_base`` never reclaims memory for iarray and parray","November 2020","",""
+"`3437 <https://wg21.link/LWG3437>`__","``__cpp_lib_polymorphic_allocator`` is in the wrong header","November 2020","",""
+"`3446 <https://wg21.link/LWG3446>`__","``indirectly_readable_traits`` ambiguity for types with both ``value_type`` and ``element_type``","November 2020","",""
+"`3448 <https://wg21.link/LWG3448>`__","``transform_view``'s sentinel<false> not comparable with ``iterator<true>``","November 2020","",""
+"`3449 <https://wg21.link/LWG3449>`__","take_view and take_while_view's ``sentinel<false>`` not comparable with their const iterator","November 2020","",""
+"`3453 <https://wg21.link/LWG3453>`__","Generic code cannot call ``ranges::advance(i, s)``","November 2020","",""
+"`3455 <https://wg21.link/LWG3455>`__","Incorrect Postconditions on ``unique_ptr`` move assignment","November 2020","|Nothing To Do|",""
+"`3460 <https://wg21.link/LWG3460>`__","Unimplementable ``noop_coroutine_handle`` guarantees","November 2020","",""
+"`3461 <https://wg21.link/LWG3461>`__","``convertible_to``'s description mishandles cv-qualified void","November 2020","",""
+"`3465 <https://wg21.link/LWG3465>`__","compare_partial_order_fallback requires ``F < E``","November 2020","",""
+"`3466 <https://wg21.link/LWG3466>`__","Specify the requirements for ``promise``/``future``/``shared_future`` consistently","November 2020","",""
+"`3467 <https://wg21.link/LWG3467>`__","``bool`` can't be an integer-like type","November 2020","",""
+"`3472 <https://wg21.link/LWG3472>`__","``counted_iterator`` is missing preconditions","November 2020","",""
+"`3473 <https://wg21.link/LWG3473>`__","Normative encouragement in non-normative note","November 2020","",""
+"`3474 <https://wg21.link/LWG3474>`__","Nesting ``join_views`` is broken because of CTAD","November 2020","",""
+"`3476 <https://wg21.link/LWG3476>`__","``thread`` and ``jthread`` constructors require that the parameters be move-constructible but never move construct the parameters","November 2020","",""
+"`3477 <https://wg21.link/LWG3477>`__","Simplify constraints for semiregular-box","November 2020","",""
+"`3482 <https://wg21.link/LWG3482>`__","``drop_view``'s const begin should additionally require sized_range","November 2020","",""
+"`3483 <https://wg21.link/LWG3483>`__","``transform_view::iterator``'s difference is overconstrained","November 2020","",""
+"","","","",""
+"`3391 <https://wg21.link/LWG3391>`__","Problems with ``counted_iterator``/``move_iterator::base() const &``","February 2021","",""
+"`3433 <https://wg21.link/LWG3433>`__","``subrange::advance(n)`` has UB when ``n < 0``","February 2021","",""
+"`3490 <https://wg21.link/LWG3490>`__","``ranges::drop_while_view::begin()`` is missing a precondition","February 2021","",""
+"`3492 <https://wg21.link/LWG3492>`__","Minimal improvements to ``elements_view::iterator``","February 2021","",""
+"`3494 <https://wg21.link/LWG3494>`__","Allow ranges to be conditionally borrowed","February 2021","Superseded by `P2017R1 <https://wg21.link/P2017R1>`__",""
+"`3495 <https://wg21.link/LWG3495>`__","``constexpr launder`` makes pointers to inactive members of unions usable","February 2021","",""
+"`3500 <https://wg21.link/LWG3500>`__","``join_view::iterator::operator->()`` is bogus","February 2021","",""
+"`3502 <https://wg21.link/LWG3502>`__","``elements_view`` should not be allowed to return dangling reference","February 2021","",""
+"`3505 <https://wg21.link/LWG3505>`__","``split_view::outer-iterator::operator++`` misspecified","February 2021","",""
+"","","","",""
+`2774 <https://wg21.link/LWG2774>`__,"``std::function`` construction vs assignment","June 2021","",""
+`2818 <https://wg21.link/LWG2818>`__,"``::std::`` everywhere rule needs tweaking","June 2021","",""
+`2997 <https://wg21.link/LWG2997>`__,"LWG 491 and the specification of ``{forward_,}list::unique``","June 2021","",""
+`3410 <https://wg21.link/LWG3410>`__,"``lexicographical_compare_three_way`` is overspecified","June 2021","",""
+`3430 <https://wg21.link/LWG3430>`__,"``std::fstream`` & co. should be constructible from string_view","June 2021","",""
+`3462 <https://wg21.link/LWG3462>`__,"§[formatter.requirements]: Formatter requirements forbid use of ``fc.arg()``","June 2021","",""
+`3481 <https://wg21.link/LWG3481>`__,"``viewable_range`` mishandles lvalue move-only views","June 2021","",""
+`3506 <https://wg21.link/LWG3506>`__,"Missing allocator-extended constructors for ``priority_queue``","June 2021","",""
+`3517 <https://wg21.link/LWG3517>`__,"``join_view::iterator``'s ``iter_swap`` is underconstrained","June 2021","",""
+`3518 <https://wg21.link/LWG3518>`__,"Exception requirements on char trait operations unclear","June 2021","",""
+`3519 <https://wg21.link/LWG3519>`__,"Incomplete synopses for <random> classes","June 2021","",""
+`3520 <https://wg21.link/LWG3520>`__,"``iter_move`` and ``iter_swap`` are inconsistent for ``transform_view::iterator``","June 2021","",""
+`3521 <https://wg21.link/LWG3521>`__,"Overly strict requirements on ``qsort`` and ``bsearch``","June 2021","",""
+`3522 <https://wg21.link/LWG3522>`__,"Missing requirement on ``InputIterator`` template parameter for ``priority_queue`` constructors","June 2021","",""
+`3523 <https://wg21.link/LWG3523>`__,"``iota_view::sentinel`` is not always ``iota_view``'s sentinel","June 2021","",""
+`3526 <https://wg21.link/LWG3526>`__,"Return types of ``uses_allocator_construction_args`` unspecified","June 2021","",""
+`3527 <https://wg21.link/LWG3527>`__,"``uses_allocator_construction_args`` handles rvalue pairs of rvalue references incorrectly","June 2021","",""
+`3528 <https://wg21.link/LWG3528>`__,"``make_from_tuple`` can perform (the equivalent of) a C-style cast","June 2021","",""
+`3529 <https://wg21.link/LWG3529>`__,"``priority_queue(first, last)`` should construct ``c`` with ``(first, last)``","June 2021","",""
+`3530 <https://wg21.link/LWG3530>`__,"``BUILTIN-PTR-MEOW`` should not opt the type out of syntactic checks","June 2021","",""
+`3532 <https://wg21.link/LWG3532>`__,"``split_view<V, P>::inner-iterator<true>::operator++(int)`` should depend on ``Base``","June 2021","",""
+`3533 <https://wg21.link/LWG3533>`__,"Make ``base() const &`` consistent across iterator wrappers that supports ``input_iterators``","June 2021","",""
+`3536 <https://wg21.link/LWG3536>`__,"Should ``chrono::from_stream()`` assign zero to duration for failure?","June 2021","",""
+`3539 <https://wg21.link/LWG3539>`__,"``format_to`` must not copy models of ``output_iterator<const charT&>``","June 2021","",""
+`3540 <https://wg21.link/LWG3540>`__,"§[format.arg] There should be no const in ``basic_format_arg(const T* p)``","June 2021","",""
+`3541 <https://wg21.link/LWG3541>`__,"``indirectly_readable_traits`` should be SFINAE-friendly for all types","June 2021","",""
+`3542 <https://wg21.link/LWG3542>`__,"``basic_format_arg`` mishandles ``basic_string_view`` with custom traits","June 2021","",""
+`3543 <https://wg21.link/LWG3543>`__,"Definition of when ``counted_iterators`` refer to the same sequence isn't quite right","June 2021","",""
+`3544 <https://wg21.link/LWG3544>`__,"``format-arg-store::args`` is unintentionally not exposition-only","June 2021","",""
+`3546 <https://wg21.link/LWG3546>`__,"``common_iterator``'s postfix-proxy is not quite right","June 2021","",""
+`3548 <https://wg21.link/LWG3548>`__,"``shared_ptr`` construction from ``unique_ptr`` should move (not copy) the deleter","June 2021","",""
+`3549 <https://wg21.link/LWG3549>`__,"``view_interface`` is overspecified to derive from ``view_base``","June 2021","",""
+`3551 <https://wg21.link/LWG3551>`__,"``borrowed_{iterator,subrange}_t`` are overspecified","June 2021","",""
+`3552 <https://wg21.link/LWG3552>`__,"Parallel specialized memory algorithms should require forward iterators","June 2021","",""
+`3553 <https://wg21.link/LWG3553>`__,"Useless constraint in ``split_view::outer-iterator::value_type::begin()``","June 2021","",""
+`3555 <https://wg21.link/LWG3555>`__,"``{transform,elements}_view::iterator::iterator_concept`` should consider const-qualification of the underlying range","June 2021","",""
+"","","","",""
--- /dev/null
+"Paper #","Group","Paper Name","Meeting","Status","First released version"
+"`P0881R7 <https://wg21.link/P0881R7>`__","LWG","A Proposal to add stacktrace library","Autumn 2020","",""
+"`P0943R6 <https://wg21.link/P0943R6>`__","LWG","Support C atomics in C++","Autumn 2020","",""
+"`P1048R1 <https://wg21.link/P1048R1>`__","LWG","A proposal for a type trait to detect scoped enumerations","Autumn 2020","|Complete|","12.0"
+"`P1679R3 <https://wg21.link/P1679R3>`__","LWG","string contains function","Autumn 2020","|Complete|","12.0"
+"","","","","",""
+"`P1682R3 <https://wg21.link/P1682R3>`__","LWG","std::to_underlying for enumerations","February 2021","|Complete|","13.0"
+"`P2017R1 <https://wg21.link/P2017R1>`__","LWG","Conditionally borrowed ranges","February 2021","",""
+"`P2160R1 <https://wg21.link/P2160R1>`__","LWG","Locks lock lockables","February 2021","",""
+"`P2162R2 <https://wg21.link/P2162R2>`__","LWG","Inheriting from std::variant","February 2021","|Complete|","13.0"
+"`P2212R2 <https://wg21.link/P2212R2>`__","LWG","Relax Requirements for time_point::clock","February 2021","",""
+"`P2259R1 <https://wg21.link/P2259R1>`__","LWG","Repairing input range adaptors and counted_iterator","February 2021","",""
+"","","","","",""
+"`P0401R6 <https://wg21.link/P0401R6>`__","LWG","Providing size feedback in the Allocator interface","June 2021","",
+"`P0448R4 <https://wg21.link/P0448R4>`__","LWG","A strstream replacement using span<charT> as buffer","June 2021","",""
+"`P1132R8 <https://wg21.link/P1132R8>`__","LWG","out_ptr - a scalable output pointer abstraction","June 2021","",""
+"`P1328R1 <https://wg21.link/P1328R1>`__","LWG","Making std::type_info::operator== constexpr","June 2021","",""
+"`P1425R4 <https://wg21.link/P1425R4>`__","LWG","Iterators pair constructors for stack and queue","June 2021","",""
+"`P1518R2 <https://wg21.link/P1518R2>`__","LWG","Stop overconstraining allocators in container deduction guides","June 2021","|Complete|","13.0"
+"`P1659R3 <https://wg21.link/P1659R3>`__","LWG","starts_with and ends_with","June 2021","",""
+"`P1951R1 <https://wg21.link/P1951R1>`__","LWG","Default Arguments for pair Forwarding Constructor","June 2021","",""
+"`P1989R2 <https://wg21.link/P1989R2>`__","LWG","Range constructor for std::string_view","June 2021","",""
+"`P2136R3 <https://wg21.link/P2136R3>`__","LWG","invoke_r","June 2021","",""
+"`P2166R1 <https://wg21.link/P2166R1>`__","LWG","A Proposal to Prohibit std::basic_string and std::basic_string_view construction from nullptr","June 2021","|Complete|","13.0"
+"","","","","",""
\ No newline at end of file
--- /dev/null
+.. format-status:
+
+================================
+libc++ Format Status
+================================
+
+.. include:: ../Helpers/Styles.rst
+
+.. contents::
+ :local:
+
+
+Overview
+========
+
+This document contains the status of the C++20 Format library in libc++. It is used to
+track both the status of the sub-projects of the Format library and who is assigned to
+these sub-projects. This is imperative to effective implementation so that work is not
+duplicated and implementors are not blocked by each other.
+
+
+If you are interested in contributing to the libc++ Format library, please send
+a message to the #libcxx channel in the LLVM discord. Please *do not* start
+working on any of the assigned items below.
+
+
+Sub-Projects in the Format library
+==================================
+
+.. csv-table::
+ :file: FormatPaper.csv
+ :header-rows: 1
+ :widths: auto
+
+
+Misc. Items and TODOs
+=====================
+
+(Please mark all Format-related TODO comments with the string ``TODO FMT``, so we
+can find them easily.)
+
+ * C++23 may break the ABI with `P2216 <https://wg21.link/P2216>`_.
+ This ABI break may be backported to C++20. Therefore the library will not
+ be available on platforms where the ABI break is an issue.
+
+
+Paper and Issue Status
+======================
+
+.. csv-table::
+ :file: FormatIssues.csv
+ :header-rows: 1
+ :widths: auto
--- /dev/null
+Number,Name,Assignee,Patch,Status,First released version
+`P0645 <https://wg21.link/P0645>`_,"Text Formatting",Mark de Wever,,|partial|,
+`P1652 <https://wg21.link/P1652>`_,"Printf corner cases in std::format",Mark de Wever,`D103433 <https://reviews.llvm.org/D103433>`__,Review,
+`P1892 <https://wg21.link/P1892>`_,"Extended locale-specific presentation specifiers for std::format",Mark de Wever,`D103368 <https://reviews.llvm.org/D103368>`__,Review,
+`P1868 <https://wg21.link/P1868>`_,"width: clarifying units of width and precision in std::format (Implements the unicode support.)",Mark de Wever,"`D103413 <https://reviews.llvm.org/D103413>`__ `D103425 <https://reviews.llvm.org/D103425>`__ `D103670 <https://reviews.llvm.org/D103670>`__",Review,
+`P2216 <https://wg21.link/P2216>`_,"std::format improvements",,,,
+`LWG-3242 <https://wg21.link/LWG3242>`_,"std::format: missing rules for arg-id in width and precision",Mark de Wever,`D103368 <https://reviews.llvm.org/D103368>`__,Review,
+`LWG-3243 <https://wg21.link/LWG3243>`_,"std::format and negative zeroes",,,,
+`LWG-3246 <https://wg21.link/LWG3246>`_,"What are the constraints on the template parameter of basic_format_arg?",,,,
+`LWG-3248 <https://wg21.link/LWG3248>`_,"std::format #b, #B, #o, #x, and #X presentation types misformat negative numbers",Mark de Wever,`D103433 <https://reviews.llvm.org/D103433>`__,Review,
+`LWG-3250 <https://wg21.link/LWG3250>`_,"std::format: # (alternate form) for NaN and inf",,,,
+`LWG-3327 <https://wg21.link/LWG3327>`_,"Format alignment specifiers vs. text direction",,,|Nothing To Do|,
+`LWG-3340 <https://wg21.link/LWG3340>`_,"Formatting functions should throw on argument/format string mismatch in [format.functions]",,,,
+`LWG-3371 <https://wg21.link/LWG3371>`_,"visit_format_arg and make_format_args are not hidden friends",Mark de Wever,`D103357 <https://llvm.org/D103357>`__,Review,
+`LWG-3372 <https://wg21.link/LWG3372>`_,"vformat_to should not try to deduce Out twice",,,,
+`LWG-3373 <https://wg21.link/LWG3373>`_,"{to,from}_chars_result and format_to_n_result need the 'we really mean what we say'",,,,
+`LWG-3462 <https://wg21.link/LWG3462>`_,"§[formatter.requirements]: Formatter requirements forbid use of fc.arg()",,,,
+`LWG-3539 <https://wg21.link/LWG3539>`_,"format_to must not copy models of output_iterator<const charT&>",,,,
+`LWG-3540 <https://wg21.link/LWG3540>`_,"§[format.arg] There should be no const in basic_format_arg(const T* p)",,,,
+`LWG-3541 <https://wg21.link/LWG3541>`_,"indirectly_readable_traits should be SFINAE-friendly for all types",,,,
+`LWG-3542 <https://wg21.link/LWG3542>`_,"basic_format_arg mishandles basic_string_view with custom traits",,,,
+`LWG-3544 <https://wg21.link/LWG3544>`_,"format-arg-store::args is unintentionally not exposition-only",,,,
+
+`P1361 <https://wg21.link/P1361>`_,"Integration of chrono with text formatting",,,,
+`LWG-3218 <https://wg21.link/LWG3218>`_,"Modifier for %d parse flag does not match POSIX and format specification",,,,
+`LWG-3230 <https://wg21.link/LWG3230>`_,"Format specifier %y/%Y is missing locale alternative versions",,,,
+`LWG-3241 <https://wg21.link/LWG3241>`_,"chrono-spec grammar ambiguity in [time.format]",,,,
+`LWG-3262 <https://wg21.link/LWG3262>`_,"Formatting of negative durations is not specified",,,,
+`LWG-3270 <https://wg21.link/LWG3270>`_,"Parsing and formatting %j with durations",,,,
+`LWG-3272 <https://wg21.link/LWG3272>`_,"%I%p should parse/format duration since midnight",,,,
+`LWG-3332 <https://wg21.link/LWG3332>`_,"Issue in [time.format]",,,,
--- /dev/null
+Section,Description,Dependencies,Assignee,Patch,Status,First released version
+[charconv.to.chars],"Fix integral conformance",,Mark de Wever,`D100722 <https://llvm.org/D100722>`__,|Complete|,Clang 13
+[charconv.to.chars],"Add floating-point conversion",`D100722 <https://llvm.org/D100722>`__,"Mark de Wever (Code provided by Stephan T. Lavavej of Microsoft)",`D70631 <https://llvm.org/D70631>`__,In progress,
+[format.error],"Class format_error",,Mark de Wever,`D92214 <https://llvm.org/D92214>`__,|Complete|,Clang 13
+[format.parse.ctx],"Class template basic_format_parse_context",,Mark de Wever,`D93166 <https://llvm.org/D93166>`__,|Complete|,Clang 13
+[format.context],"Class template basic_format_context",,Mark de Wever,`D103357 <https://llvm.org/D103357>`__,Review,
+[format.args],"Class template basic_format_args",,Mark de Wever,`D103357 <https://llvm.org/D103357>`__,Review,
+[format.arg],"Class template basic_format_arg",,Mark de Wever,`D103357 <https://llvm.org/D103357>`__,Review,
+[format.arg],"Class template basic_format_arg - handle",,,,,,
+[format.arg],"Class template basic_format_arg - pointers",,,,,,
+[format.arg.store],"Class template format-arg-store",,Mark de Wever,`D103357 <https://llvm.org/D103357>`__,Review,
+[format.formatter.spec],"Formatter specializations - character types",,Mark de Wever,"`D96664 <https://llvm.org/D96664>`__ `D103466 <https://llvm.org/D103466>`__",Review,
+[format.formatter.spec],"Formatter specializations - string types",,Mark de Wever,"`D96664 <https://llvm.org/D96664>`__ `D103425 <https://reviews.llvm.org/D103425>`__",Review,
+[format.formatter.spec],"Formatter specializations - boolean type",,Mark de Wever,"`D96664 <https://llvm.org/D96664>`__ `D103670 <https://reviews.llvm.org/D103670>`__",Review,
+[format.formatter.spec],"Formatter specializations - integral types",,Mark de Wever,"`D96664 <https://llvm.org/D96664>`__ `D103433 <https://reviews.llvm.org/D103433>`__",Review,
+[format.formatter.spec],"Formatter specializations - floating-point types",`D70631 <https://llvm.org/D70631>`__,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.formatter.spec],"Formatter specializations - pointer types",,,,,,
+[format.string.std],"Standard format specifiers - character types",,Mark de Wever,`D103368 <https://reviews.llvm.org/D103368>`__,Review,
+[format.string.std],"Standard format specifiers - string types",`D103379 <https://reviews.llvm.org/D103379>`__,Mark de Wever,"`D103368 <https://reviews.llvm.org/D103368>`__ `D103413 <https://reviews.llvm.org/D103413>`__",Review,
+[format.string.std],"Standard format specifiers - boolean type",`D103379 <https://reviews.llvm.org/D103379>`__,Mark de Wever,"`D103368 <https://reviews.llvm.org/D103368>`__ `D103413 <https://reviews.llvm.org/D103413>`__",Review,
+[format.string.std],"Standard format specifiers - integral types",,Mark de Wever,`D103368 <https://reviews.llvm.org/D103368>`__,Review,
+[format.string.std],"Standard format specifiers - floating-point types",,Mark de Wever,,,,
+[format.string.std],"Standard format specifiers - pointer types",,Mark de Wever,,,,
+[format.functions],"Format functions - format(string_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format(wstring_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format(const locale& loc, string_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format(const locale& loc, wstring_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - vformat(string_view fmt, format_args args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - vformat(wstring_view fmt, wformat_args args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - vformat(const locale& loc, string_view fmt, format_args args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - vformat(const locale& loc, wstring_view fmt, wformat_args args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format_to(Out out, wstring_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format_to(Out out, const locale& loc, wstring_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - vformat_to(Out out, string_view fmt, format_args_t<type_identity_t<Out>, char> args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - vformat_to(Out out, wstring_view fmt, format_args_t<type_identity_t<Out>, char> args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - vformat_to(Out out, const locale& loc, string_view fmt, format_args_t<type_identity_t<Out>, char> args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - vformat_to(Out out, const locale& loc, wstring_view fmt,format_args_t<type_identity_t<Out>, wchar_t> args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format_to_n(Out out, iter_difference_t<Out> n, string_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format_to_n(Out out, iter_difference_t<Out> n, wstring_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, const locale& loc, string_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, const locale& loc, wstring_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - formatted_size(string_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - formatted_size(wstring_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - formatted_size(const locale& loc, string_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - formatted_size(const locale& loc, wstring_view fmt, const Args&... args);",,Mark de Wever,`D96664 <https://llvm.org/D96664>`__,Review,
+[format.functions],"Format functions - Implement locale support",,Mark de Wever,,In progress,,
+[format.functions],"Format functions - Improve performance format_to_n",,Mark de Wever,,,,
+[format.functions],"Format functions - Improve performance formatted size",,Mark de Wever,,,,
--- /dev/null
+.. ranges-status:
+
+================================
+libc++ Ranges Status
+================================
+
+.. include:: ../Helpers/Styles.rst
+
+.. contents::
+ :local:
+
+
+Overview
+================================
+
+This document contains the status of the C++20 Ranges library in libc++. It is used to
+track both the status of the sub-projects of the ranges library and who is assigned to
+these sub-projects. This is imperative to effective implementation so that work is not
+duplicated and implementors are not blocked by each other.
+
+If you are interested in contributing to the libc++ Ranges library, please send a message
+to the #libcxx channel in the LLVM discord. Please *do not* start working on any of the
+assigned items below.
+
+
+Sub-Projects in the One Ranges Proposal
+=======================================
+
+.. csv-table::
+ :file: RangesPaper.csv
+ :header-rows: 1
+ :widths: auto
+
+
+Misc. Items and TODOs
+====================================
+
+(Note: files with required updates will contain the TODO at the beginning of the list item
+so they can be easily found via global search.)
+
+ * TODO(XX_SPACESHIP_CONCEPTS): when spaceship support is added to various STL types, we need to update some concept tests.
+
+Paper and Issue Status
+====================================
+
+(Note: stolen from MSVC `here <https://github.com/microsoft/STL/issues/39>`_.)
+
+.. csv-table::
+ :file: RangesIssues.csv
+ :header-rows: 1
+ :widths: auto
\ No newline at end of file
--- /dev/null
+"Number","Name","Status","Assignee"
+`P0896R4 <https://wg21.link/P0896R4>`__,<ranges>,,
+`P1035R7 <https://wg21.link/P1035R7>`__,Input Range Adaptors,,
+`P1207R4 <https://wg21.link/P1207R4>`__,Movability Of Single-Pass Iterators,,
+`P1243R4 <https://wg21.link/P1243R4>`__,Rangify New Algorithms,,
+`P1248R1 <https://wg21.link/P1248R1>`__,Fixing Relations,,
+`P1252R2 <https://wg21.link/P1252R2>`__,Ranges Design Cleanup,,
+`P1391R4 <https://wg21.link/P1391R4>`__,Range Constructor For string_view,,
+`P1456R1 <https://wg21.link/P1456R1>`__,Move-Only Views,,
+`P1474R1 <https://wg21.link/P1474R1>`__,Helpful Pointers For contiguous_iterator,,
+`P1522R1 <https://wg21.link/P1522R1>`__,Iterator Difference Type And Integer Overflow,,
+`P1523R1 <https://wg21.link/P1523R1>`__,Views And Size Types,,
+`P1638R1 <https://wg21.link/P1638R1>`__,basic_istream_view::iterator Should Not Be Copyable,,
+`P1716R3 <https://wg21.link/P1716R3>`__,Range Comparison Algorithms Are Over-Constrained,,
+`P1739R4 <https://wg21.link/P1739R4>`__,Avoiding Template Bloat For Ranges,,
+`P1862R1 <https://wg21.link/P1862R1>`__,Range Adaptors For Non-Copyable Iterators,,
+`P1870R1 <https://wg21.link/P1870R1>`__,safe_range,,
+`P1871R1 <https://wg21.link/P1871R1>`__,disable_sized_sentinel_for,,
+`P1878R1 <https://wg21.link/P1878R1>`__,Constraining Readable Types,,
+`P1970R2 <https://wg21.link/P1970R2>`__,ranges::ssize,,
+`P1983R0 <https://wg21.link/P1983R0>`__,Fixing Minor Ranges Issues,,
+`P1994R1 <https://wg21.link/P1994R1>`__,elements_view Needs Its Own sentinel,,
+`P2091R0 <https://wg21.link/P2091R0>`__,Fixing Issues With Range Access CPOs,,
+`P2106R0 <https://wg21.link/P2106R0>`__,Range Algorithm Result Types,,
+
+`P2325R3 <https://wg21.link/P2325R3>`__,Views should not be required to be default constructible ,,
+`P2328R1 <https://wg21.link/P2328R1>`__,join_view should join all views of ranges,,
+`P2210R2 <https://wg21.link/P2210R2>`__,Superior String Splitting,,
+`P2281R1 <https://wg21.link/P2281R1>`__,Clarifying range adaptor objects,,
+`P2367R0 <https://wg21.link/P2367R0>`__,Remove misuses of list-initialization from Clause 24,,
+
+`LWG3169 <https://wg21.link/lwg3169>`__, ranges permutation generators discard useful information,,
+`LWG3173 <https://wg21.link/lwg3173>`__, Enable CTAD for ref-view,,
+`LWG3179 <https://wg21.link/lwg3179>`__, subrange should always model Range,,
+`LWG3180 <https://wg21.link/lwg3180>`__, Inconsistently named return type for ranges::minmax_element,,
+`LWG3183 <https://wg21.link/lwg3183>`__, Normative permission to specialize Ranges variable templates,,
+`LWG3186 <https://wg21.link/lwg3186>`__, "ranges removal, partition, and partial_sort_copy algorithms discard useful information",,
+`LWG3191 <https://wg21.link/lwg3191>`__, std::ranges::shuffle synopsis does not match algorithm definition,,
+`LWG3276 <https://wg21.link/lwg3276>`__, Class split_view::outer_iterator::value_type should inherit from view_interface,,
+`LWG3280 <https://wg21.link/lwg3280>`__, View converting constructors can cause constraint recursion and are unneeded,,
+`LWG3281 <https://wg21.link/lwg3281>`__, Conversion from pair-like types to subrange is a silent semantic promotion,,
+`LWG3282 <https://wg21.link/lwg3282>`__, subrange converting constructor should disallow derived to base conversions,,
+`LWG3286 <https://wg21.link/lwg3286>`__, ranges::size is not required to be valid after a call to ranges::begin on an input range,,
+`LWG3291 <https://wg21.link/lwg3291>`__, iota_view::iterator has the wrong iterator_category,,
+`LWG3292 <https://wg21.link/lwg3292>`__, iota_view is under-constrained,,
+`LWG3299 <https://wg21.link/lwg3299>`__, Pointers don't need customized iterator behavior,,
+`LWG3301 <https://wg21.link/lwg3301>`__, transform_view::iterator has incorrect iterator_category,,
+`LWG3302 <https://wg21.link/lwg3302>`__, Range adaptor objects keys and values are unspecified,,
+`LWG3313 <https://wg21.link/lwg3313>`__, join_view::iterator::operator-- is incorrectly constrained,,
+`LWG3323 <https://wg21.link/lwg3323>`__, has-tuple-element helper concept needs convertible_to,,
+`LWG3325 <https://wg21.link/lwg3325>`__, Constrain return type of transformation function for transform_view,,
+`LWG3335 <https://wg21.link/lwg3335>`__, range_size_t and views::all_t,,
+`LWG3355 <https://wg21.link/lwg3355>`__, The memory algorithms should support move-only input iterators introduced by P1207,,
+`LWG3363 <https://wg21.link/lwg3363>`__, drop_while_view should opt-out of sized_range,,
+`LWG3364 <https://wg21.link/lwg3364>`__, Initialize data members of ranges and their iterators,,
+`LWG3381 <https://wg21.link/lwg3381>`__, begin and data must agree for contiguous_range,,
+`LWG3384 <https://wg21.link/lwg3384>`__, transform_view::sentinel has an incorrect operator-,,
+`LWG3385 <https://wg21.link/lwg3385>`__, common_iterator is not sufficiently constrained for non-copyable iterators,,
+`LWG3387 <https://wg21.link/lwg3387>`__, [range.reverse.view] reverse_view<V> unintentionally requires range<const V>,,
+`LWG3388 <https://wg21.link/lwg3388>`__, view iterator types have ill-formed <=> operators,,
+`LWG3389 <https://wg21.link/lwg3389>`__, A move-only iterator still does not have a counted_iterator,,
+`LWG3397 <https://wg21.link/lwg3397>`__, ranges::basic_istream_view::iterator should not provide iterator_category,,
+`LWG3398 <https://wg21.link/lwg3398>`__, tuple_element_t is also wrong for const subrange,,
+`LWG3474 <https://wg21.link/lwg3474>`__, Nesting join_views is broken because of CTAD,,
+`LWG3481 <https://wg21.link/LWG3481>`__,"viewable_range mishandles lvalue move-only views",,
+`LWG3500 <https://wg21.link/lwg3500>`__, join_view::iterator::operator->() is bogus,,
+`LWG3505 <https://wg21.link/lwg3505>`__, split_view::outer-iterator::operator++ misspecified,,
+`LWG3517 <https://wg21.link/LWG3517>`__,"join_view::iterator's iter_swap is underconstrained",,
+`LWG3520 <https://wg21.link/LWG3520>`__,"iter_move and iter_swap are inconsistent for transform_view::iterator",,
+`LWG3522 <https://wg21.link/LWG3522>`__,"Missing requirement on InputIterator template parameter for priority_queue constructors",,
+`LWG3523 <https://wg21.link/LWG3523>`__,"iota_view::sentinel is not always iota_view's sentinel",,
+`LWG3532 <https://wg21.link/LWG3532>`__,"split_view<V, P>::inner-iterator<true>::operator++(int) should depend on Base",,
+`LWG3533 <https://wg21.link/LWG3533>`__,"Make base() const & consistent across iterator wrappers that supports input_iterators",,
+`LWG3541 <https://wg21.link/LWG3541>`__,"indirectly_readable_traits should be SFINAE-friendly for all types",,
+`LWG3543 <https://wg21.link/LWG3543>`__,"Definition of when counted_iterators refer to the same sequence isn't quite right",,
+`LWG3546 <https://wg21.link/LWG3546>`__,"common_iterator's postfix-proxy is not quite right",,
+`LWG3549 <https://wg21.link/LWG3549>`__,"view_interface is overspecified to derive from view_base",,
+`LWG3551 <https://wg21.link/LWG3551>`__,"borrowed_{iterator,subrange}_t are overspecified",,
+`LWG3553 <https://wg21.link/LWG3553>`__,"Useless constraint in split_view::outer-iterator::value_type::begin()",,
+`LWG3555 <https://wg21.link/LWG3555>`__,"{transform,elements}_view::iterator::iterator_concept should consider const-qualification of the underlying range",,
--- /dev/null
+Section,Description,Dependencies,Assignee,Complete
+[tuple.helper],Update <tuple> includes.,None,Unassigned,Not started
+`[range.cmp] <http://wg21.link/range.cmp>`_,"| `ranges::equal_to <https://llvm.org/D100429>`_
+| `ranges::not_equal_to <https://llvm.org/D100429>`_
+| `ranges::less <https://llvm.org/D100429>`_
+| `ranges::greater <https://llvm.org/D100429>`_
+| `ranges::less_equal <https://llvm.org/D100429>`_
+| `ranges::greater_equal <https://llvm.org/D100429>`_",None,Zoe Carver,✅
+`[readable.traits] <http://wg21.link/readable.traits>`_,"| `indirectly_readable_traits <https://llvm.org/D99461>`_
+| `iter_value_t <https://llvm.org/D99863>`_",None,Christopher Di Bella,✅
+`[incrementable.traits] <http://wg21.link/incrementable.traits>`_,"| `incrementable_traits <https://llvm.org/D99141>`_
+| `iter_difference_t <https://llvm.org/D99863>`_",,Christopher Di Bella,✅
+`[iterator.traits] <http://wg21.link/iterator.traits>`_,`Updates to iterator_traits <https://llvm.org/D99855>`_,"| indirectly_readable_traits
+| incrementable_traits",Christopher Di Bella,✅
+`[special.mem.concepts] <http://wg21.link/special.mem.concepts>`_,"| *no-throw-input-iterator*
+| *no-throw-sentinel-for*
+| *no-throw-input-range*
+| *no-throw-forward-iterator*
+| *no-throw-forward-range*","| [iterator.concepts]
+| [range.refinements]",Unassigned,Not started
+`[specialized.algorithms] <http://wg21.link/specialized.algorithms>`_,"| ranges::uninitialized_default_construct
+| ranges::uninitialized_default_construct_n
+| ranges::uninitialized_value_construct
+| ranges::uninitialized_value_construct_n
+| ranges::uninitialized_copy
+| ranges::uninitialized_copy_n
+| ranges::uninitialized_move
+| ranges::uninitialized_move_n
+| ranges::uninitialized_fill
+| ranges::uninitialized_fill_n
+| ranges::construct_at
+| ranges::destroy
+| ranges::destroy_at
+| ranges::destroy_n",[special.mem.concepts],Unassigned,Not started
+[strings],Adds begin/end and updates const_iterator.,[iterator.concepts],Unassigned,Not started
+[views.span],Same as [strings],[iterator.concepts],Unassigned,Not started
+`[iterator.cust.move] <http://wg21.link/iterator.cust.move>`_,`ranges::iter_move <https://llvm.org/D99873>`_,,Zoe Carver,✅
+`[iterator.cust.swap] <http://wg21.link/iterator.cust.swap>`_,`ranges::iter_swap <https://llvm.org/D102809>`_,iter_value_t,Zoe Carver,✅
+`[iterator.concepts] <http://wg21.link/iterator.concepts>`_,"| `indirectly_readable <https://llvm.org/D100073>`_
+| `indirectly_writable <https://llvm.org/D100073>`_
+| `weakly_incrementable <https://llvm.org/D100080>`_
+| `incrementable <https://llvm.org/D100080>`_
+| `input_or_output_iterator <https://llvm.org/D100160>`_
+| `sentinel_for <https://llvm.org/D100160>`_
+| `sized_sentinel_for <https://llvm.org/D101371>`_
+| `input_iterator <https://llvm.org/D100271>`_
+| `output_iterator <https://llvm.org/D106704>`_
+| `forward_iterator <https://llvm.org/D100275>`_
+| `bidirectional_iterator <https://llvm.org/D100278>`_
+| `random_access_iterator <https://llvm.org/D101316>`_
+| `contiguous_iterator <https://llvm.org/D101396>`_",,Various,✅
+`[indirectcallable.indirectinvocable] <http://wg21.link/indirectcallable.indirectinvocable>`_,"| indirectly_unary_invocable
+| `indirectly_regular_unary_invocable <https://llvm.org/D101277>`_
+| `indirectly_unary_predicate <https://llvm.org/D101277>`_
+| `indirectly_binary_predicate <https://llvm.org/D101277>`_
+| `indirectly_equivalence_relation <https://llvm.org/D101277>`_
+| `indirectly_strict_weak_order <https://llvm.org/D101277>`_",[readable.traits],Louis Dionne,✅
+`[projected] <http://wg21.link/projected>`_,`ranges::projected <https://llvm.org/D101277>`_,[iterator.concepts],Louis Dionne,✅
+`[common.alg.req] <http://wg21.link/common.alg.req>`_: pt. 1,"| `indirectly_movable <https://llvm.org/D102639>`_
+| `indirectly_movable_storable <https://llvm.org/D102639>`_
+| indirectly_copyable
+| indirectly_copyable_storable",[iterator.concepts],Zoe Carver,In progress
+[common.alg.req]: pt. 2,indirectly_swappable,"| [iterator.concepts]
+| [iterator.cust.swap]",Zoe Carver,✅
+[common.alg.req]: pt. 3,indirectly_comparable,[projected],Louis Dionne,Not started
+[common.alg.req]: pt. 4,"| permutable
+| mergeable
+| sortable",[iterator.concepts],Unassigned,Not started
+[std.iterator.tags],,[iterator.traits],Unassigned,Not started
+`[range.iter.ops] <http://wg21.link/range.iter.ops>`_,"| `ranges::advance <https://llvm.org/D101922>`_
+| `ranges::distance <https://llvm.org/D102789>`_
+| `ranges::next <https://llvm.org/D102563>`_
+| `ranges::prev <https://llvm.org/D102564>`_",[iterator.concepts],Christopher Di Bella,In progress
+[predef.iterators],Updates to predefined iterators.,"| [iterator.concepts]
+| [iterator.cust.swap]
+| [iterator.cust.move]",Unassigned,Not started
+[move.sentinel],,[predef.iterators],Unassigned,Not started
+[common.iterator],,"| [iterator.concepts]
+| [iterator.cust.swap]
+| [iterator.cust.move]",Zoe Carver,✅
+[default.sentinels],std::default_sentinel_t.,No dependencies,Zoe Carver,✅
+[counted.iterator],,"| [iterator.concepts]
+| [iterator.cust.swap]
+| [iterator.cust.move]
+| [default.sentinels]",Zoe Carver,✅
+[stream.iterators],,[default.sentinels],Unassigned,Not started
+`[range.access] <http://wg21.link/range.access>`_,"| `ranges::begin <https://llvm.org/D100255>`_
+| `ranges::end <https://llvm.org/D100255>`_
+| `range::cbegin <https://llvm.org/D100255>`_
+| `ranges::cend <https://llvm.org/D100255>`_
+| ranges::rbegin
+| ranges::rend
+| ranges::crbegin
+| ranges::crend
+| `ranges::size <https://llvm.org/D101079>`_
+| `ranges::ssize <https://llvm.org/D101189>`_
+| `ranges::empty <https://llvm.org/D101193>`_
+| `ranges::data <https://llvm.org/D101476>`_
+| ranges::cdata",[iterator.concepts],Christopher Di Bella and Zoe Carver,In progress
+`[range.range] <http://wg21.link/range.range>`_,"| `ranges::range <https://llvm.org/D100269>`_
+| `ranges::borrowed_range <https://llvm.org/D102426>`_
+| `ranges::enable_borrowed_range <https://llvm.org/D90999>`_
+| `ranges::iterator_t <https://llvm.org/D100255>`_
+| `ranges::sentinel_t <https://llvm.org/D100269>`_
+| `ranges::range_difference_t <https://llvm.org/D100269>`_
+| `ranges::range_size_t <https://llvm.org/D106708>`_
+| `ranges::range_value_t <https://llvm.org/D100269>`_
+| `ranges::range_reference_t <https://llvm.org/D100269>`_
+| `ranges::range_rvalue_reference_t <https://llvm.org/D100269>`_",[range.access],Christopher Di Bella,✅
+`[range.sized] <http://wg21.link/range.sized>`_,"| `ranges::sized_range <https://llvm.org/D102434>`_
+| `ranges::disable_sized_range <https://llvm.org/D102434>`_","| [range.primitives]
+| [range.range]",Christopher Di Bella,✅
+`[range.view] <http://wg21.link/range.view>`_,"| `ranges::enable_view <https://llvm.org/D101547>`_
+| `ranges::view_base <https://llvm.org/D101547>`_
+| `ranges::view <https://llvm.org/D101547>`_",[range.range],Louis Dionne,✅
+`[range.refinements] <http://wg21.link/range.refinements>`_,"| ranges::output_range
+| `ranges::input_range <https://llvm.org/D100271>`_
+| `ranges::forward_range: `D100275 <https://llvm.org/D100275>`_
+| `ranges::bidirectional_range <https://llvm.org/D100278>`_
+| `ranges::random_access_range <https://llvm.org/D101316>`_
+| ranges::contiguous_range
+| `ranges::common_range <https://llvm.org/D100269>`_",[range.range],Christopher Di Bella,✅
+`[range.refinements]`_,`ranges::viewable_range <https://llvm.org/D105816>`_,[range.range],Louis Dionne,✅
+`[range.utility.helpers] <http://wg21.link/range.utility.helpers>`_,"| *simple-view*
+| *has-arrow*
+| *not-same-as*","| [range.range]
+| [iterator.concept.input]",Zoe Carver,✅
+`[view.interface] <http://wg21.link/view.interface>`_,"`ranges::view_interface <https://llvm.org/D101737>`_","| [ranges.range]
+| [range.view]
+| [range.iterator.op.prev]
+| [range.refinements]",Zoe Carver,✅
+`[range.subrange] <http://wg21.link/range.subrange>`_,`ranges::subrange <https://llvm.org/D102006>`_,[view.interface],Zoe Carver,✅
+`[range.dangling] <http://wg21.link/range.dangling>`_,"| ranges::dangling
+| ranges::borrowed_iterator_t
+| ranges::borrowed_subrange_t","| [range.range]
+| [range.subrange]",Christopher Di Bella,✅
+`[range.all] <http://wg21.link/range.all>`_,`view::all <https://llvm.org/D102028>`_,"[range.subrange], [range.view.ref]",Zoe Carver,✅
+`[range.view.ref] <http://wg21.link/range.view>`_,`ref-view <https://llvm.org/D102020>`_,[view.interface],Zoe Carver,✅
+`[range.filter] <http://wg21.link/range.filter>`_,filter_view,[range.all],Louis Dionne,Not started
+`[range.transform] <http://wg21.link/range.transform>`_,`transform_view <https://llvm.org/D103056>`_,[range.all],Zoe Carver,✅
+`[range.iota] <http://wg21.link/range.iota>`_,iota_view,[range.all],Louis Dionne,Not started
+`[range.take] <http://wg21.link/range.take>`_,take_view,[range.all],Zoe Carver,In Progress
+`[range.join] <http://wg21.link/range.join>`_,join_view,[range.all],Christopher Di Bella,Not started
+`[range.empty] <http://wg21.link/range.empty>`_,`empty_view <https://llvm.org/D103208>`_,[view.interface],Zoe Carver,✅
+`[range.single] <http://wg21.link/range.single>`_,single_view,[view.interface],Zoe Carver,In Progress
+`[range.split] <http://wg21.link/range.split>`_,split_view,[range.all],Unassigned,Not started
+`[range.counted] <http://wg21.link/range.counted>`_,view::counted,[range.subrange],Zoe Carver,Not started
+`[range.common] <http://wg21.link/range.common>`_,common_view,[range.all],Zoe Carver,✅
+`[range.reverse] <http://wg21.link/range.reverse>`_,reverse_view,[range.all],Unassigned,Not started
After building libc++, you can run parts of the libc++ test suite by simply
running ``llvm-lit`` on a specified test or directory. If you're unsure
whether the required libraries have been built, you can use the
-`check-cxx-deps` target. For example:
+`cxx-test-depends` target. For example:
.. code-block:: bash
$ cd <monorepo-root>
- $ make -C <build> check-cxx-deps # If you want to make sure the targets get rebuilt
+ $ make -C <build> cxx-test-depends # If you want to make sure the targets get rebuilt
$ <build>/bin/llvm-lit -sv libcxx/test/std/re # Run all of the std::regex tests
$ <build>/bin/llvm-lit -sv libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp # Run a single test
$ <build>/bin/llvm-lit -sv libcxx/test/std/atomics libcxx/test/std/threads # Test std::thread and std::atomic
+In the default configuration, the tests are built against headers that form a
+fake installation root of libc++. This installation root has to be updated when
+changes are made to the headers, so you should re-run the `cxx-test-depends`
+target before running the tests manually with `lit` when you make any sort of
+change, including to the headers.
+
Sometimes you'll want to change the way LIT is running the tests. Custom options
can be specified using the `--param=<name>=<val>` flag. The most common option
you'll want to change is the standard dialect (ie -std=c++XX). By default the
# Specify a custom compiler.
$ <build>/bin/llvm-lit -sv libcxx/test/std --param=cxx_under_test=/opt/bin/g++
- # Enable warnings in the test suite
- $ <build>/bin/llvm-lit -sv libcxx/test --param=enable_warnings=true
+ # Disable warnings in the test suite
+ $ <build>/bin/llvm-lit -sv libcxx/test --param=enable_warnings=False
# Use UBSAN when running the tests.
$ <build>/bin/llvm-lit -sv libcxx/test --param=use_sanitizer=Undefined
By default, the libc++ test suite will use a site configuration that matches
the current CMake configuration. It does so by generating a ``lit.site.cfg``
-file in the build directory from the ``libcxx/test/lit.site.cfg.in`` template,
-and pointing ``llvm-lit`` (which is a wrapper around ``llvm/utils/lit/lit.py``)
-to that file. So when you're running ``<build>/bin/llvm-lit``, the generated
-``lit.site.cfg`` file is always loaded instead of ``libcxx/test/lit.cfg.py``.
-If you want to use a custom site configuration, simply point the CMake build
-to it using ``-DLIBCXX_TEST_CONFIG=<path-to-site-config>``, and that site
-configuration will be used instead. That file can use CMake variables inside
-itself to make configuration easier.
+file in the build directory from one of the configuration file templates in
+``libcxx/test/configs/``, and pointing ``llvm-lit`` (which is a wrapper around
+``llvm/utils/lit/lit.py``) to that file. So when you're running
+``<build>/bin/llvm-lit``, the generated ``lit.site.cfg`` file is always loaded
+instead of ``libcxx/test/lit.cfg.py``. If you want to use a custom site
+configuration, simply point the CMake build to it using
+``-DLIBCXX_TEST_CONFIG=<path-to-site-config>``, and that site configuration
+will be used instead. That file can use CMake variables inside it to make
+configuration easier.
.. code-block:: bash
$ cmake <options> -DLIBCXX_TEST_CONFIG=<path-to-site-config>
- $ make -C <build> check-cxx-deps
+ $ make -C <build> cxx-test-depends
$ <build>/bin/llvm-lit -sv libcxx/test # will use your custom config file
.. option:: std=<standard version>
- **Values**: c++03, c++11, c++14, c++17, c++2a
+ **Values**: c++03, c++11, c++14, c++17, c++20, c++2b
Change the standard version used when building the tests.
**Default**: False
Enable or disable testing against the installed version of libc++ library.
- This impacts whether the ``with_system_cxx_lib`` Lit feature is defined or
+ This impacts whether the ``use_system_cxx_lib`` Lit feature is defined or
not. The ``cxx_library_root`` and ``cxx_runtime_root`` parameters should
still be used to specify the path of the library to link to and run against,
respectively.
- All tests are run in a temporary directory that is unique to that test and
cleaned up after the test is done.
- When a test needs data files as inputs, these data files can be saved in the
- repository (when reasonable) and referrenced by the test as
+ repository (when reasonable) and referenced by the test as
``// FILE_DEPENDENCIES: <path-to-dependencies>``. Copies of these files or
directories will be made available to the test in the temporary directory
where it is run.
+.. _using-libcxx:
+
============
Using libc++
============
.. contents::
:local:
-Getting Started
-===============
-
-If you already have libc++ installed you can use it with clang.
-
-.. code-block:: bash
-
- $ clang++ -stdlib=libc++ test.cpp
- $ clang++ -std=c++11 -stdlib=libc++ test.cpp
+Usually, libc++ is packaged and shipped by a vendor through some delivery vehicle
+(operating system distribution, SDK, toolchain, etc) and users don't need to do
+anything special in order to use the library.
-On macOS and FreeBSD libc++ is the default standard library
-and the ``-stdlib=libc++`` is not required.
+This page contains information about configuration knobs that can be used by
+users when they know libc++ is used by their toolchain, and how to use libc++
+when it is not the default library used by their toolchain.
-.. _alternate libcxx:
-
-If you want to select an alternate installation of libc++ you
-can use the following options.
-
-.. code-block:: bash
-
- $ clang++ -std=c++11 -stdlib=libc++ -nostdinc++ \
- -I<libcxx-install-prefix>/include/c++/v1 \
- -L<libcxx-install-prefix>/lib \
- -Wl,-rpath,<libcxx-install-prefix>/lib \
- test.cpp
-The option ``-Wl,-rpath,<libcxx-install-prefix>/lib`` adds a runtime library
-search path. Meaning that the systems dynamic linker will look for libc++ in
-``<libcxx-install-prefix>/lib`` whenever the program is run. Alternatively the
-environment variable ``LD_LIBRARY_PATH`` (``DYLD_LIBRARY_PATH`` on macOS) can
-be used to change the dynamic linkers search paths after a program is compiled.
+Using a different version of the C++ Standard
+=============================================
-An example of using ``LD_LIBRARY_PATH``:
+Libc++ implements the various versions of the C++ Standard. Changing the version of
+the standard can be done by passing ``-std=c++XY`` to the compiler. Libc++ will
+automatically detect what Standard is being used and will provide functionality that
+matches that Standard in the library.
.. code-block:: bash
- $ clang++ -stdlib=libc++ -nostdinc++ \
- -I<libcxx-install-prefix>/include/c++/v1
- -L<libcxx-install-prefix>/lib \
- test.cpp -o
- $ ./a.out # Searches for libc++ in the systems library paths.
- $ export LD_LIBRARY_PATH=<libcxx-install-prefix>/lib
- $ ./a.out # Searches for libc++ along LD_LIBRARY_PATH
+ $ clang++ -std=c++17 test.cpp
-Using ``<filesystem>``
-======================
-
-Prior to LLVM 9.0, libc++ provides the implementation of the filesystem library
-in a separate static library. Users of ``<filesystem>`` and ``<experimental/filesystem>``
-are required to link ``-lc++fs``. Prior to libc++ 7.0, users of
-``<experimental/filesystem>`` were required to link libc++experimental.
+.. warning::
+ Using ``-std=c++XY`` with a version of the Standard that has not been ratified yet
+ is considered unstable. Libc++ reserves the right to make breaking changes to the
+ library until the standard has been ratified.
-Starting with LLVM 9.0, support for ``<filesystem>`` is provided in the main
-library and nothing special is required to use ``<filesystem>``.
Using libc++experimental and ``<experimental/...>``
-=====================================================
+===================================================
Libc++ provides implementations of experimental technical specifications
in a separate library, ``libc++experimental.a``. Users of ``<experimental/...>``
-headers may be required to link ``-lc++experimental``.
+headers may be required to link ``-lc++experimental``. Note that not all
+vendors ship ``libc++experimental.a``, and as a result, you may not be
+able to use those experimental features.
.. code-block:: bash
- $ clang++ -std=c++14 -stdlib=libc++ test.cpp -lc++experimental
-
-Libc++experimental.a may not always be available, even when libc++ is already
-installed. For information on building libc++experimental from source see
-:ref:`Building Libc++ <build instructions>` and
-:ref:`libc++experimental CMake Options <libc++experimental options>`.
-
-Also see the `Experimental Library Implementation Status <http://libcxx.llvm.org/ts1z_status.html>`__
-page.
+ $ clang++ test.cpp -lc++experimental
.. warning::
Experimental libraries are Experimental.
* The contents of the ``<experimental/...>`` headers and ``libc++experimental.a``
library will not remain compatible between versions.
* No guarantees of API or ABI stability are provided.
- * When we implement the standardized version of an experimental feature,
+ * When the standardized version of an experimental feature is implemented,
the experimental feature is removed two releases after the non-experimental
version has shipped. The full policy is explained :ref:`here <experimental features>`.
-Using libc++ on Linux
-=====================
-On Linux libc++ can typically be used with only '-stdlib=libc++'. However
-some libc++ installations require the user manually link libc++abi themselves.
-If you are running into linker errors when using libc++ try adding '-lc++abi'
-to the link line. For example:
+Using libc++ when it is not the system default
+==============================================
+
+On systems where libc++ is provided but is not the default, Clang provides a flag
+called ``-stdlib=`` that can be used to decide which standard library is used.
+Using ``-stdlib=libc++`` will select libc++:
.. code-block:: bash
- $ clang++ -stdlib=libc++ test.cpp -lc++ -lc++abi -lm -lc -lgcc_s -lgcc
+ $ clang++ -stdlib=libc++ test.cpp
-Alternately, you could just add libc++abi to your libraries list, which in
-most situations will give the same result:
+On systems where libc++ is the library in use by default such as macOS and FreeBSD,
+this flag is not required.
-.. code-block:: bash
- $ clang++ -stdlib=libc++ test.cpp -lc++abi
+.. _alternate libcxx:
+Using a custom built libc++
+===========================
-Using libc++ with GCC
----------------------
+Most compilers provide a way to disable the default behavior for finding the
+standard library and to override it with custom paths. With Clang, this can
+be done with:
-GCC does not provide a way to switch from libstdc++ to libc++. You must manually
-configure the compile and link commands.
+.. code-block:: bash
+
+ $ clang++ -nostdinc++ -nostdlib++ \
+ -isystem <install>/include/c++/v1 \
+ -L <install>/lib \
+ -Wl,-rpath,<install>/lib \
+ -lc++ \
+ test.cpp
-In particular you must tell GCC to remove the libstdc++ include directories
-using ``-nostdinc++`` and to not link libstdc++.so using ``-nodefaultlibs``.
+The option ``-Wl,-rpath,<install>/lib`` adds a runtime library search path,
+which causes the system's dynamic linker to look for libc++ in ``<install>/lib``
+whenever the program is loaded.
-Note that ``-nodefaultlibs`` removes all of the standard system libraries and
-not just libstdc++ so they must be manually linked. For example:
+GCC does not support the ``-nostdlib++`` flag, so one must use ``-nodefaultlibs``
+instead. Since that removes all the standard system libraries and not just libc++,
+the system libraries must be re-added manually. For example:
.. code-block:: bash
- $ g++ -nostdinc++ -I<libcxx-install-prefix>/include/c++/v1 \
- test.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc
+ $ g++ -nostdinc++ -nodefaultlibs \
+ -isystem <install>/include/c++/v1 \
+ -L <install>/lib \
+ -Wl,-rpath,<install>/lib \
+ -lc++ -lc++abi -lm -lc -lgcc_s -lgcc \
+ test.cpp
GDB Pretty printers for libc++
-------------------------------
+==============================
-GDB does not support pretty-printing of libc++ symbols by default. Unfortunately
-libc++ does not provide pretty-printers itself. However there are 3rd
-party implementations available and although they are not officially
-supported by libc++ they may be useful to users.
+GDB does not support pretty-printing of libc++ symbols by default. However, libc++ does
+provide pretty-printers itself. Those can be used as:
-Known 3rd Party Implementations Include:
+.. code-block:: bash
-* `Koutheir's libc++ pretty-printers <https://github.com/koutheir/libcxx-pretty-printers>`_.
+ $ gdb -ex "source <libcxx>/utils/gdb/libcxx/printers.py" \
+ -ex "python register_libcxx_printer_loader()" \
+ <args>
Libc++ Configuration Macros
**_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS**:
This macro is used to enable -Wthread-safety annotations on libc++'s
- ``std::mutex`` and ``std::lock_guard``. By default these annotations are
+ ``std::mutex`` and ``std::lock_guard``. By default, these annotations are
disabled and must be manually enabled by the user.
**_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS**:
headers. The intended use case is for clients who wish to use the libc++
headers without taking a dependency on the libc++ library itself.
-**_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION**:
- This macro is used to re-enable an extension in `std::tuple` which allowed
- it to be implicitly constructed from fewer initializers than contained
- elements. Elements without an initializer are default constructed. For example:
-
- .. code-block:: cpp
-
- std::tuple<std::string, int, std::error_code> foo() {
- return {"hello world", 42}; // default constructs error_code
- }
-
-
- Since libc++ 4.0 this extension has been disabled by default. This macro
- may be defined to re-enable it in order to support existing code that depends
- on the extension. New use of this extension should be discouraged.
- See `PR 27374 <https://llvm.org/PR27374>`_ for more information.
-
- Note: The "reduced-arity-initialization" extension is still offered but only
- for explicit conversions. Example:
-
- .. code-block:: cpp
-
- auto foo() {
- using Tup = std::tuple<std::string, int, std::error_code>;
- return Tup{"hello world", 42}; // explicit constructor called. OK.
- }
-
**_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS**:
This macro disables the additional diagnostics generated by libc++ using the
`diagnose_if` attribute. These additional diagnostics include checks for:
This macro is used to re-enable all the features removed in C++17. The effect
is equivalent to manually defining each macro listed below.
-**_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS**:
- This macro is used to re-enable the `set_unexpected`, `get_unexpected`, and
- `unexpected` functions, which were removed in C++17.
-
**_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR**:
- This macro is used to re-enable `std::auto_ptr` in C++17.
+ This macro is used to re-enable `auto_ptr`.
-C++2a Specific Configuration Macros:
+**_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS**:
+ This macro is used to re-enable the `binder1st`, `binder2nd`,
+ `pointer_to_unary_function`, `pointer_to_binary_function`, `mem_fun_t`,
+ `mem_fun1_t`, `mem_fun_ref_t`, `mem_fun1_ref_t`, `const_mem_fun_t`,
+ `const_mem_fun1_t`, `const_mem_fun_ref_t`, and `const_mem_fun1_ref_t`
+ class templates, and the `bind1st`, `bind2nd`, `mem_fun`, `mem_fun_ref`,
+ and `ptr_fun` functions.
+
+**_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE**:
+ This macro is used to re-enable the `random_shuffle` algorithm.
+
+**_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS**:
+ This macro is used to re-enable `set_unexpected`, `get_unexpected`, and
+ `unexpected`.
+
+C++20 Specific Configuration Macros:
------------------------------------
**_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17**:
This macro can be used to disable diagnostics emitted from functions marked
``[[nodiscard]]`` in dialects after C++17. See :ref:`Extended Applications of [[nodiscard]] <nodiscard extension>`
for more information.
+**_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES**:
+ This macro is used to re-enable all the features removed in C++20. The effect
+ is equivalent to manually defining each macro listed below.
+
+**_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS**:
+ This macro is used to re-enable redundant members of `allocator<T>`,
+ including `pointer`, `reference`, `rebind`, `address`, `max_size`,
+ `construct`, `destroy`, and the two-argument overload of `allocate`.
+
+**_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS**:
+ This macro is used to re-enable the `argument_type`, `result_type`,
+ `first_argument_type`, and `second_argument_type` members of class
+ templates such as `plus`, `logical_not`, `hash`, and `owner_less`.
+
+**_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS**:
+ This macro is used to re-enable `not1`, `not2`, `unary_negate`,
+ and `binary_negate`.
+
+**_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR**:
+ This macro is used to re-enable `raw_storage_iterator`.
+
+**_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS**:
+ This macro is used to re-enable `is_literal_type`, `is_literal_type_v`,
+ `result_of` and `result_of_t`.
+
Libc++ Extensions
=================
1. Backporting ``[[nodiscard]]`` to entities declared as such by the
standard in newer dialects, but not in the present one.
-2. Extended applications of ``[[nodiscard]]``, at the libraries discretion,
+2. Extended applications of ``[[nodiscard]]``, at the library's discretion,
applied to entities never declared as such by the standard.
Users may also opt-out of additional applications ``[[nodiscard]]`` using
additional macros.
Applications of the first form, which backport ``[[nodiscard]]`` from a newer
-dialect may be disabled using macros specific to the dialect it was added. For
-example ``_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17``.
+dialect, may be disabled using macros specific to the dialect in which it was
+added. For example, ``_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17``.
Applications of the second form, which are pure extensions, may be disabled
by defining ``_LIBCPP_DISABLE_NODISCARD_EXT``.
* ``unique``
* ``upper_bound``
* ``lock_guard``'s constructors
+* ``as_const``
+* ``forward``
+* ``move``
+* ``move_if_noexcept``
+* ``identity::operator()``
+* ``to_integer``
+* ``to_underlying``
# serve to show the default.
import sys, os
+from datetime import date
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# General information about the project.
project = u'libc++'
-copyright = u'2011-2018, LLVM Project'
+copyright = u'2011-%d, LLVM Project' % date.today().year
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '11.0'
+version = '13.0'
# The full version, including alpha/beta/rc tags.
-release = '11.0'
+release = '13.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
+exclude_patterns = ['_build', 'Helpers']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
Getting Started with libc++
----------------------------
+===========================
.. toctree::
- :maxdepth: 2
+ :maxdepth: 1
ReleaseNotes
UsingLibcxx
BuildingLibcxx
TestingLibcxx
+ Contributing
+ Status/Cxx14
+ Status/Cxx17
+ Status/Cxx20
+ Status/Cxx2b
+ Status/Ranges
+ Status/Format
.. toctree::
:hidden:
+ AddingNewCIJobs
FeatureTestMacroTable
+
Current Status
---------------
+==============
After its initial introduction, many people have asked "why start a new
library instead of contributing to an existing library?" (like Apache's
Further, both projects are apparently abandoned: STLport 5.2.1 was
released in Oct'08, and STDCXX 4.2.1 in May'08.
-Platform and Compiler Support
------------------------------
-
-For using the libc++ headers
-############################
-The libc++ headers are known to work on the following platforms, using GCC and
-Clang. Note that functionality provided by ``<atomic>`` is only functional with
-Clang and GCC.
-
-============ ==================== ============
-OS Arch Compilers
-============ ==================== ============
-macOS 10.9+ i386, x86_64 Clang, GCC
-FreeBSD 10+ i386, x86_64, ARM Clang, GCC
-Linux i386, x86_64 Clang, GCC
-============ ==================== ============
-
-The following minimum compiler versions are required:
-
-* Clang 4.0 and above
-* GCC 5.0 and above.
-
-The C++03 dialect is only supported with Clang.
+.. _platform_and_compiler_support:
-For building the libc++ library
-###############################
-Building the libc++ library (static or shared) requires some features from
-the operating system. As such, it has its own set of (slightly different)
-system requirements.
-
-============ ==================== ============ ========================
-OS Arch Compilers ABI Library
-============ ==================== ============ ========================
-macOS 10.12+ i386, x86_64 Clang, GCC libc++abi
-FreeBSD 10+ i386, x86_64, ARM Clang, GCC libcxxrt, libc++abi
-Linux i386, x86_64 Clang, GCC libc++abi
-============ ==================== ============ ========================
-
-The following minimum compiler versions are required:
+Platform and Compiler Support
+=============================
-* Clang 4.0 and above
-* GCC 5.0 and above.
+Libc++ aims to support common compilers that implement the C++11 Standard. In order to strike a
+good balance between stability for users and maintenance cost, testing coverage and development
+velocity, libc++ drops support for older compilers as newer ones are released.
+
+============ =============== ========================== =====================
+Compiler Versions Restrictions Support policy
+============ =============== ========================== =====================
+Clang 11, 12 latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_
+AppleClang 12 latest stable release per `Xcode's release page <https://developer.apple.com/documentation/xcode-release-notes>`_
+GCC 11 In C++11 or later only latest stable release per `GCC's release page <https://gcc.gnu.org/releases.html>`_
+============ =============== ========================== =====================
+
+Libc++ also supports common platforms and architectures:
+
+=============== ========================= ============================
+Target platform Target architecture Notes
+=============== ========================= ============================
+macOS 10.9+ i386, x86_64, arm64 Building the shared library itself requires targetting macOS 10.11+
+FreeBSD 10+ i386, x86_64, arm
+Linux i386, x86_64, arm, arm64
+Windows x86_64
+=============== ========================= ============================
+
+Generally speaking, libc++ should work on any platform that provides a fairly complete
+C Standard Library. It is also possible to turn off parts of the library for use on
+systems that provide incomplete support.
+
+However, libc++ aims to provide a high-quality implementation of the C++ Standard
+Library, especially when it comes to correctness. As such, we aim to have test coverage
+for all the platforms and compilers that we claim to support. If a platform or compiler
+is not listed here, it is not officially supported. It may happen to work, and
+in practice the library is known to work on some platforms not listed here, but
+we don't make any guarantees. If you would like your compiler and/or platform
+to be formally supported and listed here,
+please work with the libc++ team to set up testing for your configuration.
C++ Dialect Support
----------------------
+===================
* C++11 - Complete
-* `C++14 - Complete <http://libcxx.llvm.org/cxx1y_status.html>`__
-* `C++17 - In Progress <http://libcxx.llvm.org/cxx1z_status.html>`__
-* `Post C++14 Technical Specifications - In Progress <http://libcxx.llvm.org/ts1z_status.html>`__
+* :ref:`C++14 - Complete <cxx14-status>`
+* :ref:`C++17 - In Progress <cxx17-status>`
+* :ref:`C++20 - In Progress <cxx20-status>`
+* :ref:`C++2b - In Progress <cxx2b-status>`
* :ref:`C++ Feature Test Macro Status <feature-status>`
+
Notes and Known Issues
-----------------------
+======================
This list contains known issues with libc++
.. __: https://bugs.llvm.org/buglist.cgi?component=All%20Bugs&product=libc%2B%2B&query_format=advanced&resolution=---&order=changeddate%20DESC%2Cassigned_to%20DESC%2Cbug_status%2Cpriority%2Cbug_id&list_id=74184
+
Design Documents
-----------------
+================
.. toctree::
:maxdepth: 1
- DesignDocs/AvailabilityMarkup
- DesignDocs/DebugMode
- DesignDocs/CapturingConfigInfo
DesignDocs/ABIVersioning
+ DesignDocs/AtomicDesign
+ DesignDocs/CapturingConfigInfo
+ DesignDocs/DebugMode
DesignDocs/ExperimentalFeatures
- DesignDocs/VisibilityMacros
- DesignDocs/ThreadingSupportAPI
- DesignDocs/FileTimeType
- DesignDocs/FeatureTestMacros
DesignDocs/ExtendedCXX03Support
+ DesignDocs/FeatureTestMacros
+ DesignDocs/FileTimeType
+ DesignDocs/NoexceptPolicy
+ DesignDocs/ThreadingSupportAPI
+ DesignDocs/UniquePtrTrivialAbi
+ DesignDocs/VisibilityMacros
-* `<atomic> design <http://libcxx.llvm.org/atomic_design.html>`_
-* `<type_traits> design <http://libcxx.llvm.org/type_traits_design.html>`_
-* `Notes by Marshall Clow`__
-
-.. __: https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/
Build Bots and Test Coverage
-----------------------------
+============================
+
+* `Buildkite CI pipeline <https://buildkite.com/llvm-project/libcxx-ci>`_
+* `LLVM Buildbot Builders <http://lab.llvm.org:8011>`_
+* :ref:`Adding New CI Jobs <AddingNewCIJobs>`
-* `LLVM Buildbot Builders <http://lab.llvm.org:8011/console>`_
-* `Apple Jenkins Builders <http://lab.llvm.org:8080/green/view/Libcxx/>`_
-* `Windows Appveyor Builders <https://ci.appveyor.com/project/llvm-mirror/libcxx>`_
-* `Code Coverage Results <http://efcs.ca/libcxx-coverage>`_
Getting Involved
================
`libcxx-dev mailing list <http://lists.llvm.org/mailman/listinfo/libcxx-dev>`_.
-
Quick Links
===========
* `LLVM Homepage <https://llvm.org/>`_
* `LLVM Bugzilla <https://bugs.llvm.org/>`_
* `libcxx-commits Mailing List`_
* `libcxx-dev Mailing List`_
-* `Browse libc++ Sources <https://github.com/llvm/llvm-project/tree/master/libcxx/>`_
+* `Browse libc++ Sources <https://github.com/llvm/llvm-project/tree/main/libcxx/>`_
set(files
+ __algorithm/adjacent_find.h
+ __algorithm/all_of.h
+ __algorithm/any_of.h
+ __algorithm/binary_search.h
+ __algorithm/clamp.h
+ __algorithm/comp_ref_type.h
+ __algorithm/comp.h
+ __algorithm/copy_backward.h
+ __algorithm/copy_if.h
+ __algorithm/copy_n.h
+ __algorithm/copy.h
+ __algorithm/count_if.h
+ __algorithm/count.h
+ __algorithm/equal_range.h
+ __algorithm/equal.h
+ __algorithm/fill_n.h
+ __algorithm/fill.h
+ __algorithm/find_end.h
+ __algorithm/find_first_of.h
+ __algorithm/find_if_not.h
+ __algorithm/find_if.h
+ __algorithm/find.h
+ __algorithm/for_each_n.h
+ __algorithm/for_each.h
+ __algorithm/generate_n.h
+ __algorithm/generate.h
+ __algorithm/half_positive.h
+ __algorithm/includes.h
+ __algorithm/inplace_merge.h
+ __algorithm/is_heap_until.h
+ __algorithm/is_heap.h
+ __algorithm/is_partitioned.h
+ __algorithm/is_permutation.h
+ __algorithm/is_sorted_until.h
+ __algorithm/is_sorted.h
+ __algorithm/iter_swap.h
+ __algorithm/lexicographical_compare.h
+ __algorithm/lower_bound.h
+ __algorithm/make_heap.h
+ __algorithm/max_element.h
+ __algorithm/max.h
+ __algorithm/merge.h
+ __algorithm/min_element.h
+ __algorithm/min.h
+ __algorithm/minmax_element.h
+ __algorithm/minmax.h
+ __algorithm/mismatch.h
+ __algorithm/move_backward.h
+ __algorithm/move.h
+ __algorithm/next_permutation.h
+ __algorithm/none_of.h
+ __algorithm/nth_element.h
+ __algorithm/partial_sort_copy.h
+ __algorithm/partial_sort.h
+ __algorithm/partition_copy.h
+ __algorithm/partition_point.h
+ __algorithm/partition.h
+ __algorithm/pop_heap.h
+ __algorithm/prev_permutation.h
+ __algorithm/push_heap.h
+ __algorithm/remove_copy_if.h
+ __algorithm/remove_copy.h
+ __algorithm/remove_if.h
+ __algorithm/remove.h
+ __algorithm/replace_copy_if.h
+ __algorithm/replace_copy.h
+ __algorithm/replace_if.h
+ __algorithm/replace.h
+ __algorithm/reverse_copy.h
+ __algorithm/reverse.h
+ __algorithm/rotate_copy.h
+ __algorithm/rotate.h
+ __algorithm/sample.h
+ __algorithm/search_n.h
+ __algorithm/search.h
+ __algorithm/set_difference.h
+ __algorithm/set_intersection.h
+ __algorithm/set_symmetric_difference.h
+ __algorithm/set_union.h
+ __algorithm/shift_left.h
+ __algorithm/shift_right.h
+ __algorithm/shuffle.h
+ __algorithm/sift_down.h
+ __algorithm/sort_heap.h
+ __algorithm/sort.h
+ __algorithm/stable_partition.h
+ __algorithm/stable_sort.h
+ __algorithm/swap_ranges.h
+ __algorithm/transform.h
+ __algorithm/unique_copy.h
+ __algorithm/unique.h
+ __algorithm/unwrap_iter.h
+ __algorithm/upper_bound.h
+ __availability
__bit_reference
+ __bits
__bsd_locale_defaults.h
__bsd_locale_fallbacks.h
- __errc
+ __config
__debug
- __functional_03
+ __errc
+ __format/format_error.h
+ __format/format_parse_context.h
+ __function_like.h
__functional_base
- __functional_base_03
+ __functional/binary_function.h
+ __functional/binary_negate.h
+ __functional/bind_front.h
+ __functional/bind.h
+ __functional/binder1st.h
+ __functional/binder2nd.h
+ __functional/default_searcher.h
+ __functional/function.h
+ __functional/hash.h
+ __functional/identity.h
+ __functional/invoke.h
+ __functional/is_transparent.h
+ __functional/mem_fn.h
+ __functional/mem_fun_ref.h
+ __functional/not_fn.h
+ __functional/operations.h
+ __functional/perfect_forward.h
+ __functional/pointer_to_binary_function.h
+ __functional/pointer_to_unary_function.h
+ __functional/ranges_operations.h
+ __functional/reference_wrapper.h
+ __functional/unary_function.h
+ __functional/unary_negate.h
+ __functional/unwrap_ref.h
+ __functional/weak_result_type.h
__hash_table
+ __iterator/access.h
+ __iterator/advance.h
+ __iterator/back_insert_iterator.h
+ __iterator/common_iterator.h
+ __iterator/concepts.h
+ __iterator/counted_iterator.h
+ __iterator/data.h
+ __iterator/default_sentinel.h
+ __iterator/distance.h
+ __iterator/empty.h
+ __iterator/erase_if_container.h
+ __iterator/front_insert_iterator.h
+ __iterator/incrementable_traits.h
+ __iterator/insert_iterator.h
+ __iterator/istream_iterator.h
+ __iterator/istreambuf_iterator.h
+ __iterator/iter_move.h
+ __iterator/iter_swap.h
+ __iterator/iterator_traits.h
+ __iterator/iterator.h
+ __iterator/move_iterator.h
+ __iterator/next.h
+ __iterator/ostream_iterator.h
+ __iterator/ostreambuf_iterator.h
+ __iterator/prev.h
+ __iterator/projected.h
+ __iterator/readable_traits.h
+ __iterator/reverse_access.h
+ __iterator/reverse_iterator.h
+ __iterator/size.h
+ __iterator/wrap_iter.h
__libcpp_version
__locale
+ __memory/addressof.h
+ __memory/allocation_guard.h
+ __memory/allocator_arg_t.h
+ __memory/allocator_traits.h
+ __memory/allocator.h
+ __memory/auto_ptr.h
+ __memory/compressed_pair.h
+ __memory/construct_at.h
+ __memory/pointer_safety.h
+ __memory/pointer_traits.h
+ __memory/raw_storage_iterator.h
+ __memory/shared_ptr.h
+ __memory/temporary_buffer.h
+ __memory/uninitialized_algorithms.h
+ __memory/unique_ptr.h
+ __memory/uses_allocator.h
__mutex_base
__node_handle
__nullptr
+ __random/uniform_int_distribution.h
+ __ranges/access.h
+ __ranges/all.h
+ __ranges/common_view.h
+ __ranges/concepts.h
+ __ranges/copyable_box.h
+ __ranges/dangling.h
+ __ranges/data.h
+ __ranges/drop_view.h
+ __ranges/empty_view.h
+ __ranges/empty.h
+ __ranges/enable_borrowed_range.h
+ __ranges/enable_view.h
+ __ranges/non_propagating_cache.h
+ __ranges/ref_view.h
+ __ranges/size.h
+ __ranges/subrange.h
+ __ranges/transform_view.h
+ __ranges/view_interface.h
__split_buffer
- __sso_allocator
__std_stream
__string
+ __support/android/locale_bionic.h
+ __support/fuchsia/xlocale.h
+ __support/ibm/gettod_zos.h
+ __support/ibm/limits.h
+ __support/ibm/locale_mgmt_aix.h
+ __support/ibm/locale_mgmt_zos.h
+ __support/ibm/nanosleep.h
+ __support/ibm/support.h
+ __support/ibm/xlocale.h
+ __support/musl/xlocale.h
+ __support/newlib/xlocale.h
+ __support/nuttx/xlocale.h
+ __support/openbsd/xlocale.h
+ __support/solaris/floatingpoint.h
+ __support/solaris/wchar.h
+ __support/solaris/xlocale.h
+ __support/win32/limits_msvc_win32.h
+ __support/win32/locale_win32.h
+ __support/xlocale/__nop_locale_mgmt.h
+ __support/xlocale/__posix_l_fallback.h
+ __support/xlocale/__strtonum_fallback.h
__threading_support
__tree
__tuple
__undef_macros
+ __utility/__decay_copy.h
+ __utility/as_const.h
+ __utility/cmp.h
+ __utility/declval.h
+ __utility/exchange.h
+ __utility/forward.h
+ __utility/in_place.h
+ __utility/integer_sequence.h
+ __utility/move.h
+ __utility/pair.h
+ __utility/piecewise_construct.h
+ __utility/rel_ops.h
+ __utility/swap.h
+ __utility/to_underlying.h
+ __variant/monostate.h
algorithm
any
array
fenv.h
filesystem
float.h
+ format
forward_list
fstream
functional
ostream
queue
random
+ ranges
+ ranges
ratio
regex
scoped_allocator
stdlib.h
streambuf
string
- string.h
string_view
+ string.h
strstream
system_error
tgmath.h
wctype.h
)
-if(LIBCXX_INSTALL_SUPPORT_HEADERS)
- set(files
- ${files}
- support/android/locale_bionic.h
- support/fuchsia/xlocale.h
- support/ibm/limits.h
- support/ibm/locale_mgmt_aix.h
- support/ibm/support.h
- support/ibm/xlocale.h
- support/musl/xlocale.h
- support/newlib/xlocale.h
- support/solaris/floatingpoint.h
- support/solaris/wchar.h
- support/solaris/xlocale.h
- support/win32/limits_msvc_win32.h
- support/win32/locale_win32.h
- support/xlocale/__nop_locale_mgmt.h
- support/xlocale/__posix_l_fallback.h
- support/xlocale/__strtonum_fallback.h
- )
-endif()
-
-configure_file("__config_site.in"
- "${LIBCXX_BINARY_DIR}/__config_site"
- @ONLY)
+configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY)
-# Generate a custom __config header. The new header is created
-# by prepending __config_site to the current __config header.
-add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
- COMMAND ${Python3_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
- ${LIBCXX_BINARY_DIR}/__config_site
- ${LIBCXX_SOURCE_DIR}/include/__config
- -o ${LIBCXX_BINARY_DIR}/__generated_config
- DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
- ${LIBCXX_BINARY_DIR}/__config_site
-)
-# Add a target that executes the generation commands.
-add_custom_target(cxx-generated-config ALL
- DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
-
-# In some build configurations (like bootstrapping clang), we need to be able to
-# install the libcxx headers before the CMake configuration for libcxx runs. Making
-# the name of this target configurable allows LLVM/runtimes/CMakeLists.txt to
-# add this subdirectory to the LLVM build to put libcxx's headers in place
-# before libcxx's build configuration is run.
-if (NOT CXX_HEADER_TARGET)
- set(CXX_HEADER_TARGET cxx-headers)
-endif()
-if(LIBCXX_HEADER_DIR)
- set(output_dir ${LIBCXX_HEADER_DIR}/include/c++/v1)
-
- set(out_files)
- foreach(f ${files})
- set(src ${CMAKE_CURRENT_SOURCE_DIR}/${f})
- set(dst ${output_dir}/${f})
- add_custom_command(OUTPUT ${dst}
- DEPENDS ${src}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
- COMMENT "Copying CXX header ${f}")
- list(APPEND out_files ${dst})
- endforeach()
-
- # Copy the generated header as __config into build directory.
- set(src ${LIBCXX_BINARY_DIR}/__generated_config)
- set(dst ${output_dir}/__config)
+set(_all_includes "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site")
+foreach(f ${files})
+ set(src "${CMAKE_CURRENT_SOURCE_DIR}/${f}")
+ set(dst "${LIBCXX_GENERATED_INCLUDE_DIR}/${f}")
add_custom_command(OUTPUT ${dst}
- DEPENDS ${src} cxx-generated-config
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
- COMMENT "Copying CXX __config")
- list(APPEND out_files ${dst})
- add_custom_target(generate-cxx-headers DEPENDS ${out_files})
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying CXX header ${f}")
+ list(APPEND _all_includes "${dst}")
+endforeach()
- add_library(${CXX_HEADER_TARGET} INTERFACE)
- add_dependencies(${CXX_HEADER_TARGET} generate-cxx-headers ${LIBCXX_CXX_ABI_HEADER_TARGET})
- # TODO: Use target_include_directories once we figure out why that breaks the runtimes build
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
- target_compile_options(${CXX_HEADER_TARGET} INTERFACE /I "${output_dir}")
- else()
- target_compile_options(${CXX_HEADER_TARGET} INTERFACE -I "${output_dir}")
- endif()
+add_custom_target(generate-cxx-headers ALL DEPENDS ${_all_includes})
- # Make sure the generated __config_site header is included when we build the library.
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
- target_compile_options(${CXX_HEADER_TARGET} INTERFACE /FI "${LIBCXX_BINARY_DIR}/__config_site")
- else()
- target_compile_options(${CXX_HEADER_TARGET} INTERFACE -include "${LIBCXX_BINARY_DIR}/__config_site")
- endif()
+add_library(cxx-headers INTERFACE)
+add_dependencies(cxx-headers generate-cxx-headers ${LIBCXX_CXX_ABI_HEADER_TARGET})
+# TODO: Use target_include_directories once we figure out why that breaks the runtimes build
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
+ target_compile_options(cxx-headers INTERFACE /I${LIBCXX_GENERATED_INCLUDE_DIR}
+ INTERFACE /I${LIBCXX_GENERATED_INCLUDE_TARGET_DIR})
else()
- add_library(${CXX_HEADER_TARGET} INTERFACE)
+ target_compile_options(cxx-headers INTERFACE -I${LIBCXX_GENERATED_INCLUDE_DIR}
+ INTERFACE -I${LIBCXX_GENERATED_INCLUDE_TARGET_DIR})
endif()
if (LIBCXX_INSTALL_HEADERS)
foreach(file ${files})
get_filename_component(dir ${file} DIRECTORY)
install(FILES ${file}
- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir}
- COMPONENT ${CXX_HEADER_TARGET}
+ DESTINATION ${LIBCXX_INSTALL_INCLUDE_DIR}/${dir}
+ COMPONENT cxx-headers
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endforeach()
- # Install the generated header as __config.
- install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1
+ # Install the generated __config_site.
+ install(FILES ${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site
+ DESTINATION ${LIBCXX_INSTALL_INCLUDE_TARGET_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
- RENAME __config
- COMPONENT ${CXX_HEADER_TARGET})
+ COMPONENT cxx-headers)
if (NOT CMAKE_CONFIGURATION_TYPES)
- add_custom_target(install-${CXX_HEADER_TARGET}
- DEPENDS ${CXX_HEADER_TARGET} cxx-generated-config
+ add_custom_target(install-cxx-headers
+ DEPENDS cxx-headers
COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=${CXX_HEADER_TARGET}
+ -DCMAKE_INSTALL_COMPONENT=cxx-headers
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
# Stripping is a no-op for headers
- add_custom_target(install-${CXX_HEADER_TARGET}-stripped DEPENDS install-${CXX_HEADER_TARGET})
+ add_custom_target(install-cxx-headers-stripped DEPENDS install-cxx-headers)
endif()
endif()
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_ADJACENT_FIND_H
+#define _LIBCPP___ALGORITHM_ADJACENT_FIND_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
+ if (__first != __last) {
+ _ForwardIterator __i = __first;
+ while (++__i != __last) {
+ if (__pred(*__first, *__i))
+ return __first;
+ __first = __i;
+ }
+ }
+ return __last;
+}
+
+template <class _ForwardIterator>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
+ typedef typename iterator_traits<_ForwardIterator>::value_type __v;
+ return _VSTD::adjacent_find(__first, __last, __equal_to<__v>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_ADJACENT_FIND_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_ALL_OF_H
+#define _LIBCPP___ALGORITHM_ALL_OF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Predicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
+ for (; __first != __last; ++__first)
+ if (!__pred(*__first))
+ return false;
+ return true;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_ALL_OF_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_ANY_OF_H
+#define _LIBCPP___ALGORITHM_ANY_OF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Predicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ return true;
+ return false;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_ANY_OF_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_BINARY_SEARCH_H
+#define _LIBCPP___ALGORITHM_BINARY_SEARCH_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/lower_bound.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _ForwardIterator, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
+{
+ __first = _VSTD::__lower_bound<_Compare>(__first, __last, __value_, __comp);
+ return __first != __last && !__comp(__value_, *__first);
+}
+
+template <class _ForwardIterator, class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__binary_search<_Comp_ref>(__first, __last, __value_, __comp);
+}
+
+template <class _ForwardIterator, class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
+{
+ return _VSTD::binary_search(__first, __last, __value_,
+ __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
+}
+
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_BINARY_SEARCH_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_CLAMP_H
+#define _LIBCPP___ALGORITHM_CLAMP_H
+
+#include <__config>
+#include <__debug>
+#include <__algorithm/comp.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+// clamp
+template<class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+const _Tp&
+clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
+{
+ _LIBCPP_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
+ return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
+
+}
+
+template<class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+const _Tp&
+clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
+{
+ return _VSTD::clamp(__v, __lo, __hi, __less<_Tp>());
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_CLAMP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_COMP_H
+#define _LIBCPP___ALGORITHM_COMP_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// I'd like to replace these with _VSTD::equal_to<void>, but can't because:
+// * That only works with C++14 and later, and
+// * We haven't included <functional> here.
+template <class _T1, class _T2 = _T1>
+struct __equal_to
+{
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
+};
+
+template <class _T1>
+struct __equal_to<_T1, _T1>
+{
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
+};
+
+template <class _T1>
+struct __equal_to<const _T1, _T1>
+{
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
+};
+
+template <class _T1>
+struct __equal_to<_T1, const _T1>
+{
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
+};
+
+template <class _T1, class _T2 = _T1>
+struct __less
+{
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;}
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;}
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;}
+};
+
+template <class _T1>
+struct __less<_T1, _T1>
+{
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
+};
+
+template <class _T1>
+struct __less<const _T1, _T1>
+{
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
+};
+
+template <class _T1>
+struct __less<_T1, const _T1>
+{
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_COMP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
+#define _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifdef _LIBCPP_DEBUG
+
+template <class _Compare>
+struct __debug_less
+{
+ _Compare &__comp_;
+ _LIBCPP_CONSTEXPR_AFTER_CXX17
+ __debug_less(_Compare& __c) : __comp_(__c) {}
+
+ template <class _Tp, class _Up>
+ _LIBCPP_CONSTEXPR_AFTER_CXX17
+ bool operator()(const _Tp& __x, const _Up& __y)
+ {
+ bool __r = __comp_(__x, __y);
+ if (__r)
+ __do_compare_assert(0, __y, __x);
+ return __r;
+ }
+
+ template <class _Tp, class _Up>
+ _LIBCPP_CONSTEXPR_AFTER_CXX17
+ bool operator()(_Tp& __x, _Up& __y)
+ {
+ bool __r = __comp_(__x, __y);
+ if (__r)
+ __do_compare_assert(0, __y, __x);
+ return __r;
+ }
+
+ template <class _LHS, class _RHS>
+ _LIBCPP_CONSTEXPR_AFTER_CXX17
+ inline _LIBCPP_INLINE_VISIBILITY
+ decltype((void)declval<_Compare&>()(
+ declval<_LHS &>(), declval<_RHS &>()))
+ __do_compare_assert(int, _LHS & __l, _RHS & __r) {
+ _LIBCPP_ASSERT(!__comp_(__l, __r),
+ "Comparator does not induce a strict weak ordering");
+ }
+
+ template <class _LHS, class _RHS>
+ _LIBCPP_CONSTEXPR_AFTER_CXX17
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __do_compare_assert(long, _LHS &, _RHS &) {}
+};
+
+#endif // _LIBCPP_DEBUG
+
+template <class _Comp>
+struct __comp_ref_type {
+ // Pass the comparator by lvalue reference. Or in debug mode, using a
+ // debugging wrapper that stores a reference.
+#ifndef _LIBCPP_DEBUG
+ typedef typename add_lvalue_reference<_Comp>::type type;
+#else
+ typedef __debug_less<_Comp> type;
+#endif
+};
+
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_COPY_H
+#define _LIBCPP___ALGORITHM_COPY_H
+
+#include <__config>
+#include <__algorithm/unwrap_iter.h>
+#include <__iterator/iterator_traits.h>
+#include <cstring>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// copy
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+__copy_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ for (; __first != __last; ++__first, (void) ++__result)
+ *__result = *__first;
+ return __result;
+}
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+_OutputIterator
+__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ return _VSTD::__copy_constexpr(__first, __last, __result);
+}
+
+template <class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
+ is_same<typename remove_const<_Tp>::type, _Up>::value &&
+ is_trivially_copy_assignable<_Up>::value,
+ _Up*
+>::type
+__copy(_Tp* __first, _Tp* __last, _Up* __result)
+{
+ const size_t __n = static_cast<size_t>(__last - __first);
+ if (__n > 0)
+ _VSTD::memmove(__result, __first, __n * sizeof(_Up));
+ return __result + __n;
+}
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ if (__libcpp_is_constant_evaluated()) {
+ return _VSTD::__copy_constexpr(__first, __last, __result);
+ } else {
+ return _VSTD::__rewrap_iter(__result,
+ _VSTD::__copy(_VSTD::__unwrap_iter(__first),
+ _VSTD::__unwrap_iter(__last),
+ _VSTD::__unwrap_iter(__result)));
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_COPY_BACKWARD_H
+#define _LIBCPP___ALGORITHM_COPY_BACKWARD_H
+
+#include <__config>
+#include <__algorithm/unwrap_iter.h>
+#include <__iterator/iterator_traits.h>
+#include <cstring>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _BidirectionalIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+__copy_backward_constexpr(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
+{
+ while (__first != __last)
+ *--__result = *--__last;
+ return __result;
+}
+
+template <class _BidirectionalIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+_OutputIterator
+__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
+{
+ return _VSTD::__copy_backward_constexpr(__first, __last, __result);
+}
+
+template <class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
+ is_same<typename remove_const<_Tp>::type, _Up>::value &&
+ is_trivially_copy_assignable<_Up>::value,
+ _Up*
+>::type
+__copy_backward(_Tp* __first, _Tp* __last, _Up* __result)
+{
+ const size_t __n = static_cast<size_t>(__last - __first);
+ if (__n > 0)
+ {
+ __result -= __n;
+ _VSTD::memmove(__result, __first, __n * sizeof(_Up));
+ }
+ return __result;
+}
+
+template <class _BidirectionalIterator1, class _BidirectionalIterator2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_BidirectionalIterator2
+copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
+ _BidirectionalIterator2 __result)
+{
+ if (__libcpp_is_constant_evaluated()) {
+ return _VSTD::__copy_backward_constexpr(__first, __last, __result);
+ } else {
+ return _VSTD::__rewrap_iter(__result,
+ _VSTD::__copy_backward(_VSTD::__unwrap_iter(__first),
+ _VSTD::__unwrap_iter(__last),
+ _VSTD::__unwrap_iter(__result)));
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_COPY_BACKWARD_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_COPY_IF_H
+#define _LIBCPP___ALGORITHM_COPY_IF_H
+
+#include <__config>
+#include <__algorithm/unwrap_iter.h>
+#include <__iterator/iterator_traits.h>
+#include <cstring>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _InputIterator, class _OutputIterator, class _Predicate>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _Predicate __pred)
+{
+ for (; __first != __last; ++__first)
+ {
+ if (__pred(*__first))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ }
+ return __result;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_COPY_IF_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_COPY_N_H
+#define _LIBCPP___ALGORITHM_COPY_N_H
+
+#include <__config>
+#include <__algorithm/copy.h>
+#include <__algorithm/unwrap_iter.h>
+#include <__iterator/iterator_traits.h>
+#include <cstring>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _InputIterator, class _Size, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+typename enable_if
+<
+ __is_cpp17_input_iterator<_InputIterator>::value &&
+ !__is_cpp17_random_access_iterator<_InputIterator>::value,
+ _OutputIterator
+>::type
+copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
+{
+ typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
+ _IntegralSize __n = __orig_n;
+ if (__n > 0)
+ {
+ *__result = *__first;
+ ++__result;
+ for (--__n; __n > 0; --__n)
+ {
+ ++__first;
+ *__result = *__first;
+ ++__result;
+ }
+ }
+ return __result;
+}
+
+template<class _InputIterator, class _Size, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+typename enable_if
+<
+ __is_cpp17_random_access_iterator<_InputIterator>::value,
+ _OutputIterator
+>::type
+copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
+{
+ typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
+ _IntegralSize __n = __orig_n;
+ return _VSTD::copy(__first, __first + __n, __result);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_COPY_N_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_COUNT_H
+#define _LIBCPP___ALGORITHM_COUNT_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ typename iterator_traits<_InputIterator>::difference_type
+ count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) {
+ typename iterator_traits<_InputIterator>::difference_type __r(0);
+ for (; __first != __last; ++__first)
+ if (*__first == __value_)
+ ++__r;
+ return __r;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_COUNT_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_COUNT_IF_H
+#define _LIBCPP___ALGORITHM_COUNT_IF_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Predicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ typename iterator_traits<_InputIterator>::difference_type
+ count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
+ typename iterator_traits<_InputIterator>::difference_type __r(0);
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ ++__r;
+ return __r;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_COUNT_IF_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_EQUAL_H
+#define _LIBCPP___ALGORITHM_EQUAL_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+#include <iterator> // FIXME: replace with <__iterator/distance.h> when it lands
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
+ for (; __first1 != __last1; ++__first1, (void)++__first2)
+ if (!__pred(*__first1, *__first2))
+ return false;
+ return true;
+}
+
+template <class _InputIterator1, class _InputIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) {
+ typedef typename iterator_traits<_InputIterator1>::value_type __v1;
+ typedef typename iterator_traits<_InputIterator2>::value_type __v2;
+ return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
+}
+
+#if _LIBCPP_STD_VER > 11
+template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+__equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
+ _BinaryPredicate __pred, input_iterator_tag, input_iterator_tag) {
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2)
+ if (!__pred(*__first1, *__first2))
+ return false;
+ return __first1 == __last1 && __first2 == __last2;
+}
+
+template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
+ _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag,
+ random_access_iterator_tag) {
+ if (_VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
+ return false;
+ return _VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2,
+ typename add_lvalue_reference<_BinaryPredicate>::type>(__first1, __last1, __first2, __pred);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
+ _BinaryPredicate __pred) {
+ return _VSTD::__equal<typename add_lvalue_reference<_BinaryPredicate>::type>(
+ __first1, __last1, __first2, __last2, __pred, typename iterator_traits<_InputIterator1>::iterator_category(),
+ typename iterator_traits<_InputIterator2>::iterator_category());
+}
+
+template <class _InputIterator1, class _InputIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
+ typedef typename iterator_traits<_InputIterator1>::value_type __v1;
+ typedef typename iterator_traits<_InputIterator2>::value_type __v2;
+ return _VSTD::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(),
+ typename iterator_traits<_InputIterator1>::iterator_category(),
+ typename iterator_traits<_InputIterator2>::iterator_category());
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_EQUAL_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_EQUAL_RANGE_H
+#define _LIBCPP___ALGORITHM_EQUAL_RANGE_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/half_positive.h>
+#include <__algorithm/lower_bound.h>
+#include <__algorithm/upper_bound.h>
+#include <iterator>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _ForwardIterator, class _Tp>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
+__equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
+{
+ typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
+ difference_type __len = _VSTD::distance(__first, __last);
+ while (__len != 0)
+ {
+ difference_type __l2 = _VSTD::__half_positive(__len);
+ _ForwardIterator __m = __first;
+ _VSTD::advance(__m, __l2);
+ if (__comp(*__m, __value_))
+ {
+ __first = ++__m;
+ __len -= __l2 + 1;
+ }
+ else if (__comp(__value_, *__m))
+ {
+ __last = __m;
+ __len = __l2;
+ }
+ else
+ {
+ _ForwardIterator __mp1 = __m;
+ return pair<_ForwardIterator, _ForwardIterator>
+ (
+ _VSTD::__lower_bound<_Compare>(__first, __m, __value_, __comp),
+ _VSTD::__upper_bound<_Compare>(++__mp1, __last, __value_, __comp)
+ );
+ }
+ }
+ return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
+}
+
+template <class _ForwardIterator, class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+pair<_ForwardIterator, _ForwardIterator>
+equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__equal_range<_Comp_ref>(__first, __last, __value_, __comp);
+}
+
+template <class _ForwardIterator, class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+pair<_ForwardIterator, _ForwardIterator>
+equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
+{
+ return _VSTD::equal_range(__first, __last, __value_,
+ __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_EQUAL_RANGE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FILL_H
+#define _LIBCPP___ALGORITHM_FILL_H
+
+#include <__config>
+#include <__algorithm/fill_n.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag)
+{
+ for (; __first != __last; ++__first)
+ *__first = __value_;
+}
+
+template <class _RandomAccessIterator, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag)
+{
+ _VSTD::fill_n(__first, __last - __first, __value_);
+}
+
+template <class _ForwardIterator, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
+{
+ _VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FILL_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FILL_N_H
+#define _LIBCPP___ALGORITHM_FILL_N_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _OutputIterator, class _Size, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
+{
+ for (; __n > 0; ++__first, (void) --__n)
+ *__first = __value_;
+ return __first;
+}
+
+template <class _OutputIterator, class _Size, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
+{
+ return _VSTD::__fill_n(__first, _VSTD::__convert_to_integral(__n), __value_);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FILL_N_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FIND_H
+#define _LIBCPP___ALGORITHM_FIND_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator
+find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) {
+ for (; __first != __last; ++__first)
+ if (*__first == __value_)
+ break;
+ return __first;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FIND_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FIND_END_OF_H
+#define _LIBCPP___ALGORITHM_FIND_END_OF_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __pred, forward_iterator_tag,
+ forward_iterator_tag) {
+ // modeled after search algorithm
+ _ForwardIterator1 __r = __last1; // __last1 is the "default" answer
+ if (__first2 == __last2)
+ return __r;
+ while (true) {
+ while (true) {
+ if (__first1 == __last1) // if source exhausted return last correct answer
+ return __r; // (or __last1 if never found)
+ if (__pred(*__first1, *__first2))
+ break;
+ ++__first1;
+ }
+ // *__first1 matches *__first2, now match elements after here
+ _ForwardIterator1 __m1 = __first1;
+ _ForwardIterator2 __m2 = __first2;
+ while (true) {
+ if (++__m2 == __last2) { // Pattern exhaused, record answer and search for another one
+ __r = __first1;
+ ++__first1;
+ break;
+ }
+ if (++__m1 == __last1) // Source exhausted, return last answer
+ return __r;
+ if (!__pred(*__m1, *__m2)) // mismatch, restart with a new __first
+ {
+ ++__first1;
+ break;
+ } // else there is a match, check next elements
+ }
+ }
+}
+
+template <class _BinaryPredicate, class _BidirectionalIterator1, class _BidirectionalIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator1 __find_end(
+ _BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2, _BinaryPredicate __pred, bidirectional_iterator_tag, bidirectional_iterator_tag) {
+ // modeled after search algorithm (in reverse)
+ if (__first2 == __last2)
+ return __last1; // Everything matches an empty sequence
+ _BidirectionalIterator1 __l1 = __last1;
+ _BidirectionalIterator2 __l2 = __last2;
+ --__l2;
+ while (true) {
+ // Find last element in sequence 1 that matchs *(__last2-1), with a mininum of loop checks
+ while (true) {
+ if (__first1 == __l1) // return __last1 if no element matches *__first2
+ return __last1;
+ if (__pred(*--__l1, *__l2))
+ break;
+ }
+ // *__l1 matches *__l2, now match elements before here
+ _BidirectionalIterator1 __m1 = __l1;
+ _BidirectionalIterator2 __m2 = __l2;
+ while (true) {
+ if (__m2 == __first2) // If pattern exhausted, __m1 is the answer (works for 1 element pattern)
+ return __m1;
+ if (__m1 == __first1) // Otherwise if source exhaused, pattern not found
+ return __last1;
+ if (!__pred(*--__m1, *--__m2)) // if there is a mismatch, restart with a new __l1
+ {
+ break;
+ } // else there is a match, check next elements
+ }
+ }
+}
+
+template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1 __find_end(
+ _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
+ _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag, random_access_iterator_tag) {
+ // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern
+ typename iterator_traits<_RandomAccessIterator2>::difference_type __len2 = __last2 - __first2;
+ if (__len2 == 0)
+ return __last1;
+ typename iterator_traits<_RandomAccessIterator1>::difference_type __len1 = __last1 - __first1;
+ if (__len1 < __len2)
+ return __last1;
+ const _RandomAccessIterator1 __s = __first1 + (__len2 - 1); // End of pattern match can't go before here
+ _RandomAccessIterator1 __l1 = __last1;
+ _RandomAccessIterator2 __l2 = __last2;
+ --__l2;
+ while (true) {
+ while (true) {
+ if (__s == __l1)
+ return __last1;
+ if (__pred(*--__l1, *__l2))
+ break;
+ }
+ _RandomAccessIterator1 __m1 = __l1;
+ _RandomAccessIterator2 __m2 = __l2;
+ while (true) {
+ if (__m2 == __first2)
+ return __m1;
+ // no need to check range on __m1 because __s guarantees we have enough source
+ if (!__pred(*--__m1, *--__m2)) {
+ break;
+ }
+ }
+ }
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
+find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __pred) {
+ return _VSTD::__find_end<typename add_lvalue_reference<_BinaryPredicate>::type>(
+ __first1, __last1, __first2, __last2, __pred, typename iterator_traits<_ForwardIterator1>::iterator_category(),
+ typename iterator_traits<_ForwardIterator2>::iterator_category());
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
+find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
+ return _VSTD::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FIND_END_OF_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FIND_FIRST_OF_H
+#define _LIBCPP___ALGORITHM_FIND_FIRST_OF_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardIterator1 __first1,
+ _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _BinaryPredicate __pred) {
+ for (; __first1 != __last1; ++__first1)
+ for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
+ if (__pred(*__first1, *__j))
+ return __first1;
+ return __last1;
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
+find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _BinaryPredicate __pred) {
+ return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred);
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_first_of(
+ _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
+ return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FIND_FIRST_OF_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FIND_IF_H
+#define _LIBCPP___ALGORITHM_FIND_IF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Predicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator
+find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ break;
+ return __first;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FIND_IF_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FIND_IF_NOT_H
+#define _LIBCPP___ALGORITHM_FIND_IF_NOT_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Predicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator
+find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
+ for (; __first != __last; ++__first)
+ if (!__pred(*__first))
+ break;
+ return __first;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FIND_IF_NOT_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FOR_EACH_H
+#define _LIBCPP___ALGORITHM_FOR_EACH_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Function>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Function for_each(_InputIterator __first,
+ _InputIterator __last,
+ _Function __f) {
+ for (; __first != __last; ++__first)
+ __f(*__first);
+ return __f;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FOR_EACH_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_FOR_EACH_N_H
+#define _LIBCPP___ALGORITHM_FOR_EACH_N_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+template <class _InputIterator, class _Size, class _Function>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator for_each_n(_InputIterator __first,
+ _Size __orig_n,
+ _Function __f) {
+ typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
+ _IntegralSize __n = __orig_n;
+ while (__n > 0) {
+ __f(*__first);
+ ++__first;
+ --__n;
+ }
+ return __first;
+}
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_FOR_EACH_N_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_GENERATE_H
+#define _LIBCPP___ALGORITHM_GENERATE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Generator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
+{
+ for (; __first != __last; ++__first)
+ *__first = __gen();
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_GENERATE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_GENERATE_N_H
+#define _LIBCPP___ALGORITHM_GENERATE_N_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _OutputIterator, class _Size, class _Generator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)
+{
+ typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
+ _IntegralSize __n = __orig_n;
+ for (; __n > 0; ++__first, (void) --__n)
+ *__first = __gen();
+ return __first;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_GENERATE_N_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_HALF_POSITIVE_H
+#define _LIBCPP___ALGORITHM_HALF_POSITIVE_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Perform division by two quickly for positive integers (llvm.org/PR39129)
+
+template <typename _Integral>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ is_integral<_Integral>::value,
+ _Integral
+>::type
+__half_positive(_Integral __value)
+{
+ return static_cast<_Integral>(static_cast<typename make_unsigned<_Integral>::type>(__value) / 2);
+}
+
+template <typename _Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ !is_integral<_Tp>::value,
+ _Tp
+>::type
+__half_positive(_Tp __value)
+{
+ return __value / 2;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_HALF_POSITIVE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_INCLUDES_H
+#define _LIBCPP___ALGORITHM_INCLUDES_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator1, class _InputIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+__includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
+ _Compare __comp)
+{
+ for (; __first2 != __last2; ++__first1)
+ {
+ if (__first1 == __last1 || __comp(*__first2, *__first1))
+ return false;
+ if (!__comp(*__first1, *__first2))
+ ++__first2;
+ }
+ return true;
+}
+
+template <class _InputIterator1, class _InputIterator2, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
+ _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
+}
+
+template <class _InputIterator1, class _InputIterator2>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)
+{
+ return _VSTD::includes(__first1, __last1, __first2, __last2,
+ __less<typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_INCLUDES_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_INPLACE_MERGE_H
+#define _LIBCPP___ALGORITHM_INPLACE_MERGE_H
+
+#include <__config>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/comp.h>
+#include <__algorithm/lower_bound.h>
+#include <__algorithm/min.h>
+#include <__algorithm/move.h>
+#include <__algorithm/rotate.h>
+#include <__algorithm/upper_bound.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+#include <memory>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Predicate>
+class __invert // invert the sense of a comparison
+{
+private:
+ _Predicate __p_;
+public:
+ _LIBCPP_INLINE_VISIBILITY __invert() {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __invert(_Predicate __p) : __p_(__p) {}
+
+ template <class _T1>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _T1& __x) {return !__p_(__x);}
+
+ template <class _T1, class _T2>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);}
+};
+
+template <class _Compare, class _InputIterator1, class _InputIterator2,
+ class _OutputIterator>
+void __half_inplace_merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+{
+ for (; __first1 != __last1; ++__result)
+ {
+ if (__first2 == __last2)
+ {
+ _VSTD::move(__first1, __last1, __result);
+ return;
+ }
+
+ if (__comp(*__first2, *__first1))
+ {
+ *__result = _VSTD::move(*__first2);
+ ++__first2;
+ }
+ else
+ {
+ *__result = _VSTD::move(*__first1);
+ ++__first1;
+ }
+ }
+ // __first2 through __last2 are already in the right spot.
+}
+
+template <class _Compare, class _BidirectionalIterator>
+void
+__buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
+ _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1,
+ typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
+ typename iterator_traits<_BidirectionalIterator>::value_type* __buff)
+{
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
+ if (__len1 <= __len2)
+ {
+ value_type* __p = __buff;
+ for (_BidirectionalIterator __i = __first; __i != __middle; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p)
+ ::new ((void*)__p) value_type(_VSTD::move(*__i));
+ _VSTD::__half_inplace_merge<_Compare>(__buff, __p, __middle, __last, __first, __comp);
+ }
+ else
+ {
+ value_type* __p = __buff;
+ for (_BidirectionalIterator __i = __middle; __i != __last; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p)
+ ::new ((void*)__p) value_type(_VSTD::move(*__i));
+ typedef reverse_iterator<_BidirectionalIterator> _RBi;
+ typedef reverse_iterator<value_type*> _Rv;
+ typedef __invert<_Compare> _Inverted;
+ _VSTD::__half_inplace_merge<_Inverted>(_Rv(__p), _Rv(__buff),
+ _RBi(__middle), _RBi(__first),
+ _RBi(__last), _Inverted(__comp));
+ }
+}
+
+template <class _Compare, class _BidirectionalIterator>
+void
+__inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
+ _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1,
+ typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
+ typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size)
+{
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
+ while (true)
+ {
+ // if __middle == __last, we're done
+ if (__len2 == 0)
+ return;
+ if (__len1 <= __buff_size || __len2 <= __buff_size)
+ return _VSTD::__buffered_inplace_merge<_Compare>
+ (__first, __middle, __last, __comp, __len1, __len2, __buff);
+ // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0
+ for (; true; ++__first, (void) --__len1)
+ {
+ if (__len1 == 0)
+ return;
+ if (__comp(*__middle, *__first))
+ break;
+ }
+ // __first < __middle < __last
+ // *__first > *__middle
+ // partition [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) such that
+ // all elements in:
+ // [__first, __m1) <= [__middle, __m2)
+ // [__middle, __m2) < [__m1, __middle)
+ // [__m1, __middle) <= [__m2, __last)
+ // and __m1 or __m2 is in the middle of its range
+ _BidirectionalIterator __m1; // "median" of [__first, __middle)
+ _BidirectionalIterator __m2; // "median" of [__middle, __last)
+ difference_type __len11; // distance(__first, __m1)
+ difference_type __len21; // distance(__middle, __m2)
+ // binary search smaller range
+ if (__len1 < __len2)
+ { // __len >= 1, __len2 >= 2
+ __len21 = __len2 / 2;
+ __m2 = __middle;
+ _VSTD::advance(__m2, __len21);
+ __m1 = _VSTD::__upper_bound<_Compare>(__first, __middle, *__m2, __comp);
+ __len11 = _VSTD::distance(__first, __m1);
+ }
+ else
+ {
+ if (__len1 == 1)
+ { // __len1 >= __len2 && __len2 > 0, therefore __len2 == 1
+ // It is known *__first > *__middle
+ swap(*__first, *__middle);
+ return;
+ }
+ // __len1 >= 2, __len2 >= 1
+ __len11 = __len1 / 2;
+ __m1 = __first;
+ _VSTD::advance(__m1, __len11);
+ __m2 = _VSTD::__lower_bound<_Compare>(__middle, __last, *__m1, __comp);
+ __len21 = _VSTD::distance(__middle, __m2);
+ }
+ difference_type __len12 = __len1 - __len11; // distance(__m1, __middle)
+ difference_type __len22 = __len2 - __len21; // distance(__m2, __last)
+ // [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last)
+ // swap middle two partitions
+ __middle = _VSTD::rotate(__m1, __middle, __m2);
+ // __len12 and __len21 now have swapped meanings
+ // merge smaller range with recursive call and larger with tail recursion elimination
+ if (__len11 + __len21 < __len12 + __len22)
+ {
+ _VSTD::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
+// _VSTD::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
+ __first = __middle;
+ __middle = __m2;
+ __len1 = __len12;
+ __len2 = __len22;
+ }
+ else
+ {
+ _VSTD::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
+// _VSTD::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
+ __last = __middle;
+ __middle = __m1;
+ __len1 = __len11;
+ __len2 = __len21;
+ }
+ }
+}
+
+template <class _BidirectionalIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
+ _Compare __comp)
+{
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
+ difference_type __len1 = _VSTD::distance(__first, __middle);
+ difference_type __len2 = _VSTD::distance(__middle, __last);
+ difference_type __buf_size = _VSTD::min(__len1, __len2);
+ pair<value_type*, ptrdiff_t> __buf = _VSTD::get_temporary_buffer<value_type>(__buf_size);
+ unique_ptr<value_type, __return_temporary_buffer> __h(__buf.first);
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2,
+ __buf.first, __buf.second);
+}
+
+template <class _BidirectionalIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last)
+{
+ _VSTD::inplace_merge(__first, __middle, __last,
+ __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_INPLACE_MERGE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_IS_HEAP_H
+#define _LIBCPP___ALGORITHM_IS_HEAP_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/is_heap_until.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _RandomAccessIterator, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ return _VSTD::is_heap_until(__first, __last, __comp) == __last;
+}
+
+template<class _RandomAccessIterator>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ return _VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_IS_HEAP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H
+#define _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _RandomAccessIterator, class _Compare>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
+is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ difference_type __len = __last - __first;
+ difference_type __p = 0;
+ difference_type __c = 1;
+ _RandomAccessIterator __pp = __first;
+ while (__c < __len)
+ {
+ _RandomAccessIterator __cp = __first + __c;
+ if (__comp(*__pp, *__cp))
+ return __cp;
+ ++__c;
+ ++__cp;
+ if (__c == __len)
+ return __last;
+ if (__comp(*__pp, *__cp))
+ return __cp;
+ ++__p;
+ ++__pp;
+ __c = 2 * __p + 1;
+ }
+ return __last;
+}
+
+template<class _RandomAccessIterator>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_RandomAccessIterator
+is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ return _VSTD::is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_IS_PARTITIONED_H
+#define _LIBCPP___ALGORITHM_IS_PARTITIONED_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Predicate>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+{
+ for (; __first != __last; ++__first)
+ if (!__pred(*__first))
+ break;
+ if ( __first == __last )
+ return true;
+ ++__first;
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ return false;
+ return true;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_IS_PARTITIONED_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_IS_PERMUTATION_H
+#define _LIBCPP___ALGORITHM_IS_PERMUTATION_H
+
+#include <__algorithm/comp.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <iterator> // FIXME: replace with <__iterator/distance.h> when it lands
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _BinaryPredicate __pred) {
+ // shorten sequences as much as possible by lopping of any equal prefix
+ for (; __first1 != __last1; ++__first1, (void)++__first2)
+ if (!__pred(*__first1, *__first2))
+ break;
+ if (__first1 == __last1)
+ return true;
+
+ // __first1 != __last1 && *__first1 != *__first2
+ typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;
+ _D1 __l1 = _VSTD::distance(__first1, __last1);
+ if (__l1 == _D1(1))
+ return false;
+ _ForwardIterator2 __last2 = _VSTD::next(__first2, __l1);
+ // For each element in [f1, l1) see if there are the same number of
+ // equal elements in [f2, l2)
+ for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) {
+ // Have we already counted the number of *__i in [f1, l1)?
+ _ForwardIterator1 __match = __first1;
+ for (; __match != __i; ++__match)
+ if (__pred(*__match, *__i))
+ break;
+ if (__match == __i) {
+ // Count number of *__i in [f2, l2)
+ _D1 __c2 = 0;
+ for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
+ if (__pred(*__i, *__j))
+ ++__c2;
+ if (__c2 == 0)
+ return false;
+ // Count number of *__i in [__i, l1) (we can start with 1)
+ _D1 __c1 = 1;
+ for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j)
+ if (__pred(*__i, *__j))
+ ++__c1;
+ if (__c1 != __c2)
+ return false;
+ }
+ }
+ return true;
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
+ return _VSTD::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>());
+}
+
+#if _LIBCPP_STD_VER > 11
+template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag) {
+ // shorten sequences as much as possible by lopping of any equal prefix
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2)
+ if (!__pred(*__first1, *__first2))
+ break;
+ if (__first1 == __last1)
+ return __first2 == __last2;
+ else if (__first2 == __last2)
+ return false;
+
+ typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;
+ _D1 __l1 = _VSTD::distance(__first1, __last1);
+
+ typedef typename iterator_traits<_ForwardIterator2>::difference_type _D2;
+ _D2 __l2 = _VSTD::distance(__first2, __last2);
+ if (__l1 != __l2)
+ return false;
+
+ // For each element in [f1, l1) see if there are the same number of
+ // equal elements in [f2, l2)
+ for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) {
+ // Have we already counted the number of *__i in [f1, l1)?
+ _ForwardIterator1 __match = __first1;
+ for (; __match != __i; ++__match)
+ if (__pred(*__match, *__i))
+ break;
+ if (__match == __i) {
+ // Count number of *__i in [f2, l2)
+ _D1 __c2 = 0;
+ for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
+ if (__pred(*__i, *__j))
+ ++__c2;
+ if (__c2 == 0)
+ return false;
+ // Count number of *__i in [__i, l1) (we can start with 1)
+ _D1 __c1 = 1;
+ for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j)
+ if (__pred(*__i, *__j))
+ ++__c1;
+ if (__c1 != __c2)
+ return false;
+ }
+ }
+ return true;
+}
+
+template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1,
+ _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2,
+ _BinaryPredicate __pred, random_access_iterator_tag,
+ random_access_iterator_tag) {
+ if (_VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
+ return false;
+ return _VSTD::is_permutation<_RandomAccessIterator1, _RandomAccessIterator2,
+ typename add_lvalue_reference<_BinaryPredicate>::type>(__first1, __last1, __first2,
+ __pred);
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _BinaryPredicate __pred) {
+ return _VSTD::__is_permutation<typename add_lvalue_reference<_BinaryPredicate>::type>(
+ __first1, __last1, __first2, __last2, __pred, typename iterator_traits<_ForwardIterator1>::iterator_category(),
+ typename iterator_traits<_ForwardIterator2>::iterator_category());
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2) {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
+ return _VSTD::__is_permutation(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(),
+ typename iterator_traits<_ForwardIterator1>::iterator_category(),
+ typename iterator_traits<_ForwardIterator2>::iterator_category());
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_IS_PERMUTATION_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_IS_SORTED_H
+#define _LIBCPP___ALGORITHM_IS_SORTED_H
+
+#include <__algorithm/comp.h>
+#include <__algorithm/is_sorted_until.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
+{
+ return _VSTD::is_sorted_until(__first, __last, __comp) == __last;
+}
+
+template<class _ForwardIterator>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+is_sorted(_ForwardIterator __first, _ForwardIterator __last)
+{
+ return _VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_IS_SORTED_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H
+#define _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Compare>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
+{
+ if (__first != __last)
+ {
+ _ForwardIterator __i = __first;
+ while (++__i != __last)
+ {
+ if (__comp(*__i, *__first))
+ return __i;
+ __first = __i;
+ }
+ }
+ return __last;
+}
+
+template<class _ForwardIterator>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator
+is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
+{
+ return _VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_ITER_SWAP_H
+#define _LIBCPP___ALGORITHM_ITER_SWAP_H
+
+#include <__config>
+#include <__utility/declval.h>
+#include <__utility/swap.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator1, class _ForwardIterator2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void iter_swap(_ForwardIterator1 __a,
+ _ForwardIterator2 __b)
+ // _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))
+ _NOEXCEPT_(_NOEXCEPT_(swap(*declval<_ForwardIterator1>(), *declval<_ForwardIterator2>()))) {
+ swap(*__a, *__b);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_ITER_SWAP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
+#define _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator1, class _InputIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
+{
+ for (; __first2 != __last2; ++__first1, (void) ++__first2)
+ {
+ if (__first1 == __last1 || __comp(*__first1, *__first2))
+ return true;
+ if (__comp(*__first2, *__first1))
+ return false;
+ }
+ return false;
+}
+
+template <class _InputIterator1, class _InputIterator2, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
+}
+
+template <class _InputIterator1, class _InputIterator2>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2)
+{
+ return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2,
+ __less<typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_LOWER_BOUND_H
+#define _LIBCPP___ALGORITHM_LOWER_BOUND_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/half_positive.h>
+#include <iterator>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _ForwardIterator, class _Tp>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+__lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
+{
+ typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
+ difference_type __len = _VSTD::distance(__first, __last);
+ while (__len != 0)
+ {
+ difference_type __l2 = _VSTD::__half_positive(__len);
+ _ForwardIterator __m = __first;
+ _VSTD::advance(__m, __l2);
+ if (__comp(*__m, __value_))
+ {
+ __first = ++__m;
+ __len -= __l2 + 1;
+ }
+ else
+ __len = __l2;
+ }
+ return __first;
+}
+
+template <class _ForwardIterator, class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator
+lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
+{
+ typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
+ return _VSTD::__lower_bound<_Comp_ref>(__first, __last, __value_, __comp);
+}
+
+template <class _ForwardIterator, class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator
+lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
+{
+ return _VSTD::lower_bound(__first, __last, __value_,
+ __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_LOWER_BOUND_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MAKE_HEAP_H
+#define _LIBCPP___ALGORITHM_MAKE_HEAP_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/sift_down.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 void
+__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ difference_type __n = __last - __first;
+ if (__n > 1)
+ {
+ // start from the first parent, there is no need to consider children
+ for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start)
+ {
+ _VSTD::__sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);
+ }
+ }
+}
+
+template <class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ _VSTD::__make_heap<_Comp_ref>(__first, __last, __comp);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ _VSTD::make_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MAKE_HEAP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MAX_H
+#define _LIBCPP___ALGORITHM_MAX_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/max_element.h>
+#include <initializer_list>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const _Tp&
+max(const _Tp& __a, const _Tp& __b, _Compare __comp)
+{
+ return __comp(__a, __b) ? __b : __a;
+}
+
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const _Tp&
+max(const _Tp& __a, const _Tp& __b)
+{
+ return _VSTD::max(__a, __b, __less<_Tp>());
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+
+template<class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_Tp
+max(initializer_list<_Tp> __t, _Compare __comp)
+{
+ return *_VSTD::max_element(__t.begin(), __t.end(), __comp);
+}
+
+template<class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_Tp
+max(initializer_list<_Tp> __t)
+{
+ return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());
+}
+
+#endif // _LIBCPP_CXX03_LANG
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MAX_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MAX_ELEMENT_H
+#define _LIBCPP___ALGORITHM_MAX_ELEMENT_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_ForwardIterator
+max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
+{
+ static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
+ "std::max_element requires a ForwardIterator");
+ if (__first != __last)
+ {
+ _ForwardIterator __i = __first;
+ while (++__i != __last)
+ if (__comp(*__first, *__i))
+ __first = __i;
+ }
+ return __first;
+}
+
+
+template <class _ForwardIterator>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_ForwardIterator
+max_element(_ForwardIterator __first, _ForwardIterator __last)
+{
+ return _VSTD::max_element(__first, __last,
+ __less<typename iterator_traits<_ForwardIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MAX_ELEMENT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MERGE_H
+#define _LIBCPP___ALGORITHM_MERGE_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/copy.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+__merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ for (; __first1 != __last1; ++__result)
+ {
+ if (__first2 == __last2)
+ return _VSTD::copy(__first1, __last1, __result);
+ if (__comp(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ }
+ return _VSTD::copy(__first2, __last2, __result);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
+{
+ typedef typename iterator_traits<_InputIterator1>::value_type __v1;
+ typedef typename iterator_traits<_InputIterator2>::value_type __v2;
+ return _VSTD::merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MERGE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MIN_H
+#define _LIBCPP___ALGORITHM_MIN_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/min_element.h>
+#include <initializer_list>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const _Tp&
+min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+{
+ return __comp(__b, __a) ? __b : __a;
+}
+
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const _Tp&
+min(const _Tp& __a, const _Tp& __b)
+{
+ return _VSTD::min(__a, __b, __less<_Tp>());
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+
+template<class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_Tp
+min(initializer_list<_Tp> __t, _Compare __comp)
+{
+ return *_VSTD::min_element(__t.begin(), __t.end(), __comp);
+}
+
+template<class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_Tp
+min(initializer_list<_Tp> __t)
+{
+ return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());
+}
+
+#endif // _LIBCPP_CXX03_LANG
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MIN_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MIN_ELEMENT_H
+#define _LIBCPP___ALGORITHM_MIN_ELEMENT_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_ForwardIterator
+min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
+{
+ static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
+ "std::min_element requires a ForwardIterator");
+ if (__first != __last)
+ {
+ _ForwardIterator __i = __first;
+ while (++__i != __last)
+ if (__comp(*__i, *__first))
+ __first = __i;
+ }
+ return __first;
+}
+
+template <class _ForwardIterator>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_ForwardIterator
+min_element(_ForwardIterator __first, _ForwardIterator __last)
+{
+ return _VSTD::min_element(__first, __last,
+ __less<typename iterator_traits<_ForwardIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MIN_ELEMENT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MINMAX_H
+#define _LIBCPP___ALGORITHM_MINMAX_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <initializer_list>
+#include <utility>
+
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+pair<const _Tp&, const _Tp&>
+minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
+{
+ return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) :
+ pair<const _Tp&, const _Tp&>(__a, __b);
+}
+
+template<class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+pair<const _Tp&, const _Tp&>
+minmax(const _Tp& __a, const _Tp& __b)
+{
+ return _VSTD::minmax(__a, __b, __less<_Tp>());
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+
+template<class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+pair<_Tp, _Tp>
+minmax(initializer_list<_Tp> __t, _Compare __comp)
+{
+ typedef typename initializer_list<_Tp>::const_iterator _Iter;
+ _Iter __first = __t.begin();
+ _Iter __last = __t.end();
+ pair<_Tp, _Tp> __result(*__first, *__first);
+
+ ++__first;
+ if (__t.size() % 2 == 0)
+ {
+ if (__comp(*__first, __result.first))
+ __result.first = *__first;
+ else
+ __result.second = *__first;
+ ++__first;
+ }
+
+ while (__first != __last)
+ {
+ _Tp __prev = *__first++;
+ if (__comp(*__first, __prev)) {
+ if ( __comp(*__first, __result.first)) __result.first = *__first;
+ if (!__comp(__prev, __result.second)) __result.second = __prev;
+ }
+ else {
+ if ( __comp(__prev, __result.first)) __result.first = __prev;
+ if (!__comp(*__first, __result.second)) __result.second = *__first;
+ }
+
+ __first++;
+ }
+ return __result;
+}
+
+template<class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+pair<_Tp, _Tp>
+minmax(initializer_list<_Tp> __t)
+{
+ return _VSTD::minmax(__t, __less<_Tp>());
+}
+
+#endif // _LIBCPP_CXX03_LANG
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MINMAX_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H
+#define _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Compare>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11
+pair<_ForwardIterator, _ForwardIterator>
+minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
+{
+ static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
+ "std::minmax_element requires a ForwardIterator");
+ pair<_ForwardIterator, _ForwardIterator> __result(__first, __first);
+ if (__first != __last)
+ {
+ if (++__first != __last)
+ {
+ if (__comp(*__first, *__result.first))
+ __result.first = __first;
+ else
+ __result.second = __first;
+ while (++__first != __last)
+ {
+ _ForwardIterator __i = __first;
+ if (++__first == __last)
+ {
+ if (__comp(*__i, *__result.first))
+ __result.first = __i;
+ else if (!__comp(*__i, *__result.second))
+ __result.second = __i;
+ break;
+ }
+ else
+ {
+ if (__comp(*__first, *__i))
+ {
+ if (__comp(*__first, *__result.first))
+ __result.first = __first;
+ if (!__comp(*__i, *__result.second))
+ __result.second = __i;
+ }
+ else
+ {
+ if (__comp(*__i, *__result.first))
+ __result.first = __i;
+ if (!__comp(*__first, *__result.second))
+ __result.second = __first;
+ }
+ }
+ }
+ }
+ }
+ return __result;
+}
+
+template <class _ForwardIterator>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+pair<_ForwardIterator, _ForwardIterator>
+minmax_element(_ForwardIterator __first, _ForwardIterator __last)
+{
+ return _VSTD::minmax_element(__first, __last,
+ __less<typename iterator_traits<_ForwardIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MISMATCH_H
+#define _LIBCPP___ALGORITHM_MISMATCH_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
+ for (; __first1 != __last1; ++__first1, (void)++__first2)
+ if (!__pred(*__first1, *__first2))
+ break;
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+}
+
+template <class _InputIterator1, class _InputIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) {
+ typedef typename iterator_traits<_InputIterator1>::value_type __v1;
+ typedef typename iterator_traits<_InputIterator2>::value_type __v2;
+ return _VSTD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>());
+}
+
+#if _LIBCPP_STD_VER > 11
+template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
+ _BinaryPredicate __pred) {
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2)
+ if (!__pred(*__first1, *__first2))
+ break;
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+}
+
+template <class _InputIterator1, class _InputIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
+ typedef typename iterator_traits<_InputIterator1>::value_type __v1;
+ typedef typename iterator_traits<_InputIterator2>::value_type __v2;
+ return _VSTD::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MISMATCH_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MOVE_H
+#define _LIBCPP___ALGORITHM_MOVE_H
+
+#include <__config>
+#include <__algorithm/unwrap_iter.h>
+#include <__utility/move.h>
+#include <cstring>
+#include <utility>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// move
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_OutputIterator
+__move_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ for (; __first != __last; ++__first, (void) ++__result)
+ *__result = _VSTD::move(*__first);
+ return __result;
+}
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_OutputIterator
+__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ return _VSTD::__move_constexpr(__first, __last, __result);
+}
+
+template <class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+typename enable_if
+<
+ is_same<typename remove_const<_Tp>::type, _Up>::value &&
+ is_trivially_move_assignable<_Up>::value,
+ _Up*
+>::type
+__move(_Tp* __first, _Tp* __last, _Up* __result)
+{
+ const size_t __n = static_cast<size_t>(__last - __first);
+ if (__n > 0)
+ _VSTD::memmove(__result, __first, __n * sizeof(_Up));
+ return __result + __n;
+}
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ if (__libcpp_is_constant_evaluated()) {
+ return _VSTD::__move_constexpr(__first, __last, __result);
+ } else {
+ return _VSTD::__rewrap_iter(__result,
+ _VSTD::__move(_VSTD::__unwrap_iter(__first),
+ _VSTD::__unwrap_iter(__last),
+ _VSTD::__unwrap_iter(__result)));
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MOVE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_MOVE_BACKWARD_H
+#define _LIBCPP___ALGORITHM_MOVE_BACKWARD_H
+
+#include <__config>
+#include <__algorithm/unwrap_iter.h>
+#include <cstring>
+#include <utility>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_OutputIterator
+__move_backward_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ while (__first != __last)
+ *--__result = _VSTD::move(*--__last);
+ return __result;
+}
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_OutputIterator
+__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ return _VSTD::__move_backward_constexpr(__first, __last, __result);
+}
+
+template <class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+typename enable_if
+<
+ is_same<typename remove_const<_Tp>::type, _Up>::value &&
+ is_trivially_move_assignable<_Up>::value,
+ _Up*
+>::type
+__move_backward(_Tp* __first, _Tp* __last, _Up* __result)
+{
+ const size_t __n = static_cast<size_t>(__last - __first);
+ if (__n > 0)
+ {
+ __result -= __n;
+ _VSTD::memmove(__result, __first, __n * sizeof(_Up));
+ }
+ return __result;
+}
+
+template <class _BidirectionalIterator1, class _BidirectionalIterator2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_BidirectionalIterator2
+move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
+ _BidirectionalIterator2 __result)
+{
+ if (__libcpp_is_constant_evaluated()) {
+ return _VSTD::__move_backward_constexpr(__first, __last, __result);
+ } else {
+ return _VSTD::__rewrap_iter(__result,
+ _VSTD::__move_backward(_VSTD::__unwrap_iter(__first),
+ _VSTD::__unwrap_iter(__last),
+ _VSTD::__unwrap_iter(__result)));
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_MOVE_BACKWARD_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H
+#define _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/reverse.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _BidirectionalIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
+{
+ _BidirectionalIterator __i = __last;
+ if (__first == __last || __first == --__i)
+ return false;
+ while (true)
+ {
+ _BidirectionalIterator __ip1 = __i;
+ if (__comp(*--__i, *__ip1))
+ {
+ _BidirectionalIterator __j = __last;
+ while (!__comp(*__i, *--__j))
+ ;
+ swap(*__i, *__j);
+ _VSTD::reverse(__ip1, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ _VSTD::reverse(__first, __last);
+ return false;
+ }
+ }
+}
+
+template <class _BidirectionalIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__next_permutation<_Comp_ref>(__first, __last, __comp);
+}
+
+template <class _BidirectionalIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
+{
+ return _VSTD::next_permutation(__first, __last,
+ __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_NONE_OF_H
+#define _LIBCPP___ALGORITHM_NONE_OF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _Predicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ return false;
+ return true;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_NONE_OF_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_NTH_ELEMENT_H
+#define _LIBCPP___ALGORITHM_NTH_ELEMENT_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/sort.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _Compare, class _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 bool
+__nth_element_find_guard(_RandomAccessIterator& __i, _RandomAccessIterator& __j,
+ _RandomAccessIterator __m, _Compare __comp)
+{
+ // manually guard downward moving __j against __i
+ while (true) {
+ if (__i == --__j) {
+ return false;
+ }
+ if (__comp(*__j, *__m)) {
+ return true; // found guard for downward moving __j, now use unguarded partition
+ }
+ }
+}
+
+template <class _Compare, class _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 void
+__nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
+{
+ // _Compare is known to be a reference type
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ const difference_type __limit = 7;
+ while (true)
+ {
+ if (__nth == __last)
+ return;
+ difference_type __len = __last - __first;
+ switch (__len)
+ {
+ case 0:
+ case 1:
+ return;
+ case 2:
+ if (__comp(*--__last, *__first))
+ swap(*__first, *__last);
+ return;
+ case 3:
+ {
+ _RandomAccessIterator __m = __first;
+ _VSTD::__sort3<_Compare>(__first, ++__m, --__last, __comp);
+ return;
+ }
+ }
+ if (__len <= __limit)
+ {
+ _VSTD::__selection_sort<_Compare>(__first, __last, __comp);
+ return;
+ }
+ // __len > __limit >= 3
+ _RandomAccessIterator __m = __first + __len/2;
+ _RandomAccessIterator __lm1 = __last;
+ unsigned __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, --__lm1, __comp);
+ // *__m is median
+ // partition [__first, __m) < *__m and *__m <= [__m, __last)
+ // (this inhibits tossing elements equivalent to __m around unnecessarily)
+ _RandomAccessIterator __i = __first;
+ _RandomAccessIterator __j = __lm1;
+ // j points beyond range to be tested, *__lm1 is known to be <= *__m
+ // The search going up is known to be guarded but the search coming down isn't.
+ // Prime the downward search with a guard.
+ if (!__comp(*__i, *__m)) // if *__first == *__m
+ {
+ // *__first == *__m, *__first doesn't go in first part
+ if (_VSTD::__nth_element_find_guard<_Compare>(__i, __j, __m, __comp)) {
+ swap(*__i, *__j);
+ ++__n_swaps;
+ } else {
+ // *__first == *__m, *__m <= all other elements
+ // Partition instead into [__first, __i) == *__first and *__first < [__i, __last)
+ ++__i; // __first + 1
+ __j = __last;
+ if (!__comp(*__first, *--__j)) { // we need a guard if *__first == *(__last-1)
+ while (true) {
+ if (__i == __j) {
+ return; // [__first, __last) all equivalent elements
+ } else if (__comp(*__first, *__i)) {
+ swap(*__i, *__j);
+ ++__n_swaps;
+ ++__i;
+ break;
+ }
+ ++__i;
+ }
+ }
+ // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
+ if (__i == __j) {
+ return;
+ }
+ while (true) {
+ while (!__comp(*__first, *__i))
+ ++__i;
+ while (__comp(*__first, *--__j))
+ ;
+ if (__i >= __j)
+ break;
+ swap(*__i, *__j);
+ ++__n_swaps;
+ ++__i;
+ }
+ // [__first, __i) == *__first and *__first < [__i, __last)
+ // The first part is sorted,
+ if (__nth < __i) {
+ return;
+ }
+ // __nth_element the second part
+ // _VSTD::__nth_element<_Compare>(__i, __nth, __last, __comp);
+ __first = __i;
+ continue;
+ }
+ }
+ ++__i;
+ // j points beyond range to be tested, *__lm1 is known to be <= *__m
+ // if not yet partitioned...
+ if (__i < __j)
+ {
+ // known that *(__i - 1) < *__m
+ while (true)
+ {
+ // __m still guards upward moving __i
+ while (__comp(*__i, *__m))
+ ++__i;
+ // It is now known that a guard exists for downward moving __j
+ while (!__comp(*--__j, *__m))
+ ;
+ if (__i >= __j)
+ break;
+ swap(*__i, *__j);
+ ++__n_swaps;
+ // It is known that __m != __j
+ // If __m just moved, follow it
+ if (__m == __i)
+ __m = __j;
+ ++__i;
+ }
+ }
+ // [__first, __i) < *__m and *__m <= [__i, __last)
+ if (__i != __m && __comp(*__m, *__i))
+ {
+ swap(*__i, *__m);
+ ++__n_swaps;
+ }
+ // [__first, __i) < *__i and *__i <= [__i+1, __last)
+ if (__nth == __i)
+ return;
+ if (__n_swaps == 0)
+ {
+ // We were given a perfectly partitioned sequence. Coincidence?
+ if (__nth < __i)
+ {
+ // Check for [__first, __i) already sorted
+ __j = __m = __first;
+ while (true) {
+ if (++__j == __i) {
+ // [__first, __i) sorted
+ return;
+ }
+ if (__comp(*__j, *__m)) {
+ // not yet sorted, so sort
+ break;
+ }
+ __m = __j;
+ }
+ }
+ else
+ {
+ // Check for [__i, __last) already sorted
+ __j = __m = __i;
+ while (true) {
+ if (++__j == __last) {
+ // [__i, __last) sorted
+ return;
+ }
+ if (__comp(*__j, *__m)) {
+ // not yet sorted, so sort
+ break;
+ }
+ __m = __j;
+ }
+ }
+ }
+ // __nth_element on range containing __nth
+ if (__nth < __i)
+ {
+ // _VSTD::__nth_element<_Compare>(__first, __nth, __i, __comp);
+ __last = __i;
+ }
+ else
+ {
+ // _VSTD::__nth_element<_Compare>(__i+1, __nth, __last, __comp);
+ __first = ++__i;
+ }
+ }
+}
+
+template <class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ _VSTD::__nth_element<_Comp_ref>(__first, __nth, __last, __comp);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last)
+{
+ _VSTD::nth_element(__first, __nth, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_NTH_ELEMENT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_PARTIAL_SORT_H
+#define _LIBCPP___ALGORITHM_PARTIAL_SORT_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/make_heap.h>
+#include <__algorithm/sift_down.h>
+#include <__algorithm/sort_heap.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 void
+__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
+ _Compare __comp)
+{
+ _VSTD::__make_heap<_Compare>(__first, __middle, __comp);
+ typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first;
+ for (_RandomAccessIterator __i = __middle; __i != __last; ++__i)
+ {
+ if (__comp(*__i, *__first))
+ {
+ swap(*__i, *__first);
+ _VSTD::__sift_down<_Compare>(__first, __middle, __comp, __len, __first);
+ }
+ }
+ _VSTD::__sort_heap<_Compare>(__first, __middle, __comp);
+}
+
+template <class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
+ _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ _VSTD::__partial_sort<_Comp_ref>(__first, __middle, __last, __comp);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
+{
+ _VSTD::partial_sort(__first, __middle, __last,
+ __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PARTIAL_SORT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H
+#define _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/make_heap.h>
+#include <__algorithm/sift_down.h>
+#include <__algorithm/sort_heap.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits> // swap
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator, class _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
+__partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)
+{
+ _RandomAccessIterator __r = __result_first;
+ if (__r != __result_last)
+ {
+ for (; __first != __last && __r != __result_last; ++__first, (void) ++__r)
+ *__r = *__first;
+ _VSTD::__make_heap<_Compare>(__result_first, __r, __comp);
+ typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first;
+ for (; __first != __last; ++__first)
+ if (__comp(*__first, *__result_first))
+ {
+ *__result_first = *__first;
+ _VSTD::__sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first);
+ }
+ _VSTD::__sort_heap<_Compare>(__result_first, __r, __comp);
+ }
+ return __r;
+}
+
+template <class _InputIterator, class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_RandomAccessIterator
+partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp);
+}
+
+template <class _InputIterator, class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_RandomAccessIterator
+partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first, _RandomAccessIterator __result_last)
+{
+ return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last,
+ __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_PARTITION_H
+#define _LIBCPP___ALGORITHM_PARTITION_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+#include <utility> // pair
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Predicate, class _ForwardIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag)
+{
+ while (true)
+ {
+ if (__first == __last)
+ return __first;
+ if (!__pred(*__first))
+ break;
+ ++__first;
+ }
+ for (_ForwardIterator __p = __first; ++__p != __last;)
+ {
+ if (__pred(*__p))
+ {
+ swap(*__first, *__p);
+ ++__first;
+ }
+ }
+ return __first;
+}
+
+template <class _Predicate, class _BidirectionalIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator
+__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
+ bidirectional_iterator_tag)
+{
+ while (true)
+ {
+ while (true)
+ {
+ if (__first == __last)
+ return __first;
+ if (!__pred(*__first))
+ break;
+ ++__first;
+ }
+ do
+ {
+ if (__first == --__last)
+ return __first;
+ } while (!__pred(*__last));
+ swap(*__first, *__last);
+ ++__first;
+ }
+}
+
+template <class _ForwardIterator, class _Predicate>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator
+partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
+{
+ return _VSTD::__partition<typename add_lvalue_reference<_Predicate>::type>
+ (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PARTITION_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_PARTITION_COPY_H
+#define _LIBCPP___ALGORITHM_PARTITION_COPY_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <utility> // pair
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _OutputIterator1,
+ class _OutputIterator2, class _Predicate>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2>
+partition_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator1 __out_true, _OutputIterator2 __out_false,
+ _Predicate __pred)
+{
+ for (; __first != __last; ++__first)
+ {
+ if (__pred(*__first))
+ {
+ *__out_true = *__first;
+ ++__out_true;
+ }
+ else
+ {
+ *__out_false = *__first;
+ ++__out_false;
+ }
+ }
+ return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PARTITION_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_PARTITION_POINT_H
+#define _LIBCPP___ALGORITHM_PARTITION_POINT_H
+
+#include <__config>
+#include <__algorithm/half_positive.h>
+#include <iterator>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _ForwardIterator, class _Predicate>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
+{
+ typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
+ difference_type __len = _VSTD::distance(__first, __last);
+ while (__len != 0)
+ {
+ difference_type __l2 = _VSTD::__half_positive(__len);
+ _ForwardIterator __m = __first;
+ _VSTD::advance(__m, __l2);
+ if (__pred(*__m))
+ {
+ __first = ++__m;
+ __len -= __l2 + 1;
+ }
+ else
+ __len = __l2;
+ }
+ return __first;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PARTITION_POINT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_POP_HEAP_H
+#define _LIBCPP___ALGORITHM_POP_HEAP_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/sift_down.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ typename iterator_traits<_RandomAccessIterator>::difference_type __len)
+{
+ if (__len > 1)
+ {
+ swap(*__first, *--__last);
+ _VSTD::__sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);
+ }
+}
+
+template <class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ _VSTD::__pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ _VSTD::pop_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_POP_HEAP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_PREV_PERMUTATION_H
+#define _LIBCPP___ALGORITHM_PREV_PERMUTATION_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/reverse.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _BidirectionalIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
+{
+ _BidirectionalIterator __i = __last;
+ if (__first == __last || __first == --__i)
+ return false;
+ while (true)
+ {
+ _BidirectionalIterator __ip1 = __i;
+ if (__comp(*__ip1, *--__i))
+ {
+ _BidirectionalIterator __j = __last;
+ while (!__comp(*--__j, *__i))
+ ;
+ swap(*__i, *__j);
+ _VSTD::reverse(__ip1, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ _VSTD::reverse(__first, __last);
+ return false;
+ }
+ }
+}
+
+template <class _BidirectionalIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__prev_permutation<_Comp_ref>(__first, __last, __comp);
+}
+
+template <class _BidirectionalIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool
+prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
+{
+ return _VSTD::prev_permutation(__first, __last,
+ __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PREV_PERMUTATION_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_PUSH_HEAP_H
+#define _LIBCPP___ALGORITHM_PUSH_HEAP_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 void
+__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ typename iterator_traits<_RandomAccessIterator>::difference_type __len)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ if (__len > 1)
+ {
+ __len = (__len - 2) / 2;
+ _RandomAccessIterator __ptr = __first + __len;
+ if (__comp(*__ptr, *--__last))
+ {
+ value_type __t(_VSTD::move(*__last));
+ do
+ {
+ *__last = _VSTD::move(*__ptr);
+ __last = __ptr;
+ if (__len == 0)
+ break;
+ __len = (__len - 1) / 2;
+ __ptr = __first + __len;
+ } while (__comp(*__ptr, __t));
+ *__last = _VSTD::move(__t);
+ }
+ }
+}
+
+template <class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ _VSTD::__sift_up<_Comp_ref>(__first, __last, __comp, __last - __first);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ _VSTD::push_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_PUSH_HEAP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REMOVE_H
+#define _LIBCPP___ALGORITHM_REMOVE_H
+
+#include <__config>
+#include <__algorithm/find.h>
+#include <__algorithm/find_if.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Tp>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
+{
+ __first = _VSTD::find(__first, __last, __value_);
+ if (__first != __last)
+ {
+ _ForwardIterator __i = __first;
+ while (++__i != __last)
+ {
+ if (!(*__i == __value_))
+ {
+ *__first = _VSTD::move(*__i);
+ ++__first;
+ }
+ }
+ }
+ return __first;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REMOVE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REMOVE_COPY_H
+#define _LIBCPP___ALGORITHM_REMOVE_COPY_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _OutputIterator, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_)
+{
+ for (; __first != __last; ++__first)
+ {
+ if (!(*__first == __value_))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ }
+ return __result;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REMOVE_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H
+#define _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _OutputIterator, class _Predicate>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred)
+{
+ for (; __first != __last; ++__first)
+ {
+ if (!__pred(*__first))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ }
+ return __result;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REMOVE_IF_H
+#define _LIBCPP___ALGORITHM_REMOVE_IF_H
+
+#include <__config>
+#include <__algorithm/find_if.h>
+#include <utility>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Predicate>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
+{
+ __first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type>
+ (__first, __last, __pred);
+ if (__first != __last)
+ {
+ _ForwardIterator __i = __first;
+ while (++__i != __last)
+ {
+ if (!__pred(*__i))
+ {
+ *__first = _VSTD::move(*__i);
+ ++__first;
+ }
+ }
+ }
+ return __first;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REMOVE_IF_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REPLACE_H
+#define _LIBCPP___ALGORITHM_REPLACE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value)
+{
+ for (; __first != __last; ++__first)
+ if (*__first == __old_value)
+ *__first = __new_value;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REPLACE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REPLACE_COPY_H
+#define _LIBCPP___ALGORITHM_REPLACE_COPY_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _OutputIterator, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
+ const _Tp& __old_value, const _Tp& __new_value)
+{
+ for (; __first != __last; ++__first, (void) ++__result)
+ if (*__first == __old_value)
+ *__result = __new_value;
+ else
+ *__result = *__first;
+ return __result;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REPLACE_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H
+#define _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
+ _Predicate __pred, const _Tp& __new_value)
+{
+ for (; __first != __last; ++__first, (void) ++__result)
+ if (__pred(*__first))
+ *__result = __new_value;
+ else
+ *__result = *__first;
+ return __result;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REPLACE_IF_H
+#define _LIBCPP___ALGORITHM_REPLACE_IF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _Predicate, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value)
+{
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ *__first = __new_value;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REPLACE_IF_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REVERSE_H
+#define _LIBCPP___ALGORITHM_REVERSE_H
+
+#include <__config>
+#include <__algorithm/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _BidirectionalIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)
+{
+ while (__first != __last)
+ {
+ if (__first == --__last)
+ break;
+ _VSTD::iter_swap(__first, __last);
+ ++__first;
+ }
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)
+{
+ if (__first != __last)
+ for (; __first < --__last; ++__first)
+ _VSTD::iter_swap(__first, __last);
+}
+
+template <class _BidirectionalIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
+{
+ _VSTD::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_category());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REVERSE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_REVERSE_COPY_H
+#define _LIBCPP___ALGORITHM_REVERSE_COPY_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _BidirectionalIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
+{
+ for (; __first != __last; ++__result)
+ *__result = *--__last;
+ return __result;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_REVERSE_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_ROTATE_H
+#define _LIBCPP___ALGORITHM_ROTATE_H
+
+#include <__algorithm/move.h>
+#include <__algorithm/move_backward.h>
+#include <__algorithm/swap_ranges.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__iterator/prev.h>
+#include <__utility/swap.h>
+#include <iterator>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+__rotate_left(_ForwardIterator __first, _ForwardIterator __last)
+{
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+ value_type __tmp = _VSTD::move(*__first);
+ _ForwardIterator __lm1 = _VSTD::move(_VSTD::next(__first), __last, __first);
+ *__lm1 = _VSTD::move(__tmp);
+ return __lm1;
+}
+
+template <class _BidirectionalIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
+__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
+{
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ _BidirectionalIterator __lm1 = _VSTD::prev(__last);
+ value_type __tmp = _VSTD::move(*__lm1);
+ _BidirectionalIterator __fp1 = _VSTD::move_backward(__first, __lm1, __last);
+ *__first = _VSTD::move(__tmp);
+ return __fp1;
+}
+
+template <class _ForwardIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX14 _ForwardIterator
+__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
+{
+ _ForwardIterator __i = __middle;
+ while (true)
+ {
+ swap(*__first, *__i);
+ ++__first;
+ if (++__i == __last)
+ break;
+ if (__first == __middle)
+ __middle = __i;
+ }
+ _ForwardIterator __r = __first;
+ if (__first != __middle)
+ {
+ __i = __middle;
+ while (true)
+ {
+ swap(*__first, *__i);
+ ++__first;
+ if (++__i == __last)
+ {
+ if (__first == __middle)
+ break;
+ __i = __middle;
+ }
+ else if (__first == __middle)
+ __middle = __i;
+ }
+ }
+ return __r;
+}
+
+template<typename _Integral>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR_AFTER_CXX14 _Integral
+__algo_gcd(_Integral __x, _Integral __y)
+{
+ do
+ {
+ _Integral __t = __x % __y;
+ __x = __y;
+ __y = __t;
+ } while (__y);
+ return __x;
+}
+
+template<typename _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator
+__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+
+ const difference_type __m1 = __middle - __first;
+ const difference_type __m2 = __last - __middle;
+ if (__m1 == __m2)
+ {
+ _VSTD::swap_ranges(__first, __middle, __middle);
+ return __middle;
+ }
+ const difference_type __g = _VSTD::__algo_gcd(__m1, __m2);
+ for (_RandomAccessIterator __p = __first + __g; __p != __first;)
+ {
+ value_type __t(_VSTD::move(*--__p));
+ _RandomAccessIterator __p1 = __p;
+ _RandomAccessIterator __p2 = __p1 + __m1;
+ do
+ {
+ *__p1 = _VSTD::move(*__p2);
+ __p1 = __p2;
+ const difference_type __d = __last - __p2;
+ if (__m1 < __d)
+ __p2 += __m1;
+ else
+ __p2 = __first + (__m1 - __d);
+ } while (__p2 != __p);
+ *__p1 = _VSTD::move(__t);
+ }
+ return __first + __m2;
+}
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
+ _VSTD::forward_iterator_tag)
+{
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+ if (is_trivially_move_assignable<value_type>::value)
+ {
+ if (_VSTD::next(__first) == __middle)
+ return _VSTD::__rotate_left(__first, __last);
+ }
+ return _VSTD::__rotate_forward(__first, __middle, __last);
+}
+
+template <class _BidirectionalIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
+__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
+ bidirectional_iterator_tag)
+{
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ if (is_trivially_move_assignable<value_type>::value)
+ {
+ if (_VSTD::next(__first) == __middle)
+ return _VSTD::__rotate_left(__first, __last);
+ if (_VSTD::next(__middle) == __last)
+ return _VSTD::__rotate_right(__first, __last);
+ }
+ return _VSTD::__rotate_forward(__first, __middle, __last);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator
+__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
+ random_access_iterator_tag)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ if (is_trivially_move_assignable<value_type>::value)
+ {
+ if (_VSTD::next(__first) == __middle)
+ return _VSTD::__rotate_left(__first, __last);
+ if (_VSTD::next(__middle) == __last)
+ return _VSTD::__rotate_right(__first, __last);
+ return _VSTD::__rotate_gcd(__first, __middle, __last);
+ }
+ return _VSTD::__rotate_forward(__first, __middle, __last);
+}
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
+{
+ if (__first == __middle)
+ return __last;
+ if (__middle == __last)
+ return __first;
+ return _VSTD::__rotate(__first, __middle, __last,
+ typename iterator_traits<_ForwardIterator>::iterator_category());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_ROTATE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_ROTATE_COPY_H
+#define _LIBCPP___ALGORITHM_ROTATE_COPY_H
+
+#include <__config>
+#include <__algorithm/copy.h>
+#include <iterator>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)
+{
+ return _VSTD::copy(__first, __middle, _VSTD::copy(__middle, __last, __result));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_ROTATE_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SAMPLE_H
+#define _LIBCPP___ALGORITHM_SAMPLE_H
+
+#include <__config>
+#include <__algorithm/min.h>
+#include <__random/uniform_int_distribution.h>
+#include <iterator>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __output_iter,
+ _Distance __n,
+ _UniformRandomNumberGenerator & __g,
+ input_iterator_tag) {
+
+ _Distance __k = 0;
+ for (; __first != __last && __k < __n; ++__first, (void) ++__k)
+ __output_iter[__k] = *__first;
+ _Distance __sz = __k;
+ for (; __first != __last; ++__first, (void) ++__k) {
+ _Distance __r = uniform_int_distribution<_Distance>(0, __k)(__g);
+ if (__r < __sz)
+ __output_iter[__r] = *__first;
+ }
+ return __output_iter + _VSTD::min(__n, __k);
+}
+
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __output_iter,
+ _Distance __n,
+ _UniformRandomNumberGenerator& __g,
+ forward_iterator_tag) {
+ _Distance __unsampled_sz = _VSTD::distance(__first, __last);
+ for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {
+ _Distance __r = uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);
+ if (__r < __n) {
+ *__output_iter++ = *__first;
+ --__n;
+ }
+ }
+ return __output_iter;
+}
+
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __output_iter,
+ _Distance __n, _UniformRandomNumberGenerator& __g) {
+ typedef typename iterator_traits<_PopulationIterator>::iterator_category
+ _PopCategory;
+ typedef typename iterator_traits<_PopulationIterator>::difference_type
+ _Difference;
+ static_assert(__is_cpp17_forward_iterator<_PopulationIterator>::value ||
+ __is_cpp17_random_access_iterator<_SampleIterator>::value,
+ "SampleIterator must meet the requirements of RandomAccessIterator");
+ typedef typename common_type<_Distance, _Difference>::type _CommonType;
+ _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
+ return _VSTD::__sample(
+ __first, __last, __output_iter, _CommonType(__n),
+ __g, _PopCategory());
+}
+
+#if _LIBCPP_STD_VER > 14
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+inline _LIBCPP_INLINE_VISIBILITY
+_SampleIterator sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __output_iter,
+ _Distance __n, _UniformRandomNumberGenerator&& __g) {
+ return _VSTD::__sample(__first, __last, __output_iter, __n, __g);
+}
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SAMPLE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SEARCH_H
+#define _LIBCPP___ALGORITHM_SEARCH_H
+
+#include <__algorithm/comp.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
+pair<_ForwardIterator1, _ForwardIterator1>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag) {
+ if (__first2 == __last2)
+ return _VSTD::make_pair(__first1, __first1); // Everything matches an empty sequence
+ while (true) {
+ // Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks
+ while (true) {
+ if (__first1 == __last1) // return __last1 if no element matches *__first2
+ return _VSTD::make_pair(__last1, __last1);
+ if (__pred(*__first1, *__first2))
+ break;
+ ++__first1;
+ }
+ // *__first1 matches *__first2, now match elements after here
+ _ForwardIterator1 __m1 = __first1;
+ _ForwardIterator2 __m2 = __first2;
+ while (true) {
+ if (++__m2 == __last2) // If pattern exhausted, __first1 is the answer (works for 1 element pattern)
+ return _VSTD::make_pair(__first1, __m1);
+ if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found
+ return _VSTD::make_pair(__last1, __last1);
+ if (!__pred(*__m1, *__m2)) // if there is a mismatch, restart with a new __first1
+ {
+ ++__first1;
+ break;
+ } // else there is a match, check next elements
+ }
+ }
+}
+
+template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 pair<_RandomAccessIterator1, _RandomAccessIterator1>
+__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
+ _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag,
+ random_access_iterator_tag) {
+ typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1;
+ typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2;
+ // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern
+ const _D2 __len2 = __last2 - __first2;
+ if (__len2 == 0)
+ return _VSTD::make_pair(__first1, __first1);
+ const _D1 __len1 = __last1 - __first1;
+ if (__len1 < __len2)
+ return _VSTD::make_pair(__last1, __last1);
+ const _RandomAccessIterator1 __s = __last1 - (__len2 - 1); // Start of pattern match can't go beyond here
+
+ while (true) {
+ while (true) {
+ if (__first1 == __s)
+ return _VSTD::make_pair(__last1, __last1);
+ if (__pred(*__first1, *__first2))
+ break;
+ ++__first1;
+ }
+
+ _RandomAccessIterator1 __m1 = __first1;
+ _RandomAccessIterator2 __m2 = __first2;
+ while (true) {
+ if (++__m2 == __last2)
+ return _VSTD::make_pair(__first1, __first1 + __len2);
+ ++__m1; // no need to check range on __m1 because __s guarantees we have enough source
+ if (!__pred(*__m1, *__m2)) {
+ ++__first1;
+ break;
+ }
+ }
+ }
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
+search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __pred) {
+ return _VSTD::__search<typename add_lvalue_reference<_BinaryPredicate>::type>(
+ __first1, __last1, __first2, __last2, __pred,
+ typename iterator_traits<_ForwardIterator1>::iterator_category(),
+ typename iterator_traits<_ForwardIterator2>::iterator_category()).first;
+}
+
+template <class _ForwardIterator1, class _ForwardIterator2>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
+search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
+ return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+}
+
+#if _LIBCPP_STD_VER > 14
+template <class _ForwardIterator, class _Searcher>
+_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher& __s) {
+ return __s(__f, __l).first;
+}
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SEARCH_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SEARCH_N_H
+#define _LIBCPP___ALGORITHM_SEARCH_N_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator __search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Size __count, const _Tp& __value_, _BinaryPredicate __pred,
+ forward_iterator_tag) {
+ if (__count <= 0)
+ return __first;
+ while (true) {
+ // Find first element in sequence that matchs __value_, with a mininum of loop checks
+ while (true) {
+ if (__first == __last) // return __last if no element matches __value_
+ return __last;
+ if (__pred(*__first, __value_))
+ break;
+ ++__first;
+ }
+ // *__first matches __value_, now match elements after here
+ _ForwardIterator __m = __first;
+ _Size __c(0);
+ while (true) {
+ if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)
+ return __first;
+ if (++__m == __last) // Otherwise if source exhaused, pattern not found
+ return __last;
+ if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first
+ {
+ __first = __m;
+ ++__first;
+ break;
+ } // else there is a match, check next elements
+ }
+ }
+}
+
+template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator __search_n(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Size __count,
+ const _Tp& __value_, _BinaryPredicate __pred,
+ random_access_iterator_tag) {
+ if (__count <= 0)
+ return __first;
+ _Size __len = static_cast<_Size>(__last - __first);
+ if (__len < __count)
+ return __last;
+ const _RandomAccessIterator __s = __last - (__count - 1); // Start of pattern match can't go beyond here
+ while (true) {
+ // Find first element in sequence that matchs __value_, with a mininum of loop checks
+ while (true) {
+ if (__first >= __s) // return __last if no element matches __value_
+ return __last;
+ if (__pred(*__first, __value_))
+ break;
+ ++__first;
+ }
+ // *__first matches __value_, now match elements after here
+ _RandomAccessIterator __m = __first;
+ _Size __c(0);
+ while (true) {
+ if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)
+ return __first;
+ ++__m; // no need to check range on __m because __s guarantees we have enough source
+ if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first
+ {
+ __first = __m;
+ ++__first;
+ break;
+ } // else there is a match, check next elements
+ }
+ }
+}
+
+template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator search_n(
+ _ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_, _BinaryPredicate __pred) {
+ return _VSTD::__search_n<typename add_lvalue_reference<_BinaryPredicate>::type>(
+ __first, __last, _VSTD::__convert_to_integral(__count), __value_, __pred,
+ typename iterator_traits<_ForwardIterator>::iterator_category());
+}
+
+template <class _ForwardIterator, class _Size, class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_) {
+ typedef typename iterator_traits<_ForwardIterator>::value_type __v;
+ return _VSTD::search_n(__first, __last, _VSTD::__convert_to_integral(__count), __value_, __equal_to<__v, _Tp>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SEARCH_N_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SET_DIFFERENCE_H
+#define _LIBCPP___ALGORITHM_SET_DIFFERENCE_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/copy.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+__set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ while (__first1 != __last1)
+ {
+ if (__first2 == __last2)
+ return _VSTD::copy(__first1, __last1, __result);
+ if (__comp(*__first1, *__first2))
+ {
+ *__result = *__first1;
+ ++__result;
+ ++__first1;
+ }
+ else
+ {
+ if (!__comp(*__first2, *__first1))
+ ++__first1;
+ ++__first2;
+ }
+ }
+ return __result;
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
+{
+ return _VSTD::set_difference(__first1, __last1, __first2, __last2, __result,
+ __less<typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SET_DIFFERENCE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SET_INTERSECTION_H
+#define _LIBCPP___ALGORITHM_SET_INTERSECTION_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+__set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (__comp(*__first1, *__first2))
+ ++__first1;
+ else
+ {
+ if (!__comp(*__first2, *__first1))
+ {
+ *__result = *__first1;
+ ++__result;
+ ++__first1;
+ }
+ ++__first2;
+ }
+ }
+ return __result;
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
+{
+ return _VSTD::set_intersection(__first1, __last1, __first2, __last2, __result,
+ __less<typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SET_INTERSECTION_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
+#define _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/copy.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ while (__first1 != __last1)
+ {
+ if (__first2 == __last2)
+ return _VSTD::copy(__first1, __last1, __result);
+ if (__comp(*__first1, *__first2))
+ {
+ *__result = *__first1;
+ ++__result;
+ ++__first1;
+ }
+ else
+ {
+ if (__comp(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__result;
+ }
+ else
+ ++__first1;
+ ++__first2;
+ }
+ }
+ return _VSTD::copy(__first2, __last2, __result);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
+{
+ return _VSTD::set_symmetric_difference(__first1, __last1, __first2, __last2, __result,
+ __less<typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SET_UNION_H
+#define _LIBCPP___ALGORITHM_SET_UNION_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/copy.h>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+__set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ for (; __first1 != __last1; ++__result)
+ {
+ if (__first2 == __last2)
+ return _VSTD::copy(__first1, __last1, __result);
+ if (__comp(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ if (!__comp(*__first1, *__first2))
+ ++__first2;
+ *__result = *__first1;
+ ++__first1;
+ }
+ }
+ return _VSTD::copy(__first2, __last2, __result);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
+{
+ return _VSTD::set_union(__first1, __last1, __first2, __last2, __result,
+ __less<typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SET_UNION_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SHIFT_LEFT_H
+#define _LIBCPP___ALGORITHM_SHIFT_LEFT_H
+
+#include <__config>
+#include <__algorithm/move.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits> // swap
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY constexpr
+_ForwardIterator
+shift_left(_ForwardIterator __first, _ForwardIterator __last,
+ typename iterator_traits<_ForwardIterator>::difference_type __n)
+{
+ if (__n == 0) {
+ return __last;
+ }
+
+ _ForwardIterator __m = __first;
+ if constexpr (__is_cpp17_random_access_iterator<_ForwardIterator>::value) {
+ if (__n >= __last - __first) {
+ return __first;
+ }
+ __m += __n;
+ } else {
+ for (; __n > 0; --__n) {
+ if (__m == __last) {
+ return __first;
+ }
+ ++__m;
+ }
+ }
+ return _VSTD::move(__m, __last, __first);
+}
+
+#endif // _LIBCPP_STD_VER > 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SHIFT_LEFT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
+#define _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
+
+#include <__config>
+#include <__algorithm/move.h>
+#include <__algorithm/move_backward.h>
+#include <__algorithm/swap_ranges.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits> // swap
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY constexpr
+_ForwardIterator
+shift_right(_ForwardIterator __first, _ForwardIterator __last,
+ typename iterator_traits<_ForwardIterator>::difference_type __n)
+{
+ if (__n == 0) {
+ return __first;
+ }
+
+ if constexpr (__is_cpp17_random_access_iterator<_ForwardIterator>::value) {
+ decltype(__n) __d = __last - __first;
+ if (__n >= __d) {
+ return __last;
+ }
+ _ForwardIterator __m = __first + (__d - __n);
+ return _VSTD::move_backward(__first, __m, __last);
+ } else if constexpr (__is_cpp17_bidirectional_iterator<_ForwardIterator>::value) {
+ _ForwardIterator __m = __last;
+ for (; __n > 0; --__n) {
+ if (__m == __first) {
+ return __last;
+ }
+ --__m;
+ }
+ return _VSTD::move_backward(__first, __m, __last);
+ } else {
+ _ForwardIterator __ret = __first;
+ for (; __n > 0; --__n) {
+ if (__ret == __last) {
+ return __last;
+ }
+ ++__ret;
+ }
+
+ // We have an __n-element scratch space from __first to __ret.
+ // Slide an __n-element window [__trail, __lead) from left to right.
+ // We're essentially doing swap_ranges(__first, __ret, __trail, __lead)
+ // over and over; but once __lead reaches __last we needn't bother
+ // to save the values of elements [__trail, __last).
+
+ auto __trail = __first;
+ auto __lead = __ret;
+ while (__trail != __ret) {
+ if (__lead == __last) {
+ _VSTD::move(__first, __trail, __ret);
+ return __ret;
+ }
+ ++__trail;
+ ++__lead;
+ }
+
+ _ForwardIterator __mid = __first;
+ while (true) {
+ if (__lead == __last) {
+ __trail = _VSTD::move(__mid, __ret, __trail);
+ _VSTD::move(__first, __mid, __trail);
+ return __ret;
+ }
+ swap(*__mid, *__trail);
+ ++__mid;
+ ++__trail;
+ ++__lead;
+ if (__mid == __ret) {
+ __mid = __first;
+ }
+ }
+ }
+}
+
+#endif // _LIBCPP_STD_VER > 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SHUFFLE_H
+#define _LIBCPP___ALGORITHM_SHUFFLE_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__random/uniform_int_distribution.h>
+#include <__utility/swap.h>
+#include <cstddef>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
+ || defined(_LIBCPP_BUILDING_LIBRARY)
+class _LIBCPP_TYPE_VIS __rs_default;
+
+_LIBCPP_FUNC_VIS __rs_default __rs_get();
+
+class _LIBCPP_TYPE_VIS __rs_default
+{
+ static unsigned __c_;
+
+ __rs_default();
+public:
+ typedef uint_fast32_t result_type;
+
+ static const result_type _Min = 0;
+ static const result_type _Max = 0xFFFFFFFF;
+
+ __rs_default(const __rs_default&);
+ ~__rs_default();
+
+ result_type operator()();
+
+ static _LIBCPP_CONSTEXPR result_type min() {return _Min;}
+ static _LIBCPP_CONSTEXPR result_type max() {return _Max;}
+
+ friend _LIBCPP_FUNC_VIS __rs_default __rs_get();
+};
+
+_LIBCPP_FUNC_VIS __rs_default __rs_get();
+
+template <class _RandomAccessIterator>
+_LIBCPP_DEPRECATED_IN_CXX14 void
+random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef uniform_int_distribution<ptrdiff_t> _Dp;
+ typedef typename _Dp::param_type _Pp;
+ difference_type __d = __last - __first;
+ if (__d > 1)
+ {
+ _Dp __uid;
+ __rs_default __g = __rs_get();
+ for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d)
+ {
+ difference_type __i = __uid(__g, _Pp(0, __d));
+ if (__i != difference_type(0))
+ swap(*__first, *(__first + __i));
+ }
+ }
+}
+
+template <class _RandomAccessIterator, class _RandomNumberGenerator>
+_LIBCPP_DEPRECATED_IN_CXX14 void
+random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
+#ifndef _LIBCPP_CXX03_LANG
+ _RandomNumberGenerator&& __rand)
+#else
+ _RandomNumberGenerator& __rand)
+#endif
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ difference_type __d = __last - __first;
+ if (__d > 1)
+ {
+ for (--__last; __first < __last; ++__first, (void) --__d)
+ {
+ difference_type __i = __rand(__d);
+ if (__i != difference_type(0))
+ swap(*__first, *(__first + __i));
+ }
+ }
+}
+#endif
+
+template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
+ void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _UniformRandomNumberGenerator&& __g)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef uniform_int_distribution<ptrdiff_t> _Dp;
+ typedef typename _Dp::param_type _Pp;
+ difference_type __d = __last - __first;
+ if (__d > 1)
+ {
+ _Dp __uid;
+ for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d)
+ {
+ difference_type __i = __uid(__g, _Pp(0, __d));
+ if (__i != difference_type(0))
+ swap(*__first, *(__first + __i));
+ }
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SHUFFLE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SIFT_DOWN_H
+#define _LIBCPP___ALGORITHM_SIFT_DOWN_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 void
+__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
+ _Compare __comp,
+ typename iterator_traits<_RandomAccessIterator>::difference_type __len,
+ _RandomAccessIterator __start)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ // left-child of __start is at 2 * __start + 1
+ // right-child of __start is at 2 * __start + 2
+ difference_type __child = __start - __first;
+
+ if (__len < 2 || (__len - 2) / 2 < __child)
+ return;
+
+ __child = 2 * __child + 1;
+ _RandomAccessIterator __child_i = __first + __child;
+
+ if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) {
+ // right-child exists and is greater than left-child
+ ++__child_i;
+ ++__child;
+ }
+
+ // check if we are in heap-order
+ if (__comp(*__child_i, *__start))
+ // we are, __start is larger than it's largest child
+ return;
+
+ value_type __top(_VSTD::move(*__start));
+ do
+ {
+ // we are not in heap-order, swap the parent with its largest child
+ *__start = _VSTD::move(*__child_i);
+ __start = __child_i;
+
+ if ((__len - 2) / 2 < __child)
+ break;
+
+ // recompute the child based off of the updated parent
+ __child = 2 * __child + 1;
+ __child_i = __first + __child;
+
+ if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) {
+ // right-child exists and is greater than left-child
+ ++__child_i;
+ ++__child;
+ }
+
+ // check if we are in heap-order
+ } while (!__comp(*__child_i, __top));
+ *__start = _VSTD::move(__top);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SIFT_DOWN_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SORT_H
+#define _LIBCPP___ALGORITHM_SORT_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/min_element.h>
+#include <__algorithm/partial_sort.h>
+#include <__algorithm/unwrap_iter.h>
+#include <__utility/swap.h>
+#include <memory>
+#include <type_traits> // swap
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// stable, 2-3 compares, 0-2 swaps
+
+template <class _Compare, class _ForwardIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 unsigned
+__sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z, _Compare __c)
+{
+ unsigned __r = 0;
+ if (!__c(*__y, *__x)) // if x <= y
+ {
+ if (!__c(*__z, *__y)) // if y <= z
+ return __r; // x <= y && y <= z
+ // x <= y && y > z
+ swap(*__y, *__z); // x <= z && y < z
+ __r = 1;
+ if (__c(*__y, *__x)) // if x > y
+ {
+ swap(*__x, *__y); // x < y && y <= z
+ __r = 2;
+ }
+ return __r; // x <= y && y < z
+ }
+ if (__c(*__z, *__y)) // x > y, if y > z
+ {
+ swap(*__x, *__z); // x < y && y < z
+ __r = 1;
+ return __r;
+ }
+ swap(*__x, *__y); // x > y && y <= z
+ __r = 1; // x < y && x <= z
+ if (__c(*__z, *__y)) // if y > z
+ {
+ swap(*__y, *__z); // x <= y && y < z
+ __r = 2;
+ }
+ return __r;
+} // x <= y && y <= z
+
+// stable, 3-6 compares, 0-5 swaps
+
+template <class _Compare, class _ForwardIterator>
+unsigned
+__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
+ _ForwardIterator __x4, _Compare __c)
+{
+ unsigned __r = _VSTD::__sort3<_Compare>(__x1, __x2, __x3, __c);
+ if (__c(*__x4, *__x3))
+ {
+ swap(*__x3, *__x4);
+ ++__r;
+ if (__c(*__x3, *__x2))
+ {
+ swap(*__x2, *__x3);
+ ++__r;
+ if (__c(*__x2, *__x1))
+ {
+ swap(*__x1, *__x2);
+ ++__r;
+ }
+ }
+ }
+ return __r;
+}
+
+// stable, 4-10 compares, 0-9 swaps
+
+template <class _Compare, class _ForwardIterator>
+_LIBCPP_HIDDEN
+unsigned
+__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
+ _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c)
+{
+ unsigned __r = _VSTD::__sort4<_Compare>(__x1, __x2, __x3, __x4, __c);
+ if (__c(*__x5, *__x4))
+ {
+ swap(*__x4, *__x5);
+ ++__r;
+ if (__c(*__x4, *__x3))
+ {
+ swap(*__x3, *__x4);
+ ++__r;
+ if (__c(*__x3, *__x2))
+ {
+ swap(*__x2, *__x3);
+ ++__r;
+ if (__c(*__x2, *__x1))
+ {
+ swap(*__x1, *__x2);
+ ++__r;
+ }
+ }
+ }
+ }
+ return __r;
+}
+
+// Assumes size > 0
+template <class _Compare, class _BidirectionalIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 void
+__selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
+{
+ _BidirectionalIterator __lm1 = __last;
+ for (--__lm1; __first != __lm1; ++__first)
+ {
+ _BidirectionalIterator __i = _VSTD::min_element<_BidirectionalIterator,
+ typename add_lvalue_reference<_Compare>::type>
+ (__first, __last, __comp);
+ if (__i != __first)
+ swap(*__first, *__i);
+ }
+}
+
+template <class _Compare, class _BidirectionalIterator>
+void
+__insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
+{
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ if (__first != __last)
+ {
+ _BidirectionalIterator __i = __first;
+ for (++__i; __i != __last; ++__i)
+ {
+ _BidirectionalIterator __j = __i;
+ value_type __t(_VSTD::move(*__j));
+ for (_BidirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j)
+ *__j = _VSTD::move(*__k);
+ *__j = _VSTD::move(__t);
+ }
+ }
+}
+
+template <class _Compare, class _RandomAccessIterator>
+void
+__insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ _RandomAccessIterator __j = __first+2;
+ _VSTD::__sort3<_Compare>(__first, __first+1, __j, __comp);
+ for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
+ {
+ if (__comp(*__i, *__j))
+ {
+ value_type __t(_VSTD::move(*__i));
+ _RandomAccessIterator __k = __j;
+ __j = __i;
+ do
+ {
+ *__j = _VSTD::move(*__k);
+ __j = __k;
+ } while (__j != __first && __comp(__t, *--__k));
+ *__j = _VSTD::move(__t);
+ }
+ __j = __i;
+ }
+}
+
+template <class _Compare, class _RandomAccessIterator>
+bool
+__insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ switch (__last - __first)
+ {
+ case 0:
+ case 1:
+ return true;
+ case 2:
+ if (__comp(*--__last, *__first))
+ swap(*__first, *__last);
+ return true;
+ case 3:
+ _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
+ return true;
+ case 4:
+ _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
+ return true;
+ case 5:
+ _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
+ return true;
+ }
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ _RandomAccessIterator __j = __first+2;
+ _VSTD::__sort3<_Compare>(__first, __first+1, __j, __comp);
+ const unsigned __limit = 8;
+ unsigned __count = 0;
+ for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
+ {
+ if (__comp(*__i, *__j))
+ {
+ value_type __t(_VSTD::move(*__i));
+ _RandomAccessIterator __k = __j;
+ __j = __i;
+ do
+ {
+ *__j = _VSTD::move(*__k);
+ __j = __k;
+ } while (__j != __first && __comp(__t, *--__k));
+ *__j = _VSTD::move(__t);
+ if (++__count == __limit)
+ return ++__i == __last;
+ }
+ __j = __i;
+ }
+ return true;
+}
+
+template <class _Compare, class _BidirectionalIterator>
+void
+__insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1,
+ typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp)
+{
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ if (__first1 != __last1)
+ {
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
+ value_type* __last2 = __first2;
+ ::new ((void*)__last2) value_type(_VSTD::move(*__first1));
+ __d.template __incr<value_type>();
+ for (++__last2; ++__first1 != __last1; ++__last2)
+ {
+ value_type* __j2 = __last2;
+ value_type* __i2 = __j2;
+ if (__comp(*__first1, *--__i2))
+ {
+ ::new ((void*)__j2) value_type(_VSTD::move(*__i2));
+ __d.template __incr<value_type>();
+ for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
+ *__j2 = _VSTD::move(*__i2);
+ *__j2 = _VSTD::move(*__first1);
+ }
+ else
+ {
+ ::new ((void*)__j2) value_type(_VSTD::move(*__first1));
+ __d.template __incr<value_type>();
+ }
+ }
+ __h.release();
+ }
+}
+
+template <class _Compare, class _RandomAccessIterator>
+void
+__sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ const difference_type __limit = is_trivially_copy_constructible<value_type>::value &&
+ is_trivially_copy_assignable<value_type>::value ? 30 : 6;
+ while (true)
+ {
+ __restart:
+ difference_type __len = __last - __first;
+ switch (__len)
+ {
+ case 0:
+ case 1:
+ return;
+ case 2:
+ if (__comp(*--__last, *__first))
+ swap(*__first, *__last);
+ return;
+ case 3:
+ _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
+ return;
+ case 4:
+ _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
+ return;
+ case 5:
+ _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
+ return;
+ }
+ if (__len <= __limit)
+ {
+ _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
+ return;
+ }
+ // __len > 5
+ _RandomAccessIterator __m = __first;
+ _RandomAccessIterator __lm1 = __last;
+ --__lm1;
+ unsigned __n_swaps;
+ {
+ difference_type __delta;
+ if (__len >= 1000)
+ {
+ __delta = __len/2;
+ __m += __delta;
+ __delta /= 2;
+ __n_swaps = _VSTD::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp);
+ }
+ else
+ {
+ __delta = __len/2;
+ __m += __delta;
+ __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, __lm1, __comp);
+ }
+ }
+ // *__m is median
+ // partition [__first, __m) < *__m and *__m <= [__m, __last)
+ // (this inhibits tossing elements equivalent to __m around unnecessarily)
+ _RandomAccessIterator __i = __first;
+ _RandomAccessIterator __j = __lm1;
+ // j points beyond range to be tested, *__m is known to be <= *__lm1
+ // The search going up is known to be guarded but the search coming down isn't.
+ // Prime the downward search with a guard.
+ if (!__comp(*__i, *__m)) // if *__first == *__m
+ {
+ // *__first == *__m, *__first doesn't go in first part
+ // manually guard downward moving __j against __i
+ while (true)
+ {
+ if (__i == --__j)
+ {
+ // *__first == *__m, *__m <= all other elements
+ // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)
+ ++__i; // __first + 1
+ __j = __last;
+ if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
+ {
+ while (true)
+ {
+ if (__i == __j)
+ return; // [__first, __last) all equivalent elements
+ if (__comp(*__first, *__i))
+ {
+ swap(*__i, *__j);
+ ++__n_swaps;
+ ++__i;
+ break;
+ }
+ ++__i;
+ }
+ }
+ // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
+ if (__i == __j)
+ return;
+ while (true)
+ {
+ while (!__comp(*__first, *__i))
+ ++__i;
+ while (__comp(*__first, *--__j))
+ ;
+ if (__i >= __j)
+ break;
+ swap(*__i, *__j);
+ ++__n_swaps;
+ ++__i;
+ }
+ // [__first, __i) == *__first and *__first < [__i, __last)
+ // The first part is sorted, sort the second part
+ // _VSTD::__sort<_Compare>(__i, __last, __comp);
+ __first = __i;
+ goto __restart;
+ }
+ if (__comp(*__j, *__m))
+ {
+ swap(*__i, *__j);
+ ++__n_swaps;
+ break; // found guard for downward moving __j, now use unguarded partition
+ }
+ }
+ }
+ // It is known that *__i < *__m
+ ++__i;
+ // j points beyond range to be tested, *__m is known to be <= *__lm1
+ // if not yet partitioned...
+ if (__i < __j)
+ {
+ // known that *(__i - 1) < *__m
+ // known that __i <= __m
+ while (true)
+ {
+ // __m still guards upward moving __i
+ while (__comp(*__i, *__m))
+ ++__i;
+ // It is now known that a guard exists for downward moving __j
+ while (!__comp(*--__j, *__m))
+ ;
+ if (__i > __j)
+ break;
+ swap(*__i, *__j);
+ ++__n_swaps;
+ // It is known that __m != __j
+ // If __m just moved, follow it
+ if (__m == __i)
+ __m = __j;
+ ++__i;
+ }
+ }
+ // [__first, __i) < *__m and *__m <= [__i, __last)
+ if (__i != __m && __comp(*__m, *__i))
+ {
+ swap(*__i, *__m);
+ ++__n_swaps;
+ }
+ // [__first, __i) < *__i and *__i <= [__i+1, __last)
+ // If we were given a perfect partition, see if insertion sort is quick...
+ if (__n_swaps == 0)
+ {
+ bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
+ if (_VSTD::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp))
+ {
+ if (__fs)
+ return;
+ __last = __i;
+ continue;
+ }
+ else
+ {
+ if (__fs)
+ {
+ __first = ++__i;
+ continue;
+ }
+ }
+ }
+ // sort smaller range with recursive call and larger with tail recursion elimination
+ if (__i - __first < __last - __i)
+ {
+ _VSTD::__sort<_Compare>(__first, __i, __comp);
+ // _VSTD::__sort<_Compare>(__i+1, __last, __comp);
+ __first = ++__i;
+ }
+ else
+ {
+ _VSTD::__sort<_Compare>(__i+1, __last, __comp);
+ // _VSTD::__sort<_Compare>(__first, __i, __comp);
+ __last = __i;
+ }
+ }
+}
+
+template <class _Compare, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+__sort(_Tp** __first, _Tp** __last, __less<_Tp*>&)
+{
+ __less<uintptr_t> __comp;
+ _VSTD::__sort<__less<uintptr_t>&, uintptr_t*>((uintptr_t*)__first, (uintptr_t*)__last, __comp);
+}
+
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<short>&, short*>(short*, short*, __less<short>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<int>&, int*>(int*, int*, __less<int>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long>&, long*>(long*, long*, __less<long>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<float>&, float*>(float*, float*, __less<float>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<double>&, double*>(double*, double*, __less<double>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&))
+
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&))
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&))
+
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&))
+
+template <class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ if (__libcpp_is_constant_evaluated()) {
+ _VSTD::__partial_sort<_Comp_ref>(__first, __last, __last, _Comp_ref(__comp));
+ } else {
+ _VSTD::__sort<_Comp_ref>(_VSTD::__unwrap_iter(__first), _VSTD::__unwrap_iter(__last), _Comp_ref(__comp));
+ }
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ _VSTD::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SORT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SORT_HEAP_H
+#define _LIBCPP___ALGORITHM_SORT_HEAP_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/pop_heap.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits> // swap
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _RandomAccessIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 void
+__sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ for (difference_type __n = __last - __first; __n > 1; --__last, (void) --__n)
+ _VSTD::__pop_heap<_Compare>(__first, __last, __comp, __n);
+}
+
+template <class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ _VSTD::__sort_heap<_Comp_ref>(__first, __last, __comp);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void
+sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ _VSTD::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SORT_HEAP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_STABLE_PARTITION_H
+#define _LIBCPP___ALGORITHM_STABLE_PARTITION_H
+
+#include <__config>
+#include <__algorithm/rotate.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+#include <memory>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Predicate, class _ForwardIterator, class _Distance, class _Pair>
+_ForwardIterator
+__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ _Distance __len, _Pair __p, forward_iterator_tag __fit)
+{
+ // *__first is known to be false
+ // __len >= 1
+ if (__len == 1)
+ return __first;
+ if (__len == 2)
+ {
+ _ForwardIterator __m = __first;
+ if (__pred(*++__m))
+ {
+ swap(*__first, *__m);
+ return __m;
+ }
+ return __first;
+ }
+ if (__len <= __p.second)
+ { // The buffer is big enough to use
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h(__p.first, __d);
+ // Move the falses into the temporary buffer, and the trues to the front of the line
+ // Update __first to always point to the end of the trues
+ value_type* __t = __p.first;
+ ::new ((void*)__t) value_type(_VSTD::move(*__first));
+ __d.template __incr<value_type>();
+ ++__t;
+ _ForwardIterator __i = __first;
+ while (++__i != __last)
+ {
+ if (__pred(*__i))
+ {
+ *__first = _VSTD::move(*__i);
+ ++__first;
+ }
+ else
+ {
+ ::new ((void*)__t) value_type(_VSTD::move(*__i));
+ __d.template __incr<value_type>();
+ ++__t;
+ }
+ }
+ // All trues now at start of range, all falses in buffer
+ // Move falses back into range, but don't mess up __first which points to first false
+ __i = __first;
+ for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i)
+ *__i = _VSTD::move(*__t2);
+ // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer
+ return __first;
+ }
+ // Else not enough buffer, do in place
+ // __len >= 3
+ _ForwardIterator __m = __first;
+ _Distance __len2 = __len / 2; // __len2 >= 2
+ _VSTD::advance(__m, __len2);
+ // recurse on [__first, __m), *__first know to be false
+ // F?????????????????
+ // f m l
+ typedef typename add_lvalue_reference<_Predicate>::type _PredRef;
+ _ForwardIterator __first_false = _VSTD::__stable_partition<_PredRef>(__first, __m, __pred, __len2, __p, __fit);
+ // TTTFFFFF??????????
+ // f ff m l
+ // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true
+ _ForwardIterator __m1 = __m;
+ _ForwardIterator __second_false = __last;
+ _Distance __len_half = __len - __len2;
+ while (__pred(*__m1))
+ {
+ if (++__m1 == __last)
+ goto __second_half_done;
+ --__len_half;
+ }
+ // TTTFFFFFTTTF??????
+ // f ff m m1 l
+ __second_false = _VSTD::__stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit);
+__second_half_done:
+ // TTTFFFFFTTTTTFFFFF
+ // f ff m sf l
+ return _VSTD::rotate(__first_false, __m, __second_false);
+ // TTTTTTTTFFFFFFFFFF
+ // |
+}
+
+template <class _Predicate, class _ForwardIterator>
+_ForwardIterator
+__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ forward_iterator_tag)
+{
+ const unsigned __alloc_limit = 3; // might want to make this a function of trivial assignment
+ // Either prove all true and return __first or point to first false
+ while (true)
+ {
+ if (__first == __last)
+ return __first;
+ if (!__pred(*__first))
+ break;
+ ++__first;
+ }
+ // We now have a reduced range [__first, __last)
+ // *__first is known to be false
+ typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+ difference_type __len = _VSTD::distance(__first, __last);
+ pair<value_type*, ptrdiff_t> __p(0, 0);
+ unique_ptr<value_type, __return_temporary_buffer> __h;
+ if (__len >= __alloc_limit)
+ {
+ __p = _VSTD::get_temporary_buffer<value_type>(__len);
+ __h.reset(__p.first);
+ }
+ return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
+ (__first, __last, __pred, __len, __p, forward_iterator_tag());
+}
+
+template <class _Predicate, class _BidirectionalIterator, class _Distance, class _Pair>
+_BidirectionalIterator
+__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
+ _Distance __len, _Pair __p, bidirectional_iterator_tag __bit)
+{
+ // *__first is known to be false
+ // *__last is known to be true
+ // __len >= 2
+ if (__len == 2)
+ {
+ swap(*__first, *__last);
+ return __last;
+ }
+ if (__len == 3)
+ {
+ _BidirectionalIterator __m = __first;
+ if (__pred(*++__m))
+ {
+ swap(*__first, *__m);
+ swap(*__m, *__last);
+ return __last;
+ }
+ swap(*__m, *__last);
+ swap(*__first, *__m);
+ return __m;
+ }
+ if (__len <= __p.second)
+ { // The buffer is big enough to use
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h(__p.first, __d);
+ // Move the falses into the temporary buffer, and the trues to the front of the line
+ // Update __first to always point to the end of the trues
+ value_type* __t = __p.first;
+ ::new ((void*)__t) value_type(_VSTD::move(*__first));
+ __d.template __incr<value_type>();
+ ++__t;
+ _BidirectionalIterator __i = __first;
+ while (++__i != __last)
+ {
+ if (__pred(*__i))
+ {
+ *__first = _VSTD::move(*__i);
+ ++__first;
+ }
+ else
+ {
+ ::new ((void*)__t) value_type(_VSTD::move(*__i));
+ __d.template __incr<value_type>();
+ ++__t;
+ }
+ }
+ // move *__last, known to be true
+ *__first = _VSTD::move(*__i);
+ __i = ++__first;
+ // All trues now at start of range, all falses in buffer
+ // Move falses back into range, but don't mess up __first which points to first false
+ for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i)
+ *__i = _VSTD::move(*__t2);
+ // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer
+ return __first;
+ }
+ // Else not enough buffer, do in place
+ // __len >= 4
+ _BidirectionalIterator __m = __first;
+ _Distance __len2 = __len / 2; // __len2 >= 2
+ _VSTD::advance(__m, __len2);
+ // recurse on [__first, __m-1], except reduce __m-1 until *(__m-1) is true, *__first know to be false
+ // F????????????????T
+ // f m l
+ _BidirectionalIterator __m1 = __m;
+ _BidirectionalIterator __first_false = __first;
+ _Distance __len_half = __len2;
+ while (!__pred(*--__m1))
+ {
+ if (__m1 == __first)
+ goto __first_half_done;
+ --__len_half;
+ }
+ // F???TFFF?????????T
+ // f m1 m l
+ typedef typename add_lvalue_reference<_Predicate>::type _PredRef;
+ __first_false = _VSTD::__stable_partition<_PredRef>(__first, __m1, __pred, __len_half, __p, __bit);
+__first_half_done:
+ // TTTFFFFF?????????T
+ // f ff m l
+ // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true
+ __m1 = __m;
+ _BidirectionalIterator __second_false = __last;
+ ++__second_false;
+ __len_half = __len - __len2;
+ while (__pred(*__m1))
+ {
+ if (++__m1 == __last)
+ goto __second_half_done;
+ --__len_half;
+ }
+ // TTTFFFFFTTTF?????T
+ // f ff m m1 l
+ __second_false = _VSTD::__stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __bit);
+__second_half_done:
+ // TTTFFFFFTTTTTFFFFF
+ // f ff m sf l
+ return _VSTD::rotate(__first_false, __m, __second_false);
+ // TTTTTTTTFFFFFFFFFF
+ // |
+}
+
+template <class _Predicate, class _BidirectionalIterator>
+_BidirectionalIterator
+__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
+ bidirectional_iterator_tag)
+{
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ const difference_type __alloc_limit = 4; // might want to make this a function of trivial assignment
+ // Either prove all true and return __first or point to first false
+ while (true)
+ {
+ if (__first == __last)
+ return __first;
+ if (!__pred(*__first))
+ break;
+ ++__first;
+ }
+ // __first points to first false, everything prior to __first is already set.
+ // Either prove [__first, __last) is all false and return __first, or point __last to last true
+ do
+ {
+ if (__first == --__last)
+ return __first;
+ } while (!__pred(*__last));
+ // We now have a reduced range [__first, __last]
+ // *__first is known to be false
+ // *__last is known to be true
+ // __len >= 2
+ difference_type __len = _VSTD::distance(__first, __last) + 1;
+ pair<value_type*, ptrdiff_t> __p(0, 0);
+ unique_ptr<value_type, __return_temporary_buffer> __h;
+ if (__len >= __alloc_limit)
+ {
+ __p = _VSTD::get_temporary_buffer<value_type>(__len);
+ __h.reset(__p.first);
+ }
+ return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
+ (__first, __last, __pred, __len, __p, bidirectional_iterator_tag());
+}
+
+template <class _ForwardIterator, class _Predicate>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator
+stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
+{
+ return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
+ (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_STABLE_PARTITION_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_STABLE_SORT_H
+#define _LIBCPP___ALGORITHM_STABLE_SORT_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/inplace_merge.h>
+#include <__algorithm/sort.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/swap.h>
+#include <memory>
+#include <type_traits> // swap
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _InputIterator1, class _InputIterator2>
+void
+__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ typename iterator_traits<_InputIterator1>::value_type* __result, _Compare __comp)
+{
+ typedef typename iterator_traits<_InputIterator1>::value_type value_type;
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h(__result, __d);
+ for (; true; ++__result)
+ {
+ if (__first1 == __last1)
+ {
+ for (; __first2 != __last2; ++__first2, ++__result, (void)__d.template __incr<value_type>())
+ ::new ((void*)__result) value_type(_VSTD::move(*__first2));
+ __h.release();
+ return;
+ }
+ if (__first2 == __last2)
+ {
+ for (; __first1 != __last1; ++__first1, ++__result, (void)__d.template __incr<value_type>())
+ ::new ((void*)__result) value_type(_VSTD::move(*__first1));
+ __h.release();
+ return;
+ }
+ if (__comp(*__first2, *__first1))
+ {
+ ::new ((void*)__result) value_type(_VSTD::move(*__first2));
+ __d.template __incr<value_type>();
+ ++__first2;
+ }
+ else
+ {
+ ::new ((void*)__result) value_type(_VSTD::move(*__first1));
+ __d.template __incr<value_type>();
+ ++__first1;
+ }
+ }
+}
+
+template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
+void
+__merge_move_assign(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+{
+ for (; __first1 != __last1; ++__result)
+ {
+ if (__first2 == __last2)
+ {
+ for (; __first1 != __last1; ++__first1, (void) ++__result)
+ *__result = _VSTD::move(*__first1);
+ return;
+ }
+ if (__comp(*__first2, *__first1))
+ {
+ *__result = _VSTD::move(*__first2);
+ ++__first2;
+ }
+ else
+ {
+ *__result = _VSTD::move(*__first1);
+ ++__first1;
+ }
+ }
+ for (; __first2 != __last2; ++__first2, (void) ++__result)
+ *__result = _VSTD::move(*__first2);
+}
+
+template <class _Compare, class _RandomAccessIterator>
+void
+__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ typename iterator_traits<_RandomAccessIterator>::difference_type __len,
+ typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size);
+
+template <class _Compare, class _RandomAccessIterator>
+void
+__stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1, _Compare __comp,
+ typename iterator_traits<_RandomAccessIterator>::difference_type __len,
+ typename iterator_traits<_RandomAccessIterator>::value_type* __first2)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ switch (__len)
+ {
+ case 0:
+ return;
+ case 1:
+ ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
+ return;
+ case 2:
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h2(__first2, __d);
+ if (__comp(*--__last1, *__first1))
+ {
+ ::new ((void*)__first2) value_type(_VSTD::move(*__last1));
+ __d.template __incr<value_type>();
+ ++__first2;
+ ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
+ }
+ else
+ {
+ ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
+ __d.template __incr<value_type>();
+ ++__first2;
+ ::new ((void*)__first2) value_type(_VSTD::move(*__last1));
+ }
+ __h2.release();
+ return;
+ }
+ if (__len <= 8)
+ {
+ _VSTD::__insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp);
+ return;
+ }
+ typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
+ _RandomAccessIterator __m = __first1 + __l2;
+ _VSTD::__stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2);
+ _VSTD::__stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2);
+ _VSTD::__merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp);
+}
+
+template <class _Tp>
+struct __stable_sort_switch
+{
+ static const unsigned value = 128*is_trivially_copy_assignable<_Tp>::value;
+};
+
+template <class _Compare, class _RandomAccessIterator>
+void
+__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ typename iterator_traits<_RandomAccessIterator>::difference_type __len,
+ typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ switch (__len)
+ {
+ case 0:
+ case 1:
+ return;
+ case 2:
+ if (__comp(*--__last, *__first))
+ swap(*__first, *__last);
+ return;
+ }
+ if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value))
+ {
+ _VSTD::__insertion_sort<_Compare>(__first, __last, __comp);
+ return;
+ }
+ typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
+ _RandomAccessIterator __m = __first + __l2;
+ if (__len <= __buff_size)
+ {
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
+ _VSTD::__stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff);
+ __d.__set(__l2, (value_type*)nullptr);
+ _VSTD::__stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);
+ __d.__set(__len, (value_type*)nullptr);
+ _VSTD::__merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);
+// _VSTD::__merge<_Compare>(move_iterator<value_type*>(__buff),
+// move_iterator<value_type*>(__buff + __l2),
+// move_iterator<_RandomAccessIterator>(__buff + __l2),
+// move_iterator<_RandomAccessIterator>(__buff + __len),
+// __first, __comp);
+ return;
+ }
+ _VSTD::__stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size);
+ _VSTD::__stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size);
+ _VSTD::__inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size);
+}
+
+template <class _RandomAccessIterator, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
+{
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ difference_type __len = __last - __first;
+ pair<value_type*, ptrdiff_t> __buf(0, 0);
+ unique_ptr<value_type, __return_temporary_buffer> __h;
+ if (__len > static_cast<difference_type>(__stable_sort_switch<value_type>::value))
+ {
+ __buf = _VSTD::get_temporary_buffer<value_type>(__len);
+ __h.reset(__buf.first);
+ }
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ _VSTD::__stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second);
+}
+
+template <class _RandomAccessIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
+{
+ _VSTD::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_STABLE_SORT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SWAP_RANGES_H
+#define _LIBCPP___ALGORITHM_SWAP_RANGES_H
+
+#include <__config>
+#include <__utility/swap.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _ForwardIterator1, class _ForwardIterator2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator2
+swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) {
+ for (; __first1 != __last1; ++__first1, (void)++__first2)
+ swap(*__first1, *__first2);
+ return __first2;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_SWAP_RANGES_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_TRANSFORM_H
+#define _LIBCPP___ALGORITHM_TRANSFORM_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _OutputIterator, class _UnaryOperation>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)
+{
+ for (; __first != __last; ++__first, (void) ++__result)
+ *__result = __op(*__first);
+ return __result;
+}
+
+template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
+ _OutputIterator __result, _BinaryOperation __binary_op)
+{
+ for (; __first1 != __last1; ++__first1, (void) ++__first2, ++__result)
+ *__result = __binary_op(*__first1, *__first2);
+ return __result;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_TRANSFORM_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_UNIQUE_H
+#define _LIBCPP___ALGORITHM_UNIQUE_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/adjacent_find.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/move.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// unique
+
+template <class _ForwardIterator, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
+{
+ __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type>
+ (__first, __last, __pred);
+ if (__first != __last)
+ {
+ // ... a a ? ...
+ // f i
+ _ForwardIterator __i = __first;
+ for (++__i; ++__i != __last;)
+ if (!__pred(*__first, *__i))
+ *++__first = _VSTD::move(*__i);
+ ++__first;
+ }
+ return __first;
+}
+
+template <class _ForwardIterator>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator
+unique(_ForwardIterator __first, _ForwardIterator __last)
+{
+ typedef typename iterator_traits<_ForwardIterator>::value_type __v;
+ return _VSTD::unique(__first, __last, __equal_to<__v>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_UNIQUE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_UNIQUE_COPY_H
+#define _LIBCPP___ALGORITHM_UNIQUE_COPY_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__iterator/iterator_traits.h>
+#include <utility>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _BinaryPredicate, class _InputIterator, class _OutputIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+__unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred,
+ input_iterator_tag, output_iterator_tag)
+{
+ if (__first != __last)
+ {
+ typename iterator_traits<_InputIterator>::value_type __t(*__first);
+ *__result = __t;
+ ++__result;
+ while (++__first != __last)
+ {
+ if (!__pred(__t, *__first))
+ {
+ __t = *__first;
+ *__result = __t;
+ ++__result;
+ }
+ }
+ }
+ return __result;
+}
+
+template <class _BinaryPredicate, class _ForwardIterator, class _OutputIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+__unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred,
+ forward_iterator_tag, output_iterator_tag)
+{
+ if (__first != __last)
+ {
+ _ForwardIterator __i = __first;
+ *__result = *__i;
+ ++__result;
+ while (++__first != __last)
+ {
+ if (!__pred(*__i, *__first))
+ {
+ *__result = *__first;
+ ++__result;
+ __i = __first;
+ }
+ }
+ }
+ return __result;
+}
+
+template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+__unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred,
+ input_iterator_tag, forward_iterator_tag)
+{
+ if (__first != __last)
+ {
+ *__result = *__first;
+ while (++__first != __last)
+ if (!__pred(*__result, *__first))
+ *++__result = *__first;
+ ++__result;
+ }
+ return __result;
+}
+
+template <class _InputIterator, class _OutputIterator, class _BinaryPredicate>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred)
+{
+ return _VSTD::__unique_copy<typename add_lvalue_reference<_BinaryPredicate>::type>
+ (__first, __last, __result, __pred,
+ typename iterator_traits<_InputIterator>::iterator_category(),
+ typename iterator_traits<_OutputIterator>::iterator_category());
+}
+
+template <class _InputIterator, class _OutputIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+ typedef typename iterator_traits<_InputIterator>::value_type __v;
+ return _VSTD::unique_copy(__first, __last, __result, __equal_to<__v>());
+}
+
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_UNIQUE_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_UNWRAP_ITER_H
+#define _LIBCPP___ALGORITHM_UNWRAP_ITER_H
+
+#include <__config>
+#include <iterator>
+#include <__memory/pointer_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// The job of __unwrap_iter is to lower contiguous iterators (such as
+// vector<T>::iterator) into pointers, to reduce the number of template
+// instantiations and to enable pointer-based optimizations e.g. in std::copy.
+// For iterators that are not contiguous, it must be a no-op.
+// In debug mode, we don't do this.
+//
+// __unwrap_iter is non-constexpr for user-defined iterators whose
+// `to_address` and/or `operator->` is non-constexpr. This is okay; but we
+// try to avoid doing __unwrap_iter in constant-evaluated contexts anyway.
+//
+// Some algorithms (e.g. std::copy, but not std::sort) need to convert an
+// "unwrapped" result back into a contiguous iterator. Since contiguous iterators
+// are random-access, we can do this portably using iterator arithmetic; this
+// is the job of __rewrap_iter.
+
+template <class _Iter, bool = __is_cpp17_contiguous_iterator<_Iter>::value>
+struct __unwrap_iter_impl {
+ static _LIBCPP_CONSTEXPR _Iter
+ __apply(_Iter __i) _NOEXCEPT {
+ return __i;
+ }
+};
+
+#if _LIBCPP_DEBUG_LEVEL < 2
+
+template <class _Iter>
+struct __unwrap_iter_impl<_Iter, true> {
+ static _LIBCPP_CONSTEXPR decltype(_VSTD::__to_address(declval<_Iter>()))
+ __apply(_Iter __i) _NOEXCEPT {
+ return _VSTD::__to_address(__i);
+ }
+};
+
+#endif // _LIBCPP_DEBUG_LEVEL < 2
+
+template<class _Iter, class _Impl = __unwrap_iter_impl<_Iter> >
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+decltype(_Impl::__apply(declval<_Iter>()))
+__unwrap_iter(_Iter __i) _NOEXCEPT
+{
+ return _Impl::__apply(__i);
+}
+
+template<class _OrigIter>
+_OrigIter __rewrap_iter(_OrigIter, _OrigIter __result)
+{
+ return __result;
+}
+
+template<class _OrigIter, class _UnwrappedIter>
+_OrigIter __rewrap_iter(_OrigIter __first, _UnwrappedIter __result)
+{
+ // Precondition: __result is reachable from __first
+ // Precondition: _OrigIter is a contiguous iterator
+ return __first + (__result - _VSTD::__unwrap_iter(__first));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_UNWRAP_ITER_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_UPPER_BOUND_H
+#define _LIBCPP___ALGORITHM_UPPER_BOUND_H
+
+#include <__config>
+#include <__algorithm/comp.h>
+#include <__algorithm/half_positive.h>
+#include <iterator>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Compare, class _ForwardIterator, class _Tp>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+__upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
+{
+ typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
+ difference_type __len = _VSTD::distance(__first, __last);
+ while (__len != 0)
+ {
+ difference_type __l2 = _VSTD::__half_positive(__len);
+ _ForwardIterator __m = __first;
+ _VSTD::advance(__m, __l2);
+ if (__comp(__value_, *__m))
+ __len = __l2;
+ else
+ {
+ __first = ++__m;
+ __len -= __l2 + 1;
+ }
+ }
+ return __first;
+}
+
+template <class _ForwardIterator, class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator
+upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
+{
+ typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
+ return _VSTD::__upper_bound<_Comp_ref>(__first, __last, __value_, __comp);
+}
+
+template <class _ForwardIterator, class _Tp>
+_LIBCPP_NODISCARD_EXT inline
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator
+upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
+{
+ return _VSTD::upper_bound(__first, __last, __value_,
+ __less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_UPPER_BOUND_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___AVAILABILITY
+#define _LIBCPP___AVAILABILITY
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+// Libc++ is shipped by various vendors. In particular, it is used as a system
+// library on macOS, iOS and other Apple platforms. In order for users to be
+// able to compile a binary that is intended to be deployed to an older version
+// of a platform, Clang provides availability attributes [1]. These attributes
+// can be placed on declarations and are used to describe the life cycle of a
+// symbol in the library.
+//
+// The main goal is to ensure a compile-time error if a symbol that hasn't been
+// introduced in a previously released library is used in a program that targets
+// that previously released library. Normally, this would be a load-time error
+// when one tries to launch the program against the older library.
+//
+// For example, the filesystem library was introduced in the dylib in macOS 10.15.
+// If a user compiles on a macOS 10.15 host but targets macOS 10.13 with their
+// program, the compiler would normally not complain (because the required
+// declarations are in the headers), but the dynamic loader would fail to find
+// the symbols when actually trying to launch the program on macOS 10.13. To
+// turn this into a compile-time issue instead, declarations are annotated with
+// when they were introduced, and the compiler can produce a diagnostic if the
+// program references something that isn't available on the deployment target.
+//
+// This mechanism is general in nature, and any vendor can add their markup to
+// the library (see below). Whenever a new feature is added that requires support
+// in the shared library, a macro should be added below to mark this feature
+// as unavailable. When vendors decide to ship the feature as part of their
+// shared library, they can update the markup appropriately.
+//
+// Furthermore, many features in the standard library have corresponding
+// feature-test macros. When a feature is made unavailable on some deployment
+// target, a macro should be defined to signal that it is unavailable. That
+// macro can then be picked up when feature-test macros are generated (see
+// generate_feature_test_macro_components.py) to make sure that feature-test
+// macros don't announce a feature as being implemented if it has been marked
+// as unavailable.
+//
+// Note that this mechanism is disabled by default in the "upstream" libc++.
+// Availability annotations are only meaningful when shipping libc++ inside
+// a platform (i.e. as a system library), and so vendors that want them should
+// turn those annotations on at CMake configuration time.
+//
+// [1]: https://clang.llvm.org/docs/AttributeReference.html#availability
+
+
+// For backwards compatibility, allow users to define _LIBCPP_DISABLE_AVAILABILITY
+// for a while.
+#if defined(_LIBCPP_DISABLE_AVAILABILITY)
+# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
+# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
+# endif
+#endif
+
+// Availability markup is disabled when building the library, or when the compiler
+// doesn't support the proper attributes.
+#if defined(_LIBCPP_BUILDING_LIBRARY) || \
+ defined(_LIBCXXABI_BUILDING_LIBRARY) || \
+ !__has_feature(attribute_availability_with_strict) || \
+ !__has_feature(attribute_availability_in_templates) || \
+ !__has_extension(pragma_clang_attribute_external_declaration)
+# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
+# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
+# endif
+#endif
+
+#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
+
+ // This controls the availability of std::shared_mutex and std::shared_timed_mutex,
+ // which were added to the dylib later.
+# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
+// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
+// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
+
+ // These macros control the availability of std::bad_optional_access and
+ // other exception types. These were put in the shared library to prevent
+ // code bloat from every user program defining the vtable for these exception
+ // types.
+# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
+# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
+
+ // This controls the availability of std::uncaught_exceptions().
+# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
+
+ // This controls the availability of the sized version of ::operator delete,
+ // which was added to the dylib later.
+# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
+
+ // This controls the availability of the std::future_error exception.
+# define _LIBCPP_AVAILABILITY_FUTURE_ERROR
+
+ // This controls the availability of std::type_info's vtable.
+ // I can't imagine how using std::type_info can work at all if
+ // this isn't supported.
+# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
+
+ // This controls the availability of std::locale::category members
+ // (e.g. std::locale::collate), which are defined in the dylib.
+# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
+
+ // This controls the availability of atomic operations on std::shared_ptr
+ // (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared
+ // lock table located in the dylib.
+# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+
+ // These macros control the availability of all parts of <filesystem> that
+ // depend on something in the dylib.
+# define _LIBCPP_AVAILABILITY_FILESYSTEM
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP
+// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
+
+ // This controls the availability of std::to_chars.
+# define _LIBCPP_AVAILABILITY_TO_CHARS
+
+ // This controls the availability of the C++20 synchronization library,
+ // which requires shared library support for various operations
+ // (see libcxx/src/atomic.cpp).
+# define _LIBCPP_AVAILABILITY_SYNC
+// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
+// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
+// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
+// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
+
+ // This controls the availability of the C++20 format library.
+ // The library is in development and not ABI stable yet. Currently
+ // P2216 is aiming to be retroactively accepted in C++20. This paper
+ // contains ABI breaking changes.
+# define _LIBCPP_AVAILABILITY_FORMAT
+// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format
+
+#elif defined(__APPLE__)
+
+# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
+# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
+# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
+# endif
+
+# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \
+ __attribute__((availability(macosx,strict,introduced=10.13))) \
+ __attribute__((availability(ios,strict,introduced=11.0))) \
+ __attribute__((availability(tvos,strict,introduced=11.0))) \
+ __attribute__((availability(watchos,strict,introduced=4.0)))
+# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS \
+ _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \
+ _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+
+# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+
+# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+
+# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
+ __attribute__((availability(ios,strict,introduced=6.0)))
+
+# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
+
+# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
+
+# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
+
+# define _LIBCPP_AVAILABILITY_FILESYSTEM \
+ __attribute__((availability(macosx,strict,introduced=10.15))) \
+ __attribute__((availability(ios,strict,introduced=13.0))) \
+ __attribute__((availability(tvos,strict,introduced=13.0))) \
+ __attribute__((availability(watchos,strict,introduced=6.0)))
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH \
+ _Pragma("clang attribute push(__attribute__((availability(macosx,strict,introduced=10.15))), apply_to=any(function,record))") \
+ _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \
+ _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \
+ _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))")
+# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP \
+ _Pragma("clang attribute pop") \
+ _Pragma("clang attribute pop") \
+ _Pragma("clang attribute pop") \
+ _Pragma("clang attribute pop")
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
+# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
+# endif
+
+# define _LIBCPP_AVAILABILITY_TO_CHARS \
+ _LIBCPP_AVAILABILITY_FILESYSTEM
+
+# define _LIBCPP_AVAILABILITY_SYNC \
+ __attribute__((availability(macosx,strict,introduced=11.0))) \
+ __attribute__((availability(ios,strict,introduced=14.0))) \
+ __attribute__((availability(tvos,strict,introduced=14.0))) \
+ __attribute__((availability(watchos,strict,introduced=7.0)))
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)
+# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
+# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
+# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
+# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
+# endif
+
+ // This controls the availability of the C++20 format library.
+ // The library is in development and not ABI stable yet. Currently
+ // P2216 is aiming to be retroactively accepted in C++20. This paper
+ // contains ABI breaking changes.
+# define _LIBCPP_AVAILABILITY_FORMAT \
+ __attribute__((unavailable))
+# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format
+#else
+
+// ...New vendors can add availability markup here...
+
+# error "It looks like you're trying to enable vendor availability markup, but you haven't defined the corresponding macros yet!"
+
+#endif
+
+// Define availability attributes that depend on _LIBCPP_NO_EXCEPTIONS.
+// Those are defined in terms of the availability attributes above, and
+// should not be vendor-specific.
+#if defined(_LIBCPP_NO_EXCEPTIONS)
+# define _LIBCPP_AVAILABILITY_FUTURE
+# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
+# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
+#else
+# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
+# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST
+# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
+#endif
+
+#endif // _LIBCPP___AVAILABILITY
#define _LIBCPP___BIT_REFERENCE
#include <__config>
-#include <bit>
+#include <__bits>
#include <algorithm>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
{
if (static_cast<bool>(__value_))
- return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
- return __find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
+ return _VSTD::__find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
+ return _VSTD::__find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
}
// count
count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
{
if (static_cast<bool>(__value_))
- return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
- return __count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
+ return _VSTD::__count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
+ return _VSTD::__count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
}
// fill_n
if (__n > 0)
{
if (__value_)
- __fill_n_true(__first, __n);
+ _VSTD::__fill_n_true(__first, __n);
else
- __fill_n_false(__first, __n);
+ _VSTD::__fill_n_false(__first, __n);
}
}
copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
{
if (__first.__ctz_ == __result.__ctz_)
- return __copy_aligned(__first, __last, __result);
- return __copy_unaligned(__first, __last, __result);
+ return _VSTD::__copy_aligned(__first, __last, __result);
+ return _VSTD::__copy_unaligned(__first, __last, __result);
}
// copy_backward
copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
{
if (__last.__ctz_ == __result.__ctz_)
- return __copy_backward_aligned(__first, __last, __result);
- return __copy_backward_unaligned(__first, __last, __result);
+ return _VSTD::__copy_backward_aligned(__first, __last, __result);
+ return _VSTD::__copy_backward_unaligned(__first, __last, __result);
}
// move
__bit_iterator<__C2, false> __first2)
{
if (__first1.__ctz_ == __first2.__ctz_)
- return __swap_ranges_aligned(__first1, __last1, __first2);
- return __swap_ranges_unaligned(__first1, __last1, __first2);
+ return _VSTD::__swap_ranges_aligned(__first1, __last1, __first2);
+ return _VSTD::__swap_ranges_unaligned(__first1, __last1, __first2);
}
// rotate
equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2)
{
if (__first1.__ctz_ == __first2.__ctz_)
- return __equal_aligned(__first1, __last1, __first2);
- return __equal_unaligned(__first1, __last1, __first2);
+ return _VSTD::__equal_aligned(__first1, __last1, __first2);
+ return _VSTD::__equal_unaligned(__first1, __last1, __first2);
}
template <class _Cp, bool _IsConst,
#endif
{}
- // avoid re-declaring a copy constructor for the non-const version.
- using __type_for_copy_to_const =
- _If<_IsConst, __bit_iterator<_Cp, false>, struct __private_nat>;
-
+ // When _IsConst=false, this is the copy constructor.
+ // It is non-trivial. Making it trivial would break ABI.
+ // When _IsConst=true, this is a converting constructor;
+ // the copy and move constructors are implicitly generated
+ // and trivial.
_LIBCPP_INLINE_VISIBILITY
- __bit_iterator(const __type_for_copy_to_const& __it) _NOEXCEPT
+ __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT
: __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
- // The non-const __bit_iterator has historically had a non-trivial
- // copy constructor (as a quirk of its construction). We need to maintain
- // this for ABI purposes.
- using __type_for_abi_non_trivial_copy_ctor =
- _If<!_IsConst, __bit_iterator, struct __private_nat>;
-
- _LIBCPP_INLINE_VISIBILITY
- __bit_iterator(__type_for_abi_non_trivial_copy_ctor const& __it) _NOEXCEPT
- : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
-
- // Always declare the copy assignment operator since the implicit declaration
- // is deprecated.
+ // When _IsConst=false, we have a user-provided copy constructor,
+ // so we must also provide a copy assignment operator because
+ // the implicit generation of a defaulted one is deprecated.
+ // When _IsConst=true, the assignment operators are
+ // implicitly generated and trivial.
_LIBCPP_INLINE_VISIBILITY
- __bit_iterator& operator=(__bit_iterator const&) = default;
+ __bit_iterator& operator=(const _If<_IsConst, struct __private_nat, __bit_iterator>& __it) {
+ __seg_ = __it.__seg_;
+ __ctz_ = __it.__ctz_;
+ return *this;
+ }
_LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
{return reference(__seg_, __storage_type(1) << __ctz_);}
_LIBCPP_POP_MACROS
-#endif // _LIBCPP___BIT_REFERENCE
+#endif // _LIBCPP___BIT_REFERENCE
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___BITS
+#define _LIBCPP___BITS
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_COMPILER_MSVC
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_ctz(unsigned __x) _NOEXCEPT { return __builtin_ctz(__x); }
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_ctz(unsigned long __x) _NOEXCEPT { return __builtin_ctzl(__x); }
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); }
+
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_clz(unsigned __x) _NOEXCEPT { return __builtin_clz(__x); }
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_clz(unsigned long __x) _NOEXCEPT { return __builtin_clzl(__x); }
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); }
+
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_popcount(unsigned __x) _NOEXCEPT { return __builtin_popcount(__x); }
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_popcount(unsigned long __x) _NOEXCEPT { return __builtin_popcountl(__x); }
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+int __libcpp_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popcountll(__x); }
+
+#else // _LIBCPP_COMPILER_MSVC
+
+// Precondition: __x != 0
+inline _LIBCPP_INLINE_VISIBILITY
+int __libcpp_ctz(unsigned __x) {
+ static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
+ static_assert(sizeof(unsigned long) == 4, "");
+ unsigned long __where;
+ if (_BitScanForward(&__where, __x))
+ return static_cast<int>(__where);
+ return 32;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+int __libcpp_ctz(unsigned long __x) {
+ static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
+ return __ctz(static_cast<unsigned>(__x));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+int __libcpp_ctz(unsigned long long __x) {
+ unsigned long __where;
+#if defined(_LIBCPP_HAS_BITSCAN64)
+ if (_BitScanForward64(&__where, __x))
+ return static_cast<int>(__where);
+#else
+ // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
+ if (_BitScanForward(&__where, static_cast<unsigned long>(__x)))
+ return static_cast<int>(__where);
+ if (_BitScanForward(&__where, static_cast<unsigned long>(__x >> 32)))
+ return static_cast<int>(__where + 32);
+#endif
+ return 64;
+}
+
+// Precondition: __x != 0
+inline _LIBCPP_INLINE_VISIBILITY
+int __libcpp_clz(unsigned __x) {
+ static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
+ static_assert(sizeof(unsigned long) == 4, "");
+ unsigned long __where;
+ if (_BitScanReverse(&__where, __x))
+ return static_cast<int>(31 - __where);
+ return 32; // Undefined Behavior.
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+int __libcpp_clz(unsigned long __x) {
+ static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
+ return __libcpp_clz(static_cast<unsigned>(__x));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+int __libcpp_clz(unsigned long long __x) {
+ unsigned long __where;
+#if defined(_LIBCPP_HAS_BITSCAN64)
+ if (_BitScanReverse64(&__where, __x))
+ return static_cast<int>(63 - __where);
+#else
+ // Win32 doesn't have _BitScanReverse64 so emulate it with two 32 bit calls.
+ if (_BitScanReverse(&__where, static_cast<unsigned long>(__x >> 32)))
+ return static_cast<int>(63 - (__where + 32));
+ if (_BitScanReverse(&__where, static_cast<unsigned long>(__x)))
+ return static_cast<int>(63 - __where);
+#endif
+ return 64; // Undefined Behavior.
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned __x) {
+ static_assert(sizeof(unsigned) == 4, "");
+ return __popcnt(__x);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long __x) {
+ static_assert(sizeof(unsigned long) == 4, "");
+ return __popcnt(__x);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long long __x) {
+ static_assert(sizeof(unsigned long long) == 8, "");
+ return __popcnt64(__x);
+}
+
+#endif // _LIBCPP_COMPILER_MSVC
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___BITS
#ifndef _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H
#define _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H
-#include <stdlib.h>
-#include <stdarg.h>
#include <memory>
+#include <stdarg.h>
+#include <stdlib.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32
#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL
#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
+#cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
#cmakedefine _LIBCPP_NO_VCRUNTIME
-#ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@
-#endif
#cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@
+#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
#cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS
+#cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
+#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
+#cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT
+#cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES
@_LIBCPP_ABI_DEFINES@
# include <cstddef>
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_ASSERT)
-# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : \
- _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
-#endif
-
-#if _LIBCPP_DEBUG_LEVEL >= 2
-#ifndef _LIBCPP_DEBUG_ASSERT
-#define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(x, m)
-#endif
-#define _LIBCPP_DEBUG_MODE(...) __VA_ARGS__
-#endif
-
-#ifndef _LIBCPP_ASSERT
-# define _LIBCPP_ASSERT(x, m) ((void)0)
-#endif
-#ifndef _LIBCPP_DEBUG_ASSERT
+#if _LIBCPP_DEBUG_LEVEL == 0
+# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
+# define _LIBCPP_ASSERT_IMPL(x, m) ((void)0)
+#elif _LIBCPP_DEBUG_LEVEL == 1
# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
+# define _LIBCPP_ASSERT_IMPL(x, m) ((x) ? (void)0 : _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
+#elif _LIBCPP_DEBUG_LEVEL == 2
+# define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(x, m)
+# define _LIBCPP_ASSERT_IMPL(x, m) ((x) ? (void)0 : _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
+#else
+# error _LIBCPP_DEBUG_LEVEL must be one of 0, 1, 2
#endif
-#ifndef _LIBCPP_DEBUG_MODE
-#define _LIBCPP_DEBUG_MODE(...) ((void)0)
+
+#if !defined(_LIBCPP_ASSERT)
+# define _LIBCPP_ASSERT(x, m) _LIBCPP_ASSERT_IMPL(x, m)
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
__libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m)
: __file_(__f), __line_(__l), __pred_(__p), __msg_(__m) {}
- _LIBCPP_FUNC_VIS std::string what() const;
+ _LIBCPP_FUNC_VIS string what() const;
const char* __file_;
int __line_;
_LIBCPP_FUNC_VIS
bool __libcpp_set_debug_function(__libcpp_debug_function_type __func);
-#if _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY)
+#if _LIBCPP_DEBUG_LEVEL == 2 || defined(_LIBCPP_BUILDING_LIBRARY)
struct _LIBCPP_TYPE_VIS __c_node;
template <class _Cont>
_LIBCPP_INLINE_VISIBILITY static __c_node* __create_C_node(void *__mem, void *__c, __c_node *__next) {
- return ::new(__mem) _C_node<_Cont>(__c, __next);
+ return ::new (__mem) _C_node<_Cont>(__c, __next);
}
template <class _Cont>
_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
-#endif // _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY)
+#endif // _LIBCPP_DEBUG_LEVEL == 2 || defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_DEBUG_H
+#endif // _LIBCPP_DEBUG_H
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP___ERRC
+#endif // _LIBCPP___ERRC
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FORMAT_FORMAT_ERROR_H
+#define _LIBCPP___FORMAT_FORMAT_ERROR_H
+
+#include <__config>
+#include <stdexcept>
+
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17
+
+class _LIBCPP_EXCEPTION_ABI format_error : public runtime_error {
+public:
+ _LIBCPP_HIDE_FROM_ABI explicit format_error(const string& __s)
+ : runtime_error(__s) {}
+ _LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s)
+ : runtime_error(__s) {}
+ virtual ~format_error() noexcept;
+};
+
+_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void
+__throw_format_error(const char* __s) {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw format_error(__s);
+#else
+ (void)__s;
+ _VSTD::abort();
+#endif
+}
+
+#endif //_LIBCPP_STD_VER > 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___FORMAT_FORMAT_ERROR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H
+#define _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H
+
+#include <__config>
+#include <__format/format_error.h>
+#include <string_view>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17
+
+// TODO FMT Remove this once we require compilers with proper C++20 support.
+// If the compiler has no concepts support, the format header will be disabled.
+// Without concepts support enable_if needs to be used and that too much effort
+// to support compilers with partial C++20 support.
+#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && \
+ !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
+
+template <class _CharT>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_context {
+public:
+ using char_type = _CharT;
+ using const_iterator = typename basic_string_view<_CharT>::const_iterator;
+ using iterator = const_iterator;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit basic_format_parse_context(basic_string_view<_CharT> __fmt,
+ size_t __num_args = 0) noexcept
+ : __begin_(__fmt.begin()),
+ __end_(__fmt.end()),
+ __indexing_(__unknown),
+ __next_arg_id_(0),
+ __num_args_(__num_args) {}
+
+ basic_format_parse_context(const basic_format_parse_context&) = delete;
+ basic_format_parse_context&
+ operator=(const basic_format_parse_context&) = delete;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept {
+ return __begin_;
+ }
+ _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept {
+ return __end_;
+ }
+ _LIBCPP_HIDE_FROM_ABI constexpr void advance_to(const_iterator __it) {
+ __begin_ = __it;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr size_t next_arg_id() {
+ if (__indexing_ == __manual)
+ __throw_format_error("Using automatic argument numbering in manual "
+ "argument numbering mode");
+
+ if (__indexing_ == __unknown)
+ __indexing_ = __automatic;
+ return __next_arg_id_++;
+ }
+ _LIBCPP_HIDE_FROM_ABI constexpr void check_arg_id(size_t __id) {
+ if (__indexing_ == __automatic)
+ __throw_format_error("Using manual argument numbering in automatic "
+ "argument numbering mode");
+
+ if (__indexing_ == __unknown)
+ __indexing_ = __manual;
+
+ // Throws an exception to make the expression a non core constant
+ // expression as required by:
+ // [format.parse.ctx]/11
+ // Remarks: Call expressions where id >= num_args_ are not core constant
+ // expressions ([expr.const]).
+ // Note: the Throws clause [format.parse.ctx]/10 doesn't specify the
+ // behavior when id >= num_args_.
+ if (is_constant_evaluated() && __id >= __num_args_)
+ __throw_format_error("Argument index outside the valid range");
+ }
+
+private:
+ iterator __begin_;
+ iterator __end_;
+ enum _Indexing { __unknown, __manual, __automatic };
+ _Indexing __indexing_;
+ size_t __next_arg_id_;
+ size_t __num_args_;
+};
+
+using format_parse_context = basic_format_parse_context<char>;
+using wformat_parse_context = basic_format_parse_context<wchar_t>;
+
+#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
+
+#endif //_LIBCPP_STD_VER > 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_FUNCTION_LIKE_H
+#define _LIBCPP___ITERATOR_FUNCTION_LIKE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+// Per [range.iter.ops.general] and [algorithms.requirements], functions in namespace std::ranges
+// can't be found by ADL and inhibit ADL when found by unqualified lookup. The easiest way to
+// facilitate this is to use function objects.
+//
+// Since these are still standard library functions, we use `__function_like` to eliminate most of
+// the properties that function objects get by default (e.g. semiregularity, addressability), to
+// limit the surface area of the unintended public interface, so as to curb the effect of Hyrum's
+// law.
+struct __function_like {
+ __function_like() = delete;
+ __function_like(__function_like const&) = delete;
+ __function_like& operator=(__function_like const&) = delete;
+
+ void operator&() const = delete;
+
+ struct __tag { };
+
+protected:
+ constexpr explicit __function_like(__tag) noexcept {}
+ ~__function_like() = default;
+};
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_FUNCTION_LIKE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H
+#define _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Arg1, class _Arg2, class _Result>
+struct _LIBCPP_TEMPLATE_VIS binary_function
+{
+ typedef _Arg1 first_argument_type;
+ typedef _Arg2 second_argument_type;
+ typedef _Result result_type;
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
+#define _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
+
+#include <__config>
+#include <__functional/binary_function.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
+
+template <class _Predicate>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 binary_negate
+ : public binary_function<typename _Predicate::first_argument_type,
+ typename _Predicate::second_argument_type,
+ bool>
+{
+ _Predicate __pred_;
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit _LIBCPP_CONSTEXPR_AFTER_CXX11
+ binary_negate(const _Predicate& __pred) : __pred_(__pred) {}
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const typename _Predicate::first_argument_type& __x,
+ const typename _Predicate::second_argument_type& __y) const
+ {return !__pred_(__x, __y);}
+};
+
+template <class _Predicate>
+_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+binary_negate<_Predicate>
+not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
+
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_BIND_H
+#define _LIBCPP___FUNCTIONAL_BIND_H
+
+#include <__config>
+#include <__functional/weak_result_type.h>
+#include <__functional/invoke.h>
+#include <cstddef>
+#include <tuple>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _Tp> struct __is_bind_expression : public false_type {};
+template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_bind_expression
+ : public __is_bind_expression<typename remove_cv<_Tp>::type> {};
+
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+_LIBCPP_INLINE_VAR constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
+#endif
+
+template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
+template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_placeholder
+ : public __is_placeholder<typename remove_cv<_Tp>::type> {};
+
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+_LIBCPP_INLINE_VAR constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
+#endif
+
+namespace placeholders
+{
+
+template <int _Np> struct __ph {};
+
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
+_LIBCPP_FUNC_VIS extern const __ph<1> _1;
+_LIBCPP_FUNC_VIS extern const __ph<2> _2;
+_LIBCPP_FUNC_VIS extern const __ph<3> _3;
+_LIBCPP_FUNC_VIS extern const __ph<4> _4;
+_LIBCPP_FUNC_VIS extern const __ph<5> _5;
+_LIBCPP_FUNC_VIS extern const __ph<6> _6;
+_LIBCPP_FUNC_VIS extern const __ph<7> _7;
+_LIBCPP_FUNC_VIS extern const __ph<8> _8;
+_LIBCPP_FUNC_VIS extern const __ph<9> _9;
+_LIBCPP_FUNC_VIS extern const __ph<10> _10;
+#else
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<1> _1{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<2> _2{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<3> _3{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<4> _4{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<5> _5{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<6> _6{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<7> _7{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<8> _8{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<9> _9{};
+/* _LIBCPP_INLINE_VAR */ constexpr __ph<10> _10{};
+#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
+
+} // placeholders
+
+template<int _Np>
+struct __is_placeholder<placeholders::__ph<_Np> >
+ : public integral_constant<int, _Np> {};
+
+
+#ifndef _LIBCPP_CXX03_LANG
+
+template <class _Tp, class _Uj>
+inline _LIBCPP_INLINE_VISIBILITY
+_Tp&
+__mu(reference_wrapper<_Tp> __t, _Uj&)
+{
+ return __t.get();
+}
+
+template <class _Ti, class ..._Uj, size_t ..._Indx>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __invoke_of<_Ti&, _Uj...>::type
+__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
+{
+ return __ti(_VSTD::forward<_Uj>(_VSTD::get<_Indx>(__uj))...);
+}
+
+template <class _Ti, class ..._Uj>
+inline _LIBCPP_INLINE_VISIBILITY
+typename _EnableIf
+<
+ is_bind_expression<_Ti>::value,
+ __invoke_of<_Ti&, _Uj...>
+>::type
+__mu(_Ti& __ti, tuple<_Uj...>& __uj)
+{
+ typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;
+ return _VSTD::__mu_expand(__ti, __uj, __indices());
+}
+
+template <bool IsPh, class _Ti, class _Uj>
+struct __mu_return2 {};
+
+template <class _Ti, class _Uj>
+struct __mu_return2<true, _Ti, _Uj>
+{
+ typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type;
+};
+
+template <class _Ti, class _Uj>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
+ 0 < is_placeholder<_Ti>::value,
+ typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
+>::type
+__mu(_Ti&, _Uj& __uj)
+{
+ const size_t _Indx = is_placeholder<_Ti>::value - 1;
+ return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_VSTD::get<_Indx>(__uj));
+}
+
+template <class _Ti, class _Uj>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
+ !is_bind_expression<_Ti>::value &&
+ is_placeholder<_Ti>::value == 0 &&
+ !__is_reference_wrapper<_Ti>::value,
+ _Ti&
+>::type
+__mu(_Ti& __ti, _Uj&)
+{
+ return __ti;
+}
+
+template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh,
+ class _TupleUj>
+struct __mu_return_impl;
+
+template <bool _Invokable, class _Ti, class ..._Uj>
+struct __mu_return_invokable // false
+{
+ typedef __nat type;
+};
+
+template <class _Ti, class ..._Uj>
+struct __mu_return_invokable<true, _Ti, _Uj...>
+{
+ typedef typename __invoke_of<_Ti&, _Uj...>::type type;
+};
+
+template <class _Ti, class ..._Uj>
+struct __mu_return_impl<_Ti, false, true, false, tuple<_Uj...> >
+ : public __mu_return_invokable<__invokable<_Ti&, _Uj...>::value, _Ti, _Uj...>
+{
+};
+
+template <class _Ti, class _TupleUj>
+struct __mu_return_impl<_Ti, false, false, true, _TupleUj>
+{
+ typedef typename tuple_element<is_placeholder<_Ti>::value - 1,
+ _TupleUj>::type&& type;
+};
+
+template <class _Ti, class _TupleUj>
+struct __mu_return_impl<_Ti, true, false, false, _TupleUj>
+{
+ typedef typename _Ti::type& type;
+};
+
+template <class _Ti, class _TupleUj>
+struct __mu_return_impl<_Ti, false, false, false, _TupleUj>
+{
+ typedef _Ti& type;
+};
+
+template <class _Ti, class _TupleUj>
+struct __mu_return
+ : public __mu_return_impl<_Ti,
+ __is_reference_wrapper<_Ti>::value,
+ is_bind_expression<_Ti>::value,
+ 0 < is_placeholder<_Ti>::value &&
+ is_placeholder<_Ti>::value <= tuple_size<_TupleUj>::value,
+ _TupleUj>
+{
+};
+
+template <class _Fp, class _BoundArgs, class _TupleUj>
+struct __is_valid_bind_return
+{
+ static const bool value = false;
+};
+
+template <class _Fp, class ..._BoundArgs, class _TupleUj>
+struct __is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>
+{
+ static const bool value = __invokable<_Fp,
+ typename __mu_return<_BoundArgs, _TupleUj>::type...>::value;
+};
+
+template <class _Fp, class ..._BoundArgs, class _TupleUj>
+struct __is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj>
+{
+ static const bool value = __invokable<_Fp,
+ typename __mu_return<const _BoundArgs, _TupleUj>::type...>::value;
+};
+
+template <class _Fp, class _BoundArgs, class _TupleUj,
+ bool = __is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value>
+struct __bind_return;
+
+template <class _Fp, class ..._BoundArgs, class _TupleUj>
+struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj, true>
+{
+ typedef typename __invoke_of
+ <
+ _Fp&,
+ typename __mu_return
+ <
+ _BoundArgs,
+ _TupleUj
+ >::type...
+ >::type type;
+};
+
+template <class _Fp, class ..._BoundArgs, class _TupleUj>
+struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true>
+{
+ typedef typename __invoke_of
+ <
+ _Fp&,
+ typename __mu_return
+ <
+ const _BoundArgs,
+ _TupleUj
+ >::type...
+ >::type type;
+};
+
+template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __bind_return<_Fp, _BoundArgs, _Args>::type
+__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
+ _Args&& __args)
+{
+ return _VSTD::__invoke(__f, _VSTD::__mu(_VSTD::get<_Indx>(__bound_args), __args)...);
+}
+
+template<class _Fp, class ..._BoundArgs>
+class __bind
+#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public __weak_result_type<typename decay<_Fp>::type>
+#endif
+{
+protected:
+ typedef typename decay<_Fp>::type _Fd;
+ typedef tuple<typename decay<_BoundArgs>::type...> _Td;
+private:
+ _Fd __f_;
+ _Td __bound_args_;
+
+ typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
+public:
+ template <class _Gp, class ..._BA,
+ class = typename enable_if
+ <
+ is_constructible<_Fd, _Gp>::value &&
+ !is_same<typename remove_reference<_Gp>::type,
+ __bind>::value
+ >::type>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
+ : __f_(_VSTD::forward<_Gp>(__f)),
+ __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
+
+ template <class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
+ operator()(_Args&& ...__args)
+ {
+ return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
+ tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
+ }
+
+ template <class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
+ operator()(_Args&& ...__args) const
+ {
+ return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
+ tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
+ }
+};
+
+template<class _Fp, class ..._BoundArgs>
+struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {};
+
+template<class _Rp, class _Fp, class ..._BoundArgs>
+class __bind_r
+ : public __bind<_Fp, _BoundArgs...>
+{
+ typedef __bind<_Fp, _BoundArgs...> base;
+ typedef typename base::_Fd _Fd;
+ typedef typename base::_Td _Td;
+public:
+ typedef _Rp result_type;
+
+
+ template <class _Gp, class ..._BA,
+ class = typename enable_if
+ <
+ is_constructible<_Fd, _Gp>::value &&
+ !is_same<typename remove_reference<_Gp>::type,
+ __bind_r>::value
+ >::type>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)
+ : base(_VSTD::forward<_Gp>(__f),
+ _VSTD::forward<_BA>(__bound_args)...) {}
+
+ template <class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ typename enable_if
+ <
+ is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
+ result_type>::value || is_void<_Rp>::value,
+ result_type
+ >::type
+ operator()(_Args&& ...__args)
+ {
+ typedef __invoke_void_return_wrapper<_Rp> _Invoker;
+ return _Invoker::__call(static_cast<base&>(*this), _VSTD::forward<_Args>(__args)...);
+ }
+
+ template <class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ typename enable_if
+ <
+ is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
+ result_type>::value || is_void<_Rp>::value,
+ result_type
+ >::type
+ operator()(_Args&& ...__args) const
+ {
+ typedef __invoke_void_return_wrapper<_Rp> _Invoker;
+ return _Invoker::__call(static_cast<base const&>(*this), _VSTD::forward<_Args>(__args)...);
+ }
+};
+
+template<class _Rp, class _Fp, class ..._BoundArgs>
+struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
+
+template<class _Fp, class ..._BoundArgs>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+__bind<_Fp, _BoundArgs...>
+bind(_Fp&& __f, _BoundArgs&&... __bound_args)
+{
+ typedef __bind<_Fp, _BoundArgs...> type;
+ return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
+}
+
+template<class _Rp, class _Fp, class ..._BoundArgs>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+__bind_r<_Rp, _Fp, _BoundArgs...>
+bind(_Fp&& __f, _BoundArgs&&... __bound_args)
+{
+ typedef __bind_r<_Rp, _Fp, _BoundArgs...> type;
+ return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
+}
+
+#endif // _LIBCPP_CXX03_LANG
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_BIND_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_BIND_FRONT_H
+#define _LIBCPP___FUNCTIONAL_BIND_FRONT_H
+
+#include <__config>
+#include <__functional/perfect_forward.h>
+#include <__functional/invoke.h>
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17
+
+struct __bind_front_op
+{
+ template<class... _Args>
+ constexpr static auto __call(_Args&&... __args)
+ noexcept(noexcept(_VSTD::invoke(_VSTD::forward<_Args>(__args)...)))
+ -> decltype( _VSTD::invoke(_VSTD::forward<_Args>(__args)...))
+ { return _VSTD::invoke(_VSTD::forward<_Args>(__args)...); }
+};
+
+template<class _Fn, class... _Args,
+ class = _EnableIf<conjunction<is_constructible<decay_t<_Fn>, _Fn>,
+ is_move_constructible<decay_t<_Fn>>,
+ is_constructible<decay_t<_Args>, _Args>...,
+ is_move_constructible<decay_t<_Args>>...
+ >::value>>
+constexpr auto bind_front(_Fn&& __f, _Args&&... __args)
+{
+ return __perfect_forward<__bind_front_op, _Fn, _Args...>(_VSTD::forward<_Fn>(__f),
+ _VSTD::forward<_Args>(__args)...);
+}
+
+#endif // _LIBCPP_STD_VER > 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_BIND_FRONT_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_BINDER1ST_H
+#define _LIBCPP___FUNCTIONAL_BINDER1ST_H
+
+#include <__config>
+#include <__functional/unary_function.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+template <class __Operation>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder1st
+ : public unary_function<typename __Operation::second_argument_type,
+ typename __Operation::result_type>
+{
+protected:
+ __Operation op;
+ typename __Operation::first_argument_type value;
+public:
+ _LIBCPP_INLINE_VISIBILITY binder1st(const __Operation& __x,
+ const typename __Operation::first_argument_type __y)
+ : op(__x), value(__y) {}
+ _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
+ (typename __Operation::second_argument_type& __x) const
+ {return op(value, __x);}
+ _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
+ (const typename __Operation::second_argument_type& __x) const
+ {return op(value, __x);}
+};
+
+template <class __Operation, class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+binder1st<__Operation>
+bind1st(const __Operation& __op, const _Tp& __x)
+ {return binder1st<__Operation>(__op, __x);}
+
+#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_BINDER1ST_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_BINDER2ND_H
+#define _LIBCPP___FUNCTIONAL_BINDER2ND_H
+
+#include <__config>
+#include <__functional/unary_function.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+template <class __Operation>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder2nd
+ : public unary_function<typename __Operation::first_argument_type,
+ typename __Operation::result_type>
+{
+protected:
+ __Operation op;
+ typename __Operation::second_argument_type value;
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ binder2nd(const __Operation& __x, const typename __Operation::second_argument_type __y)
+ : op(__x), value(__y) {}
+ _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
+ ( typename __Operation::first_argument_type& __x) const
+ {return op(__x, value);}
+ _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
+ (const typename __Operation::first_argument_type& __x) const
+ {return op(__x, value);}
+};
+
+template <class __Operation, class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+binder2nd<__Operation>
+bind2nd(const __Operation& __op, const _Tp& __x)
+ {return binder2nd<__Operation>(__op, __x);}
+
+#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_BINDER2ND_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H
+#define _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H
+
+#include <__algorithm/search.h>
+#include <__config>
+#include <__functional/operations.h>
+#include <__iterator/iterator_traits.h>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+// default searcher
+template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
+class _LIBCPP_TEMPLATE_VIS default_searcher {
+public:
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ default_searcher(_ForwardIterator __f, _ForwardIterator __l,
+ _BinaryPredicate __p = _BinaryPredicate())
+ : __first_(__f), __last_(__l), __pred_(__p) {}
+
+ template <typename _ForwardIterator2>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ pair<_ForwardIterator2, _ForwardIterator2>
+ operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
+ {
+ return _VSTD::__search(__f, __l, __first_, __last_, __pred_,
+ typename iterator_traits<_ForwardIterator>::iterator_category(),
+ typename iterator_traits<_ForwardIterator2>::iterator_category());
+ }
+
+private:
+ _ForwardIterator __first_;
+ _ForwardIterator __last_;
+ _BinaryPredicate __pred_;
+ };
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_FUNCTION_H
+#define _LIBCPP___FUNCTIONAL_FUNCTION_H
+
+#include <__config>
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/unary_function.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/shared_ptr.h>
+#include <exception>
+#include <memory> // TODO: replace with <__memory/__builtin_new_allocator.h>
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// bad_function_call
+
+class _LIBCPP_EXCEPTION_ABI bad_function_call
+ : public exception
+{
+#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+public:
+ virtual ~bad_function_call() _NOEXCEPT;
+
+ virtual const char* what() const _NOEXCEPT;
+#endif
+};
+
+_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+void __throw_bad_function_call()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_function_call();
+#else
+ _VSTD::abort();
+#endif
+}
+
+#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) && __has_attribute(deprecated)
+# define _LIBCPP_DEPRECATED_CXX03_FUNCTION \
+ __attribute__((deprecated("Using std::function in C++03 is not supported anymore. Please upgrade to C++11 or later, or use a different type")))
+#else
+# define _LIBCPP_DEPRECATED_CXX03_FUNCTION /* nothing */
+#endif
+
+template<class _Fp> class _LIBCPP_DEPRECATED_CXX03_FUNCTION _LIBCPP_TEMPLATE_VIS function; // undefined
+
+namespace __function
+{
+
+template<class _Rp>
+struct __maybe_derive_from_unary_function
+{
+};
+
+template<class _Rp, class _A1>
+struct __maybe_derive_from_unary_function<_Rp(_A1)>
+ : public unary_function<_A1, _Rp>
+{
+};
+
+template<class _Rp>
+struct __maybe_derive_from_binary_function
+{
+};
+
+template<class _Rp, class _A1, class _A2>
+struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)>
+ : public binary_function<_A1, _A2, _Rp>
+{
+};
+
+template <class _Fp>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(_Fp const&) { return true; }
+
+template <class _Fp>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(_Fp* __ptr) { return __ptr; }
+
+template <class _Ret, class _Class>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(_Ret _Class::*__ptr) { return __ptr; }
+
+template <class _Fp>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(function<_Fp> const& __f) { return !!__f; }
+
+#ifdef _LIBCPP_HAS_EXTENSION_BLOCKS
+template <class _Rp, class ..._Args>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(_Rp (^__p)(_Args...)) { return __p; }
+#endif
+
+} // namespace __function
+
+#ifndef _LIBCPP_CXX03_LANG
+
+namespace __function {
+
+// __alloc_func holds a functor and an allocator.
+
+template <class _Fp, class _Ap, class _FB> class __alloc_func;
+template <class _Fp, class _FB>
+class __default_alloc_func;
+
+template <class _Fp, class _Ap, class _Rp, class... _ArgTypes>
+class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)>
+{
+ __compressed_pair<_Fp, _Ap> __f_;
+
+ public:
+ typedef _LIBCPP_NODEBUG_TYPE _Fp _Target;
+ typedef _LIBCPP_NODEBUG_TYPE _Ap _Alloc;
+
+ _LIBCPP_INLINE_VISIBILITY
+ const _Target& __target() const { return __f_.first(); }
+
+ // WIN32 APIs may define __allocator, so use __get_allocator instead.
+ _LIBCPP_INLINE_VISIBILITY
+ const _Alloc& __get_allocator() const { return __f_.second(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __alloc_func(_Target&& __f)
+ : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
+ _VSTD::forward_as_tuple())
+ {
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __alloc_func(const _Target& __f, const _Alloc& __a)
+ : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
+ _VSTD::forward_as_tuple(__a))
+ {
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __alloc_func(const _Target& __f, _Alloc&& __a)
+ : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
+ _VSTD::forward_as_tuple(_VSTD::move(__a)))
+ {
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __alloc_func(_Target&& __f, _Alloc&& __a)
+ : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
+ _VSTD::forward_as_tuple(_VSTD::move(__a)))
+ {
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ _Rp operator()(_ArgTypes&&... __arg)
+ {
+ typedef __invoke_void_return_wrapper<_Rp> _Invoker;
+ return _Invoker::__call(__f_.first(),
+ _VSTD::forward<_ArgTypes>(__arg)...);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __alloc_func* __clone() const
+ {
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef
+ typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type
+ _AA;
+ _AA __a(__f_.second());
+ typedef __allocator_destructor<_AA> _Dp;
+ unique_ptr<__alloc_func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) __alloc_func(__f_.first(), _Alloc(__a));
+ return __hold.release();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void destroy() _NOEXCEPT { __f_.~__compressed_pair<_Target, _Alloc>(); }
+
+ static void __destroy_and_delete(__alloc_func* __f) {
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type
+ _FunAlloc;
+ _FunAlloc __a(__f->__get_allocator());
+ __f->destroy();
+ __a.deallocate(__f, 1);
+ }
+};
+
+template <class _Fp, class _Rp, class... _ArgTypes>
+class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> {
+ _Fp __f_;
+
+public:
+ typedef _LIBCPP_NODEBUG_TYPE _Fp _Target;
+
+ _LIBCPP_INLINE_VISIBILITY
+ const _Target& __target() const { return __f_; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __default_alloc_func(_Target&& __f) : __f_(_VSTD::move(__f)) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __default_alloc_func(const _Target& __f) : __f_(__f) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ _Rp operator()(_ArgTypes&&... __arg) {
+ typedef __invoke_void_return_wrapper<_Rp> _Invoker;
+ return _Invoker::__call(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __default_alloc_func* __clone() const {
+ __builtin_new_allocator::__holder_t __hold =
+ __builtin_new_allocator::__allocate_type<__default_alloc_func>(1);
+ __default_alloc_func* __res =
+ ::new ((void*)__hold.get()) __default_alloc_func(__f_);
+ (void)__hold.release();
+ return __res;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void destroy() _NOEXCEPT { __f_.~_Target(); }
+
+ static void __destroy_and_delete(__default_alloc_func* __f) {
+ __f->destroy();
+ __builtin_new_allocator::__deallocate_type<__default_alloc_func>(__f, 1);
+ }
+};
+
+// __base provides an abstract interface for copyable functors.
+
+template<class _Fp> class _LIBCPP_TEMPLATE_VIS __base;
+
+template<class _Rp, class ..._ArgTypes>
+class __base<_Rp(_ArgTypes...)>
+{
+ __base(const __base&);
+ __base& operator=(const __base&);
+public:
+ _LIBCPP_INLINE_VISIBILITY __base() {}
+ _LIBCPP_INLINE_VISIBILITY virtual ~__base() {}
+ virtual __base* __clone() const = 0;
+ virtual void __clone(__base*) const = 0;
+ virtual void destroy() _NOEXCEPT = 0;
+ virtual void destroy_deallocate() _NOEXCEPT = 0;
+ virtual _Rp operator()(_ArgTypes&& ...) = 0;
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const _NOEXCEPT = 0;
+ virtual const std::type_info& target_type() const _NOEXCEPT = 0;
+#endif // _LIBCPP_NO_RTTI
+};
+
+// __func implements __base for a given functor type.
+
+template<class _FD, class _Alloc, class _FB> class __func;
+
+template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
+class __func<_Fp, _Alloc, _Rp(_ArgTypes...)>
+ : public __base<_Rp(_ArgTypes...)>
+{
+ __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> __f_;
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __func(_Fp&& __f)
+ : __f_(_VSTD::move(__f)) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __func(const _Fp& __f, const _Alloc& __a)
+ : __f_(__f, __a) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __func(const _Fp& __f, _Alloc&& __a)
+ : __f_(__f, _VSTD::move(__a)) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __func(_Fp&& __f, _Alloc&& __a)
+ : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+
+ virtual __base<_Rp(_ArgTypes...)>* __clone() const;
+ virtual void __clone(__base<_Rp(_ArgTypes...)>*) const;
+ virtual void destroy() _NOEXCEPT;
+ virtual void destroy_deallocate() _NOEXCEPT;
+ virtual _Rp operator()(_ArgTypes&&... __arg);
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const _NOEXCEPT;
+ virtual const std::type_info& target_type() const _NOEXCEPT;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
+__base<_Rp(_ArgTypes...)>*
+__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone() const
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.__get_allocator());
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) __func(__f_.__target(), _Alloc(__a));
+ return __hold.release();
+}
+
+template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
+void
+__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const
+{
+ ::new ((void*)__p) __func(__f_.__target(), __f_.__get_allocator());
+}
+
+template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
+void
+__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy() _NOEXCEPT
+{
+ __f_.destroy();
+}
+
+template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
+void
+__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate() _NOEXCEPT
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.__get_allocator());
+ __f_.destroy();
+ __a.deallocate(this, 1);
+}
+
+template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
+_Rp
+__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
+{
+ return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
+const void*
+__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT
+{
+ if (__ti == typeid(_Fp))
+ return &__f_.__target();
+ return nullptr;
+}
+
+template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
+const std::type_info&
+__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
+{
+ return typeid(_Fp);
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+// __value_func creates a value-type from a __func.
+
+template <class _Fp> class __value_func;
+
+template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
+{
+ typename aligned_storage<3 * sizeof(void*)>::type __buf_;
+
+ typedef __base<_Rp(_ArgTypes...)> __func;
+ __func* __f_;
+
+ _LIBCPP_NO_CFI static __func* __as_base(void* p)
+ {
+ return reinterpret_cast<__func*>(p);
+ }
+
+ public:
+ _LIBCPP_INLINE_VISIBILITY
+ __value_func() _NOEXCEPT : __f_(nullptr) {}
+
+ template <class _Fp, class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a)
+ : __f_(nullptr)
+ {
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun;
+ typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type
+ _FunAlloc;
+
+ if (__function::__not_null(__f))
+ {
+ _FunAlloc __af(__a);
+ if (sizeof(_Fun) <= sizeof(__buf_) &&
+ is_nothrow_copy_constructible<_Fp>::value &&
+ is_nothrow_copy_constructible<_FunAlloc>::value)
+ {
+ __f_ =
+ ::new ((void*)&__buf_) _Fun(_VSTD::move(__f), _Alloc(__af));
+ }
+ else
+ {
+ typedef __allocator_destructor<_FunAlloc> _Dp;
+ unique_ptr<__func, _Dp> __hold(__af.allocate(1), _Dp(__af, 1));
+ ::new ((void*)__hold.get()) _Fun(_VSTD::move(__f), _Alloc(__a));
+ __f_ = __hold.release();
+ }
+ }
+ }
+
+ template <class _Fp,
+ class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type>
+ _LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f)
+ : __value_func(_VSTD::forward<_Fp>(__f), allocator<_Fp>()) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ __value_func(const __value_func& __f)
+ {
+ if (__f.__f_ == nullptr)
+ __f_ = nullptr;
+ else if ((void*)__f.__f_ == &__f.__buf_)
+ {
+ __f_ = __as_base(&__buf_);
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __value_func(__value_func&& __f) _NOEXCEPT
+ {
+ if (__f.__f_ == nullptr)
+ __f_ = nullptr;
+ else if ((void*)__f.__f_ == &__f.__buf_)
+ {
+ __f_ = __as_base(&__buf_);
+ __f.__f_->__clone(__f_);
+ }
+ else
+ {
+ __f_ = __f.__f_;
+ __f.__f_ = nullptr;
+ }
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~__value_func()
+ {
+ if ((void*)__f_ == &__buf_)
+ __f_->destroy();
+ else if (__f_)
+ __f_->destroy_deallocate();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __value_func& operator=(__value_func&& __f)
+ {
+ *this = nullptr;
+ if (__f.__f_ == nullptr)
+ __f_ = nullptr;
+ else if ((void*)__f.__f_ == &__f.__buf_)
+ {
+ __f_ = __as_base(&__buf_);
+ __f.__f_->__clone(__f_);
+ }
+ else
+ {
+ __f_ = __f.__f_;
+ __f.__f_ = nullptr;
+ }
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __value_func& operator=(nullptr_t)
+ {
+ __func* __f = __f_;
+ __f_ = nullptr;
+ if ((void*)__f == &__buf_)
+ __f->destroy();
+ else if (__f)
+ __f->destroy_deallocate();
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ _Rp operator()(_ArgTypes&&... __args) const
+ {
+ if (__f_ == nullptr)
+ __throw_bad_function_call();
+ return (*__f_)(_VSTD::forward<_ArgTypes>(__args)...);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(__value_func& __f) _NOEXCEPT
+ {
+ if (&__f == this)
+ return;
+ if ((void*)__f_ == &__buf_ && (void*)__f.__f_ == &__f.__buf_)
+ {
+ typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
+ __func* __t = __as_base(&__tempbuf);
+ __f_->__clone(__t);
+ __f_->destroy();
+ __f_ = nullptr;
+ __f.__f_->__clone(__as_base(&__buf_));
+ __f.__f_->destroy();
+ __f.__f_ = nullptr;
+ __f_ = __as_base(&__buf_);
+ __t->__clone(__as_base(&__f.__buf_));
+ __t->destroy();
+ __f.__f_ = __as_base(&__f.__buf_);
+ }
+ else if ((void*)__f_ == &__buf_)
+ {
+ __f_->__clone(__as_base(&__f.__buf_));
+ __f_->destroy();
+ __f_ = __f.__f_;
+ __f.__f_ = __as_base(&__f.__buf_);
+ }
+ else if ((void*)__f.__f_ == &__f.__buf_)
+ {
+ __f.__f_->__clone(__as_base(&__buf_));
+ __f.__f_->destroy();
+ __f.__f_ = __f_;
+ __f_ = __as_base(&__buf_);
+ }
+ else
+ _VSTD::swap(__f_, __f.__f_);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit operator bool() const _NOEXCEPT { return __f_ != nullptr; }
+
+#ifndef _LIBCPP_NO_RTTI
+ _LIBCPP_INLINE_VISIBILITY
+ const std::type_info& target_type() const _NOEXCEPT
+ {
+ if (__f_ == nullptr)
+ return typeid(void);
+ return __f_->target_type();
+ }
+
+ template <typename _Tp>
+ _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
+ {
+ if (__f_ == nullptr)
+ return nullptr;
+ return (const _Tp*)__f_->target(typeid(_Tp));
+ }
+#endif // _LIBCPP_NO_RTTI
+};
+
+// Storage for a functor object, to be used with __policy to manage copy and
+// destruction.
+union __policy_storage
+{
+ mutable char __small[sizeof(void*) * 2];
+ void* __large;
+};
+
+// True if _Fun can safely be held in __policy_storage.__small.
+template <typename _Fun>
+struct __use_small_storage
+ : public integral_constant<
+ bool, sizeof(_Fun) <= sizeof(__policy_storage) &&
+ _LIBCPP_ALIGNOF(_Fun) <= _LIBCPP_ALIGNOF(__policy_storage) &&
+ is_trivially_copy_constructible<_Fun>::value &&
+ is_trivially_destructible<_Fun>::value> {};
+
+// Policy contains information about how to copy, destroy, and move the
+// underlying functor. You can think of it as a vtable of sorts.
+struct __policy
+{
+ // Used to copy or destroy __large values. null for trivial objects.
+ void* (*const __clone)(const void*);
+ void (*const __destroy)(void*);
+
+ // True if this is the null policy (no value).
+ const bool __is_null;
+
+ // The target type. May be null if RTTI is disabled.
+ const std::type_info* const __type_info;
+
+ // Returns a pointer to a static policy object suitable for the functor
+ // type.
+ template <typename _Fun>
+ _LIBCPP_INLINE_VISIBILITY static const __policy* __create()
+ {
+ return __choose_policy<_Fun>(__use_small_storage<_Fun>());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static const __policy* __create_empty()
+ {
+ static const _LIBCPP_CONSTEXPR __policy __policy_ = {nullptr, nullptr,
+ true,
+#ifndef _LIBCPP_NO_RTTI
+ &typeid(void)
+#else
+ nullptr
+#endif
+ };
+ return &__policy_;
+ }
+
+ private:
+ template <typename _Fun> static void* __large_clone(const void* __s)
+ {
+ const _Fun* __f = static_cast<const _Fun*>(__s);
+ return __f->__clone();
+ }
+
+ template <typename _Fun>
+ static void __large_destroy(void* __s) {
+ _Fun::__destroy_and_delete(static_cast<_Fun*>(__s));
+ }
+
+ template <typename _Fun>
+ _LIBCPP_INLINE_VISIBILITY static const __policy*
+ __choose_policy(/* is_small = */ false_type) {
+ static const _LIBCPP_CONSTEXPR __policy __policy_ = {
+ &__large_clone<_Fun>, &__large_destroy<_Fun>, false,
+#ifndef _LIBCPP_NO_RTTI
+ &typeid(typename _Fun::_Target)
+#else
+ nullptr
+#endif
+ };
+ return &__policy_;
+ }
+
+ template <typename _Fun>
+ _LIBCPP_INLINE_VISIBILITY static const __policy*
+ __choose_policy(/* is_small = */ true_type)
+ {
+ static const _LIBCPP_CONSTEXPR __policy __policy_ = {
+ nullptr, nullptr, false,
+#ifndef _LIBCPP_NO_RTTI
+ &typeid(typename _Fun::_Target)
+#else
+ nullptr
+#endif
+ };
+ return &__policy_;
+ }
+};
+
+// Used to choose between perfect forwarding or pass-by-value. Pass-by-value is
+// faster for types that can be passed in registers.
+template <typename _Tp>
+using __fast_forward =
+ typename conditional<is_scalar<_Tp>::value, _Tp, _Tp&&>::type;
+
+// __policy_invoker calls an instance of __alloc_func held in __policy_storage.
+
+template <class _Fp> struct __policy_invoker;
+
+template <class _Rp, class... _ArgTypes>
+struct __policy_invoker<_Rp(_ArgTypes...)>
+{
+ typedef _Rp (*__Call)(const __policy_storage*,
+ __fast_forward<_ArgTypes>...);
+
+ __Call __call_;
+
+ // Creates an invoker that throws bad_function_call.
+ _LIBCPP_INLINE_VISIBILITY
+ __policy_invoker() : __call_(&__call_empty) {}
+
+ // Creates an invoker that calls the given instance of __func.
+ template <typename _Fun>
+ _LIBCPP_INLINE_VISIBILITY static __policy_invoker __create()
+ {
+ return __policy_invoker(&__call_impl<_Fun>);
+ }
+
+ private:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __policy_invoker(__Call __c) : __call_(__c) {}
+
+ static _Rp __call_empty(const __policy_storage*,
+ __fast_forward<_ArgTypes>...)
+ {
+ __throw_bad_function_call();
+ }
+
+ template <typename _Fun>
+ static _Rp __call_impl(const __policy_storage* __buf,
+ __fast_forward<_ArgTypes>... __args)
+ {
+ _Fun* __f = reinterpret_cast<_Fun*>(__use_small_storage<_Fun>::value
+ ? &__buf->__small
+ : __buf->__large);
+ return (*__f)(_VSTD::forward<_ArgTypes>(__args)...);
+ }
+};
+
+// __policy_func uses a __policy and __policy_invoker to create a type-erased,
+// copyable functor.
+
+template <class _Fp> class __policy_func;
+
+template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
+{
+ // Inline storage for small objects.
+ __policy_storage __buf_;
+
+ // Calls the value stored in __buf_. This could technically be part of
+ // policy, but storing it here eliminates a level of indirection inside
+ // operator().
+ typedef __function::__policy_invoker<_Rp(_ArgTypes...)> __invoker;
+ __invoker __invoker_;
+
+ // The policy that describes how to move / copy / destroy __buf_. Never
+ // null, even if the function is empty.
+ const __policy* __policy_;
+
+ public:
+ _LIBCPP_INLINE_VISIBILITY
+ __policy_func() : __policy_(__policy::__create_empty()) {}
+
+ template <class _Fp, class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY __policy_func(_Fp&& __f, const _Alloc& __a)
+ : __policy_(__policy::__create_empty())
+ {
+ typedef __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun;
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type
+ _FunAlloc;
+
+ if (__function::__not_null(__f))
+ {
+ __invoker_ = __invoker::template __create<_Fun>();
+ __policy_ = __policy::__create<_Fun>();
+
+ _FunAlloc __af(__a);
+ if (__use_small_storage<_Fun>())
+ {
+ ::new ((void*)&__buf_.__small)
+ _Fun(_VSTD::move(__f), _Alloc(__af));
+ }
+ else
+ {
+ typedef __allocator_destructor<_FunAlloc> _Dp;
+ unique_ptr<_Fun, _Dp> __hold(__af.allocate(1), _Dp(__af, 1));
+ ::new ((void*)__hold.get())
+ _Fun(_VSTD::move(__f), _Alloc(__af));
+ __buf_.__large = __hold.release();
+ }
+ }
+ }
+
+ template <class _Fp, class = typename enable_if<!is_same<typename decay<_Fp>::type, __policy_func>::value>::type>
+ _LIBCPP_INLINE_VISIBILITY explicit __policy_func(_Fp&& __f)
+ : __policy_(__policy::__create_empty()) {
+ typedef __default_alloc_func<_Fp, _Rp(_ArgTypes...)> _Fun;
+
+ if (__function::__not_null(__f)) {
+ __invoker_ = __invoker::template __create<_Fun>();
+ __policy_ = __policy::__create<_Fun>();
+ if (__use_small_storage<_Fun>()) {
+ ::new ((void*)&__buf_.__small) _Fun(_VSTD::move(__f));
+ } else {
+ __builtin_new_allocator::__holder_t __hold =
+ __builtin_new_allocator::__allocate_type<_Fun>(1);
+ __buf_.__large = ::new ((void*)__hold.get()) _Fun(_VSTD::move(__f));
+ (void)__hold.release();
+ }
+ }
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __policy_func(const __policy_func& __f)
+ : __buf_(__f.__buf_), __invoker_(__f.__invoker_),
+ __policy_(__f.__policy_)
+ {
+ if (__policy_->__clone)
+ __buf_.__large = __policy_->__clone(__f.__buf_.__large);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __policy_func(__policy_func&& __f)
+ : __buf_(__f.__buf_), __invoker_(__f.__invoker_),
+ __policy_(__f.__policy_)
+ {
+ if (__policy_->__destroy)
+ {
+ __f.__policy_ = __policy::__create_empty();
+ __f.__invoker_ = __invoker();
+ }
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~__policy_func()
+ {
+ if (__policy_->__destroy)
+ __policy_->__destroy(__buf_.__large);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __policy_func& operator=(__policy_func&& __f)
+ {
+ *this = nullptr;
+ __buf_ = __f.__buf_;
+ __invoker_ = __f.__invoker_;
+ __policy_ = __f.__policy_;
+ __f.__policy_ = __policy::__create_empty();
+ __f.__invoker_ = __invoker();
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __policy_func& operator=(nullptr_t)
+ {
+ const __policy* __p = __policy_;
+ __policy_ = __policy::__create_empty();
+ __invoker_ = __invoker();
+ if (__p->__destroy)
+ __p->__destroy(__buf_.__large);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ _Rp operator()(_ArgTypes&&... __args) const
+ {
+ return __invoker_.__call_(_VSTD::addressof(__buf_),
+ _VSTD::forward<_ArgTypes>(__args)...);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(__policy_func& __f)
+ {
+ _VSTD::swap(__invoker_, __f.__invoker_);
+ _VSTD::swap(__policy_, __f.__policy_);
+ _VSTD::swap(__buf_, __f.__buf_);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit operator bool() const _NOEXCEPT
+ {
+ return !__policy_->__is_null;
+ }
+
+#ifndef _LIBCPP_NO_RTTI
+ _LIBCPP_INLINE_VISIBILITY
+ const std::type_info& target_type() const _NOEXCEPT
+ {
+ return *__policy_->__type_info;
+ }
+
+ template <typename _Tp>
+ _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
+ {
+ if (__policy_->__is_null || typeid(_Tp) != *__policy_->__type_info)
+ return nullptr;
+ if (__policy_->__clone) // Out of line storage.
+ return reinterpret_cast<const _Tp*>(__buf_.__large);
+ else
+ return reinterpret_cast<const _Tp*>(&__buf_.__small);
+ }
+#endif // _LIBCPP_NO_RTTI
+};
+
+#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
+
+extern "C" void *_Block_copy(const void *);
+extern "C" void _Block_release(const void *);
+
+template<class _Rp1, class ..._ArgTypes1, class _Alloc, class _Rp, class ..._ArgTypes>
+class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
+ : public __base<_Rp(_ArgTypes...)>
+{
+ typedef _Rp1(^__block_type)(_ArgTypes1...);
+ __block_type __f_;
+
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __func(__block_type const& __f)
+ : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
+ { }
+
+ // [TODO] add && to save on a retain
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __func(__block_type __f, const _Alloc& /* unused */)
+ : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
+ { }
+
+ virtual __base<_Rp(_ArgTypes...)>* __clone() const {
+ _LIBCPP_ASSERT(false,
+ "Block pointers are just pointers, so they should always fit into "
+ "std::function's small buffer optimization. This function should "
+ "never be invoked.");
+ return nullptr;
+ }
+
+ virtual void __clone(__base<_Rp(_ArgTypes...)>* __p) const {
+ ::new ((void*)__p) __func(__f_);
+ }
+
+ virtual void destroy() _NOEXCEPT {
+ if (__f_)
+ _Block_release(__f_);
+ __f_ = 0;
+ }
+
+ virtual void destroy_deallocate() _NOEXCEPT {
+ _LIBCPP_ASSERT(false,
+ "Block pointers are just pointers, so they should always fit into "
+ "std::function's small buffer optimization. This function should "
+ "never be invoked.");
+ }
+
+ virtual _Rp operator()(_ArgTypes&& ... __arg) {
+ return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
+ }
+
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(type_info const& __ti) const _NOEXCEPT {
+ if (__ti == typeid(__func::__block_type))
+ return &__f_;
+ return (const void*)nullptr;
+ }
+
+ virtual const std::type_info& target_type() const _NOEXCEPT {
+ return typeid(__func::__block_type);
+ }
+#endif // _LIBCPP_NO_RTTI
+};
+
+#endif // _LIBCPP_HAS_EXTENSION_BLOCKS && !_LIBCPP_HAS_OBJC_ARC
+
+} // __function
+
+template<class _Rp, class ..._ArgTypes>
+class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
+#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
+ public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
+#endif
+{
+#ifndef _LIBCPP_ABI_OPTIMIZED_FUNCTION
+ typedef __function::__value_func<_Rp(_ArgTypes...)> __func;
+#else
+ typedef __function::__policy_func<_Rp(_ArgTypes...)> __func;
+#endif
+
+ __func __f_;
+
+ template <class _Fp, bool = _And<
+ _IsNotSame<__uncvref_t<_Fp>, function>,
+ __invokable<_Fp, _ArgTypes...>
+ >::value>
+ struct __callable;
+ template <class _Fp>
+ struct __callable<_Fp, true>
+ {
+ static const bool value = is_void<_Rp>::value ||
+ __is_core_convertible<typename __invoke_of<_Fp, _ArgTypes...>::type,
+ _Rp>::value;
+ };
+ template <class _Fp>
+ struct __callable<_Fp, false>
+ {
+ static const bool value = false;
+ };
+
+ template <class _Fp>
+ using _EnableIfLValueCallable = typename enable_if<__callable<_Fp&>::value>::type;
+public:
+ typedef _Rp result_type;
+
+ // construct/copy/destroy:
+ _LIBCPP_INLINE_VISIBILITY
+ function() _NOEXCEPT { }
+ _LIBCPP_INLINE_VISIBILITY
+ function(nullptr_t) _NOEXCEPT {}
+ function(const function&);
+ function(function&&) _NOEXCEPT;
+ template<class _Fp, class = _EnableIfLValueCallable<_Fp>>
+ function(_Fp);
+
+#if _LIBCPP_STD_VER <= 14
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&) _NOEXCEPT {}
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&, nullptr_t) _NOEXCEPT {}
+ template<class _Alloc>
+ function(allocator_arg_t, const _Alloc&, const function&);
+ template<class _Alloc>
+ function(allocator_arg_t, const _Alloc&, function&&);
+ template<class _Fp, class _Alloc, class = _EnableIfLValueCallable<_Fp>>
+ function(allocator_arg_t, const _Alloc& __a, _Fp __f);
+#endif
+
+ function& operator=(const function&);
+ function& operator=(function&&) _NOEXCEPT;
+ function& operator=(nullptr_t) _NOEXCEPT;
+ template<class _Fp, class = _EnableIfLValueCallable<typename decay<_Fp>::type>>
+ function& operator=(_Fp&&);
+
+ ~function();
+
+ // function modifiers:
+ void swap(function&) _NOEXCEPT;
+
+#if _LIBCPP_STD_VER <= 14
+ template<class _Fp, class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(_Fp&& __f, const _Alloc& __a)
+ {function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);}
+#endif
+
+ // function capacity:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit operator bool() const _NOEXCEPT {
+ return static_cast<bool>(__f_);
+ }
+
+ // deleted overloads close possible hole in the type system
+ template<class _R2, class... _ArgTypes2>
+ bool operator==(const function<_R2(_ArgTypes2...)>&) const = delete;
+ template<class _R2, class... _ArgTypes2>
+ bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete;
+public:
+ // function invocation:
+ _Rp operator()(_ArgTypes...) const;
+
+#ifndef _LIBCPP_NO_RTTI
+ // function target access:
+ const std::type_info& target_type() const _NOEXCEPT;
+ template <typename _Tp> _Tp* target() _NOEXCEPT;
+ template <typename _Tp> const _Tp* target() const _NOEXCEPT;
+#endif // _LIBCPP_NO_RTTI
+};
+
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class _Rp, class ..._Ap>
+function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
+
+template<class _Fp>
+struct __strip_signature;
+
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile> { using type = _Rp(_Ap...); };
+
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) &> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const &> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile &> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile &> { using type = _Rp(_Ap...); };
+
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) noexcept> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const noexcept> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile noexcept> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile noexcept> { using type = _Rp(_Ap...); };
+
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) & noexcept> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const & noexcept> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile & noexcept> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type = _Rp(_Ap...); };
+
+template<class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
+function(_Fp) -> function<_Stripped>;
+#endif // !_LIBCPP_HAS_NO_DEDUCTION_GUIDES
+
+template<class _Rp, class ..._ArgTypes>
+function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {}
+
+#if _LIBCPP_STD_VER <= 14
+template<class _Rp, class ..._ArgTypes>
+template <class _Alloc>
+function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
+ const function& __f) : __f_(__f.__f_) {}
+#endif
+
+template <class _Rp, class... _ArgTypes>
+function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
+ : __f_(_VSTD::move(__f.__f_)) {}
+
+#if _LIBCPP_STD_VER <= 14
+template<class _Rp, class ..._ArgTypes>
+template <class _Alloc>
+function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
+ function&& __f)
+ : __f_(_VSTD::move(__f.__f_)) {}
+#endif
+
+template <class _Rp, class... _ArgTypes>
+template <class _Fp, class>
+function<_Rp(_ArgTypes...)>::function(_Fp __f) : __f_(_VSTD::move(__f)) {}
+
+#if _LIBCPP_STD_VER <= 14
+template <class _Rp, class... _ArgTypes>
+template <class _Fp, class _Alloc, class>
+function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a,
+ _Fp __f)
+ : __f_(_VSTD::move(__f), __a) {}
+#endif
+
+template<class _Rp, class ..._ArgTypes>
+function<_Rp(_ArgTypes...)>&
+function<_Rp(_ArgTypes...)>::operator=(const function& __f)
+{
+ function(__f).swap(*this);
+ return *this;
+}
+
+template<class _Rp, class ..._ArgTypes>
+function<_Rp(_ArgTypes...)>&
+function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
+{
+ __f_ = _VSTD::move(__f.__f_);
+ return *this;
+}
+
+template<class _Rp, class ..._ArgTypes>
+function<_Rp(_ArgTypes...)>&
+function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
+{
+ __f_ = nullptr;
+ return *this;
+}
+
+template<class _Rp, class ..._ArgTypes>
+template <class _Fp, class>
+function<_Rp(_ArgTypes...)>&
+function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f)
+{
+ function(_VSTD::forward<_Fp>(__f)).swap(*this);
+ return *this;
+}
+
+template<class _Rp, class ..._ArgTypes>
+function<_Rp(_ArgTypes...)>::~function() {}
+
+template<class _Rp, class ..._ArgTypes>
+void
+function<_Rp(_ArgTypes...)>::swap(function& __f) _NOEXCEPT
+{
+ __f_.swap(__f.__f_);
+}
+
+template<class _Rp, class ..._ArgTypes>
+_Rp
+function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
+{
+ return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Rp, class ..._ArgTypes>
+const std::type_info&
+function<_Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
+{
+ return __f_.target_type();
+}
+
+template<class _Rp, class ..._ArgTypes>
+template <typename _Tp>
+_Tp*
+function<_Rp(_ArgTypes...)>::target() _NOEXCEPT
+{
+ return (_Tp*)(__f_.template target<_Tp>());
+}
+
+template<class _Rp, class ..._ArgTypes>
+template <typename _Tp>
+const _Tp*
+function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT
+{
+ return __f_.template target<_Tp>();
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template <class _Rp, class... _ArgTypes>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;}
+
+template <class _Rp, class... _ArgTypes>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return !__f;}
+
+template <class _Rp, class... _ArgTypes>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;}
+
+template <class _Rp, class... _ArgTypes>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;}
+
+template <class _Rp, class... _ArgTypes>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
+{return __x.swap(__y);}
+
+#else // _LIBCPP_CXX03_LANG
+
+namespace __function {
+
+template<class _Fp> class __base;
+
+template<class _Rp>
+class __base<_Rp()>
+{
+ __base(const __base&);
+ __base& operator=(const __base&);
+public:
+ __base() {}
+ virtual ~__base() {}
+ virtual __base* __clone() const = 0;
+ virtual void __clone(__base*) const = 0;
+ virtual void destroy() = 0;
+ virtual void destroy_deallocate() = 0;
+ virtual _Rp operator()() = 0;
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const = 0;
+ virtual const std::type_info& target_type() const = 0;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Rp, class _A0>
+class __base<_Rp(_A0)>
+{
+ __base(const __base&);
+ __base& operator=(const __base&);
+public:
+ __base() {}
+ virtual ~__base() {}
+ virtual __base* __clone() const = 0;
+ virtual void __clone(__base*) const = 0;
+ virtual void destroy() = 0;
+ virtual void destroy_deallocate() = 0;
+ virtual _Rp operator()(_A0) = 0;
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const = 0;
+ virtual const std::type_info& target_type() const = 0;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Rp, class _A0, class _A1>
+class __base<_Rp(_A0, _A1)>
+{
+ __base(const __base&);
+ __base& operator=(const __base&);
+public:
+ __base() {}
+ virtual ~__base() {}
+ virtual __base* __clone() const = 0;
+ virtual void __clone(__base*) const = 0;
+ virtual void destroy() = 0;
+ virtual void destroy_deallocate() = 0;
+ virtual _Rp operator()(_A0, _A1) = 0;
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const = 0;
+ virtual const std::type_info& target_type() const = 0;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Rp, class _A0, class _A1, class _A2>
+class __base<_Rp(_A0, _A1, _A2)>
+{
+ __base(const __base&);
+ __base& operator=(const __base&);
+public:
+ __base() {}
+ virtual ~__base() {}
+ virtual __base* __clone() const = 0;
+ virtual void __clone(__base*) const = 0;
+ virtual void destroy() = 0;
+ virtual void destroy_deallocate() = 0;
+ virtual _Rp operator()(_A0, _A1, _A2) = 0;
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const = 0;
+ virtual const std::type_info& target_type() const = 0;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _FD, class _Alloc, class _FB> class __func;
+
+template<class _Fp, class _Alloc, class _Rp>
+class __func<_Fp, _Alloc, _Rp()>
+ : public __base<_Rp()>
+{
+ __compressed_pair<_Fp, _Alloc> __f_;
+public:
+ explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
+ explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+ virtual __base<_Rp()>* __clone() const;
+ virtual void __clone(__base<_Rp()>*) const;
+ virtual void destroy();
+ virtual void destroy_deallocate();
+ virtual _Rp operator()();
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const;
+ virtual const std::type_info& target_type() const;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Fp, class _Alloc, class _Rp>
+__base<_Rp()>*
+__func<_Fp, _Alloc, _Rp()>::__clone() const
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.second());
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a));
+ return __hold.release();
+}
+
+template<class _Fp, class _Alloc, class _Rp>
+void
+__func<_Fp, _Alloc, _Rp()>::__clone(__base<_Rp()>* __p) const
+{
+ ::new ((void*)__p) __func(__f_.first(), __f_.second());
+}
+
+template<class _Fp, class _Alloc, class _Rp>
+void
+__func<_Fp, _Alloc, _Rp()>::destroy()
+{
+ __f_.~__compressed_pair<_Fp, _Alloc>();
+}
+
+template<class _Fp, class _Alloc, class _Rp>
+void
+__func<_Fp, _Alloc, _Rp()>::destroy_deallocate()
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.second());
+ __f_.~__compressed_pair<_Fp, _Alloc>();
+ __a.deallocate(this, 1);
+}
+
+template<class _Fp, class _Alloc, class _Rp>
+_Rp
+__func<_Fp, _Alloc, _Rp()>::operator()()
+{
+ typedef __invoke_void_return_wrapper<_Rp> _Invoker;
+ return _Invoker::__call(__f_.first());
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Fp, class _Alloc, class _Rp>
+const void*
+__func<_Fp, _Alloc, _Rp()>::target(const type_info& __ti) const
+{
+ if (__ti == typeid(_Fp))
+ return &__f_.first();
+ return (const void*)0;
+}
+
+template<class _Fp, class _Alloc, class _Rp>
+const std::type_info&
+__func<_Fp, _Alloc, _Rp()>::target_type() const
+{
+ return typeid(_Fp);
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template<class _Fp, class _Alloc, class _Rp, class _A0>
+class __func<_Fp, _Alloc, _Rp(_A0)>
+ : public __base<_Rp(_A0)>
+{
+ __compressed_pair<_Fp, _Alloc> __f_;
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
+ _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
+ : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+ virtual __base<_Rp(_A0)>* __clone() const;
+ virtual void __clone(__base<_Rp(_A0)>*) const;
+ virtual void destroy();
+ virtual void destroy_deallocate();
+ virtual _Rp operator()(_A0);
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const;
+ virtual const std::type_info& target_type() const;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Fp, class _Alloc, class _Rp, class _A0>
+__base<_Rp(_A0)>*
+__func<_Fp, _Alloc, _Rp(_A0)>::__clone() const
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.second());
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a));
+ return __hold.release();
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0>
+void
+__func<_Fp, _Alloc, _Rp(_A0)>::__clone(__base<_Rp(_A0)>* __p) const
+{
+ ::new ((void*)__p) __func(__f_.first(), __f_.second());
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0>
+void
+__func<_Fp, _Alloc, _Rp(_A0)>::destroy()
+{
+ __f_.~__compressed_pair<_Fp, _Alloc>();
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0>
+void
+__func<_Fp, _Alloc, _Rp(_A0)>::destroy_deallocate()
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.second());
+ __f_.~__compressed_pair<_Fp, _Alloc>();
+ __a.deallocate(this, 1);
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0>
+_Rp
+__func<_Fp, _Alloc, _Rp(_A0)>::operator()(_A0 __a0)
+{
+ typedef __invoke_void_return_wrapper<_Rp> _Invoker;
+ return _Invoker::__call(__f_.first(), __a0);
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Fp, class _Alloc, class _Rp, class _A0>
+const void*
+__func<_Fp, _Alloc, _Rp(_A0)>::target(const type_info& __ti) const
+{
+ if (__ti == typeid(_Fp))
+ return &__f_.first();
+ return (const void*)0;
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0>
+const std::type_info&
+__func<_Fp, _Alloc, _Rp(_A0)>::target_type() const
+{
+ return typeid(_Fp);
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
+class __func<_Fp, _Alloc, _Rp(_A0, _A1)>
+ : public __base<_Rp(_A0, _A1)>
+{
+ __compressed_pair<_Fp, _Alloc> __f_;
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
+ _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
+ : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+ virtual __base<_Rp(_A0, _A1)>* __clone() const;
+ virtual void __clone(__base<_Rp(_A0, _A1)>*) const;
+ virtual void destroy();
+ virtual void destroy_deallocate();
+ virtual _Rp operator()(_A0, _A1);
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const;
+ virtual const std::type_info& target_type() const;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
+__base<_Rp(_A0, _A1)>*
+__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone() const
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.second());
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a));
+ return __hold.release();
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
+void
+__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone(__base<_Rp(_A0, _A1)>* __p) const
+{
+ ::new ((void*)__p) __func(__f_.first(), __f_.second());
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
+void
+__func<_Fp, _Alloc, _Rp(_A0, _A1)>::destroy()
+{
+ __f_.~__compressed_pair<_Fp, _Alloc>();
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
+void
+__func<_Fp, _Alloc, _Rp(_A0, _A1)>::destroy_deallocate()
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.second());
+ __f_.~__compressed_pair<_Fp, _Alloc>();
+ __a.deallocate(this, 1);
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
+_Rp
+__func<_Fp, _Alloc, _Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1)
+{
+ typedef __invoke_void_return_wrapper<_Rp> _Invoker;
+ return _Invoker::__call(__f_.first(), __a0, __a1);
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
+const void*
+__func<_Fp, _Alloc, _Rp(_A0, _A1)>::target(const type_info& __ti) const
+{
+ if (__ti == typeid(_Fp))
+ return &__f_.first();
+ return (const void*)0;
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
+const std::type_info&
+__func<_Fp, _Alloc, _Rp(_A0, _A1)>::target_type() const
+{
+ return typeid(_Fp);
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
+class __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>
+ : public __base<_Rp(_A0, _A1, _A2)>
+{
+ __compressed_pair<_Fp, _Alloc> __f_;
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
+ _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
+ : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+ virtual __base<_Rp(_A0, _A1, _A2)>* __clone() const;
+ virtual void __clone(__base<_Rp(_A0, _A1, _A2)>*) const;
+ virtual void destroy();
+ virtual void destroy_deallocate();
+ virtual _Rp operator()(_A0, _A1, _A2);
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* target(const type_info&) const;
+ virtual const std::type_info& target_type() const;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
+__base<_Rp(_A0, _A1, _A2)>*
+__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone() const
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.second());
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a));
+ return __hold.release();
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
+void
+__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone(__base<_Rp(_A0, _A1, _A2)>* __p) const
+{
+ ::new ((void*)__p) __func(__f_.first(), __f_.second());
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
+void
+__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::destroy()
+{
+ __f_.~__compressed_pair<_Fp, _Alloc>();
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
+void
+__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::destroy_deallocate()
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
+ _Ap __a(__f_.second());
+ __f_.~__compressed_pair<_Fp, _Alloc>();
+ __a.deallocate(this, 1);
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
+_Rp
+__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2)
+{
+ typedef __invoke_void_return_wrapper<_Rp> _Invoker;
+ return _Invoker::__call(__f_.first(), __a0, __a1, __a2);
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
+const void*
+__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target(const type_info& __ti) const
+{
+ if (__ti == typeid(_Fp))
+ return &__f_.first();
+ return (const void*)0;
+}
+
+template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
+const std::type_info&
+__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const
+{
+ return typeid(_Fp);
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+} // __function
+
+template<class _Rp>
+class _LIBCPP_TEMPLATE_VIS function<_Rp()>
+{
+ typedef __function::__base<_Rp()> __base;
+ aligned_storage<3*sizeof(void*)>::type __buf_;
+ __base* __f_;
+
+public:
+ typedef _Rp result_type;
+
+ // 20.7.16.2.1, construct/copy/destroy:
+ _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
+ _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
+ function(const function&);
+ template<class _Fp>
+ function(_Fp,
+ typename enable_if<!is_integral<_Fp>::value>::type* = 0);
+
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&) : __f_(0) {}
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
+ template<class _Alloc>
+ function(allocator_arg_t, const _Alloc&, const function&);
+ template<class _Fp, class _Alloc>
+ function(allocator_arg_t, const _Alloc& __a, _Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type* = 0);
+
+ function& operator=(const function&);
+ function& operator=(nullptr_t);
+ template<class _Fp>
+ typename enable_if
+ <
+ !is_integral<_Fp>::value,
+ function&
+ >::type
+ operator=(_Fp);
+
+ ~function();
+
+ // 20.7.16.2.2, function modifiers:
+ void swap(function&);
+ template<class _Fp, class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(_Fp __f, const _Alloc& __a)
+ {function(allocator_arg, __a, __f).swap(*this);}
+
+ // 20.7.16.2.3, function capacity:
+ _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
+
+private:
+ // deleted overloads close possible hole in the type system
+ template<class _R2>
+ bool operator==(const function<_R2()>&) const;// = delete;
+ template<class _R2>
+ bool operator!=(const function<_R2()>&) const;// = delete;
+public:
+ // 20.7.16.2.4, function invocation:
+ _Rp operator()() const;
+
+#ifndef _LIBCPP_NO_RTTI
+ // 20.7.16.2.5, function target access:
+ const std::type_info& target_type() const;
+ template <typename _Tp> _Tp* target();
+ template <typename _Tp> const _Tp* target() const;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Rp>
+function<_Rp()>::function(const function& __f)
+{
+ if (__f.__f_ == 0)
+ __f_ = 0;
+ else if (__f.__f_ == (const __base*)&__f.__buf_)
+ {
+ __f_ = (__base*)&__buf_;
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+}
+
+template<class _Rp>
+template<class _Alloc>
+function<_Rp()>::function(allocator_arg_t, const _Alloc&, const function& __f)
+{
+ if (__f.__f_ == 0)
+ __f_ = 0;
+ else if (__f.__f_ == (const __base*)&__f.__buf_)
+ {
+ __f_ = (__base*)&__buf_;
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+}
+
+template<class _Rp>
+template <class _Fp>
+function<_Rp()>::function(_Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type*)
+ : __f_(0)
+{
+ if (__function::__not_null(__f))
+ {
+ typedef __function::__func<_Fp, allocator<_Fp>, _Rp()> _FF;
+ if (sizeof(_FF) <= sizeof(__buf_))
+ {
+ __f_ = (__base*)&__buf_;
+ ::new ((void*)__f_) _FF(__f);
+ }
+ else
+ {
+ typedef allocator<_FF> _Ap;
+ _Ap __a;
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a));
+ __f_ = __hold.release();
+ }
+ }
+}
+
+template<class _Rp>
+template <class _Fp, class _Alloc>
+function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type*)
+ : __f_(0)
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ if (__function::__not_null(__f))
+ {
+ typedef __function::__func<_Fp, _Alloc, _Rp()> _FF;
+ if (sizeof(_FF) <= sizeof(__buf_))
+ {
+ __f_ = (__base*)&__buf_;
+ ::new ((void*)__f_) _FF(__f, __a0);
+ }
+ else
+ {
+ typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap;
+ _Ap __a(__a0);
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a));
+ __f_ = __hold.release();
+ }
+ }
+}
+
+template<class _Rp>
+function<_Rp()>&
+function<_Rp()>::operator=(const function& __f)
+{
+ if (__f)
+ function(__f).swap(*this);
+ else
+ *this = nullptr;
+ return *this;
+}
+
+template<class _Rp>
+function<_Rp()>&
+function<_Rp()>::operator=(nullptr_t)
+{
+ __base* __t = __f_;
+ __f_ = 0;
+ if (__t == (__base*)&__buf_)
+ __t->destroy();
+ else if (__t)
+ __t->destroy_deallocate();
+ return *this;
+}
+
+template<class _Rp>
+template <class _Fp>
+typename enable_if
+<
+ !is_integral<_Fp>::value,
+ function<_Rp()>&
+>::type
+function<_Rp()>::operator=(_Fp __f)
+{
+ function(_VSTD::move(__f)).swap(*this);
+ return *this;
+}
+
+template<class _Rp>
+function<_Rp()>::~function()
+{
+ if (__f_ == (__base*)&__buf_)
+ __f_->destroy();
+ else if (__f_)
+ __f_->destroy_deallocate();
+}
+
+template<class _Rp>
+void
+function<_Rp()>::swap(function& __f)
+{
+ if (_VSTD::addressof(__f) == this)
+ return;
+ if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
+ {
+ typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
+ __base* __t = (__base*)&__tempbuf;
+ __f_->__clone(__t);
+ __f_->destroy();
+ __f_ = 0;
+ __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->destroy();
+ __f.__f_ = 0;
+ __f_ = (__base*)&__buf_;
+ __t->__clone((__base*)&__f.__buf_);
+ __t->destroy();
+ __f.__f_ = (__base*)&__f.__buf_;
+ }
+ else if (__f_ == (__base*)&__buf_)
+ {
+ __f_->__clone((__base*)&__f.__buf_);
+ __f_->destroy();
+ __f_ = __f.__f_;
+ __f.__f_ = (__base*)&__f.__buf_;
+ }
+ else if (__f.__f_ == (__base*)&__f.__buf_)
+ {
+ __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->destroy();
+ __f.__f_ = __f_;
+ __f_ = (__base*)&__buf_;
+ }
+ else
+ _VSTD::swap(__f_, __f.__f_);
+}
+
+template<class _Rp>
+_Rp
+function<_Rp()>::operator()() const
+{
+ if (__f_ == 0)
+ __throw_bad_function_call();
+ return (*__f_)();
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Rp>
+const std::type_info&
+function<_Rp()>::target_type() const
+{
+ if (__f_ == 0)
+ return typeid(void);
+ return __f_->target_type();
+}
+
+template<class _Rp>
+template <typename _Tp>
+_Tp*
+function<_Rp()>::target()
+{
+ if (__f_ == 0)
+ return (_Tp*)0;
+ return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp)));
+}
+
+template<class _Rp>
+template <typename _Tp>
+const _Tp*
+function<_Rp()>::target() const
+{
+ if (__f_ == 0)
+ return (const _Tp*)0;
+ return (const _Tp*)__f_->target(typeid(_Tp));
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template<class _Rp, class _A0>
+class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)>
+ : public unary_function<_A0, _Rp>
+{
+ typedef __function::__base<_Rp(_A0)> __base;
+ aligned_storage<3*sizeof(void*)>::type __buf_;
+ __base* __f_;
+
+public:
+ typedef _Rp result_type;
+
+ // 20.7.16.2.1, construct/copy/destroy:
+ _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
+ _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
+ function(const function&);
+ template<class _Fp>
+ function(_Fp,
+ typename enable_if<!is_integral<_Fp>::value>::type* = 0);
+
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&) : __f_(0) {}
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
+ template<class _Alloc>
+ function(allocator_arg_t, const _Alloc&, const function&);
+ template<class _Fp, class _Alloc>
+ function(allocator_arg_t, const _Alloc& __a, _Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type* = 0);
+
+ function& operator=(const function&);
+ function& operator=(nullptr_t);
+ template<class _Fp>
+ typename enable_if
+ <
+ !is_integral<_Fp>::value,
+ function&
+ >::type
+ operator=(_Fp);
+
+ ~function();
+
+ // 20.7.16.2.2, function modifiers:
+ void swap(function&);
+ template<class _Fp, class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(_Fp __f, const _Alloc& __a)
+ {function(allocator_arg, __a, __f).swap(*this);}
+
+ // 20.7.16.2.3, function capacity:
+ _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
+
+private:
+ // deleted overloads close possible hole in the type system
+ template<class _R2, class _B0>
+ bool operator==(const function<_R2(_B0)>&) const;// = delete;
+ template<class _R2, class _B0>
+ bool operator!=(const function<_R2(_B0)>&) const;// = delete;
+public:
+ // 20.7.16.2.4, function invocation:
+ _Rp operator()(_A0) const;
+
+#ifndef _LIBCPP_NO_RTTI
+ // 20.7.16.2.5, function target access:
+ const std::type_info& target_type() const;
+ template <typename _Tp> _Tp* target();
+ template <typename _Tp> const _Tp* target() const;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Rp, class _A0>
+function<_Rp(_A0)>::function(const function& __f)
+{
+ if (__f.__f_ == 0)
+ __f_ = 0;
+ else if (__f.__f_ == (const __base*)&__f.__buf_)
+ {
+ __f_ = (__base*)&__buf_;
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+}
+
+template<class _Rp, class _A0>
+template<class _Alloc>
+function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc&, const function& __f)
+{
+ if (__f.__f_ == 0)
+ __f_ = 0;
+ else if (__f.__f_ == (const __base*)&__f.__buf_)
+ {
+ __f_ = (__base*)&__buf_;
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+}
+
+template<class _Rp, class _A0>
+template <class _Fp>
+function<_Rp(_A0)>::function(_Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type*)
+ : __f_(0)
+{
+ if (__function::__not_null(__f))
+ {
+ typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0)> _FF;
+ if (sizeof(_FF) <= sizeof(__buf_))
+ {
+ __f_ = (__base*)&__buf_;
+ ::new ((void*)__f_) _FF(__f);
+ }
+ else
+ {
+ typedef allocator<_FF> _Ap;
+ _Ap __a;
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a));
+ __f_ = __hold.release();
+ }
+ }
+}
+
+template<class _Rp, class _A0>
+template <class _Fp, class _Alloc>
+function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type*)
+ : __f_(0)
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ if (__function::__not_null(__f))
+ {
+ typedef __function::__func<_Fp, _Alloc, _Rp(_A0)> _FF;
+ if (sizeof(_FF) <= sizeof(__buf_))
+ {
+ __f_ = (__base*)&__buf_;
+ ::new ((void*)__f_) _FF(__f, __a0);
+ }
+ else
+ {
+ typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap;
+ _Ap __a(__a0);
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a));
+ __f_ = __hold.release();
+ }
+ }
+}
+
+template<class _Rp, class _A0>
+function<_Rp(_A0)>&
+function<_Rp(_A0)>::operator=(const function& __f)
+{
+ if (__f)
+ function(__f).swap(*this);
+ else
+ *this = nullptr;
+ return *this;
+}
+
+template<class _Rp, class _A0>
+function<_Rp(_A0)>&
+function<_Rp(_A0)>::operator=(nullptr_t)
+{
+ __base* __t = __f_;
+ __f_ = 0;
+ if (__t == (__base*)&__buf_)
+ __t->destroy();
+ else if (__t)
+ __t->destroy_deallocate();
+ return *this;
+}
+
+template<class _Rp, class _A0>
+template <class _Fp>
+typename enable_if
+<
+ !is_integral<_Fp>::value,
+ function<_Rp(_A0)>&
+>::type
+function<_Rp(_A0)>::operator=(_Fp __f)
+{
+ function(_VSTD::move(__f)).swap(*this);
+ return *this;
+}
+
+template<class _Rp, class _A0>
+function<_Rp(_A0)>::~function()
+{
+ if (__f_ == (__base*)&__buf_)
+ __f_->destroy();
+ else if (__f_)
+ __f_->destroy_deallocate();
+}
+
+template<class _Rp, class _A0>
+void
+function<_Rp(_A0)>::swap(function& __f)
+{
+ if (_VSTD::addressof(__f) == this)
+ return;
+ if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
+ {
+ typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
+ __base* __t = (__base*)&__tempbuf;
+ __f_->__clone(__t);
+ __f_->destroy();
+ __f_ = 0;
+ __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->destroy();
+ __f.__f_ = 0;
+ __f_ = (__base*)&__buf_;
+ __t->__clone((__base*)&__f.__buf_);
+ __t->destroy();
+ __f.__f_ = (__base*)&__f.__buf_;
+ }
+ else if (__f_ == (__base*)&__buf_)
+ {
+ __f_->__clone((__base*)&__f.__buf_);
+ __f_->destroy();
+ __f_ = __f.__f_;
+ __f.__f_ = (__base*)&__f.__buf_;
+ }
+ else if (__f.__f_ == (__base*)&__f.__buf_)
+ {
+ __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->destroy();
+ __f.__f_ = __f_;
+ __f_ = (__base*)&__buf_;
+ }
+ else
+ _VSTD::swap(__f_, __f.__f_);
+}
+
+template<class _Rp, class _A0>
+_Rp
+function<_Rp(_A0)>::operator()(_A0 __a0) const
+{
+ if (__f_ == 0)
+ __throw_bad_function_call();
+ return (*__f_)(__a0);
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Rp, class _A0>
+const std::type_info&
+function<_Rp(_A0)>::target_type() const
+{
+ if (__f_ == 0)
+ return typeid(void);
+ return __f_->target_type();
+}
+
+template<class _Rp, class _A0>
+template <typename _Tp>
+_Tp*
+function<_Rp(_A0)>::target()
+{
+ if (__f_ == 0)
+ return (_Tp*)0;
+ return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp)));
+}
+
+template<class _Rp, class _A0>
+template <typename _Tp>
+const _Tp*
+function<_Rp(_A0)>::target() const
+{
+ if (__f_ == 0)
+ return (const _Tp*)0;
+ return (const _Tp*)__f_->target(typeid(_Tp));
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template<class _Rp, class _A0, class _A1>
+class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)>
+ : public binary_function<_A0, _A1, _Rp>
+{
+ typedef __function::__base<_Rp(_A0, _A1)> __base;
+ aligned_storage<3*sizeof(void*)>::type __buf_;
+ __base* __f_;
+
+public:
+ typedef _Rp result_type;
+
+ // 20.7.16.2.1, construct/copy/destroy:
+ _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
+ _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
+ function(const function&);
+ template<class _Fp>
+ function(_Fp,
+ typename enable_if<!is_integral<_Fp>::value>::type* = 0);
+
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&) : __f_(0) {}
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
+ template<class _Alloc>
+ function(allocator_arg_t, const _Alloc&, const function&);
+ template<class _Fp, class _Alloc>
+ function(allocator_arg_t, const _Alloc& __a, _Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type* = 0);
+
+ function& operator=(const function&);
+ function& operator=(nullptr_t);
+ template<class _Fp>
+ typename enable_if
+ <
+ !is_integral<_Fp>::value,
+ function&
+ >::type
+ operator=(_Fp);
+
+ ~function();
+
+ // 20.7.16.2.2, function modifiers:
+ void swap(function&);
+ template<class _Fp, class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(_Fp __f, const _Alloc& __a)
+ {function(allocator_arg, __a, __f).swap(*this);}
+
+ // 20.7.16.2.3, function capacity:
+ _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
+
+private:
+ // deleted overloads close possible hole in the type system
+ template<class _R2, class _B0, class _B1>
+ bool operator==(const function<_R2(_B0, _B1)>&) const;// = delete;
+ template<class _R2, class _B0, class _B1>
+ bool operator!=(const function<_R2(_B0, _B1)>&) const;// = delete;
+public:
+ // 20.7.16.2.4, function invocation:
+ _Rp operator()(_A0, _A1) const;
+
+#ifndef _LIBCPP_NO_RTTI
+ // 20.7.16.2.5, function target access:
+ const std::type_info& target_type() const;
+ template <typename _Tp> _Tp* target();
+ template <typename _Tp> const _Tp* target() const;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Rp, class _A0, class _A1>
+function<_Rp(_A0, _A1)>::function(const function& __f)
+{
+ if (__f.__f_ == 0)
+ __f_ = 0;
+ else if (__f.__f_ == (const __base*)&__f.__buf_)
+ {
+ __f_ = (__base*)&__buf_;
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+}
+
+template<class _Rp, class _A0, class _A1>
+template<class _Alloc>
+function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc&, const function& __f)
+{
+ if (__f.__f_ == 0)
+ __f_ = 0;
+ else if (__f.__f_ == (const __base*)&__f.__buf_)
+ {
+ __f_ = (__base*)&__buf_;
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+}
+
+template<class _Rp, class _A0, class _A1>
+template <class _Fp>
+function<_Rp(_A0, _A1)>::function(_Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type*)
+ : __f_(0)
+{
+ if (__function::__not_null(__f))
+ {
+ typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1)> _FF;
+ if (sizeof(_FF) <= sizeof(__buf_))
+ {
+ __f_ = (__base*)&__buf_;
+ ::new ((void*)__f_) _FF(__f);
+ }
+ else
+ {
+ typedef allocator<_FF> _Ap;
+ _Ap __a;
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a));
+ __f_ = __hold.release();
+ }
+ }
+}
+
+template<class _Rp, class _A0, class _A1>
+template <class _Fp, class _Alloc>
+function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type*)
+ : __f_(0)
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ if (__function::__not_null(__f))
+ {
+ typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1)> _FF;
+ if (sizeof(_FF) <= sizeof(__buf_))
+ {
+ __f_ = (__base*)&__buf_;
+ ::new ((void*)__f_) _FF(__f, __a0);
+ }
+ else
+ {
+ typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap;
+ _Ap __a(__a0);
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a));
+ __f_ = __hold.release();
+ }
+ }
+}
+
+template<class _Rp, class _A0, class _A1>
+function<_Rp(_A0, _A1)>&
+function<_Rp(_A0, _A1)>::operator=(const function& __f)
+{
+ if (__f)
+ function(__f).swap(*this);
+ else
+ *this = nullptr;
+ return *this;
+}
+
+template<class _Rp, class _A0, class _A1>
+function<_Rp(_A0, _A1)>&
+function<_Rp(_A0, _A1)>::operator=(nullptr_t)
+{
+ __base* __t = __f_;
+ __f_ = 0;
+ if (__t == (__base*)&__buf_)
+ __t->destroy();
+ else if (__t)
+ __t->destroy_deallocate();
+ return *this;
+}
+
+template<class _Rp, class _A0, class _A1>
+template <class _Fp>
+typename enable_if
+<
+ !is_integral<_Fp>::value,
+ function<_Rp(_A0, _A1)>&
+>::type
+function<_Rp(_A0, _A1)>::operator=(_Fp __f)
+{
+ function(_VSTD::move(__f)).swap(*this);
+ return *this;
+}
+
+template<class _Rp, class _A0, class _A1>
+function<_Rp(_A0, _A1)>::~function()
+{
+ if (__f_ == (__base*)&__buf_)
+ __f_->destroy();
+ else if (__f_)
+ __f_->destroy_deallocate();
+}
+
+template<class _Rp, class _A0, class _A1>
+void
+function<_Rp(_A0, _A1)>::swap(function& __f)
+{
+ if (_VSTD::addressof(__f) == this)
+ return;
+ if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
+ {
+ typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
+ __base* __t = (__base*)&__tempbuf;
+ __f_->__clone(__t);
+ __f_->destroy();
+ __f_ = 0;
+ __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->destroy();
+ __f.__f_ = 0;
+ __f_ = (__base*)&__buf_;
+ __t->__clone((__base*)&__f.__buf_);
+ __t->destroy();
+ __f.__f_ = (__base*)&__f.__buf_;
+ }
+ else if (__f_ == (__base*)&__buf_)
+ {
+ __f_->__clone((__base*)&__f.__buf_);
+ __f_->destroy();
+ __f_ = __f.__f_;
+ __f.__f_ = (__base*)&__f.__buf_;
+ }
+ else if (__f.__f_ == (__base*)&__f.__buf_)
+ {
+ __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->destroy();
+ __f.__f_ = __f_;
+ __f_ = (__base*)&__buf_;
+ }
+ else
+ _VSTD::swap(__f_, __f.__f_);
+}
+
+template<class _Rp, class _A0, class _A1>
+_Rp
+function<_Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const
+{
+ if (__f_ == 0)
+ __throw_bad_function_call();
+ return (*__f_)(__a0, __a1);
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Rp, class _A0, class _A1>
+const std::type_info&
+function<_Rp(_A0, _A1)>::target_type() const
+{
+ if (__f_ == 0)
+ return typeid(void);
+ return __f_->target_type();
+}
+
+template<class _Rp, class _A0, class _A1>
+template <typename _Tp>
+_Tp*
+function<_Rp(_A0, _A1)>::target()
+{
+ if (__f_ == 0)
+ return (_Tp*)0;
+ return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp)));
+}
+
+template<class _Rp, class _A0, class _A1>
+template <typename _Tp>
+const _Tp*
+function<_Rp(_A0, _A1)>::target() const
+{
+ if (__f_ == 0)
+ return (const _Tp*)0;
+ return (const _Tp*)__f_->target(typeid(_Tp));
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template<class _Rp, class _A0, class _A1, class _A2>
+class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
+{
+ typedef __function::__base<_Rp(_A0, _A1, _A2)> __base;
+ aligned_storage<3*sizeof(void*)>::type __buf_;
+ __base* __f_;
+
+public:
+ typedef _Rp result_type;
+
+ // 20.7.16.2.1, construct/copy/destroy:
+ _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
+ _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
+ function(const function&);
+ template<class _Fp>
+ function(_Fp,
+ typename enable_if<!is_integral<_Fp>::value>::type* = 0);
+
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&) : __f_(0) {}
+ template<class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
+ template<class _Alloc>
+ function(allocator_arg_t, const _Alloc&, const function&);
+ template<class _Fp, class _Alloc>
+ function(allocator_arg_t, const _Alloc& __a, _Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type* = 0);
+
+ function& operator=(const function&);
+ function& operator=(nullptr_t);
+ template<class _Fp>
+ typename enable_if
+ <
+ !is_integral<_Fp>::value,
+ function&
+ >::type
+ operator=(_Fp);
+
+ ~function();
+
+ // 20.7.16.2.2, function modifiers:
+ void swap(function&);
+ template<class _Fp, class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(_Fp __f, const _Alloc& __a)
+ {function(allocator_arg, __a, __f).swap(*this);}
+
+ // 20.7.16.2.3, function capacity:
+ _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
+
+private:
+ // deleted overloads close possible hole in the type system
+ template<class _R2, class _B0, class _B1, class _B2>
+ bool operator==(const function<_R2(_B0, _B1, _B2)>&) const;// = delete;
+ template<class _R2, class _B0, class _B1, class _B2>
+ bool operator!=(const function<_R2(_B0, _B1, _B2)>&) const;// = delete;
+public:
+ // 20.7.16.2.4, function invocation:
+ _Rp operator()(_A0, _A1, _A2) const;
+
+#ifndef _LIBCPP_NO_RTTI
+ // 20.7.16.2.5, function target access:
+ const std::type_info& target_type() const;
+ template <typename _Tp> _Tp* target();
+ template <typename _Tp> const _Tp* target() const;
+#endif // _LIBCPP_NO_RTTI
+};
+
+template<class _Rp, class _A0, class _A1, class _A2>
+function<_Rp(_A0, _A1, _A2)>::function(const function& __f)
+{
+ if (__f.__f_ == 0)
+ __f_ = 0;
+ else if (__f.__f_ == (const __base*)&__f.__buf_)
+ {
+ __f_ = (__base*)&__buf_;
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+template<class _Alloc>
+function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc&,
+ const function& __f)
+{
+ if (__f.__f_ == 0)
+ __f_ = 0;
+ else if (__f.__f_ == (const __base*)&__f.__buf_)
+ {
+ __f_ = (__base*)&__buf_;
+ __f.__f_->__clone(__f_);
+ }
+ else
+ __f_ = __f.__f_->__clone();
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+template <class _Fp>
+function<_Rp(_A0, _A1, _A2)>::function(_Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type*)
+ : __f_(0)
+{
+ if (__function::__not_null(__f))
+ {
+ typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1, _A2)> _FF;
+ if (sizeof(_FF) <= sizeof(__buf_))
+ {
+ __f_ = (__base*)&__buf_;
+ ::new ((void*)__f_) _FF(__f);
+ }
+ else
+ {
+ typedef allocator<_FF> _Ap;
+ _Ap __a;
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a));
+ __f_ = __hold.release();
+ }
+ }
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+template <class _Fp, class _Alloc>
+function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
+ typename enable_if<!is_integral<_Fp>::value>::type*)
+ : __f_(0)
+{
+ typedef allocator_traits<_Alloc> __alloc_traits;
+ if (__function::__not_null(__f))
+ {
+ typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> _FF;
+ if (sizeof(_FF) <= sizeof(__buf_))
+ {
+ __f_ = (__base*)&__buf_;
+ ::new ((void*)__f_) _FF(__f, __a0);
+ }
+ else
+ {
+ typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap;
+ _Ap __a(__a0);
+ typedef __allocator_destructor<_Ap> _Dp;
+ unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a));
+ __f_ = __hold.release();
+ }
+ }
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+function<_Rp(_A0, _A1, _A2)>&
+function<_Rp(_A0, _A1, _A2)>::operator=(const function& __f)
+{
+ if (__f)
+ function(__f).swap(*this);
+ else
+ *this = nullptr;
+ return *this;
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+function<_Rp(_A0, _A1, _A2)>&
+function<_Rp(_A0, _A1, _A2)>::operator=(nullptr_t)
+{
+ __base* __t = __f_;
+ __f_ = 0;
+ if (__t == (__base*)&__buf_)
+ __t->destroy();
+ else if (__t)
+ __t->destroy_deallocate();
+ return *this;
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+template <class _Fp>
+typename enable_if
+<
+ !is_integral<_Fp>::value,
+ function<_Rp(_A0, _A1, _A2)>&
+>::type
+function<_Rp(_A0, _A1, _A2)>::operator=(_Fp __f)
+{
+ function(_VSTD::move(__f)).swap(*this);
+ return *this;
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+function<_Rp(_A0, _A1, _A2)>::~function()
+{
+ if (__f_ == (__base*)&__buf_)
+ __f_->destroy();
+ else if (__f_)
+ __f_->destroy_deallocate();
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+void
+function<_Rp(_A0, _A1, _A2)>::swap(function& __f)
+{
+ if (_VSTD::addressof(__f) == this)
+ return;
+ if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
+ {
+ typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
+ __base* __t = (__base*)&__tempbuf;
+ __f_->__clone(__t);
+ __f_->destroy();
+ __f_ = 0;
+ __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->destroy();
+ __f.__f_ = 0;
+ __f_ = (__base*)&__buf_;
+ __t->__clone((__base*)&__f.__buf_);
+ __t->destroy();
+ __f.__f_ = (__base*)&__f.__buf_;
+ }
+ else if (__f_ == (__base*)&__buf_)
+ {
+ __f_->__clone((__base*)&__f.__buf_);
+ __f_->destroy();
+ __f_ = __f.__f_;
+ __f.__f_ = (__base*)&__f.__buf_;
+ }
+ else if (__f.__f_ == (__base*)&__f.__buf_)
+ {
+ __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->destroy();
+ __f.__f_ = __f_;
+ __f_ = (__base*)&__buf_;
+ }
+ else
+ _VSTD::swap(__f_, __f.__f_);
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+_Rp
+function<_Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const
+{
+ if (__f_ == 0)
+ __throw_bad_function_call();
+ return (*__f_)(__a0, __a1, __a2);
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Rp, class _A0, class _A1, class _A2>
+const std::type_info&
+function<_Rp(_A0, _A1, _A2)>::target_type() const
+{
+ if (__f_ == 0)
+ return typeid(void);
+ return __f_->target_type();
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+template <typename _Tp>
+_Tp*
+function<_Rp(_A0, _A1, _A2)>::target()
+{
+ if (__f_ == 0)
+ return (_Tp*)0;
+ return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp)));
+}
+
+template<class _Rp, class _A0, class _A1, class _A2>
+template <typename _Tp>
+const _Tp*
+function<_Rp(_A0, _A1, _A2)>::target() const
+{
+ if (__f_ == 0)
+ return (const _Tp*)0;
+ return (const _Tp*)__f_->target(typeid(_Tp));
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template <class _Fp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(const function<_Fp>& __f, nullptr_t) {return !__f;}
+
+template <class _Fp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(nullptr_t, const function<_Fp>& __f) {return !__f;}
+
+template <class _Fp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const function<_Fp>& __f, nullptr_t) {return (bool)__f;}
+
+template <class _Fp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(nullptr_t, const function<_Fp>& __f) {return (bool)__f;}
+
+template <class _Fp>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+swap(function<_Fp>& __x, function<_Fp>& __y)
+{return __x.swap(__y);}
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_FUNCTION_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_HASH_H
+#define _LIBCPP___FUNCTIONAL_HASH_H
+
+#include <__config>
+#include <__functional/unary_function.h>
+#include <__tuple>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <__utility/pair.h>
+#include <__utility/swap.h>
+#include <cstdint>
+#include <cstring>
+#include <cstddef>
+#include <limits>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_Size
+__loadword(const void* __p)
+{
+ _Size __r;
+ _VSTD::memcpy(&__r, __p, sizeof(__r));
+ return __r;
+}
+
+// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
+// is 64 bits. This is because cityhash64 uses 64bit x 64bit
+// multiplication, which can be very slow on 32-bit systems.
+template <class _Size, size_t = sizeof(_Size)*__CHAR_BIT__>
+struct __murmur2_or_cityhash;
+
+template <class _Size>
+struct __murmur2_or_cityhash<_Size, 32>
+{
+ inline _Size operator()(const void* __key, _Size __len)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+};
+
+// murmur2
+template <class _Size>
+_Size
+__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
+{
+ const _Size __m = 0x5bd1e995;
+ const _Size __r = 24;
+ _Size __h = __len;
+ const unsigned char* __data = static_cast<const unsigned char*>(__key);
+ for (; __len >= 4; __data += 4, __len -= 4)
+ {
+ _Size __k = __loadword<_Size>(__data);
+ __k *= __m;
+ __k ^= __k >> __r;
+ __k *= __m;
+ __h *= __m;
+ __h ^= __k;
+ }
+ switch (__len)
+ {
+ case 3:
+ __h ^= static_cast<_Size>(__data[2] << 16);
+ _LIBCPP_FALLTHROUGH();
+ case 2:
+ __h ^= static_cast<_Size>(__data[1] << 8);
+ _LIBCPP_FALLTHROUGH();
+ case 1:
+ __h ^= __data[0];
+ __h *= __m;
+ }
+ __h ^= __h >> 13;
+ __h *= __m;
+ __h ^= __h >> 15;
+ return __h;
+}
+
+template <class _Size>
+struct __murmur2_or_cityhash<_Size, 64>
+{
+ inline _Size operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+
+ private:
+ // Some primes between 2^63 and 2^64.
+ static const _Size __k0 = 0xc3a5c85c97cb3127ULL;
+ static const _Size __k1 = 0xb492b66fbe98f273ULL;
+ static const _Size __k2 = 0x9ae16a3b2f90404fULL;
+ static const _Size __k3 = 0xc949d7c7509e6557ULL;
+
+ static _Size __rotate(_Size __val, int __shift) {
+ return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift)));
+ }
+
+ static _Size __rotate_by_at_least_1(_Size __val, int __shift) {
+ return (__val >> __shift) | (__val << (64 - __shift));
+ }
+
+ static _Size __shift_mix(_Size __val) {
+ return __val ^ (__val >> 47);
+ }
+
+ static _Size __hash_len_16(_Size __u, _Size __v)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ const _Size __mul = 0x9ddfea08eb382d69ULL;
+ _Size __a = (__u ^ __v) * __mul;
+ __a ^= (__a >> 47);
+ _Size __b = (__v ^ __a) * __mul;
+ __b ^= (__b >> 47);
+ __b *= __mul;
+ return __b;
+ }
+
+ static _Size __hash_len_0_to_16(const char* __s, _Size __len)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ if (__len > 8) {
+ const _Size __a = __loadword<_Size>(__s);
+ const _Size __b = __loadword<_Size>(__s + __len - 8);
+ return __hash_len_16(__a, __rotate_by_at_least_1(__b + __len, __len)) ^ __b;
+ }
+ if (__len >= 4) {
+ const uint32_t __a = __loadword<uint32_t>(__s);
+ const uint32_t __b = __loadword<uint32_t>(__s + __len - 4);
+ return __hash_len_16(__len + (__a << 3), __b);
+ }
+ if (__len > 0) {
+ const unsigned char __a = static_cast<unsigned char>(__s[0]);
+ const unsigned char __b = static_cast<unsigned char>(__s[__len >> 1]);
+ const unsigned char __c = static_cast<unsigned char>(__s[__len - 1]);
+ const uint32_t __y = static_cast<uint32_t>(__a) +
+ (static_cast<uint32_t>(__b) << 8);
+ const uint32_t __z = __len + (static_cast<uint32_t>(__c) << 2);
+ return __shift_mix(__y * __k2 ^ __z * __k3) * __k2;
+ }
+ return __k2;
+ }
+
+ static _Size __hash_len_17_to_32(const char *__s, _Size __len)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ const _Size __a = __loadword<_Size>(__s) * __k1;
+ const _Size __b = __loadword<_Size>(__s + 8);
+ const _Size __c = __loadword<_Size>(__s + __len - 8) * __k2;
+ const _Size __d = __loadword<_Size>(__s + __len - 16) * __k0;
+ return __hash_len_16(__rotate(__a - __b, 43) + __rotate(__c, 30) + __d,
+ __a + __rotate(__b ^ __k3, 20) - __c + __len);
+ }
+
+ // Return a 16-byte hash for 48 bytes. Quick and dirty.
+ // Callers do best to use "random-looking" values for a and b.
+ static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
+ _Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ __a += __w;
+ __b = __rotate(__b + __a + __z, 21);
+ const _Size __c = __a;
+ __a += __x;
+ __a += __y;
+ __b += __rotate(__a, 44);
+ return pair<_Size, _Size>(__a + __z, __b + __c);
+ }
+
+ // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.
+ static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
+ const char* __s, _Size __a, _Size __b)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ return __weak_hash_len_32_with_seeds(__loadword<_Size>(__s),
+ __loadword<_Size>(__s + 8),
+ __loadword<_Size>(__s + 16),
+ __loadword<_Size>(__s + 24),
+ __a,
+ __b);
+ }
+
+ // Return an 8-byte hash for 33 to 64 bytes.
+ static _Size __hash_len_33_to_64(const char *__s, size_t __len)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ _Size __z = __loadword<_Size>(__s + 24);
+ _Size __a = __loadword<_Size>(__s) +
+ (__len + __loadword<_Size>(__s + __len - 16)) * __k0;
+ _Size __b = __rotate(__a + __z, 52);
+ _Size __c = __rotate(__a, 37);
+ __a += __loadword<_Size>(__s + 8);
+ __c += __rotate(__a, 7);
+ __a += __loadword<_Size>(__s + 16);
+ _Size __vf = __a + __z;
+ _Size __vs = __b + __rotate(__a, 31) + __c;
+ __a = __loadword<_Size>(__s + 16) + __loadword<_Size>(__s + __len - 32);
+ __z += __loadword<_Size>(__s + __len - 8);
+ __b = __rotate(__a + __z, 52);
+ __c = __rotate(__a, 37);
+ __a += __loadword<_Size>(__s + __len - 24);
+ __c += __rotate(__a, 7);
+ __a += __loadword<_Size>(__s + __len - 16);
+ _Size __wf = __a + __z;
+ _Size __ws = __b + __rotate(__a, 31) + __c;
+ _Size __r = __shift_mix((__vf + __ws) * __k2 + (__wf + __vs) * __k0);
+ return __shift_mix(__r * __k0 + __vs) * __k2;
+ }
+};
+
+// cityhash64
+template <class _Size>
+_Size
+__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
+{
+ const char* __s = static_cast<const char*>(__key);
+ if (__len <= 32) {
+ if (__len <= 16) {
+ return __hash_len_0_to_16(__s, __len);
+ } else {
+ return __hash_len_17_to_32(__s, __len);
+ }
+ } else if (__len <= 64) {
+ return __hash_len_33_to_64(__s, __len);
+ }
+
+ // For strings over 64 bytes we hash the end first, and then as we
+ // loop we keep 56 bytes of state: v, w, x, y, and z.
+ _Size __x = __loadword<_Size>(__s + __len - 40);
+ _Size __y = __loadword<_Size>(__s + __len - 16) +
+ __loadword<_Size>(__s + __len - 56);
+ _Size __z = __hash_len_16(__loadword<_Size>(__s + __len - 48) + __len,
+ __loadword<_Size>(__s + __len - 24));
+ pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
+ pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
+ __x = __x * __k1 + __loadword<_Size>(__s);
+
+ // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
+ __len = (__len - 1) & ~static_cast<_Size>(63);
+ do {
+ __x = __rotate(__x + __y + __v.first + __loadword<_Size>(__s + 8), 37) * __k1;
+ __y = __rotate(__y + __v.second + __loadword<_Size>(__s + 48), 42) * __k1;
+ __x ^= __w.second;
+ __y += __v.first + __loadword<_Size>(__s + 40);
+ __z = __rotate(__z + __w.first, 33) * __k1;
+ __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
+ __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
+ __y + __loadword<_Size>(__s + 16));
+ _VSTD::swap(__z, __x);
+ __s += 64;
+ __len -= 64;
+ } while (__len != 0);
+ return __hash_len_16(
+ __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
+ __hash_len_16(__v.second, __w.second) + __x);
+}
+
+template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)>
+struct __scalar_hash;
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp>
+struct __scalar_hash<_Tp, 0>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<_Tp, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ size_t __a;
+ } __u;
+ __u.__a = 0;
+ __u.__t = __v;
+ return __u.__a;
+ }
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp>
+struct __scalar_hash<_Tp, 1>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<_Tp, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ size_t __a;
+ } __u;
+ __u.__t = __v;
+ return __u.__a;
+ }
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp>
+struct __scalar_hash<_Tp, 2>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<_Tp, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ } __s;
+ } __u;
+ __u.__t = __v;
+ return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
+ }
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp>
+struct __scalar_hash<_Tp, 3>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<_Tp, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ size_t __c;
+ } __s;
+ } __u;
+ __u.__t = __v;
+ return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
+ }
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp>
+struct __scalar_hash<_Tp, 4>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<_Tp, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ size_t __c;
+ size_t __d;
+ } __s;
+ } __u;
+ __u.__t = __v;
+ return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
+ }
+};
+
+struct _PairT {
+ size_t first;
+ size_t second;
+};
+
+_LIBCPP_INLINE_VISIBILITY
+inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
+ typedef __scalar_hash<_PairT> _HashT;
+ const _PairT __p = {__lhs, __rhs};
+ return _HashT()(__p);
+}
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template<class _Tp>
+struct _LIBCPP_TEMPLATE_VIS hash<_Tp*>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<_Tp*, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp* __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp* __t;
+ size_t __a;
+ } __u;
+ __u.__t = __v;
+ return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
+ }
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<bool>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<bool, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<char>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<char, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef char argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<signed char>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<signed char, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef signed char argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<unsigned char, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef unsigned char argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<char8_t>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<char8_t, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef char8_t argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(char8_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+#endif // !_LIBCPP_HAS_NO_CHAR8_T
+
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<char16_t>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<char16_t, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef char16_t argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<char32_t>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<char32_t, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef char32_t argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<wchar_t>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<wchar_t, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef wchar_t argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<short>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<short, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef short argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned short>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<unsigned short, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef unsigned short argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<int>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<int, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef int argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned int>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<unsigned int, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef unsigned int argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<long>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<long, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef long argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<unsigned long, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef unsigned long argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<long long>
+ : public __scalar_hash<long long>
+{
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned long long>
+ : public __scalar_hash<unsigned long long>
+{
+};
+
+#ifndef _LIBCPP_HAS_NO_INT128
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<__int128_t>
+ : public __scalar_hash<__int128_t>
+{
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<__uint128_t>
+ : public __scalar_hash<__uint128_t>
+{
+};
+
+#endif
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<float>
+ : public __scalar_hash<float>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(float __v) const _NOEXCEPT
+ {
+ // -0.0 and 0.0 should return same hash
+ if (__v == 0.0f)
+ return 0;
+ return __scalar_hash<float>::operator()(__v);
+ }
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<double>
+ : public __scalar_hash<double>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(double __v) const _NOEXCEPT
+ {
+ // -0.0 and 0.0 should return same hash
+ if (__v == 0.0)
+ return 0;
+ return __scalar_hash<double>::operator()(__v);
+ }
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<long double>
+ : public __scalar_hash<long double>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(long double __v) const _NOEXCEPT
+ {
+ // -0.0 and 0.0 should return same hash
+ if (__v == 0.0L)
+ return 0;
+#if defined(__i386__) || (defined(__x86_64__) && defined(__ILP32__))
+ // Zero out padding bits
+ union
+ {
+ long double __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ size_t __c;
+ size_t __d;
+ } __s;
+ } __u;
+ __u.__s.__a = 0;
+ __u.__s.__b = 0;
+ __u.__s.__c = 0;
+ __u.__s.__d = 0;
+ __u.__t = __v;
+ return __u.__s.__a ^ __u.__s.__b ^ __u.__s.__c ^ __u.__s.__d;
+#elif defined(__x86_64__)
+ // Zero out padding bits
+ union
+ {
+ long double __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ } __s;
+ } __u;
+ __u.__s.__a = 0;
+ __u.__s.__b = 0;
+ __u.__t = __v;
+ return __u.__s.__a ^ __u.__s.__b;
+#else
+ return __scalar_hash<long double>::operator()(__v);
+#endif
+ }
+};
+
+#if _LIBCPP_STD_VER > 11
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp, bool = is_enum<_Tp>::value>
+struct _LIBCPP_TEMPLATE_VIS __enum_hash
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<_Tp, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ typedef typename underlying_type<_Tp>::type type;
+ return hash<type>{}(static_cast<type>(__v));
+ }
+};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS __enum_hash<_Tp, false> {
+ __enum_hash() = delete;
+ __enum_hash(__enum_hash const&) = delete;
+ __enum_hash& operator=(__enum_hash const&) = delete;
+};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS hash : public __enum_hash<_Tp>
+{
+};
+#endif
+
+#if _LIBCPP_STD_VER > 14
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public unary_function<nullptr_t, size_t>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef nullptr_t argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(nullptr_t) const _NOEXCEPT {
+ return 662607004ull;
+ }
+};
+#endif
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Key, class _Hash>
+using __check_hash_requirements _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
+ is_copy_constructible<_Hash>::value &&
+ is_move_constructible<_Hash>::value &&
+ __invokable_r<size_t, _Hash, _Key const&>::value
+>;
+
+template <class _Key, class _Hash = hash<_Key> >
+using __has_enabled_hash _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
+ __check_hash_requirements<_Key, _Hash>::value &&
+ is_default_constructible<_Hash>::value
+>;
+
+#if _LIBCPP_STD_VER > 14
+template <class _Type, class>
+using __enable_hash_helper_imp _LIBCPP_NODEBUG_TYPE = _Type;
+
+template <class _Type, class ..._Keys>
+using __enable_hash_helper _LIBCPP_NODEBUG_TYPE = __enable_hash_helper_imp<_Type,
+ typename enable_if<__all<__has_enabled_hash<_Keys>::value...>::value>::type
+>;
+#else
+template <class _Type, class ...>
+using __enable_hash_helper _LIBCPP_NODEBUG_TYPE = _Type;
+#endif
+
+#endif // !_LIBCPP_CXX03_LANG
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___FUNCTIONAL_HASH_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_IDENTITY_H
+#define _LIBCPP___FUNCTIONAL_IDENTITY_H
+
+#include <__config>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17
+
+struct identity {
+ template<class _Tp>
+ _LIBCPP_NODISCARD_EXT constexpr _Tp&& operator()(_Tp&& __t) const noexcept
+ {
+ return _VSTD::forward<_Tp>(__t);
+ }
+
+ using is_transparent = void;
+};
+#endif // _LIBCPP_STD_VER > 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_IDENTITY_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_INVOKE_H
+#define _LIBCPP___FUNCTIONAL_INVOKE_H
+
+#include <__config>
+#include <__functional/weak_result_type.h>
+#include <__utility/forward.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Ret, bool = is_void<_Ret>::value>
+struct __invoke_void_return_wrapper
+{
+#ifndef _LIBCPP_CXX03_LANG
+ template <class ..._Args>
+ static _Ret __call(_Args&&... __args) {
+ return _VSTD::__invoke(_VSTD::forward<_Args>(__args)...);
+ }
+#else
+ template <class _Fn>
+ static _Ret __call(_Fn __f) {
+ return _VSTD::__invoke(__f);
+ }
+
+ template <class _Fn, class _A0>
+ static _Ret __call(_Fn __f, _A0& __a0) {
+ return _VSTD::__invoke(__f, __a0);
+ }
+
+ template <class _Fn, class _A0, class _A1>
+ static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) {
+ return _VSTD::__invoke(__f, __a0, __a1);
+ }
+
+ template <class _Fn, class _A0, class _A1, class _A2>
+ static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2){
+ return _VSTD::__invoke(__f, __a0, __a1, __a2);
+ }
+#endif
+};
+
+template <class _Ret>
+struct __invoke_void_return_wrapper<_Ret, true>
+{
+#ifndef _LIBCPP_CXX03_LANG
+ template <class ..._Args>
+ static void __call(_Args&&... __args) {
+ _VSTD::__invoke(_VSTD::forward<_Args>(__args)...);
+ }
+#else
+ template <class _Fn>
+ static void __call(_Fn __f) {
+ _VSTD::__invoke(__f);
+ }
+
+ template <class _Fn, class _A0>
+ static void __call(_Fn __f, _A0& __a0) {
+ _VSTD::__invoke(__f, __a0);
+ }
+
+ template <class _Fn, class _A0, class _A1>
+ static void __call(_Fn __f, _A0& __a0, _A1& __a1) {
+ _VSTD::__invoke(__f, __a0, __a1);
+ }
+
+ template <class _Fn, class _A0, class _A1, class _A2>
+ static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) {
+ _VSTD::__invoke(__f, __a0, __a1, __a2);
+ }
+#endif
+};
+
+#if _LIBCPP_STD_VER > 14
+
+template <class _Fn, class ..._Args>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 invoke_result_t<_Fn, _Args...>
+invoke(_Fn&& __f, _Args&&... __args)
+ noexcept(is_nothrow_invocable_v<_Fn, _Args...>)
+{
+ return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
+}
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_INVOKE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
+#define _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 11
+
+template <class _Tp, class, class = void>
+struct __is_transparent : false_type {};
+
+template <class _Tp, class _Up>
+struct __is_transparent<_Tp, _Up,
+ typename __void_t<typename _Tp::is_transparent>::type>
+ : true_type {};
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_MEM_FN_H
+#define _LIBCPP___FUNCTIONAL_MEM_FN_H
+
+#include <__config>
+#include <__functional/weak_result_type.h>
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+class __mem_fn
+#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public __weak_result_type<_Tp>
+#endif
+{
+public:
+ // types
+ typedef _Tp type;
+private:
+ type __f_;
+
+public:
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}
+
+#ifndef _LIBCPP_CXX03_LANG
+ // invoke
+ template <class... _ArgTypes>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ typename __invoke_return<type, _ArgTypes...>::type
+ operator() (_ArgTypes&&... __args) const {
+ return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
+ }
+#else
+
+ template <class _A0>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return0<type, _A0>::type
+ operator() (_A0& __a0) const {
+ return _VSTD::__invoke(__f_, __a0);
+ }
+
+ template <class _A0>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return0<type, _A0 const>::type
+ operator() (_A0 const& __a0) const {
+ return _VSTD::__invoke(__f_, __a0);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0, _A1>::type
+ operator() (_A0& __a0, _A1& __a1) const {
+ return _VSTD::__invoke(__f_, __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0 const, _A1>::type
+ operator() (_A0 const& __a0, _A1& __a1) const {
+ return _VSTD::__invoke(__f_, __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0, _A1 const>::type
+ operator() (_A0& __a0, _A1 const& __a1) const {
+ return _VSTD::__invoke(__f_, __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0 const, _A1 const>::type
+ operator() (_A0 const& __a0, _A1 const& __a1) const {
+ return _VSTD::__invoke(__f_, __a0, __a1);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1, _A2>::type
+ operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
+ return _VSTD::__invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1, _A2>::type
+ operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
+ return _VSTD::__invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1 const, _A2>::type
+ operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
+ return _VSTD::__invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1, _A2 const>::type
+ operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
+ return _VSTD::__invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
+ operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
+ return _VSTD::__invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
+ operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
+ return _VSTD::__invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
+ operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
+ return _VSTD::__invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
+ operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
+ return _VSTD::__invoke(__f_, __a0, __a1, __a2);
+ }
+#endif
+};
+
+template<class _Rp, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+__mem_fn<_Rp _Tp::*>
+mem_fn(_Rp _Tp::* __pm) _NOEXCEPT
+{
+ return __mem_fn<_Rp _Tp::*>(__pm);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_MEM_FN_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
+#define _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
+
+#include <__config>
+#include <__functional/unary_function.h>
+#include <__functional/binary_function.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+template<class _Sp, class _Tp>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_t
+ : public unary_function<_Tp*, _Sp>
+{
+ _Sp (_Tp::*__p_)();
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit mem_fun_t(_Sp (_Tp::*__p)())
+ : __p_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p) const
+ {return (__p->*__p_)();}
+};
+
+template<class _Sp, class _Tp, class _Ap>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_t
+ : public binary_function<_Tp*, _Ap, _Sp>
+{
+ _Sp (_Tp::*__p_)(_Ap);
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_t(_Sp (_Tp::*__p)(_Ap))
+ : __p_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p, _Ap __x) const
+ {return (__p->*__p_)(__x);}
+};
+
+template<class _Sp, class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+mem_fun_t<_Sp,_Tp>
+mem_fun(_Sp (_Tp::*__f)())
+ {return mem_fun_t<_Sp,_Tp>(__f);}
+
+template<class _Sp, class _Tp, class _Ap>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+mem_fun1_t<_Sp,_Tp,_Ap>
+mem_fun(_Sp (_Tp::*__f)(_Ap))
+ {return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
+
+template<class _Sp, class _Tp>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_ref_t
+ : public unary_function<_Tp, _Sp>
+{
+ _Sp (_Tp::*__p_)();
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit mem_fun_ref_t(_Sp (_Tp::*__p)())
+ : __p_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p) const
+ {return (__p.*__p_)();}
+};
+
+template<class _Sp, class _Tp, class _Ap>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_ref_t
+ : public binary_function<_Tp, _Ap, _Sp>
+{
+ _Sp (_Tp::*__p_)(_Ap);
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap))
+ : __p_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p, _Ap __x) const
+ {return (__p.*__p_)(__x);}
+};
+
+template<class _Sp, class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+mem_fun_ref_t<_Sp,_Tp>
+mem_fun_ref(_Sp (_Tp::*__f)())
+ {return mem_fun_ref_t<_Sp,_Tp>(__f);}
+
+template<class _Sp, class _Tp, class _Ap>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+mem_fun1_ref_t<_Sp,_Tp,_Ap>
+mem_fun_ref(_Sp (_Tp::*__f)(_Ap))
+ {return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
+
+template <class _Sp, class _Tp>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_t
+ : public unary_function<const _Tp*, _Sp>
+{
+ _Sp (_Tp::*__p_)() const;
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_t(_Sp (_Tp::*__p)() const)
+ : __p_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p) const
+ {return (__p->*__p_)();}
+};
+
+template <class _Sp, class _Tp, class _Ap>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_t
+ : public binary_function<const _Tp*, _Ap, _Sp>
+{
+ _Sp (_Tp::*__p_)(_Ap) const;
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_t(_Sp (_Tp::*__p)(_Ap) const)
+ : __p_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p, _Ap __x) const
+ {return (__p->*__p_)(__x);}
+};
+
+template <class _Sp, class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+const_mem_fun_t<_Sp,_Tp>
+mem_fun(_Sp (_Tp::*__f)() const)
+ {return const_mem_fun_t<_Sp,_Tp>(__f);}
+
+template <class _Sp, class _Tp, class _Ap>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+const_mem_fun1_t<_Sp,_Tp,_Ap>
+mem_fun(_Sp (_Tp::*__f)(_Ap) const)
+ {return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
+
+template <class _Sp, class _Tp>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_ref_t
+ : public unary_function<_Tp, _Sp>
+{
+ _Sp (_Tp::*__p_)() const;
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_ref_t(_Sp (_Tp::*__p)() const)
+ : __p_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p) const
+ {return (__p.*__p_)();}
+};
+
+template <class _Sp, class _Tp, class _Ap>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_ref_t
+ : public binary_function<_Tp, _Ap, _Sp>
+{
+ _Sp (_Tp::*__p_)(_Ap) const;
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap) const)
+ : __p_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p, _Ap __x) const
+ {return (__p.*__p_)(__x);}
+};
+
+template <class _Sp, class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+const_mem_fun_ref_t<_Sp,_Tp>
+mem_fun_ref(_Sp (_Tp::*__f)() const)
+ {return const_mem_fun_ref_t<_Sp,_Tp>(__f);}
+
+template <class _Sp, class _Tp, class _Ap>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+const_mem_fun1_ref_t<_Sp,_Tp,_Ap>
+mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const)
+ {return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
+
+#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_NOT_FN_H
+#define _LIBCPP___FUNCTIONAL_NOT_FN_H
+
+#include <__config>
+#include <__functional/perfect_forward.h>
+#include <__functional/invoke.h>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+struct __not_fn_op
+{
+ template<class... _Args>
+ static _LIBCPP_CONSTEXPR_AFTER_CXX17 auto __call(_Args&&... __args)
+ noexcept(noexcept(!_VSTD::invoke(_VSTD::forward<_Args>(__args)...)))
+ -> decltype( !_VSTD::invoke(_VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(_VSTD::forward<_Args>(__args)...); }
+};
+
+template<class _Fn,
+ class = _EnableIf<is_constructible_v<decay_t<_Fn>, _Fn> &&
+ is_move_constructible_v<_Fn>>>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 auto not_fn(_Fn&& __f)
+{
+ return __perfect_forward<__not_fn_op, _Fn>(_VSTD::forward<_Fn>(__f));
+}
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_NOT_FN_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_OPERATIONS_H
+#define _LIBCPP___FUNCTIONAL_OPERATIONS_H
+
+#include <__config>
+#include <__functional/binary_function.h>
+#include <__functional/unary_function.h>
+#include <__utility/forward.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Arithmetic operations
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS plus
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x + __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS plus<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS minus
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x - __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS minus<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS multiplies
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x * __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS multiplies<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS divides
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x / __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS divides<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS modulus
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x % __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS modulus<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS negate
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : unary_function<_Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x) const
+ {return -__x;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS negate<void>
+{
+ template <class _Tp>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_Tp&& __x) const
+ _NOEXCEPT_(noexcept(- _VSTD::forward<_Tp>(__x)))
+ -> decltype (- _VSTD::forward<_Tp>(__x))
+ { return - _VSTD::forward<_Tp>(__x); }
+ typedef void is_transparent;
+};
+#endif
+
+// Bitwise operations
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS bit_and
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x & __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS bit_and<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+#if _LIBCPP_STD_VER > 11
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp = void>
+struct _LIBCPP_TEMPLATE_VIS bit_not
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : unary_function<_Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x) const
+ {return ~__x;}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS bit_not<void>
+{
+ template <class _Tp>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_Tp&& __x) const
+ _NOEXCEPT_(noexcept(~_VSTD::forward<_Tp>(__x)))
+ -> decltype (~_VSTD::forward<_Tp>(__x))
+ { return ~_VSTD::forward<_Tp>(__x); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS bit_or
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x | __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS bit_or<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS bit_xor
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, _Tp>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef _Tp __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x ^ __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS bit_xor<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+// Comparison operations
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS equal_to
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x == __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS equal_to<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS not_equal_to
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x != __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS not_equal_to<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS less
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x < __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS less<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS less_equal
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x <= __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS less_equal<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS greater_equal
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x >= __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS greater_equal<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS greater
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x > __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS greater<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+// Logical operations
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS logical_and
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x && __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS logical_and<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS logical_not
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : unary_function<_Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x) const
+ {return !__x;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS logical_not<void>
+{
+ template <class _Tp>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_Tp&& __x) const
+ _NOEXCEPT_(noexcept(!_VSTD::forward<_Tp>(__x)))
+ -> decltype (!_VSTD::forward<_Tp>(__x))
+ { return !_VSTD::forward<_Tp>(__x); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+#if _LIBCPP_STD_VER > 11
+template <class _Tp = void>
+#else
+template <class _Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS logical_or
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<_Tp, _Tp, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+ typedef bool __result_type; // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type;
+#endif
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ {return __x || __y;}
+};
+
+#if _LIBCPP_STD_VER > 11
+template <>
+struct _LIBCPP_TEMPLATE_VIS logical_or<void>
+{
+ template <class _T1, class _T2>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ auto operator()(_T1&& __t, _T2&& __u) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u)))
+ -> decltype (_VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u))
+ { return _VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u); }
+ typedef void is_transparent;
+};
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_OPERATIONS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
+#define _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
+
+#include <__config>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+template<class _Op, class _Tuple,
+ class _Idxs = typename __make_tuple_indices<tuple_size<_Tuple>::value>::type>
+struct __perfect_forward_impl;
+
+template<class _Op, class... _Bound, size_t... _Idxs>
+struct __perfect_forward_impl<_Op, __tuple_types<_Bound...>, __tuple_indices<_Idxs...>>
+{
+ tuple<_Bound...> __bound_;
+
+ template<class... _Args>
+ _LIBCPP_INLINE_VISIBILITY constexpr auto operator()(_Args&&... __args) &
+ noexcept(noexcept(_Op::__call(_VSTD::get<_Idxs>(__bound_)..., _VSTD::forward<_Args>(__args)...)))
+ -> decltype( _Op::__call(_VSTD::get<_Idxs>(__bound_)..., _VSTD::forward<_Args>(__args)...))
+ {return _Op::__call(_VSTD::get<_Idxs>(__bound_)..., _VSTD::forward<_Args>(__args)...);}
+
+ template<class... _Args>
+ _LIBCPP_INLINE_VISIBILITY constexpr auto operator()(_Args&&... __args) const&
+ noexcept(noexcept(_Op::__call(_VSTD::get<_Idxs>(__bound_)..., _VSTD::forward<_Args>(__args)...)))
+ -> decltype( _Op::__call(_VSTD::get<_Idxs>(__bound_)..., _VSTD::forward<_Args>(__args)...))
+ {return _Op::__call(_VSTD::get<_Idxs>(__bound_)..., _VSTD::forward<_Args>(__args)...);}
+
+ template<class... _Args>
+ _LIBCPP_INLINE_VISIBILITY constexpr auto operator()(_Args&&... __args) &&
+ noexcept(noexcept(_Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))...,
+ _VSTD::forward<_Args>(__args)...)))
+ -> decltype( _Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))...,
+ _VSTD::forward<_Args>(__args)...))
+ {return _Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))...,
+ _VSTD::forward<_Args>(__args)...);}
+
+ template<class... _Args>
+ _LIBCPP_INLINE_VISIBILITY constexpr auto operator()(_Args&&... __args) const&&
+ noexcept(noexcept(_Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))...,
+ _VSTD::forward<_Args>(__args)...)))
+ -> decltype( _Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))...,
+ _VSTD::forward<_Args>(__args)...))
+ {return _Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))...,
+ _VSTD::forward<_Args>(__args)...);}
+
+ template<class _Fn = typename tuple_element<0, tuple<_Bound...>>::type,
+ class = _EnableIf<is_copy_constructible_v<_Fn>>>
+ constexpr __perfect_forward_impl(__perfect_forward_impl const& __other)
+ : __bound_(__other.__bound_) {}
+
+ template<class _Fn = typename tuple_element<0, tuple<_Bound...>>::type,
+ class = _EnableIf<is_move_constructible_v<_Fn>>>
+ constexpr __perfect_forward_impl(__perfect_forward_impl && __other)
+ : __bound_(_VSTD::move(__other.__bound_)) {}
+
+ template<class... _BoundArgs>
+ explicit constexpr __perfect_forward_impl(_BoundArgs&&... __bound) :
+ __bound_(_VSTD::forward<_BoundArgs>(__bound)...) { }
+};
+
+template<class _Op, class... _Args>
+using __perfect_forward =
+ __perfect_forward_impl<_Op, __tuple_types<decay_t<_Args>...>>;
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
+#define _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
+
+#include <__config>
+#include <__functional/binary_function.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+template <class _Arg1, class _Arg2, class _Result>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function
+ : public binary_function<_Arg1, _Arg2, _Result>
+{
+ _Result (*__f_)(_Arg1, _Arg2);
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2))
+ : __f_(__f) {}
+ _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg1 __x, _Arg2 __y) const
+ {return __f_(__x, __y);}
+};
+
+template <class _Arg1, class _Arg2, class _Result>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+pointer_to_binary_function<_Arg1,_Arg2,_Result>
+ptr_fun(_Result (*__f)(_Arg1,_Arg2))
+ {return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
+#define _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
+
+#include <__config>
+#include <__functional/unary_function.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+template <class _Arg, class _Result>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function
+ : public unary_function<_Arg, _Result>
+{
+ _Result (*__f_)(_Arg);
+public:
+ _LIBCPP_INLINE_VISIBILITY explicit pointer_to_unary_function(_Result (*__f)(_Arg))
+ : __f_(__f) {}
+ _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg __x) const
+ {return __f_(__x);}
+};
+
+template <class _Arg, class _Result>
+_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+pointer_to_unary_function<_Arg,_Result>
+ptr_fun(_Result (*__f)(_Arg))
+ {return pointer_to_unary_function<_Arg,_Result>(__f);}
+
+#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
+#define _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
+
+#include <__config>
+#include <concepts>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+namespace ranges {
+
+struct equal_to {
+ template <class _Tp, class _Up>
+ requires equality_comparable_with<_Tp, _Up>
+ [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u)))) {
+ return _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u);
+ }
+
+ using is_transparent = void;
+};
+
+struct not_equal_to {
+ template <class _Tp, class _Up>
+ requires equality_comparable_with<_Tp, _Up>
+ [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u))))) {
+ return !(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u));
+ }
+
+ using is_transparent = void;
+};
+
+struct less {
+ template <class _Tp, class _Up>
+ requires totally_ordered_with<_Tp, _Up>
+ [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u)))) {
+ return _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u);
+ }
+
+ using is_transparent = void;
+};
+
+struct less_equal {
+ template <class _Tp, class _Up>
+ requires totally_ordered_with<_Tp, _Up>
+ [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ noexcept(noexcept(bool(!(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t))))) {
+ return !(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t));
+ }
+
+ using is_transparent = void;
+};
+
+struct greater {
+ template <class _Tp, class _Up>
+ requires totally_ordered_with<_Tp, _Up>
+ [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ noexcept(noexcept(bool(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t)))) {
+ return _VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t);
+ }
+
+ using is_transparent = void;
+};
+
+struct greater_equal {
+ template <class _Tp, class _Up>
+ requires totally_ordered_with<_Tp, _Up>
+ [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
+ noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u))))) {
+ return !(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u));
+ }
+
+ using is_transparent = void;
+};
+
+} // namespace ranges
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H
+#define _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H
+
+#include <__config>
+#include <__functional/weak_result_type.h>
+#include <__memory/addressof.h>
+#include <__utility/forward.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+class _LIBCPP_TEMPLATE_VIS reference_wrapper
+#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : public __weak_result_type<_Tp>
+#endif
+{
+public:
+ // types
+ typedef _Tp type;
+private:
+ type* __f_;
+
+#ifndef _LIBCPP_CXX03_LANG
+ static void __fun(_Tp&) _NOEXCEPT;
+ static void __fun(_Tp&&) = delete;
+#endif
+
+public:
+ // construct/copy/destroy
+#ifdef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ reference_wrapper(type& __f) _NOEXCEPT
+ : __f_(_VSTD::addressof(__f)) {}
+#else
+ template <class _Up, class = _EnableIf<!__is_same_uncvref<_Up, reference_wrapper>::value, decltype(__fun(declval<_Up>())) >>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ reference_wrapper(_Up&& __u) _NOEXCEPT_(noexcept(__fun(declval<_Up>()))) {
+ type& __f = static_cast<_Up&&>(__u);
+ __f_ = _VSTD::addressof(__f);
+ }
+#endif
+
+ // access
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ operator type&() const _NOEXCEPT {return *__f_;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ type& get() const _NOEXCEPT {return *__f_;}
+
+#ifndef _LIBCPP_CXX03_LANG
+ // invoke
+ template <class... _ArgTypes>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ typename __invoke_of<type&, _ArgTypes...>::type
+ operator() (_ArgTypes&&... __args) const {
+ return _VSTD::__invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
+ }
+#else
+
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return<type>::type
+ operator() () const {
+ return _VSTD::__invoke(get());
+ }
+
+ template <class _A0>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return0<type, _A0>::type
+ operator() (_A0& __a0) const {
+ return _VSTD::__invoke(get(), __a0);
+ }
+
+ template <class _A0>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return0<type, _A0 const>::type
+ operator() (_A0 const& __a0) const {
+ return _VSTD::__invoke(get(), __a0);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0, _A1>::type
+ operator() (_A0& __a0, _A1& __a1) const {
+ return _VSTD::__invoke(get(), __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0 const, _A1>::type
+ operator() (_A0 const& __a0, _A1& __a1) const {
+ return _VSTD::__invoke(get(), __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0, _A1 const>::type
+ operator() (_A0& __a0, _A1 const& __a1) const {
+ return _VSTD::__invoke(get(), __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0 const, _A1 const>::type
+ operator() (_A0 const& __a0, _A1 const& __a1) const {
+ return _VSTD::__invoke(get(), __a0, __a1);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1, _A2>::type
+ operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
+ return _VSTD::__invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1, _A2>::type
+ operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
+ return _VSTD::__invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1 const, _A2>::type
+ operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
+ return _VSTD::__invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1, _A2 const>::type
+ operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
+ return _VSTD::__invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
+ operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
+ return _VSTD::__invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
+ operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
+ return _VSTD::__invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
+ operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
+ return _VSTD::__invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
+ operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
+ return _VSTD::__invoke(get(), __a0, __a1, __a2);
+ }
+#endif // _LIBCPP_CXX03_LANG
+};
+
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template <class _Tp>
+reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
+#endif
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+reference_wrapper<_Tp>
+ref(_Tp& __t) _NOEXCEPT
+{
+ return reference_wrapper<_Tp>(__t);
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+reference_wrapper<_Tp>
+ref(reference_wrapper<_Tp> __t) _NOEXCEPT
+{
+ return _VSTD::ref(__t.get());
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+reference_wrapper<const _Tp>
+cref(const _Tp& __t) _NOEXCEPT
+{
+ return reference_wrapper<const _Tp>(__t);
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+reference_wrapper<const _Tp>
+cref(reference_wrapper<_Tp> __t) _NOEXCEPT
+{
+ return _VSTD::cref(__t.get());
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp> void ref(const _Tp&&) = delete;
+template <class _Tp> void cref(const _Tp&&) = delete;
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H
+#define _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Arg, class _Result>
+struct _LIBCPP_TEMPLATE_VIS unary_function
+{
+ typedef _Arg argument_type;
+ typedef _Result result_type;
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H
+#define _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H
+
+#include <__config>
+#include <__functional/unary_function.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
+
+template <class _Predicate>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 unary_negate
+ : public unary_function<typename _Predicate::argument_type, bool>
+{
+ _Predicate __pred_;
+public:
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ explicit unary_negate(const _Predicate& __pred)
+ : __pred_(__pred) {}
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const typename _Predicate::argument_type& __x) const
+ {return !__pred_(__x);}
+};
+
+template <class _Predicate>
+_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+unary_negate<_Predicate>
+not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);}
+
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
+#define _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct __unwrap_reference { typedef _LIBCPP_NODEBUG_TYPE _Tp type; };
+
+template <class _Tp>
+class reference_wrapper;
+
+template <class _Tp>
+struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _LIBCPP_NODEBUG_TYPE _Tp& type; };
+
+template <class _Tp>
+struct decay;
+
+#if _LIBCPP_STD_VER > 17
+template <class _Tp>
+struct unwrap_reference : __unwrap_reference<_Tp> { };
+
+template <class _Tp>
+using unwrap_reference_t = typename unwrap_reference<_Tp>::type;
+
+template <class _Tp>
+struct unwrap_ref_decay : unwrap_reference<typename decay<_Tp>::type> { };
+
+template <class _Tp>
+using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
+#endif // > C++17
+
+template <class _Tp>
+struct __unwrap_ref_decay
+#if _LIBCPP_STD_VER > 17
+ : unwrap_ref_decay<_Tp>
+#else
+ : __unwrap_reference<typename decay<_Tp>::type>
+#endif
+{ };
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H
+#define _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H
+
+#include <__config>
+#include <__functional/binary_function.h>
+#include <__functional/unary_function.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct __has_result_type
+{
+private:
+ struct __two {char __lx; char __lxx;};
+ template <class _Up> static __two __test(...);
+ template <class _Up> static char __test(typename _Up::result_type* = 0);
+public:
+ static const bool value = sizeof(__test<_Tp>(0)) == 1;
+};
+
+// __weak_result_type
+
+template <class _Tp>
+struct __derives_from_unary_function
+{
+private:
+ struct __two {char __lx; char __lxx;};
+ static __two __test(...);
+ template <class _Ap, class _Rp>
+ static unary_function<_Ap, _Rp>
+ __test(const volatile unary_function<_Ap, _Rp>*);
+public:
+ static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
+ typedef decltype(__test((_Tp*)0)) type;
+};
+
+template <class _Tp>
+struct __derives_from_binary_function
+{
+private:
+ struct __two {char __lx; char __lxx;};
+ static __two __test(...);
+ template <class _A1, class _A2, class _Rp>
+ static binary_function<_A1, _A2, _Rp>
+ __test(const volatile binary_function<_A1, _A2, _Rp>*);
+public:
+ static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
+ typedef decltype(__test((_Tp*)0)) type;
+};
+
+template <class _Tp, bool = __derives_from_unary_function<_Tp>::value>
+struct __maybe_derive_from_unary_function // bool is true
+ : public __derives_from_unary_function<_Tp>::type
+{
+};
+
+template <class _Tp>
+struct __maybe_derive_from_unary_function<_Tp, false>
+{
+};
+
+template <class _Tp, bool = __derives_from_binary_function<_Tp>::value>
+struct __maybe_derive_from_binary_function // bool is true
+ : public __derives_from_binary_function<_Tp>::type
+{
+};
+
+template <class _Tp>
+struct __maybe_derive_from_binary_function<_Tp, false>
+{
+};
+
+template <class _Tp, bool = __has_result_type<_Tp>::value>
+struct __weak_result_type_imp // bool is true
+ : public __maybe_derive_from_unary_function<_Tp>,
+ public __maybe_derive_from_binary_function<_Tp>
+{
+ typedef _LIBCPP_NODEBUG_TYPE typename _Tp::result_type result_type;
+};
+
+template <class _Tp>
+struct __weak_result_type_imp<_Tp, false>
+ : public __maybe_derive_from_unary_function<_Tp>,
+ public __maybe_derive_from_binary_function<_Tp>
+{
+};
+
+template <class _Tp>
+struct __weak_result_type
+ : public __weak_result_type_imp<_Tp>
+{
+};
+
+// 0 argument case
+
+template <class _Rp>
+struct __weak_result_type<_Rp ()>
+{
+ typedef _LIBCPP_NODEBUG_TYPE _Rp result_type;
+};
+
+template <class _Rp>
+struct __weak_result_type<_Rp (&)()>
+{
+ typedef _LIBCPP_NODEBUG_TYPE _Rp result_type;
+};
+
+template <class _Rp>
+struct __weak_result_type<_Rp (*)()>
+{
+ typedef _LIBCPP_NODEBUG_TYPE _Rp result_type;
+};
+
+// 1 argument case
+
+template <class _Rp, class _A1>
+struct __weak_result_type<_Rp (_A1)>
+ : public unary_function<_A1, _Rp>
+{
+};
+
+template <class _Rp, class _A1>
+struct __weak_result_type<_Rp (&)(_A1)>
+ : public unary_function<_A1, _Rp>
+{
+};
+
+template <class _Rp, class _A1>
+struct __weak_result_type<_Rp (*)(_A1)>
+ : public unary_function<_A1, _Rp>
+{
+};
+
+template <class _Rp, class _Cp>
+struct __weak_result_type<_Rp (_Cp::*)()>
+ : public unary_function<_Cp*, _Rp>
+{
+};
+
+template <class _Rp, class _Cp>
+struct __weak_result_type<_Rp (_Cp::*)() const>
+ : public unary_function<const _Cp*, _Rp>
+{
+};
+
+template <class _Rp, class _Cp>
+struct __weak_result_type<_Rp (_Cp::*)() volatile>
+ : public unary_function<volatile _Cp*, _Rp>
+{
+};
+
+template <class _Rp, class _Cp>
+struct __weak_result_type<_Rp (_Cp::*)() const volatile>
+ : public unary_function<const volatile _Cp*, _Rp>
+{
+};
+
+// 2 argument case
+
+template <class _Rp, class _A1, class _A2>
+struct __weak_result_type<_Rp (_A1, _A2)>
+ : public binary_function<_A1, _A2, _Rp>
+{
+};
+
+template <class _Rp, class _A1, class _A2>
+struct __weak_result_type<_Rp (*)(_A1, _A2)>
+ : public binary_function<_A1, _A2, _Rp>
+{
+};
+
+template <class _Rp, class _A1, class _A2>
+struct __weak_result_type<_Rp (&)(_A1, _A2)>
+ : public binary_function<_A1, _A2, _Rp>
+{
+};
+
+template <class _Rp, class _Cp, class _A1>
+struct __weak_result_type<_Rp (_Cp::*)(_A1)>
+ : public binary_function<_Cp*, _A1, _Rp>
+{
+};
+
+template <class _Rp, class _Cp, class _A1>
+struct __weak_result_type<_Rp (_Cp::*)(_A1) const>
+ : public binary_function<const _Cp*, _A1, _Rp>
+{
+};
+
+template <class _Rp, class _Cp, class _A1>
+struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile>
+ : public binary_function<volatile _Cp*, _A1, _Rp>
+{
+};
+
+template <class _Rp, class _Cp, class _A1>
+struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile>
+ : public binary_function<const volatile _Cp*, _A1, _Rp>
+{
+};
+
+
+#ifndef _LIBCPP_CXX03_LANG
+// 3 or more arguments
+
+template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
+struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)>
+{
+ typedef _Rp result_type;
+};
+
+template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
+struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)>
+{
+ typedef _Rp result_type;
+};
+
+template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
+struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)>
+{
+ typedef _Rp result_type;
+};
+
+template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
+struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)>
+{
+ typedef _Rp result_type;
+};
+
+template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
+struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const>
+{
+ typedef _Rp result_type;
+};
+
+template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
+struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile>
+{
+ typedef _Rp result_type;
+};
+
+template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
+struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
+{
+ typedef _Rp result_type;
+};
+
+template <class _Tp, class ..._Args>
+struct __invoke_return
+{
+ typedef decltype(_VSTD::__invoke(declval<_Tp>(), declval<_Args>()...)) type;
+};
+
+#else // defined(_LIBCPP_CXX03_LANG)
+
+template <class _Ret, class _T1, bool _IsFunc, bool _IsBase>
+struct __enable_invoke_imp;
+
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1, true, true> {
+ typedef _Ret _Bullet1;
+ typedef _Bullet1 type;
+};
+
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1, true, false> {
+ typedef _Ret _Bullet2;
+ typedef _Bullet2 type;
+};
+
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1, false, true> {
+ typedef typename add_lvalue_reference<
+ typename __apply_cv<_T1, _Ret>::type
+ >::type _Bullet3;
+ typedef _Bullet3 type;
+};
+
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1, false, false> {
+ typedef typename add_lvalue_reference<
+ typename __apply_cv<decltype(*declval<_T1>()), _Ret>::type
+ >::type _Bullet4;
+ typedef _Bullet4 type;
+};
+
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1*, false, false> {
+ typedef typename add_lvalue_reference<
+ typename __apply_cv<_T1, _Ret>::type
+ >::type _Bullet4;
+ typedef _Bullet4 type;
+};
+
+template <class _Fn, class _T1,
+ class _Traits = __member_pointer_traits<_Fn>,
+ class _Ret = typename _Traits::_ReturnType,
+ class _Class = typename _Traits::_ClassType>
+struct __enable_invoke : __enable_invoke_imp<
+ _Ret, _T1,
+ is_member_function_pointer<_Fn>::value,
+ is_base_of<_Class, typename remove_reference<_T1>::type>::value>
+{
+};
+
+__nat __invoke(__any, ...);
+
+// first bullet
+
+template <class _Fn, class _T1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet1
+__invoke(_Fn __f, _T1& __t1) {
+ return (__t1.*__f)();
+}
+
+template <class _Fn, class _T1, class _A0>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet1
+__invoke(_Fn __f, _T1& __t1, _A0& __a0) {
+ return (__t1.*__f)(__a0);
+}
+
+template <class _Fn, class _T1, class _A0, class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet1
+__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) {
+ return (__t1.*__f)(__a0, __a1);
+}
+
+template <class _Fn, class _T1, class _A0, class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet1
+__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) {
+ return (__t1.*__f)(__a0, __a1, __a2);
+}
+
+template <class _Fn, class _T1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet2
+__invoke(_Fn __f, _T1& __t1) {
+ return ((*__t1).*__f)();
+}
+
+template <class _Fn, class _T1, class _A0>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet2
+__invoke(_Fn __f, _T1& __t1, _A0& __a0) {
+ return ((*__t1).*__f)(__a0);
+}
+
+template <class _Fn, class _T1, class _A0, class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet2
+__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) {
+ return ((*__t1).*__f)(__a0, __a1);
+}
+
+template <class _Fn, class _T1, class _A0, class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet2
+__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) {
+ return ((*__t1).*__f)(__a0, __a1, __a2);
+}
+
+template <class _Fn, class _T1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet3
+__invoke(_Fn __f, _T1& __t1) {
+ return __t1.*__f;
+}
+
+template <class _Fn, class _T1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __enable_invoke<_Fn, _T1>::_Bullet4
+__invoke(_Fn __f, _T1& __t1) {
+ return (*__t1).*__f;
+}
+
+// fifth bullet
+
+template <class _Fp>
+inline _LIBCPP_INLINE_VISIBILITY
+decltype(declval<_Fp&>()())
+__invoke(_Fp& __f)
+{
+ return __f();
+}
+
+template <class _Fp, class _A0>
+inline _LIBCPP_INLINE_VISIBILITY
+decltype(declval<_Fp&>()(declval<_A0&>()))
+__invoke(_Fp& __f, _A0& __a0)
+{
+ return __f(__a0);
+}
+
+template <class _Fp, class _A0, class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+decltype(declval<_Fp&>()(declval<_A0&>(), declval<_A1&>()))
+__invoke(_Fp& __f, _A0& __a0, _A1& __a1)
+{
+ return __f(__a0, __a1);
+}
+
+template <class _Fp, class _A0, class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+decltype(declval<_Fp&>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>()))
+__invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2)
+{
+ return __f(__a0, __a1, __a2);
+}
+
+template <class _Fp, bool = __has_result_type<__weak_result_type<_Fp> >::value>
+struct __invoke_return
+{
+ typedef typename __weak_result_type<_Fp>::result_type type;
+};
+
+template <class _Fp>
+struct __invoke_return<_Fp, false>
+{
+ typedef decltype(_VSTD::__invoke(declval<_Fp&>())) type;
+};
+
+template <class _Tp, class _A0>
+struct __invoke_return0
+{
+ typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>())) type;
+};
+
+template <class _Rp, class _Tp, class _A0>
+struct __invoke_return0<_Rp _Tp::*, _A0>
+{
+ typedef typename __enable_invoke<_Rp _Tp::*, _A0>::type type;
+};
+
+template <class _Tp, class _A0, class _A1>
+struct __invoke_return1
+{
+ typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>(),
+ declval<_A1&>())) type;
+};
+
+template <class _Rp, class _Class, class _A0, class _A1>
+struct __invoke_return1<_Rp _Class::*, _A0, _A1> {
+ typedef typename __enable_invoke<_Rp _Class::*, _A0>::type type;
+};
+
+template <class _Tp, class _A0, class _A1, class _A2>
+struct __invoke_return2
+{
+ typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>(),
+ declval<_A1&>(),
+ declval<_A2&>())) type;
+};
+
+template <class _Ret, class _Class, class _A0, class _A1, class _A2>
+struct __invoke_return2<_Ret _Class::*, _A0, _A1, _A2> {
+ typedef typename __enable_invoke<_Ret _Class::*, _A0>::type type;
+};
+
+#endif // !defined(_LIBCPP_CXX03_LANG)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H
#define _LIBCPP_FUNCTIONAL_BASE
#include <__config>
-#include <type_traits>
-#include <typeinfo>
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/unary_function.h>
+#include <__functional/weak_result_type.h>
+#include <__memory/allocator_arg_t.h>
+#include <__memory/uses_allocator.h>
#include <exception>
#include <new>
+#include <type_traits>
+#include <typeinfo>
#include <utility>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Arg1, class _Arg2, class _Result>
-struct _LIBCPP_TEMPLATE_VIS binary_function
-{
- typedef _Arg1 first_argument_type;
- typedef _Arg2 second_argument_type;
- typedef _Result result_type;
-};
-
-template <class _Tp>
-struct __has_result_type
-{
-private:
- struct __two {char __lx; char __lxx;};
- template <class _Up> static __two __test(...);
- template <class _Up> static char __test(typename _Up::result_type* = 0);
-public:
- static const bool value = sizeof(__test<_Tp>(0)) == 1;
-};
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS less : binary_function<_Tp, _Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x, const _Tp& __y) const
- {return __x < __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS less<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-// __weak_result_type
-
-template <class _Tp>
-struct __derives_from_unary_function
-{
-private:
- struct __two {char __lx; char __lxx;};
- static __two __test(...);
- template <class _Ap, class _Rp>
- static unary_function<_Ap, _Rp>
- __test(const volatile unary_function<_Ap, _Rp>*);
-public:
- static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
- typedef decltype(__test((_Tp*)0)) type;
-};
-
-template <class _Tp>
-struct __derives_from_binary_function
-{
-private:
- struct __two {char __lx; char __lxx;};
- static __two __test(...);
- template <class _A1, class _A2, class _Rp>
- static binary_function<_A1, _A2, _Rp>
- __test(const volatile binary_function<_A1, _A2, _Rp>*);
-public:
- static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
- typedef decltype(__test((_Tp*)0)) type;
-};
-
-template <class _Tp, bool = __derives_from_unary_function<_Tp>::value>
-struct __maybe_derive_from_unary_function // bool is true
- : public __derives_from_unary_function<_Tp>::type
-{
-};
-
-template <class _Tp>
-struct __maybe_derive_from_unary_function<_Tp, false>
-{
-};
-
-template <class _Tp, bool = __derives_from_binary_function<_Tp>::value>
-struct __maybe_derive_from_binary_function // bool is true
- : public __derives_from_binary_function<_Tp>::type
-{
-};
-
-template <class _Tp>
-struct __maybe_derive_from_binary_function<_Tp, false>
-{
-};
-
-template <class _Tp, bool = __has_result_type<_Tp>::value>
-struct __weak_result_type_imp // bool is true
- : public __maybe_derive_from_unary_function<_Tp>,
- public __maybe_derive_from_binary_function<_Tp>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Tp::result_type result_type;
-};
-
-template <class _Tp>
-struct __weak_result_type_imp<_Tp, false>
- : public __maybe_derive_from_unary_function<_Tp>,
- public __maybe_derive_from_binary_function<_Tp>
-{
-};
-
-template <class _Tp>
-struct __weak_result_type
- : public __weak_result_type_imp<_Tp>
-{
-};
-
-// 0 argument case
-
-template <class _Rp>
-struct __weak_result_type<_Rp ()>
-{
- typedef _LIBCPP_NODEBUG_TYPE _Rp result_type;
-};
-
-template <class _Rp>
-struct __weak_result_type<_Rp (&)()>
-{
- typedef _LIBCPP_NODEBUG_TYPE _Rp result_type;
-};
-
-template <class _Rp>
-struct __weak_result_type<_Rp (*)()>
-{
- typedef _LIBCPP_NODEBUG_TYPE _Rp result_type;
-};
-
-// 1 argument case
-
-template <class _Rp, class _A1>
-struct __weak_result_type<_Rp (_A1)>
- : public unary_function<_A1, _Rp>
-{
-};
-
-template <class _Rp, class _A1>
-struct __weak_result_type<_Rp (&)(_A1)>
- : public unary_function<_A1, _Rp>
-{
-};
-
-template <class _Rp, class _A1>
-struct __weak_result_type<_Rp (*)(_A1)>
- : public unary_function<_A1, _Rp>
-{
-};
-
-template <class _Rp, class _Cp>
-struct __weak_result_type<_Rp (_Cp::*)()>
- : public unary_function<_Cp*, _Rp>
-{
-};
-
-template <class _Rp, class _Cp>
-struct __weak_result_type<_Rp (_Cp::*)() const>
- : public unary_function<const _Cp*, _Rp>
-{
-};
-
-template <class _Rp, class _Cp>
-struct __weak_result_type<_Rp (_Cp::*)() volatile>
- : public unary_function<volatile _Cp*, _Rp>
-{
-};
-
-template <class _Rp, class _Cp>
-struct __weak_result_type<_Rp (_Cp::*)() const volatile>
- : public unary_function<const volatile _Cp*, _Rp>
-{
-};
-
-// 2 argument case
-
-template <class _Rp, class _A1, class _A2>
-struct __weak_result_type<_Rp (_A1, _A2)>
- : public binary_function<_A1, _A2, _Rp>
-{
-};
-
-template <class _Rp, class _A1, class _A2>
-struct __weak_result_type<_Rp (*)(_A1, _A2)>
- : public binary_function<_A1, _A2, _Rp>
-{
-};
-
-template <class _Rp, class _A1, class _A2>
-struct __weak_result_type<_Rp (&)(_A1, _A2)>
- : public binary_function<_A1, _A2, _Rp>
-{
-};
-
-template <class _Rp, class _Cp, class _A1>
-struct __weak_result_type<_Rp (_Cp::*)(_A1)>
- : public binary_function<_Cp*, _A1, _Rp>
-{
-};
-
-template <class _Rp, class _Cp, class _A1>
-struct __weak_result_type<_Rp (_Cp::*)(_A1) const>
- : public binary_function<const _Cp*, _A1, _Rp>
-{
-};
-
-template <class _Rp, class _Cp, class _A1>
-struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile>
- : public binary_function<volatile _Cp*, _A1, _Rp>
-{
-};
-
-template <class _Rp, class _Cp, class _A1>
-struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile>
- : public binary_function<const volatile _Cp*, _A1, _Rp>
-{
-};
-
-
-#ifndef _LIBCPP_CXX03_LANG
-// 3 or more arguments
-
-template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
-struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)>
-{
- typedef _Rp result_type;
-};
-
-template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
-struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)>
-{
- typedef _Rp result_type;
-};
-
-template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
-struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)>
-{
- typedef _Rp result_type;
-};
-
-template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
-struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)>
-{
- typedef _Rp result_type;
-};
-
-template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
-struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const>
-{
- typedef _Rp result_type;
-};
-
-template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
-struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile>
-{
- typedef _Rp result_type;
-};
-
-template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
-struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
-{
- typedef _Rp result_type;
-};
-
-template <class _Tp, class ..._Args>
-struct __invoke_return
-{
- typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
-};
-
-#else // defined(_LIBCPP_CXX03_LANG)
-
-#include <__functional_base_03>
-
-#endif // !defined(_LIBCPP_CXX03_LANG)
-
-
-template <class _Ret>
-struct __invoke_void_return_wrapper
-{
-#ifndef _LIBCPP_CXX03_LANG
- template <class ..._Args>
- static _Ret __call(_Args&&... __args) {
- return __invoke(_VSTD::forward<_Args>(__args)...);
- }
-#else
- template <class _Fn>
- static _Ret __call(_Fn __f) {
- return __invoke(__f);
- }
-
- template <class _Fn, class _A0>
- static _Ret __call(_Fn __f, _A0& __a0) {
- return __invoke(__f, __a0);
- }
-
- template <class _Fn, class _A0, class _A1>
- static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) {
- return __invoke(__f, __a0, __a1);
- }
-
- template <class _Fn, class _A0, class _A1, class _A2>
- static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2){
- return __invoke(__f, __a0, __a1, __a2);
- }
-#endif
-};
-
-template <>
-struct __invoke_void_return_wrapper<void>
-{
-#ifndef _LIBCPP_CXX03_LANG
- template <class ..._Args>
- static void __call(_Args&&... __args) {
- __invoke(_VSTD::forward<_Args>(__args)...);
- }
-#else
- template <class _Fn>
- static void __call(_Fn __f) {
- __invoke(__f);
- }
-
- template <class _Fn, class _A0>
- static void __call(_Fn __f, _A0& __a0) {
- __invoke(__f, __a0);
- }
-
- template <class _Fn, class _A0, class _A1>
- static void __call(_Fn __f, _A0& __a0, _A1& __a1) {
- __invoke(__f, __a0, __a1);
- }
-
- template <class _Fn, class _A0, class _A1, class _A2>
- static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) {
- __invoke(__f, __a0, __a1, __a2);
- }
-#endif
-};
-
-template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS reference_wrapper
- : public __weak_result_type<_Tp>
-{
-public:
- // types
- typedef _Tp type;
-private:
- type* __f_;
-
-public:
- // construct/copy/destroy
- _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT
- : __f_(_VSTD::addressof(__f)) {}
-#ifndef _LIBCPP_CXX03_LANG
- private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
-#endif
-
- // access
- _LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;}
- _LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;}
-
-#ifndef _LIBCPP_CXX03_LANG
- // invoke
- template <class... _ArgTypes>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_of<type&, _ArgTypes...>::type
- operator() (_ArgTypes&&... __args) const {
- return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
- }
-#else
-
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return<type>::type
- operator() () const {
- return __invoke(get());
- }
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return0<type, _A0>::type
- operator() (_A0& __a0) const {
- return __invoke(get(), __a0);
- }
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return0<type, _A0 const>::type
- operator() (_A0 const& __a0) const {
- return __invoke(get(), __a0);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type, _A0, _A1>::type
- operator() (_A0& __a0, _A1& __a1) const {
- return __invoke(get(), __a0, __a1);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type, _A0 const, _A1>::type
- operator() (_A0 const& __a0, _A1& __a1) const {
- return __invoke(get(), __a0, __a1);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type, _A0, _A1 const>::type
- operator() (_A0& __a0, _A1 const& __a1) const {
- return __invoke(get(), __a0, __a1);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type, _A0 const, _A1 const>::type
- operator() (_A0 const& __a0, _A1 const& __a1) const {
- return __invoke(get(), __a0, __a1);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0, _A1, _A2>::type
- operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
- return __invoke(get(), __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0 const, _A1, _A2>::type
- operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
- return __invoke(get(), __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0, _A1 const, _A2>::type
- operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
- return __invoke(get(), __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0, _A1, _A2 const>::type
- operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
- return __invoke(get(), __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
- operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
- return __invoke(get(), __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
- operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
- return __invoke(get(), __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
- operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
- return __invoke(get(), __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
- operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
- return __invoke(get(), __a0, __a1, __a2);
- }
-#endif // _LIBCPP_CXX03_LANG
-};
-
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-reference_wrapper<_Tp>
-ref(_Tp& __t) _NOEXCEPT
-{
- return reference_wrapper<_Tp>(__t);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-reference_wrapper<_Tp>
-ref(reference_wrapper<_Tp> __t) _NOEXCEPT
-{
- return _VSTD::ref(__t.get());
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-reference_wrapper<const _Tp>
-cref(const _Tp& __t) _NOEXCEPT
-{
- return reference_wrapper<const _Tp>(__t);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-reference_wrapper<const _Tp>
-cref(reference_wrapper<_Tp> __t) _NOEXCEPT
-{
- return _VSTD::cref(__t.get());
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Tp> void ref(const _Tp&&) = delete;
-template <class _Tp> void cref(const _Tp&&) = delete;
-#endif
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp, class, class = void>
-struct __is_transparent : false_type {};
-
-template <class _Tp, class _Up>
-struct __is_transparent<_Tp, _Up,
- typename __void_t<typename _Tp::is_transparent>::type>
- : true_type {};
-#endif
-
-// allocator_arg_t
-
-struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { explicit allocator_arg_t() = default; };
-
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg;
-#else
-/* _LIBCPP_INLINE_VAR */ constexpr allocator_arg_t allocator_arg = allocator_arg_t();
-#endif
-
-// uses_allocator
-
-template <class _Tp>
-struct __has_allocator_type
-{
-private:
- struct __two {char __lx; char __lxx;};
- template <class _Up> static __two __test(...);
- template <class _Up> static char __test(typename _Up::allocator_type* = 0);
-public:
- static const bool value = sizeof(__test<_Tp>(0)) == 1;
-};
-
-template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value>
-struct __uses_allocator
- : public integral_constant<bool,
- is_convertible<_Alloc, typename _Tp::allocator_type>::value>
-{
-};
-
-template <class _Tp, class _Alloc>
-struct __uses_allocator<_Tp, _Alloc, false>
- : public false_type
-{
-};
-
-template <class _Tp, class _Alloc>
-struct _LIBCPP_TEMPLATE_VIS uses_allocator
- : public __uses_allocator<_Tp, _Alloc>
-{
-};
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp, class _Alloc>
-_LIBCPP_INLINE_VAR constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-
-// allocator construction
-
-template <class _Tp, class _Alloc, class ..._Args>
-struct __uses_alloc_ctor_imp
-{
- typedef _LIBCPP_NODEBUG_TYPE typename __uncvref<_Alloc>::type _RawAlloc;
- static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value;
- static const bool __ic =
- is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
- static const int value = __ua ? 2 - __ic : 0;
-};
-
-template <class _Tp, class _Alloc, class ..._Args>
-struct __uses_alloc_ctor
- : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value>
- {};
-
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
-void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args )
-{
- new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
-}
-
-// FIXME: This should have a version which takes a non-const alloc.
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
-void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
-{
- new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
-}
-
-// FIXME: This should have a version which takes a non-const alloc.
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
-void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
-{
- new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_FUNCTIONAL_BASE
+#endif // _LIBCPP_FUNCTIONAL_BASE
#ifndef _LIBCPP__HASH_TABLE
#define _LIBCPP__HASH_TABLE
+#include <__bits> // __libcpp_clz
#include <__config>
-#include <initializer_list>
-#include <memory>
-#include <iterator>
+#include <__debug>
#include <algorithm>
#include <cmath>
-#include <utility>
+#include <initializer_list>
+#include <iterator>
+#include <memory>
#include <type_traits>
-
-#include <__debug>
+#include <utility>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
template <class _Key, class _Tp>
struct __hash_value_type;
-#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
struct __is_hash_value_type_imp : false_type {};
template <class _Key, class _Value>
-struct __is_hash_value_type_imp<__hash_value_type<_Key, _Value>> : true_type {};
+struct __is_hash_value_type_imp<__hash_value_type<_Key, _Value> > : true_type {};
template <class ..._Args>
struct __is_hash_value_type : false_type {};
template <class _One>
struct __is_hash_value_type<_One> : __is_hash_value_type_imp<typename __uncvref<_One>::type> {};
-#endif
_LIBCPP_FUNC_VIS
size_t __next_prime(size_t __n);
};
template <class _Tp, class _VoidPtr>
-struct __hash_node
+struct _LIBCPP_STANDALONE_DEBUG __hash_node
: public __hash_node_base
<
typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type
size_t
__next_hash_pow2(size_t __n)
{
- return __n < 2 ? __n : (size_t(1) << (std::numeric_limits<size_t>::digits - __libcpp_clz(__n-1)));
+ return __n < 2 ? __n : (size_t(1) << (numeric_limits<size_t>::digits - __libcpp_clz(__n-1)));
}
static __container_value_type* __get_ptr(__node_value_type& __n) {
return _VSTD::addressof(__n);
}
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
static __container_value_type&& __move(__node_value_type& __v) {
return _VSTD::move(__v);
}
-#endif
};
template <class _Key, class _Tp>
static __container_value_type* __get_ptr(__node_value_type& __n) {
return _VSTD::addressof(__n.__get_value());
}
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
return __v.__move();
}
-#endif
-
};
template <class _Tp, class _AllocPtr, class _KVTypes = __hash_key_value_types<_Tp>,
typedef typename _NodeTypes::__node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
- _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
+#if _LIBCPP_DEBUG_LEVEL == 2
+ __get_db()->__insert_i(this);
+#endif
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__hash_iterator(const __hash_iterator& __i)
: __node_(__i.__node_)
}
return *this;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {
_LIBCPP_INLINE_VISIBILITY
__hash_iterator& operator++() {
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable unordered container iterator");
+ "Attempted to increment a non-incrementable unordered container iterator");
__node_ = __node_->__next_;
return *this;
}
{return !(__x == __y);}
private:
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__hash_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
: __node_(__node)
_LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
- _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
+#if _LIBCPP_DEBUG_LEVEL == 2
+ __get_db()->__insert_i(this);
+#endif
}
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
: __node_(__x.__node_)
{
- _LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));
+#if _LIBCPP_DEBUG_LEVEL == 2
+ __get_db()->__iterator_copy(this, &__x);
+#endif
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator(const __hash_const_iterator& __i)
: __node_(__i.__node_)
}
return *this;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator& operator++() {
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable unordered container const_iterator");
+ "Attempted to increment a non-incrementable unordered container const_iterator");
__node_ = __node_->__next_;
return *this;
}
{return !(__x == __y);}
private:
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
: __node_(__node)
typedef typename _NodeTypes::__node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
- _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
+#if _LIBCPP_DEBUG_LEVEL == 2
+ __get_db()->__insert_i(this);
+#endif
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__hash_local_iterator(const __hash_local_iterator& __i)
: __node_(__i.__node_),
}
return *this;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {
_LIBCPP_INLINE_VISIBILITY
__hash_local_iterator& operator++() {
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable unordered container local_iterator");
+ "Attempted to increment a non-incrementable unordered container local_iterator");
__node_ = __node_->__next_;
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
{return !(__x == __y);}
private:
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__hash_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count, const void* __c) _NOEXCEPT
_LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
- _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
+#if _LIBCPP_DEBUG_LEVEL == 2
+ __get_db()->__insert_i(this);
+#endif
}
_LIBCPP_INLINE_VISIBILITY
__bucket_(__x.__bucket_),
__bucket_count_(__x.__bucket_count_)
{
- _LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));
+#if _LIBCPP_DEBUG_LEVEL == 2
+ __get_db()->__iterator_copy(this, &__x);
+#endif
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__hash_const_local_iterator(const __hash_const_local_iterator& __i)
: __node_(__i.__node_),
}
return *this;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {
_LIBCPP_INLINE_VISIBILITY
__hash_const_local_iterator& operator++() {
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable unordered container const_local_iterator");
+ "Attempted to increment a non-incrementable unordered container const_local_iterator");
__node_ = __node_->__next_;
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
{return !(__x == __y);}
private:
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator(__next_pointer __node, size_t __bucket,
+ __hash_const_local_iterator(__next_pointer __node_ptr, size_t __bucket,
size_t __bucket_count, const void* __c) _NOEXCEPT
- : __node_(__node),
+ : __node_(__node_ptr),
__bucket_(__bucket),
__bucket_count_(__bucket_count)
{
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator(__next_pointer __node, size_t __bucket,
+ __hash_const_local_iterator(__next_pointer __node_ptr, size_t __bucket,
size_t __bucket_count) _NOEXCEPT
- : __node_(__node),
+ : __node_(__node_ptr),
__bucket_(__bucket),
__bucket_count_(__bucket_count)
{
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
: __data_(__size, __a) {}
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__bucket_list_deallocator(__bucket_list_deallocator&& __x)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
{
__x.size() = 0;
}
-#endif
_LIBCPP_INLINE_VISIBILITY
size_type& size() _NOEXCEPT {return __data_.first();}
explicit __hash_table(const allocator_type& __a);
__hash_table(const __hash_table& __u);
__hash_table(const __hash_table& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
__hash_table(__hash_table&& __u)
_NOEXCEPT_(
is_nothrow_move_constructible<__bucket_list>::value &&
is_nothrow_move_constructible<hasher>::value &&
is_nothrow_move_constructible<key_equal>::value);
__hash_table(__hash_table&& __u, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
~__hash_table();
__hash_table& operator=(const __hash_table& __u);
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__hash_table& operator=(__hash_table&& __u)
_NOEXCEPT_(
is_nothrow_move_assignable<__node_allocator>::value &&
is_nothrow_move_assignable<hasher>::value &&
is_nothrow_move_assignable<key_equal>::value);
-#endif
template <class _InputIterator>
void __assign_unique(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
{
- return std::min<size_type>(
+ return _VSTD::min<size_type>(
__node_traits::max_size(__node_alloc()),
numeric_limits<difference_type >::max()
);
iterator __node_insert_multi(const_iterator __p,
__node_pointer __nd);
-#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class ..._Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> __emplace_unique_key_args(_Key const& __k, _Args&&... __args);
return __emplace_hint_multi(__p, _VSTD::forward<_Pp>(__x));
}
-#else // !defined(_LIBCPP_CXX03_LANG)
- template <class _Key, class _Args>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args& __args);
-
- iterator __insert_multi(const __container_value_type& __x);
- iterator __insert_multi(const_iterator __p, const __container_value_type& __x);
-#endif
-
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> __insert_unique(const __container_value_type& __x) {
return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
{
_LIBCPP_ASSERT(__n < bucket_count(),
"unordered container::begin(n) called with n >= bucket_count()");
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
#else
return local_iterator(__bucket_list_[__n], __n, bucket_count());
{
_LIBCPP_ASSERT(__n < bucket_count(),
"unordered container::end(n) called with n >= bucket_count()");
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return local_iterator(nullptr, __n, bucket_count(), this);
#else
return local_iterator(nullptr, __n, bucket_count());
{
_LIBCPP_ASSERT(__n < bucket_count(),
"unordered container::cbegin(n) called with n >= bucket_count()");
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return const_local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
#else
return const_local_iterator(__bucket_list_[__n], __n, bucket_count());
{
_LIBCPP_ASSERT(__n < bucket_count(),
"unordered container::cend(n) called with n >= bucket_count()");
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return const_local_iterator(nullptr, __n, bucket_count(), this);
#else
return const_local_iterator(nullptr, __n, bucket_count());
#endif
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
bool __dereferenceable(const const_iterator* __i) const;
bool __decrementable(const const_iterator* __i) const;
bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
private:
void __rehash(size_type __n);
-#ifndef _LIBCPP_CXX03_LANG
template <class ..._Args>
__node_holder __construct_node(_Args&& ...__args);
template <class _First, class ..._Rest>
__node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);
-#else // _LIBCPP_CXX03_LANG
- __node_holder __construct_node(const __container_value_type& __v);
- __node_holder __construct_node_hash(size_t __hash, const __container_value_type& __v);
-#endif
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __hash_table&, false_type) {}
-#ifndef _LIBCPP_CXX03_LANG
void __move_assign(__hash_table& __u, false_type);
void __move_assign(__hash_table& __u, true_type)
_NOEXCEPT_(
}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
-#endif // _LIBCPP_CXX03_LANG
void __deallocate_node(__next_pointer __np) _NOEXCEPT;
__next_pointer __detach() _NOEXCEPT;
{
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
_NOEXCEPT_(
}
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
{
#endif
__deallocate_node(__p1_.first().__next_);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__erase_c(this);
#endif
}
while (__np != nullptr)
{
__next_pointer __next = __np->__next_;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __p = __c->end_; __p != __c->beg_; )
{
{
(*__p)->__c_ = nullptr;
if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
}
}
__get_db()->unlock();
return __cache;
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
__u.__p1_.first().__next_ = nullptr;
__u.size() = 0;
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->swap(this, &__u);
#endif
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
const_iterator __i = __u.begin();
while (__cache != nullptr && __u.size() != 0)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__deallocate_node(__cache);
}
const_iterator __i = __u.begin();
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _InputIterator>
void
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
__cache->__upcast()->__value_ = *__first;
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__deallocate_node(__cache);
}
for (; __first != __last; ++__first)
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
__cache->__upcast()->__value_ = *__first;
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__deallocate_node(__cache);
}
for (; __first != __last; ++__first)
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__p1_.first().__next_, this);
#else
return iterator(__p1_.first().__next_);
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(nullptr, this);
#else
return iterator(nullptr);
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return const_iterator(__p1_.first().__next_, this);
#else
return const_iterator(__p1_.first().__next_);
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return const_iterator(nullptr, this);
#else
return const_iterator(nullptr);
__existing_node = __nd->__ptr();
__inserted = true;
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return pair<iterator, bool>(iterator(__existing_node, this), __inserted);
#else
return pair<iterator, bool>(iterator(__existing_node), __inserted);
// Prepare the container for an insertion of the value __cp_val with the hash
// __cp_hash. This does a lookup into the container to see if __cp_value is
// already present, and performs a rehash if necessary. Returns a pointer to the
-// last occurance of __cp_val in the map.
+// last occurrence of __cp_val in the map.
//
// Note that this function does forward exceptions if key_eq() throws, and never
// mutates __value or actually inserts into the map.
__next_pointer __pn = __node_insert_multi_prepare(__cp->__hash(), __cp->__value_);
__node_insert_multi_perform(__cp, __pn);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__cp->__ptr(), this);
#else
return iterator(__cp->__ptr());
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
const_iterator __p, __node_pointer __cp)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
" referring to this unordered container");
__cp->__next_ = __np;
__pp->__next_ = static_cast<__next_pointer>(__cp);
++size();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(static_cast<__next_pointer>(__cp), this);
#else
return iterator(static_cast<__next_pointer>(__cp));
-#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _Key, class ..._Args>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)
-#else
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _Key, class _Args>
-pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args& __args)
-#endif
{
size_t __hash = hash_function()(__k);
}
}
{
-#ifndef _LIBCPP_CXX03_LANG
__node_holder __h = __construct_node_hash(__hash, _VSTD::forward<_Args>(__args)...);
-#else
- __node_holder __h = __construct_node_hash(__hash, __args);
-#endif
if (size()+1 > __bc * max_load_factor() || __bc == 0)
{
rehash(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
__inserted = true;
}
__done:
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return pair<iterator, bool>(iterator(__nd, this), __inserted);
#else
return pair<iterator, bool>(iterator(__nd), __inserted);
#endif
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class... _Args>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
const_iterator __p, _Args&&... __args)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
" referring to this unordered container");
return __r;
}
-#else // _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const __container_value_type& __x)
-{
- __node_holder __h = __construct_node(__x);
- iterator __r = __node_insert_multi(__h.get());
- __h.release();
- return __r;
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
- const __container_value_type& __x)
-{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "unordered container::insert(const_iterator, lvalue) called with an iterator not"
- " referring to this unordered container");
-#endif
- __node_holder __h = __construct_node(__x);
- iterator __r = __node_insert_multi(__p, __h.get());
- __h.release();
- return __r;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
#if _LIBCPP_STD_VER > 14
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _NodeHandle, class _InsertReturnType>
__node_insert_multi_perform(__src_ptr, __pn);
}
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER > 14
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__invalidate_all(this);
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif
__pointer_allocator& __npa = __bucket_list_.get_deleter().__alloc();
__bucket_list_.reset(__nbc > 0 ?
__pointer_alloc_traits::allocate(__npa, __nbc) : nullptr);
{
if ((__nd->__hash() == __hash)
&& key_eq()(__nd->__upcast()->__value_, __k))
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__nd, this);
#else
return iterator(__nd);
{
if ((__nd->__hash() == __hash)
&& key_eq()(__nd->__upcast()->__value_, __k))
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return const_iterator(__nd, this);
#else
return const_iterator(__nd);
return end();
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class ..._Args>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
return __h;
}
-#else // _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const __container_value_type& __v)
-{
- __node_allocator& __na = __node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
- __h.get_deleter().__value_constructed = true;
- __h->__hash_ = hash_function()(__h->__value_);
- __h->__next_ = nullptr;
- return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash,
- const __container_value_type& __v)
-{
- __node_allocator& __na = __node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
- __h.get_deleter().__value_constructed = true;
- __h->__hash_ = __hash;
- __h->__next_ = nullptr;
- return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
{
__next_pointer __np = __p.__node_;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered container erase(iterator) called with an iterator not"
" referring to this container");
__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
const_iterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
- "unodered container::erase(iterator, iterator) called with an iterator not"
- " referring to this unodered container");
+ "unordered container::erase(iterator, iterator) called with an iterator not"
+ " referring to this container");
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__last) == this,
- "unodered container::erase(iterator, iterator) called with an iterator not"
- " referring to this unodered container");
+ "unordered container::erase(iterator, iterator) called with an iterator not"
+ " referring to this container");
#endif
for (const_iterator __p = __first; __first != __last; __p = __first)
{
erase(__p);
}
__next_pointer __np = __last.__node_;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator (__np, this);
#else
return iterator (__np);
__pn->__next_ = __cn->__next_;
__cn->__next_ = nullptr;
--size();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __dp = __c->end_; __dp != __c->beg_; )
{
{
(*__dp)->__c_ = nullptr;
if (--__c->end_ != __dp)
- memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));
+ _VSTD::memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));
}
}
__get_db()->unlock();
__u.__bucket_list_.reset(__npp);
}
_VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
- __swap_allocator(__bucket_list_.get_deleter().__alloc(),
+ _VSTD::__swap_allocator(__bucket_list_.get_deleter().__alloc(),
__u.__bucket_list_.get_deleter().__alloc());
- __swap_allocator(__node_alloc(), __u.__node_alloc());
+ _VSTD::__swap_allocator(__node_alloc(), __u.__node_alloc());
_VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
__p2_.swap(__u.__p2_);
__p3_.swap(__u.__p3_);
if (__u.size() > 0)
__u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash(), __u.bucket_count())] =
__u.__p1_.first().__ptr();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->swap(this, &__u);
#endif
}
__x.swap(__y);
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
template <class _Tp, class _Hash, class _Equal, class _Alloc>
bool
return false;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP__HASH_TABLE
+#endif // _LIBCPP__HASH_TABLE
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ACCESS_H
+#define _LIBCPP___ITERATOR_ACCESS_H
+
+#include <__config>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, size_t _Np>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_Tp*
+begin(_Tp (&__array)[_Np])
+{
+ return __array;
+}
+
+template <class _Tp, size_t _Np>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_Tp*
+end(_Tp (&__array)[_Np])
+{
+ return __array + _Np;
+}
+
+#if !defined(_LIBCPP_CXX03_LANG)
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto
+begin(_Cp& __c) -> decltype(__c.begin())
+{
+ return __c.begin();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto
+begin(const _Cp& __c) -> decltype(__c.begin())
+{
+ return __c.begin();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto
+end(_Cp& __c) -> decltype(__c.end())
+{
+ return __c.end();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto
+end(const _Cp& __c) -> decltype(__c.end())
+{
+ return __c.end();
+}
+
+#if _LIBCPP_STD_VER > 11
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+auto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c))
+{
+ return _VSTD::begin(__c);
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c))
+{
+ return _VSTD::end(__c);
+}
+
+#endif
+
+
+#else // defined(_LIBCPP_CXX03_LANG)
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY
+typename _Cp::iterator
+begin(_Cp& __c)
+{
+ return __c.begin();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY
+typename _Cp::const_iterator
+begin(const _Cp& __c)
+{
+ return __c.begin();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY
+typename _Cp::iterator
+end(_Cp& __c)
+{
+ return __c.end();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY
+typename _Cp::const_iterator
+end(const _Cp& __c)
+{
+ return __c.end();
+}
+
+#endif // !defined(_LIBCPP_CXX03_LANG)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ACCESS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ADVANCE_H
+#define _LIBCPP___ITERATOR_ADVANCE_H
+
+#include <__config>
+#include <__debug>
+#include <__function_like.h>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/move.h>
+#include <cstdlib>
+#include <concepts>
+#include <limits>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIter>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+void __advance(_InputIter& __i, typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag) {
+ for (; __n > 0; --__n)
+ ++__i;
+}
+
+template <class _BiDirIter>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+void __advance(_BiDirIter& __i, typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag) {
+ if (__n >= 0)
+ for (; __n > 0; --__n)
+ ++__i;
+ else
+ for (; __n < 0; ++__n)
+ --__i;
+}
+
+template <class _RandIter>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+void __advance(_RandIter& __i, typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag) {
+ __i += __n;
+}
+
+template <
+ class _InputIter, class _Distance,
+ class _IntegralDistance = decltype(_VSTD::__convert_to_integral(declval<_Distance>())),
+ class = _EnableIf<is_integral<_IntegralDistance>::value> >
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+void advance(_InputIter& __i, _Distance __orig_n) {
+ typedef typename iterator_traits<_InputIter>::difference_type _Difference;
+ _Difference __n = static_cast<_Difference>(_VSTD::__convert_to_integral(__orig_n));
+ _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
+ "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
+ _VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
+}
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+// [range.iter.op.advance]
+struct __advance_fn final : private __function_like {
+private:
+ template <class _Tp>
+ _LIBCPP_HIDE_FROM_ABI
+ static constexpr _Tp __magnitude_geq(_Tp __a, _Tp __b) noexcept {
+ return __a < 0 ? (__a <= __b) : (__a >= __b);
+ }
+
+ template <class _Ip>
+ _LIBCPP_HIDE_FROM_ABI
+ static constexpr void __advance_forward(_Ip& __i, iter_difference_t<_Ip> __n) {
+ while (__n > 0) {
+ --__n;
+ ++__i;
+ }
+ }
+
+ template <class _Ip>
+ _LIBCPP_HIDE_FROM_ABI
+ static constexpr void __advance_backward(_Ip& __i, iter_difference_t<_Ip> __n) {
+ while (__n < 0) {
+ ++__n;
+ --__i;
+ }
+ }
+
+public:
+ constexpr explicit __advance_fn(__tag __x) noexcept : __function_like(__x) {}
+
+ // Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative.
+ template <input_or_output_iterator _Ip>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void operator()(_Ip& __i, iter_difference_t<_Ip> __n) const {
+ _LIBCPP_ASSERT(__n >= 0 || bidirectional_iterator<_Ip>,
+ "If `n < 0`, then `bidirectional_iterator<I>` must be true.");
+
+ // If `I` models `random_access_iterator`, equivalent to `i += n`.
+ if constexpr (random_access_iterator<_Ip>) {
+ __i += __n;
+ return;
+ } else if constexpr (bidirectional_iterator<_Ip>) {
+ // Otherwise, if `n` is non-negative, increments `i` by `n`.
+ __advance_forward(__i, __n);
+ // Otherwise, decrements `i` by `-n`.
+ __advance_backward(__i, __n);
+ return;
+ } else {
+ // Otherwise, if `n` is non-negative, increments `i` by `n`.
+ __advance_forward(__i, __n);
+ return;
+ }
+ }
+
+ // Preconditions: Either `assignable_from<I&, S> || sized_sentinel_for<S, I>` is modeled, or [i, bound) denotes a range.
+ template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void operator()(_Ip& __i, _Sp __bound) const {
+ // If `I` and `S` model `assignable_from<I&, S>`, equivalent to `i = std::move(bound)`.
+ if constexpr (assignable_from<_Ip&, _Sp>) {
+ __i = _VSTD::move(__bound);
+ }
+ // Otherwise, if `S` and `I` model `sized_sentinel_for<S, I>`, equivalent to `ranges::advance(i, bound - i)`.
+ else if constexpr (sized_sentinel_for<_Sp, _Ip>) {
+ (*this)(__i, __bound - __i);
+ }
+ // Otherwise, while `bool(i != bound)` is true, increments `i`.
+ else {
+ while (__i != __bound) {
+ ++__i;
+ }
+ }
+ }
+
+ // Preconditions:
+ // * If `n > 0`, [i, bound) denotes a range.
+ // * If `n == 0`, [i, bound) or [bound, i) denotes a range.
+ // * If `n < 0`, [bound, i) denotes a range, `I` models `bidirectional_iterator`, and `I` and `S` model `same_as<I, S>`.
+ // Returns: `n - M`, where `M` is the difference between the the ending and starting position.
+ template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr iter_difference_t<_Ip> operator()(_Ip& __i, iter_difference_t<_Ip> __n, _Sp __bound) const {
+ _LIBCPP_ASSERT((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
+ "If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true.");
+ // If `S` and `I` model `sized_sentinel_for<S, I>`:
+ if constexpr (sized_sentinel_for<_Sp, _Ip>) {
+ // If |n| >= |bound - i|, equivalent to `ranges::advance(i, bound)`.
+ if (const auto __M = __bound - __i; __magnitude_geq(__n, __M)) {
+ (*this)(__i, __bound);
+ return __n - __M;
+ }
+
+ // Otherwise, equivalent to `ranges::advance(i, n)`.
+ (*this)(__i, __n);
+ return 0;
+ } else {
+ // Otherwise, if `n` is non-negative, while `bool(i != bound)` is true, increments `i` but at
+ // most `n` times.
+ while (__i != __bound && __n > 0) {
+ ++__i;
+ --__n;
+ }
+
+ // Otherwise, while `bool(i != bound)` is true, decrements `i` but at most `-n` times.
+ if constexpr (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>) {
+ while (__i != __bound && __n < 0) {
+ --__i;
+ ++__n;
+ }
+ }
+ return __n;
+ }
+
+ _LIBCPP_UNREACHABLE();
+ }
+};
+
+inline constexpr auto advance = __advance_fn(__function_like::__tag());
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ADVANCE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H
+#define _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/addressof.h>
+#include <__utility/move.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Container>
+class _LIBCPP_TEMPLATE_VIS back_insert_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<output_iterator_tag, void, void, void, void>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+protected:
+ _Container* container;
+public:
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+#if _LIBCPP_STD_VER > 17
+ typedef ptrdiff_t difference_type;
+#else
+ typedef void difference_type;
+#endif
+ typedef void pointer;
+ typedef void reference;
+ typedef _Container container_type;
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit back_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator=(const typename _Container::value_type& __value_)
+ {container->push_back(__value_); return *this;}
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator=(typename _Container::value_type&& __value_)
+ {container->push_back(_VSTD::move(__value_)); return *this;}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator*() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator++() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator operator++(int) {return *this;}
+};
+
+template <class _Container>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+back_insert_iterator<_Container>
+back_inserter(_Container& __x)
+{
+ return back_insert_iterator<_Container>(__x);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_COMMON_ITERATOR_H
+#define _LIBCPP___ITERATOR_COMMON_ITERATOR_H
+
+#include <__config>
+#include <__debug>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/readable_traits.h>
+#include <concepts>
+#include <variant>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent>
+ requires (!same_as<_Iter, _Sent> && copyable<_Iter>)
+class common_iterator {
+ class __proxy {
+ friend common_iterator;
+
+ iter_value_t<_Iter> __value;
+ // We can move __x because the only caller verifies that __x is not a reference.
+ constexpr __proxy(iter_reference_t<_Iter>&& __x)
+ : __value(_VSTD::move(__x)) {}
+
+ public:
+ const iter_value_t<_Iter>* operator->() const {
+ return _VSTD::addressof(__value);
+ }
+ };
+
+ class __postfix_proxy {
+ friend common_iterator;
+
+ iter_value_t<_Iter> __value;
+ constexpr __postfix_proxy(iter_reference_t<_Iter>&& __x)
+ : __value(_VSTD::forward<iter_reference_t<_Iter>>(__x)) {}
+
+ public:
+ constexpr static bool __valid_for_iter =
+ constructible_from<iter_value_t<_Iter>, iter_reference_t<_Iter>> &&
+ move_constructible<iter_value_t<_Iter>>;
+
+ const iter_value_t<_Iter>& operator*() const {
+ return __value;
+ }
+ };
+
+public:
+ variant<_Iter, _Sent> __hold_;
+
+ common_iterator() requires default_initializable<_Iter> = default;
+
+ constexpr common_iterator(_Iter __i) : __hold_(in_place_type<_Iter>, _VSTD::move(__i)) {}
+ constexpr common_iterator(_Sent __s) : __hold_(in_place_type<_Sent>, _VSTD::move(__s)) {}
+
+ template<class _I2, class _S2>
+ requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent>
+ constexpr common_iterator(const common_iterator<_I2, _S2>& __other)
+ : __hold_([&]() -> variant<_Iter, _Sent> {
+ _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Constructed from valueless iterator.");
+ if (__other.__hold_.index() == 0)
+ return variant<_Iter, _Sent>{in_place_index<0>, _VSTD::__unchecked_get<0>(__other.__hold_)};
+ return variant<_Iter, _Sent>{in_place_index<1>, _VSTD::__unchecked_get<1>(__other.__hold_)};
+ }()) {}
+
+ template<class _I2, class _S2>
+ requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent> &&
+ assignable_from<_Iter&, const _I2&> && assignable_from<_Sent&, const _S2&>
+ common_iterator& operator=(const common_iterator<_I2, _S2>& __other) {
+ _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Assigned from valueless iterator.");
+
+ auto __idx = __hold_.index();
+ auto __other_idx = __other.__hold_.index();
+
+ // If they're the same index, just assign.
+ if (__idx == 0 && __other_idx == 0)
+ _VSTD::__unchecked_get<0>(__hold_) = _VSTD::__unchecked_get<0>(__other.__hold_);
+ else if (__idx == 1 && __other_idx == 1)
+ _VSTD::__unchecked_get<1>(__hold_) = _VSTD::__unchecked_get<1>(__other.__hold_);
+
+ // Otherwise replace with the oposite element.
+ else if (__other_idx == 1)
+ __hold_.template emplace<1>(_VSTD::__unchecked_get<1>(__other.__hold_));
+ else if (__other_idx == 0)
+ __hold_.template emplace<0>(_VSTD::__unchecked_get<0>(__other.__hold_));
+
+ return *this;
+ }
+
+ decltype(auto) operator*()
+ {
+ _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_),
+ "Cannot dereference sentinel. Common iterator not holding an iterator.");
+ return *_VSTD::__unchecked_get<_Iter>(__hold_);
+ }
+
+ decltype(auto) operator*() const
+ requires __dereferenceable<const _Iter>
+ {
+ _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_),
+ "Cannot dereference sentinel. Common iterator not holding an iterator.");
+ return *_VSTD::__unchecked_get<_Iter>(__hold_);
+ }
+
+ template<class _I2 = _Iter>
+ decltype(auto) operator->() const
+ requires indirectly_readable<const _I2> &&
+ (requires(const _I2& __i) { __i.operator->(); } ||
+ is_reference_v<iter_reference_t<_I2>> ||
+ constructible_from<iter_value_t<_I2>, iter_reference_t<_I2>>)
+ {
+ _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_),
+ "Cannot dereference sentinel. Common iterator not holding an iterator.");
+
+ if constexpr (is_pointer_v<_Iter> || requires(const _Iter& __i) { __i.operator->(); }) {
+ return _VSTD::__unchecked_get<_Iter>(__hold_);
+ } else if constexpr (is_reference_v<iter_reference_t<_Iter>>) {
+ auto&& __tmp = *_VSTD::__unchecked_get<_Iter>(__hold_);
+ return _VSTD::addressof(__tmp);
+ } else {
+ return __proxy(*_VSTD::__unchecked_get<_Iter>(__hold_));
+ }
+ }
+
+ common_iterator& operator++() {
+ _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_),
+ "Cannot increment sentinel. Common iterator not holding an iterator.");
+ ++_VSTD::__unchecked_get<_Iter>(__hold_); return *this;
+ }
+
+ decltype(auto) operator++(int) {
+ _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_),
+ "Cannot increment sentinel. Common iterator not holding an iterator.");
+
+ if constexpr (forward_iterator<_Iter>) {
+ auto __tmp = *this;
+ ++*this;
+ return __tmp;
+ } else if constexpr (requires (_Iter& __i) { { *__i++ } -> __referenceable; } ||
+ !__postfix_proxy::__valid_for_iter) {
+ return _VSTD::__unchecked_get<_Iter>(__hold_)++;
+ } else {
+ __postfix_proxy __p(**this);
+ ++*this;
+ return __p;
+ }
+ }
+
+ template<class _I2, sentinel_for<_Iter> _S2>
+ requires sentinel_for<_Sent, _I2>
+ friend bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
+ _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception() &&
+ !__y.__hold_.valueless_by_exception(),
+ "One or both common_iterators are valueless. (Cannot compare valueless iterators.)");
+
+ auto __x_index = __x.__hold_.index();
+ auto __y_index = __y.__hold_.index();
+
+ if (__x_index == __y_index)
+ return true;
+
+ if (__x_index == 0)
+ return _VSTD::__unchecked_get<_Iter>(__x.__hold_) == _VSTD::__unchecked_get<_S2>(__y.__hold_);
+
+ return _VSTD::__unchecked_get<_Sent>(__x.__hold_) == _VSTD::__unchecked_get<_I2>(__y.__hold_);
+ }
+
+ template<class _I2, sentinel_for<_Iter> _S2>
+ requires sentinel_for<_Sent, _I2> && equality_comparable_with<_Iter, _I2>
+ friend bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
+ _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception() &&
+ !__y.__hold_.valueless_by_exception(),
+ "One or both common_iterators are valueless. (Cannot compare valueless iterators.)");
+
+ auto __x_index = __x.__hold_.index();
+ auto __y_index = __y.__hold_.index();
+
+ if (__x_index == 1 && __y_index == 1)
+ return true;
+
+ if (__x_index == 0 && __y_index == 0)
+ return _VSTD::__unchecked_get<_Iter>(__x.__hold_) == _VSTD::__unchecked_get<_I2>(__y.__hold_);
+
+ if (__x_index == 0)
+ return _VSTD::__unchecked_get<_Iter>(__x.__hold_) == _VSTD::__unchecked_get<_S2>(__y.__hold_);
+
+ return _VSTD::__unchecked_get<_Sent>(__x.__hold_) == _VSTD::__unchecked_get<_I2>(__y.__hold_);
+ }
+
+ template<sized_sentinel_for<_Iter> _I2, sized_sentinel_for<_Iter> _S2>
+ requires sized_sentinel_for<_Sent, _I2>
+ friend iter_difference_t<_I2> operator-(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
+ _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception() &&
+ !__y.__hold_.valueless_by_exception(),
+ "One or both common_iterators are valueless. (Cannot subtract valueless iterators.)");
+
+ auto __x_index = __x.__hold_.index();
+ auto __y_index = __y.__hold_.index();
+
+ if (__x_index == 1 && __y_index == 1)
+ return 0;
+
+ if (__x_index == 0 && __y_index == 0)
+ return _VSTD::__unchecked_get<_Iter>(__x.__hold_) - _VSTD::__unchecked_get<_I2>(__y.__hold_);
+
+ if (__x_index == 0)
+ return _VSTD::__unchecked_get<_Iter>(__x.__hold_) - _VSTD::__unchecked_get<_S2>(__y.__hold_);
+
+ return _VSTD::__unchecked_get<_Sent>(__x.__hold_) - _VSTD::__unchecked_get<_I2>(__y.__hold_);
+ }
+
+ friend iter_rvalue_reference_t<_Iter> iter_move(const common_iterator& __i)
+ noexcept(noexcept(ranges::iter_move(declval<const _Iter&>())))
+ requires input_iterator<_Iter>
+ {
+ _LIBCPP_ASSERT(holds_alternative<_Iter>(__i.__hold_),
+ "Cannot iter_move a sentinel. Common iterator not holding an iterator.");
+ return ranges::iter_move( _VSTD::__unchecked_get<_Iter>(__i.__hold_));
+ }
+
+ template<indirectly_swappable<_Iter> _I2, class _S2>
+ friend void iter_swap(const common_iterator& __x, const common_iterator<_I2, _S2>& __y)
+ noexcept(noexcept(ranges::iter_swap(declval<const _Iter&>(), declval<const _I2&>())))
+ {
+ _LIBCPP_ASSERT(holds_alternative<_Iter>(__x.__hold_),
+ "Cannot swap __y with a sentinel. Common iterator (__x) not holding an iterator.");
+ _LIBCPP_ASSERT(holds_alternative<_Iter>(__y.__hold_),
+ "Cannot swap __x with a sentinel. Common iterator (__y) not holding an iterator.");
+ return ranges::iter_swap( _VSTD::__unchecked_get<_Iter>(__x.__hold_), _VSTD::__unchecked_get<_Iter>(__y.__hold_));
+ }
+};
+
+template<class _Iter, class _Sent>
+struct incrementable_traits<common_iterator<_Iter, _Sent>> {
+ using difference_type = iter_difference_t<_Iter>;
+};
+
+template<class _Iter>
+concept __denotes_forward_iter =
+ requires { typename iterator_traits<_Iter>::iterator_category; } &&
+ derived_from<typename iterator_traits<_Iter>::iterator_category, forward_iterator_tag>;
+
+template<class _Iter, class _Sent>
+concept __common_iter_has_ptr_op = requires(const common_iterator<_Iter, _Sent>& __a) {
+ __a.operator->();
+};
+
+template<class, class>
+struct __arrow_type_or_void {
+ using type = void;
+};
+
+template<class _Iter, class _Sent>
+ requires __common_iter_has_ptr_op<_Iter, _Sent>
+struct __arrow_type_or_void<_Iter, _Sent> {
+ using type = decltype(declval<const common_iterator<_Iter, _Sent>>().operator->());
+};
+
+template<class _Iter, class _Sent>
+struct iterator_traits<common_iterator<_Iter, _Sent>> {
+ using iterator_concept = _If<forward_iterator<_Iter>,
+ forward_iterator_tag,
+ input_iterator_tag>;
+ using iterator_category = _If<__denotes_forward_iter<_Iter>,
+ forward_iterator_tag,
+ input_iterator_tag>;
+ using pointer = typename __arrow_type_or_void<_Iter, _Sent>::type;
+ using value_type = iter_value_t<_Iter>;
+ using difference_type = iter_difference_t<_Iter>;
+ using reference = iter_reference_t<_Iter>;
+};
+
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_COMMON_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_CONCEPTS_H
+#define _LIBCPP___ITERATOR_CONCEPTS_H
+
+#include <__config>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/readable_traits.h>
+#include <__memory/pointer_traits.h>
+#include <__utility/forward.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// clang-format off
+
+// [iterator.concept.readable]
+template<class _In>
+concept __indirectly_readable_impl =
+ requires(const _In __i) {
+ typename iter_value_t<_In>;
+ typename iter_reference_t<_In>;
+ typename iter_rvalue_reference_t<_In>;
+ { *__i } -> same_as<iter_reference_t<_In>>;
+ { ranges::iter_move(__i) } -> same_as<iter_rvalue_reference_t<_In>>;
+ } &&
+ common_reference_with<iter_reference_t<_In>&&, iter_value_t<_In>&> &&
+ common_reference_with<iter_reference_t<_In>&&, iter_rvalue_reference_t<_In>&&> &&
+ common_reference_with<iter_rvalue_reference_t<_In>&&, const iter_value_t<_In>&>;
+
+template<class _In>
+concept indirectly_readable = __indirectly_readable_impl<remove_cvref_t<_In>>;
+
+template<indirectly_readable _Tp>
+using iter_common_reference_t = common_reference_t<iter_reference_t<_Tp>, iter_value_t<_Tp>&>;
+
+// [iterator.concept.writable]
+template<class _Out, class _Tp>
+concept indirectly_writable =
+ requires(_Out&& __o, _Tp&& __t) {
+ *__o = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving
+ *_VSTD::forward<_Out>(__o) = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving
+ const_cast<const iter_reference_t<_Out>&&>(*__o) = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving
+ const_cast<const iter_reference_t<_Out>&&>(*_VSTD::forward<_Out>(__o)) = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving
+ };
+
+// [iterator.concept.winc]
+template<class _Tp>
+concept __integer_like = integral<_Tp> && !same_as<_Tp, bool>;
+
+template<class _Tp>
+concept __signed_integer_like = signed_integral<_Tp>;
+
+template<class _Ip>
+concept weakly_incrementable =
+ movable<_Ip> &&
+ requires(_Ip __i) {
+ typename iter_difference_t<_Ip>;
+ requires __signed_integer_like<iter_difference_t<_Ip>>;
+ { ++__i } -> same_as<_Ip&>; // not required to be equality-preserving
+ __i++; // not required to be equality-preserving
+ };
+
+// [iterator.concept.inc]
+template<class _Ip>
+concept incrementable =
+ regular<_Ip> &&
+ weakly_incrementable<_Ip> &&
+ requires(_Ip __i) {
+ { __i++ } -> same_as<_Ip>;
+ };
+
+// [iterator.concept.iterator]
+template<class _Ip>
+concept input_or_output_iterator =
+ requires(_Ip __i) {
+ { *__i } -> __referenceable;
+ } &&
+ weakly_incrementable<_Ip>;
+
+// [iterator.concept.sentinel]
+template<class _Sp, class _Ip>
+concept sentinel_for =
+ semiregular<_Sp> &&
+ input_or_output_iterator<_Ip> &&
+ __weakly_equality_comparable_with<_Sp, _Ip>;
+
+template<class, class>
+inline constexpr bool disable_sized_sentinel_for = false;
+
+template<class _Sp, class _Ip>
+concept sized_sentinel_for =
+ sentinel_for<_Sp, _Ip> &&
+ !disable_sized_sentinel_for<remove_cv_t<_Sp>, remove_cv_t<_Ip>> &&
+ requires(const _Ip& __i, const _Sp& __s) {
+ { __s - __i } -> same_as<iter_difference_t<_Ip>>;
+ { __i - __s } -> same_as<iter_difference_t<_Ip>>;
+ };
+
+// [iterator.concept.input]
+template<class _Ip>
+concept input_iterator =
+ input_or_output_iterator<_Ip> &&
+ indirectly_readable<_Ip> &&
+ requires { typename _ITER_CONCEPT<_Ip>; } &&
+ derived_from<_ITER_CONCEPT<_Ip>, input_iterator_tag>;
+
+// [iterator.concept.output]
+template<class _Ip, class _Tp>
+concept output_iterator =
+ input_or_output_iterator<_Ip> &&
+ indirectly_writable<_Ip, _Tp> &&
+ requires (_Ip __it, _Tp&& __t) {
+ *__it++ = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving
+ };
+
+// [iterator.concept.forward]
+template<class _Ip>
+concept forward_iterator =
+ input_iterator<_Ip> &&
+ derived_from<_ITER_CONCEPT<_Ip>, forward_iterator_tag> &&
+ incrementable<_Ip> &&
+ sentinel_for<_Ip, _Ip>;
+
+// [iterator.concept.bidir]
+template<class _Ip>
+concept bidirectional_iterator =
+ forward_iterator<_Ip> &&
+ derived_from<_ITER_CONCEPT<_Ip>, bidirectional_iterator_tag> &&
+ requires(_Ip __i) {
+ { --__i } -> same_as<_Ip&>;
+ { __i-- } -> same_as<_Ip>;
+ };
+
+template<class _Ip>
+concept random_access_iterator =
+ bidirectional_iterator<_Ip> &&
+ derived_from<_ITER_CONCEPT<_Ip>, random_access_iterator_tag> &&
+ totally_ordered<_Ip> &&
+ sized_sentinel_for<_Ip, _Ip> &&
+ requires(_Ip __i, const _Ip __j, const iter_difference_t<_Ip> __n) {
+ { __i += __n } -> same_as<_Ip&>;
+ { __j + __n } -> same_as<_Ip>;
+ { __n + __j } -> same_as<_Ip>;
+ { __i -= __n } -> same_as<_Ip&>;
+ { __j - __n } -> same_as<_Ip>;
+ { __j[__n] } -> same_as<iter_reference_t<_Ip>>;
+ };
+
+template<class _Ip>
+concept contiguous_iterator =
+ random_access_iterator<_Ip> &&
+ derived_from<_ITER_CONCEPT<_Ip>, contiguous_iterator_tag> &&
+ is_lvalue_reference_v<iter_reference_t<_Ip>> &&
+ same_as<iter_value_t<_Ip>, remove_cvref_t<iter_reference_t<_Ip>>> &&
+ (is_pointer_v<_Ip> || requires { sizeof(__pointer_traits_element_type<_Ip>); }) &&
+ requires(const _Ip& __i) {
+ { _VSTD::to_address(__i) } -> same_as<add_pointer_t<iter_reference_t<_Ip>>>;
+ };
+
+template<class _Ip>
+concept __has_arrow = input_iterator<_Ip> && (is_pointer_v<_Ip> || requires(_Ip __i) { __i.operator->(); });
+
+// [indirectcallable.indirectinvocable]
+template<class _Fp, class _It>
+concept indirectly_unary_invocable =
+ indirectly_readable<_It> &&
+ copy_constructible<_Fp> &&
+ invocable<_Fp&, iter_value_t<_It>&> &&
+ invocable<_Fp&, iter_reference_t<_It>> &&
+ invocable<_Fp&, iter_common_reference_t<_It>> &&
+ common_reference_with<
+ invoke_result_t<_Fp&, iter_value_t<_It>&>,
+ invoke_result_t<_Fp&, iter_reference_t<_It>>>;
+
+template<class _Fp, class _It>
+concept indirectly_regular_unary_invocable =
+ indirectly_readable<_It> &&
+ copy_constructible<_Fp> &&
+ regular_invocable<_Fp&, iter_value_t<_It>&> &&
+ regular_invocable<_Fp&, iter_reference_t<_It>> &&
+ regular_invocable<_Fp&, iter_common_reference_t<_It>> &&
+ common_reference_with<
+ invoke_result_t<_Fp&, iter_value_t<_It>&>,
+ invoke_result_t<_Fp&, iter_reference_t<_It>>>;
+
+template<class _Fp, class _It>
+concept indirect_unary_predicate =
+ indirectly_readable<_It> &&
+ copy_constructible<_Fp> &&
+ predicate<_Fp&, iter_value_t<_It>&> &&
+ predicate<_Fp&, iter_reference_t<_It>> &&
+ predicate<_Fp&, iter_common_reference_t<_It>>;
+
+template<class _Fp, class _It1, class _It2>
+concept indirect_binary_predicate =
+ indirectly_readable<_It1> && indirectly_readable<_It2> &&
+ copy_constructible<_Fp> &&
+ predicate<_Fp&, iter_value_t<_It1>&, iter_value_t<_It2>&> &&
+ predicate<_Fp&, iter_value_t<_It1>&, iter_reference_t<_It2>> &&
+ predicate<_Fp&, iter_reference_t<_It1>, iter_value_t<_It2>&> &&
+ predicate<_Fp&, iter_reference_t<_It1>, iter_reference_t<_It2>> &&
+ predicate<_Fp&, iter_common_reference_t<_It1>, iter_common_reference_t<_It2>>;
+
+template<class _Fp, class _It1, class _It2 = _It1>
+concept indirect_equivalence_relation =
+ indirectly_readable<_It1> && indirectly_readable<_It2> &&
+ copy_constructible<_Fp> &&
+ equivalence_relation<_Fp&, iter_value_t<_It1>&, iter_value_t<_It2>&> &&
+ equivalence_relation<_Fp&, iter_value_t<_It1>&, iter_reference_t<_It2>> &&
+ equivalence_relation<_Fp&, iter_reference_t<_It1>, iter_value_t<_It2>&> &&
+ equivalence_relation<_Fp&, iter_reference_t<_It1>, iter_reference_t<_It2>> &&
+ equivalence_relation<_Fp&, iter_common_reference_t<_It1>, iter_common_reference_t<_It2>>;
+
+template<class _Fp, class _It1, class _It2 = _It1>
+concept indirect_strict_weak_order =
+ indirectly_readable<_It1> && indirectly_readable<_It2> &&
+ copy_constructible<_Fp> &&
+ strict_weak_order<_Fp&, iter_value_t<_It1>&, iter_value_t<_It2>&> &&
+ strict_weak_order<_Fp&, iter_value_t<_It1>&, iter_reference_t<_It2>> &&
+ strict_weak_order<_Fp&, iter_reference_t<_It1>, iter_value_t<_It2>&> &&
+ strict_weak_order<_Fp&, iter_reference_t<_It1>, iter_reference_t<_It2>> &&
+ strict_weak_order<_Fp&, iter_common_reference_t<_It1>, iter_common_reference_t<_It2>>;
+
+template<class _Fp, class... _Its>
+ requires (indirectly_readable<_Its> && ...) && invocable<_Fp, iter_reference_t<_Its>...>
+using indirect_result_t = invoke_result_t<_Fp, iter_reference_t<_Its>...>;
+
+template<class _In, class _Out>
+concept indirectly_movable =
+ indirectly_readable<_In> &&
+ indirectly_writable<_Out, iter_rvalue_reference_t<_In>>;
+
+template<class _In, class _Out>
+concept indirectly_movable_storable =
+ indirectly_movable<_In, _Out> &&
+ indirectly_writable<_Out, iter_value_t<_In>> &&
+ movable<iter_value_t<_In>> &&
+ constructible_from<iter_value_t<_In>, iter_rvalue_reference_t<_In>> &&
+ assignable_from<iter_value_t<_In>&, iter_rvalue_reference_t<_In>>;
+
+// Note: indirectly_swappable is located in iter_swap.h to prevent a dependency cycle
+// (both iter_swap and indirectly_swappable require indirectly_readable).
+
+// clang-format on
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_CONCEPTS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___ITERATOR_COUNTED_ITERATOR_H
+#define _LIBCPP___ITERATOR_COUNTED_ITERATOR_H
+
+#include <__config>
+#include <__debug>
+#include <__iterator/concepts.h>
+#include <__iterator/default_sentinel.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/readable_traits.h>
+#include <__memory/pointer_traits.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+template<class>
+struct __counted_iterator_concept {};
+
+template<class _Iter>
+ requires requires { typename _Iter::iterator_concept; }
+struct __counted_iterator_concept<_Iter> {
+ using iterator_concept = typename _Iter::iterator_concept;
+};
+
+template<class>
+struct __counted_iterator_category {};
+
+template<class _Iter>
+ requires requires { typename _Iter::iterator_category; }
+struct __counted_iterator_category<_Iter> {
+ using iterator_category = typename _Iter::iterator_category;
+};
+
+template<class>
+struct __counted_iterator_value_type {};
+
+template<indirectly_readable _Iter>
+struct __counted_iterator_value_type<_Iter> {
+ using value_type = iter_value_t<_Iter>;
+};
+
+template<input_or_output_iterator _Iter>
+class counted_iterator
+ : public __counted_iterator_concept<_Iter>
+ , public __counted_iterator_category<_Iter>
+ , public __counted_iterator_value_type<_Iter>
+{
+public:
+ [[no_unique_address]] _Iter __current_ = _Iter();
+ iter_difference_t<_Iter> __count_ = 0;
+
+ using iterator_type = _Iter;
+ using difference_type = iter_difference_t<_Iter>;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator() requires default_initializable<_Iter> = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator(_Iter __iter, iter_difference_t<_Iter> __n)
+ : __current_(_VSTD::move(__iter)), __count_(__n) {
+ _LIBCPP_ASSERT(__n >= 0, "__n must not be negative.");
+ }
+
+ template<class _I2>
+ requires convertible_to<const _I2&, _Iter>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator(const counted_iterator<_I2>& __other)
+ : __current_(__other.__current_), __count_(__other.__count_) {}
+
+ template<class _I2>
+ requires assignable_from<_Iter&, const _I2&>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator& operator=(const counted_iterator<_I2>& __other) {
+ __current_ = __other.__current_;
+ __count_ = __other.__count_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr const _Iter& base() const& { return __current_; }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Iter base() && { return _VSTD::move(__current_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr iter_difference_t<_Iter> count() const noexcept { return __count_; }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) operator*() {
+ _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
+ return *__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) operator*() const
+ requires __dereferenceable<const _Iter>
+ {
+ _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
+ return *__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto operator->() const noexcept
+ requires contiguous_iterator<_Iter>
+ {
+ return _VSTD::to_address(__current_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator& operator++() {
+ _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ ++__current_;
+ --__count_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ decltype(auto) operator++(int) {
+ _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ --__count_;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try { return __current_++; }
+ catch(...) { ++__count_; throw; }
+#else
+ return __current_++;
+#endif // _LIBCPP_NO_EXCEPTIONS
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator operator++(int)
+ requires forward_iterator<_Iter>
+ {
+ _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ counted_iterator __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator& operator--()
+ requires bidirectional_iterator<_Iter>
+ {
+ --__current_;
+ ++__count_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator operator--(int)
+ requires bidirectional_iterator<_Iter>
+ {
+ counted_iterator __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator operator+(iter_difference_t<_Iter> __n) const
+ requires random_access_iterator<_Iter>
+ {
+ return counted_iterator(__current_ + __n, __count_ - __n);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr counted_iterator operator+(
+ iter_difference_t<_Iter> __n, const counted_iterator& __x)
+ requires random_access_iterator<_Iter>
+ {
+ return __x + __n;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator& operator+=(iter_difference_t<_Iter> __n)
+ requires random_access_iterator<_Iter>
+ {
+ _LIBCPP_ASSERT(__n <= __count_, "Cannot advance iterator past end.");
+ __current_ += __n;
+ __count_ -= __n;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator operator-(iter_difference_t<_Iter> __n) const
+ requires random_access_iterator<_Iter>
+ {
+ return counted_iterator(__current_ - __n, __count_ + __n);
+ }
+
+ template<common_with<_Iter> _I2>
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr iter_difference_t<_I2> operator-(
+ const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs)
+ {
+ return __rhs.__count_ - __lhs.__count_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr iter_difference_t<_Iter> operator-(
+ const counted_iterator& __lhs, default_sentinel_t)
+ {
+ return -__lhs.__count_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr iter_difference_t<_Iter> operator-(
+ default_sentinel_t, const counted_iterator& __rhs)
+ {
+ return __rhs.__count_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr counted_iterator& operator-=(iter_difference_t<_Iter> __n)
+ requires random_access_iterator<_Iter>
+ {
+ _LIBCPP_ASSERT(-__n <= __count_, "Attempt to subtract too large of a size: "
+ "counted_iterator would be decremented before the "
+ "first element of its range.");
+ __current_ -= __n;
+ __count_ += __n;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) operator[](iter_difference_t<_Iter> __n) const
+ requires random_access_iterator<_Iter>
+ {
+ _LIBCPP_ASSERT(__n < __count_, "Subscript argument must be less than size.");
+ return __current_[__n];
+ }
+
+ template<common_with<_Iter> _I2>
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator==(
+ const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs)
+ {
+ return __lhs.__count_ == __rhs.__count_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator==(
+ const counted_iterator& __lhs, default_sentinel_t)
+ {
+ return __lhs.__count_ == 0;
+ }
+
+ template<common_with<_Iter> _I2>
+ friend constexpr strong_ordering operator<=>(
+ const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs)
+ {
+ return __rhs.__count_ <=> __lhs.__count_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const counted_iterator& __i)
+ noexcept(noexcept(ranges::iter_move(__i.__current_)))
+ requires input_iterator<_Iter>
+ {
+ _LIBCPP_ASSERT(__i.__count_ > 0, "Iterator must not be past end of range.");
+ return ranges::iter_move(__i.__current_);
+ }
+
+ template<indirectly_swappable<_Iter> _I2>
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr void iter_swap(const counted_iterator& __x, const counted_iterator<_I2>& __y)
+ noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_)))
+ {
+ _LIBCPP_ASSERT(__x.__count_ > 0 && __y.__count_ > 0,
+ "Iterators must not be past end of range.");
+ return ranges::iter_swap(__x.__current_, __y.__current_);
+ }
+};
+
+template<input_iterator _Iter>
+ requires same_as<_ITER_TRAITS<_Iter>, iterator_traits<_Iter>>
+struct iterator_traits<counted_iterator<_Iter>> : iterator_traits<_Iter> {
+ using pointer = conditional_t<contiguous_iterator<_Iter>,
+ add_pointer_t<iter_reference_t<_Iter>>, void>;
+};
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_COUNTED_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_DATA_H
+#define _LIBCPP___ITERATOR_DATA_H
+
+#include <__config>
+#include <cstddef>
+#include <initializer_list>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+template <class _Cont> constexpr
+_LIBCPP_INLINE_VISIBILITY
+auto data(_Cont& __c)
+_NOEXCEPT_(noexcept(__c.data()))
+-> decltype (__c.data())
+{ return __c.data(); }
+
+template <class _Cont> constexpr
+_LIBCPP_INLINE_VISIBILITY
+auto data(const _Cont& __c)
+_NOEXCEPT_(noexcept(__c.data()))
+-> decltype (__c.data())
+{ return __c.data(); }
+
+template <class _Tp, size_t _Sz>
+_LIBCPP_INLINE_VISIBILITY
+constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept { return __array; }
+
+template <class _Ep>
+_LIBCPP_INLINE_VISIBILITY
+constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); }
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_DATA_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H
+#define _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+struct default_sentinel_t { };
+inline constexpr default_sentinel_t default_sentinel{};
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_DISTANCE_H
+#define _LIBCPP___ITERATOR_DISTANCE_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+typename iterator_traits<_InputIter>::difference_type
+__distance(_InputIter __first, _InputIter __last, input_iterator_tag)
+{
+ typename iterator_traits<_InputIter>::difference_type __r(0);
+ for (; __first != __last; ++__first)
+ ++__r;
+ return __r;
+}
+
+template <class _RandIter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+typename iterator_traits<_RandIter>::difference_type
+__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
+{
+ return __last - __first;
+}
+
+template <class _InputIter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+typename iterator_traits<_InputIter>::difference_type
+distance(_InputIter __first, _InputIter __last)
+{
+ return _VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_DISTANCE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_EMPTY_H
+#define _LIBCPP___ITERATOR_EMPTY_H
+
+#include <__config>
+#include <cstddef>
+#include <initializer_list>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+template <class _Cont>
+_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+constexpr auto empty(const _Cont& __c)
+_NOEXCEPT_(noexcept(__c.empty()))
+-> decltype (__c.empty())
+{ return __c.empty(); }
+
+template <class _Tp, size_t _Sz>
+_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }
+
+template <class _Ep>
+_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_EMPTY_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H
+#define _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Container, class _Predicate>
+_LIBCPP_HIDE_FROM_ABI
+typename _Container::size_type
+__libcpp_erase_if_container(_Container& __c, _Predicate& __pred) {
+ typename _Container::size_type __old_size = __c.size();
+
+ const typename _Container::iterator __last = __c.end();
+ for (typename _Container::iterator __iter = __c.begin(); __iter != __last;) {
+ if (__pred(*__iter))
+ __iter = __c.erase(__iter);
+ else
+ ++__iter;
+ }
+
+ return __old_size - __c.size();
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H
+#define _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/addressof.h>
+#include <__utility/move.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Container>
+class _LIBCPP_TEMPLATE_VIS front_insert_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<output_iterator_tag, void, void, void, void>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+protected:
+ _Container* container;
+public:
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+#if _LIBCPP_STD_VER > 17
+ typedef ptrdiff_t difference_type;
+#else
+ typedef void difference_type;
+#endif
+ typedef void pointer;
+ typedef void reference;
+ typedef _Container container_type;
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit front_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator=(const typename _Container::value_type& __value_)
+ {container->push_front(__value_); return *this;}
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator=(typename _Container::value_type&& __value_)
+ {container->push_front(_VSTD::move(__value_)); return *this;}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator*() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator++() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator operator++(int) {return *this;}
+};
+
+template <class _Container>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+front_insert_iterator<_Container>
+front_inserter(_Container& __x)
+{
+ return front_insert_iterator<_Container>(__x);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
+#define _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
+
+#include <__config>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// [incrementable.traits]
+template<class> struct incrementable_traits {};
+
+template<class _Tp>
+requires is_object_v<_Tp>
+struct incrementable_traits<_Tp*> {
+ using difference_type = ptrdiff_t;
+};
+
+template<class _Ip>
+struct incrementable_traits<const _Ip> : incrementable_traits<_Ip> {};
+
+template<class _Tp>
+concept __has_member_difference_type = requires { typename _Tp::difference_type; };
+
+template<__has_member_difference_type _Tp>
+struct incrementable_traits<_Tp> {
+ using difference_type = typename _Tp::difference_type;
+};
+
+template<class _Tp>
+concept __has_integral_minus =
+ requires(const _Tp& __x, const _Tp& __y) {
+ { __x - __y } -> integral;
+ };
+
+template<__has_integral_minus _Tp>
+requires (!__has_member_difference_type<_Tp>)
+struct incrementable_traits<_Tp> {
+ using difference_type = make_signed_t<decltype(declval<_Tp>() - declval<_Tp>())>;
+};
+
+template <class>
+struct iterator_traits;
+
+// Let `RI` be `remove_cvref_t<I>`. The type `iter_difference_t<I>` denotes
+// `incrementable_traits<RI>::difference_type` if `iterator_traits<RI>` names a specialization
+// generated from the primary template, and `iterator_traits<RI>::difference_type` otherwise.
+template <class _Ip>
+using iter_difference_t = typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,
+ incrementable_traits<remove_cvref_t<_Ip> >,
+ iterator_traits<remove_cvref_t<_Ip> > >::difference_type;
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_INSERT_ITERATOR_H
+#define _LIBCPP___ITERATOR_INSERT_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/addressof.h>
+#include <__utility/move.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Container>
+class _LIBCPP_TEMPLATE_VIS insert_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<output_iterator_tag, void, void, void, void>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+protected:
+ _Container* container;
+ typename _Container::iterator iter; // FIXME: `ranges::iterator_t<Container>` in C++20 mode
+public:
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+#if _LIBCPP_STD_VER > 17
+ typedef ptrdiff_t difference_type;
+#else
+ typedef void difference_type;
+#endif
+ typedef void pointer;
+ typedef void reference;
+ typedef _Container container_type;
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator(_Container& __x, typename _Container::iterator __i)
+ : container(_VSTD::addressof(__x)), iter(__i) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator=(const typename _Container::value_type& __value_)
+ {iter = container->insert(iter, __value_); ++iter; return *this;}
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator=(typename _Container::value_type&& __value_)
+ {iter = container->insert(iter, _VSTD::move(__value_)); ++iter; return *this;}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator*() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator++() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator++(int) {return *this;}
+};
+
+template <class _Container>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+insert_iterator<_Container>
+inserter(_Container& __x, typename _Container::iterator __i)
+{
+ return insert_iterator<_Container>(__x, __i);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_INSERT_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H
+#define _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/addressof.h>
+#include <iosfwd> // for forward declarations of char_traits and basic_istream
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp, class _CharT = char,
+ class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
+class _LIBCPP_TEMPLATE_VIS istream_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+public:
+ typedef input_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_istream<_CharT,_Traits> istream_type;
+private:
+ istream_type* __in_stream_;
+ _Tp __value_;
+public:
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {}
+ _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))
+ {
+ if (!(*__in_stream_ >> __value_))
+ __in_stream_ = nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}
+ _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return _VSTD::addressof((operator*()));}
+ _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()
+ {
+ if (!(*__in_stream_ >> __value_))
+ __in_stream_ = nullptr;
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int)
+ {istream_iterator __t(*this); ++(*this); return __t;}
+
+ template <class _Up, class _CharU, class _TraitsU, class _DistanceU>
+ friend _LIBCPP_INLINE_VISIBILITY
+ bool
+ operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
+ const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
+
+ template <class _Up, class _CharU, class _TraitsU, class _DistanceU>
+ friend _LIBCPP_INLINE_VISIBILITY
+ bool
+ operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
+ const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
+};
+
+template <class _Tp, class _CharT, class _Traits, class _Distance>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y)
+{
+ return __x.__in_stream_ == __y.__in_stream_;
+}
+
+template <class _Tp, class _CharT, class _Traits, class _Distance>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y)
+{
+ return !(__x == __y);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H
+#define _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <iosfwd> // for forward declaration of basic_streambuf
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template<class _CharT, class _Traits>
+class _LIBCPP_TEMPLATE_VIS istreambuf_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<input_iterator_tag, _CharT,
+ typename _Traits::off_type, _CharT*,
+ _CharT>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+public:
+ typedef input_iterator_tag iterator_category;
+ typedef _CharT value_type;
+ typedef typename _Traits::off_type difference_type;
+ typedef _CharT* pointer;
+ typedef _CharT reference;
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename _Traits::int_type int_type;
+ typedef basic_streambuf<_CharT,_Traits> streambuf_type;
+ typedef basic_istream<_CharT,_Traits> istream_type;
+private:
+ mutable streambuf_type* __sbuf_;
+
+ class __proxy
+ {
+ char_type __keep_;
+ streambuf_type* __sbuf_;
+ _LIBCPP_INLINE_VISIBILITY __proxy(char_type __c, streambuf_type* __s)
+ : __keep_(__c), __sbuf_(__s) {}
+ friend class istreambuf_iterator;
+ public:
+ _LIBCPP_INLINE_VISIBILITY char_type operator*() const {return __keep_;}
+ };
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool __test_for_eof() const
+ {
+ if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
+ __sbuf_ = nullptr;
+ return __sbuf_ == nullptr;
+ }
+public:
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
+ _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
+ : __sbuf_(__s.rdbuf()) {}
+ _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
+ : __sbuf_(__s) {}
+ _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT
+ : __sbuf_(__p.__sbuf_) {}
+
+ _LIBCPP_INLINE_VISIBILITY char_type operator*() const
+ {return static_cast<char_type>(__sbuf_->sgetc());}
+ _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
+ {
+ __sbuf_->sbumpc();
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY __proxy operator++(int)
+ {
+ return __proxy(__sbuf_->sbumpc(), __sbuf_);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
+ {return __test_for_eof() == __b.__test_for_eof();}
+};
+
+template <class _CharT, class _Traits>
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator==(const istreambuf_iterator<_CharT,_Traits>& __a,
+ const istreambuf_iterator<_CharT,_Traits>& __b)
+ {return __a.equal(__b);}
+
+template <class _CharT, class _Traits>
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
+ const istreambuf_iterator<_CharT,_Traits>& __b)
+ {return !__a.equal(__b);}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ITER_MOVE_H
+#define _LIBCPP___ITERATOR_ITER_MOVE_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__utility/forward.h>
+#include <concepts> // __class_or_enum
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges::__iter_move {
+void iter_move();
+
+template<class _Ip>
+concept __unqualified_iter_move = requires(_Ip&& __i) {
+ iter_move(_VSTD::forward<_Ip>(__i));
+};
+
+// [iterator.cust.move]/1
+// The name ranges::iter_move denotes a customization point object.
+// The expression ranges::iter_move(E) for a subexpression E is
+// expression-equivalent to:
+struct __fn {
+ // [iterator.cust.move]/1.1
+ // iter_move(E), if E has class or enumeration type and iter_move(E) is a
+ // well-formed expression when treated as an unevaluated operand, [...]
+ template<class _Ip>
+ requires __class_or_enum<remove_cvref_t<_Ip>> && __unqualified_iter_move<_Ip>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Ip&& __i) const
+ noexcept(noexcept(iter_move(_VSTD::forward<_Ip>(__i))))
+ {
+ return iter_move(_VSTD::forward<_Ip>(__i));
+ }
+
+ // [iterator.cust.move]/1.2
+ // Otherwise, if the expression *E is well-formed:
+ // 1.2.1 if *E is an lvalue, std::move(*E);
+ // 1.2.2 otherwise, *E.
+ template<class _Ip>
+ requires (!(__class_or_enum<remove_cvref_t<_Ip>> && __unqualified_iter_move<_Ip>)) &&
+ requires(_Ip&& __i) { *_VSTD::forward<_Ip>(__i); }
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Ip&& __i) const
+ noexcept(noexcept(*_VSTD::forward<_Ip>(__i)))
+ {
+ if constexpr (is_lvalue_reference_v<decltype(*_VSTD::forward<_Ip>(__i))>) {
+ return _VSTD::move(*_VSTD::forward<_Ip>(__i));
+ } else {
+ return *_VSTD::forward<_Ip>(__i);
+ }
+ }
+
+ // [iterator.cust.move]/1.3
+ // Otherwise, ranges::iter_move(E) is ill-formed.
+};
+} // namespace ranges::__iter_move
+
+namespace ranges::inline __cpo {
+ inline constexpr auto iter_move = __iter_move::__fn{};
+}
+
+template<__dereferenceable _Tp>
+requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __referenceable; }
+using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<_Tp&>()));
+
+#endif // !_LIBCPP_HAS_NO_RANGES
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ITER_MOVE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___ITERATOR_ITER_SWAP_H
+#define _LIBCPP___ITERATOR_ITER_SWAP_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/readable_traits.h>
+#include <__ranges/access.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+namespace __iter_swap {
+ template<class _I1, class _I2>
+ void iter_swap(_I1, _I2) = delete;
+
+ template<class _T1, class _T2>
+ concept __unqualified_iter_swap = requires(_T1&& __x, _T2&& __y) {
+ iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y));
+ };
+
+ template<class _T1, class _T2>
+ concept __readable_swappable =
+ indirectly_readable<_T1> && indirectly_readable<_T2> &&
+ swappable_with<iter_reference_t<_T1>, iter_reference_t<_T2>>;
+
+ struct __fn {
+ template <class _T1, class _T2>
+ requires __unqualified_iter_swap<_T1, _T2>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void operator()(_T1&& __x, _T2&& __y) const
+ noexcept(noexcept(iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y))))
+ {
+ (void)iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y));
+ }
+
+ template <class _T1, class _T2>
+ requires (!__unqualified_iter_swap<_T1, _T2>) &&
+ __readable_swappable<_T1, _T2>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void operator()(_T1&& __x, _T2&& __y) const
+ noexcept(noexcept(ranges::swap(*_VSTD::forward<_T1>(__x), *_VSTD::forward<_T2>(__y))))
+ {
+ ranges::swap(*_VSTD::forward<_T1>(__x), *_VSTD::forward<_T2>(__y));
+ }
+
+ template <class _T1, class _T2>
+ requires (!__unqualified_iter_swap<_T1, _T2> &&
+ !__readable_swappable<_T1, _T2>) &&
+ indirectly_movable_storable<_T1, _T2> &&
+ indirectly_movable_storable<_T2, _T1>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void operator()(_T1&& __x, _T2&& __y) const
+ noexcept(noexcept(iter_value_t<_T2>(ranges::iter_move(__y))) &&
+ noexcept(*__y = ranges::iter_move(__x)) &&
+ noexcept(*_VSTD::forward<_T1>(__x) = declval<iter_value_t<_T2>>()))
+ {
+ iter_value_t<_T2> __old(ranges::iter_move(__y));
+ *__y = ranges::iter_move(__x);
+ *_VSTD::forward<_T1>(__x) = _VSTD::move(__old);
+ }
+ };
+} // end namespace __iter_swap
+
+inline namespace __cpo {
+ inline constexpr auto iter_swap = __iter_swap::__fn{};
+} // namespace __cpo
+
+} // namespace ranges
+
+template<class _I1, class _I2 = _I1>
+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);
+ };
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ITER_SWAP_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ITERATOR_H
+#define _LIBCPP___ITERATOR_ITERATOR_H
+
+#include <__config>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _Category, class _Tp, class _Distance = ptrdiff_t,
+ class _Pointer = _Tp*, class _Reference = _Tp&>
+struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 iterator
+{
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef _Pointer pointer;
+ typedef _Reference reference;
+ typedef _Category iterator_category;
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ITERATOR_TRAITS_H
+#define _LIBCPP___ITERATOR_ITERATOR_TRAITS_H
+
+#include <__config>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/readable_traits.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+template <class _Tp>
+using __with_reference = _Tp&;
+
+template <class _Tp>
+concept __referenceable = requires {
+ typename __with_reference<_Tp>;
+};
+
+template <class _Tp>
+concept __dereferenceable = requires(_Tp& __t) {
+ { *__t } -> __referenceable; // not required to be equality-preserving
+};
+
+// [iterator.traits]
+template<__dereferenceable _Tp>
+using iter_reference_t = decltype(*declval<_Tp&>());
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+template <class _Iter>
+struct _LIBCPP_TEMPLATE_VIS iterator_traits;
+
+struct _LIBCPP_TEMPLATE_VIS input_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS output_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS forward_iterator_tag : public input_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
+#if _LIBCPP_STD_VER > 17
+struct _LIBCPP_TEMPLATE_VIS contiguous_iterator_tag : public random_access_iterator_tag {};
+#endif
+
+template <class _Iter>
+struct __iter_traits_cache {
+ using type = _If<
+ __is_primary_template<iterator_traits<_Iter> >::value,
+ _Iter,
+ iterator_traits<_Iter>
+ >;
+};
+template <class _Iter>
+using _ITER_TRAITS = typename __iter_traits_cache<_Iter>::type;
+
+struct __iter_concept_concept_test {
+ template <class _Iter>
+ using _Apply = typename _ITER_TRAITS<_Iter>::iterator_concept;
+};
+struct __iter_concept_category_test {
+ template <class _Iter>
+ using _Apply = typename _ITER_TRAITS<_Iter>::iterator_category;
+};
+struct __iter_concept_random_fallback {
+ template <class _Iter>
+ using _Apply = _EnableIf<
+ __is_primary_template<iterator_traits<_Iter> >::value,
+ random_access_iterator_tag
+ >;
+};
+
+template <class _Iter, class _Tester> struct __test_iter_concept
+ : _IsValidExpansion<_Tester::template _Apply, _Iter>,
+ _Tester
+{
+};
+
+template <class _Iter>
+struct __iter_concept_cache {
+ using type = _Or<
+ __test_iter_concept<_Iter, __iter_concept_concept_test>,
+ __test_iter_concept<_Iter, __iter_concept_category_test>,
+ __test_iter_concept<_Iter, __iter_concept_random_fallback>
+ >;
+};
+
+template <class _Iter>
+using _ITER_CONCEPT = typename __iter_concept_cache<_Iter>::type::template _Apply<_Iter>;
+
+
+template <class _Tp>
+struct __has_iterator_typedefs
+{
+private:
+ struct __two {char __lx; char __lxx;};
+ template <class _Up> static __two __test(...);
+ template <class _Up> static char __test(typename __void_t<typename _Up::iterator_category>::type* = 0,
+ typename __void_t<typename _Up::difference_type>::type* = 0,
+ typename __void_t<typename _Up::value_type>::type* = 0,
+ typename __void_t<typename _Up::reference>::type* = 0,
+ typename __void_t<typename _Up::pointer>::type* = 0);
+public:
+ static const bool value = sizeof(__test<_Tp>(0,0,0,0,0)) == 1;
+};
+
+
+template <class _Tp>
+struct __has_iterator_category
+{
+private:
+ struct __two {char __lx; char __lxx;};
+ template <class _Up> static __two __test(...);
+ template <class _Up> static char __test(typename _Up::iterator_category* = nullptr);
+public:
+ static const bool value = sizeof(__test<_Tp>(nullptr)) == 1;
+};
+
+template <class _Tp>
+struct __has_iterator_concept
+{
+private:
+ struct __two {char __lx; char __lxx;};
+ template <class _Up> static __two __test(...);
+ template <class _Up> static char __test(typename _Up::iterator_concept* = nullptr);
+public:
+ static const bool value = sizeof(__test<_Tp>(nullptr)) == 1;
+};
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// The `cpp17-*-iterator` exposition-only concepts are easily confused with the Cpp17*Iterator tables,
+// so they've been banished to a namespace that makes it obvious they have a niche use-case.
+namespace __iterator_traits_detail {
+template<class _Ip>
+concept __cpp17_iterator =
+ requires(_Ip __i) {
+ { *__i } -> __referenceable;
+ { ++__i } -> same_as<_Ip&>;
+ { *__i++ } -> __referenceable;
+ } &&
+ copyable<_Ip>;
+
+template<class _Ip>
+concept __cpp17_input_iterator =
+ __cpp17_iterator<_Ip> &&
+ equality_comparable<_Ip> &&
+ requires(_Ip __i) {
+ typename incrementable_traits<_Ip>::difference_type;
+ typename indirectly_readable_traits<_Ip>::value_type;
+ typename common_reference_t<iter_reference_t<_Ip>&&,
+ typename indirectly_readable_traits<_Ip>::value_type&>;
+ typename common_reference_t<decltype(*__i++)&&,
+ typename indirectly_readable_traits<_Ip>::value_type&>;
+ requires signed_integral<typename incrementable_traits<_Ip>::difference_type>;
+ };
+
+template<class _Ip>
+concept __cpp17_forward_iterator =
+ __cpp17_input_iterator<_Ip> &&
+ constructible_from<_Ip> &&
+ is_lvalue_reference_v<iter_reference_t<_Ip>> &&
+ same_as<remove_cvref_t<iter_reference_t<_Ip>>,
+ typename indirectly_readable_traits<_Ip>::value_type> &&
+ requires(_Ip __i) {
+ { __i++ } -> convertible_to<_Ip const&>;
+ { *__i++ } -> same_as<iter_reference_t<_Ip>>;
+ };
+
+template<class _Ip>
+concept __cpp17_bidirectional_iterator =
+ __cpp17_forward_iterator<_Ip> &&
+ requires(_Ip __i) {
+ { --__i } -> same_as<_Ip&>;
+ { __i-- } -> convertible_to<_Ip const&>;
+ { *__i-- } -> same_as<iter_reference_t<_Ip>>;
+ };
+
+template<class _Ip>
+concept __cpp17_random_access_iterator =
+ __cpp17_bidirectional_iterator<_Ip> &&
+ totally_ordered<_Ip> &&
+ requires(_Ip __i, typename incrementable_traits<_Ip>::difference_type __n) {
+ { __i += __n } -> same_as<_Ip&>;
+ { __i -= __n } -> same_as<_Ip&>;
+ { __i + __n } -> same_as<_Ip>;
+ { __n + __i } -> same_as<_Ip>;
+ { __i - __n } -> same_as<_Ip>;
+ { __i - __i } -> same_as<decltype(__n)>;
+ { __i[__n] } -> convertible_to<iter_reference_t<_Ip>>;
+ };
+} // namespace __iterator_traits_detail
+
+template<class _Ip>
+concept __has_member_reference = requires { typename _Ip::reference; };
+
+template<class _Ip>
+concept __has_member_pointer = requires { typename _Ip::pointer; };
+
+template<class _Ip>
+concept __has_member_iterator_category = requires { typename _Ip::iterator_category; };
+
+template<class _Ip>
+concept __specifies_members = requires {
+ typename _Ip::value_type;
+ typename _Ip::difference_type;
+ requires __has_member_reference<_Ip>;
+ requires __has_member_iterator_category<_Ip>;
+ };
+
+template<class>
+struct __iterator_traits_member_pointer_or_void {
+ using type = void;
+};
+
+template<__has_member_pointer _Tp>
+struct __iterator_traits_member_pointer_or_void<_Tp> {
+ using type = typename _Tp::pointer;
+};
+
+template<class _Tp>
+concept __cpp17_iterator_missing_members =
+ !__specifies_members<_Tp> &&
+ __iterator_traits_detail::__cpp17_iterator<_Tp>;
+
+template<class _Tp>
+concept __cpp17_input_iterator_missing_members =
+ __cpp17_iterator_missing_members<_Tp> &&
+ __iterator_traits_detail::__cpp17_input_iterator<_Tp>;
+
+// Otherwise, `pointer` names `void`.
+template<class>
+struct __iterator_traits_member_pointer_or_arrow_or_void { using type = void; };
+
+// [iterator.traits]/3.2.1
+// If the qualified-id `I::pointer` is valid and denotes a type, `pointer` names that type.
+template<__has_member_pointer _Ip>
+struct __iterator_traits_member_pointer_or_arrow_or_void<_Ip> { using type = typename _Ip::pointer; };
+
+// Otherwise, if `decltype(declval<I&>().operator->())` is well-formed, then `pointer` names that
+// type.
+template<class _Ip>
+ requires requires(_Ip& __i) { __i.operator->(); } && (!__has_member_pointer<_Ip>)
+struct __iterator_traits_member_pointer_or_arrow_or_void<_Ip> {
+ using type = decltype(declval<_Ip&>().operator->());
+};
+
+// Otherwise, `reference` names `iter-reference-t<I>`.
+template<class _Ip>
+struct __iterator_traits_member_reference { using type = iter_reference_t<_Ip>; };
+
+// [iterator.traits]/3.2.2
+// If the qualified-id `I::reference` is valid and denotes a type, `reference` names that type.
+template<__has_member_reference _Ip>
+struct __iterator_traits_member_reference<_Ip> { using type = typename _Ip::reference; };
+
+// [iterator.traits]/3.2.3.4
+// input_iterator_tag
+template<class _Ip>
+struct __deduce_iterator_category {
+ using type = input_iterator_tag;
+};
+
+// [iterator.traits]/3.2.3.1
+// `random_access_iterator_tag` if `I` satisfies `cpp17-random-access-iterator`, or otherwise
+template<__iterator_traits_detail::__cpp17_random_access_iterator _Ip>
+struct __deduce_iterator_category<_Ip> {
+ using type = random_access_iterator_tag;
+};
+
+// [iterator.traits]/3.2.3.2
+// `bidirectional_iterator_tag` if `I` satisfies `cpp17-bidirectional-iterator`, or otherwise
+template<__iterator_traits_detail::__cpp17_bidirectional_iterator _Ip>
+struct __deduce_iterator_category<_Ip> {
+ using type = bidirectional_iterator_tag;
+};
+
+// [iterator.traits]/3.2.3.3
+// `forward_iterator_tag` if `I` satisfies `cpp17-forward-iterator`, or otherwise
+template<__iterator_traits_detail::__cpp17_forward_iterator _Ip>
+struct __deduce_iterator_category<_Ip> {
+ using type = forward_iterator_tag;
+};
+
+template<class _Ip>
+struct __iterator_traits_iterator_category : __deduce_iterator_category<_Ip> {};
+
+// [iterator.traits]/3.2.3
+// If the qualified-id `I::iterator-category` is valid and denotes a type, `iterator-category` names
+// that type.
+template<__has_member_iterator_category _Ip>
+struct __iterator_traits_iterator_category<_Ip> {
+ using type = typename _Ip::iterator_category;
+};
+
+// otherwise, it names void.
+template<class>
+struct __iterator_traits_difference_type { using type = void; };
+
+// If the qualified-id `incrementable_traits<I>::difference_type` is valid and denotes a type, then
+// `difference_type` names that type;
+template<class _Ip>
+requires requires { typename incrementable_traits<_Ip>::difference_type; }
+struct __iterator_traits_difference_type<_Ip> {
+ using type = typename incrementable_traits<_Ip>::difference_type;
+};
+
+// [iterator.traits]/3.4
+// Otherwise, `iterator_traits<I>` has no members by any of the above names.
+template<class>
+struct __iterator_traits {};
+
+// [iterator.traits]/3.1
+// If `I` has valid ([temp.deduct]) member types `difference-type`, `value-type`, `reference`, and
+// `iterator-category`, then `iterator-traits<I>` has the following publicly accessible members:
+template<__specifies_members _Ip>
+struct __iterator_traits<_Ip> {
+ using iterator_category = typename _Ip::iterator_category;
+ using value_type = typename _Ip::value_type;
+ using difference_type = typename _Ip::difference_type;
+ using pointer = typename __iterator_traits_member_pointer_or_void<_Ip>::type;
+ using reference = typename _Ip::reference;
+};
+
+// [iterator.traits]/3.2
+// Otherwise, if `I` satisfies the exposition-only concept `cpp17-input-iterator`,
+// `iterator-traits<I>` has the following publicly accessible members:
+template<__cpp17_input_iterator_missing_members _Ip>
+struct __iterator_traits<_Ip> {
+ using iterator_category = typename __iterator_traits_iterator_category<_Ip>::type;
+ using value_type = typename indirectly_readable_traits<_Ip>::value_type;
+ using difference_type = typename incrementable_traits<_Ip>::difference_type;
+ using pointer = typename __iterator_traits_member_pointer_or_arrow_or_void<_Ip>::type;
+ using reference = typename __iterator_traits_member_reference<_Ip>::type;
+};
+
+// Otherwise, if `I` satisfies the exposition-only concept `cpp17-iterator`, then
+// `iterator_traits<I>` has the following publicly accessible members:
+template<__cpp17_iterator_missing_members _Ip>
+struct __iterator_traits<_Ip> {
+ using iterator_category = output_iterator_tag;
+ using value_type = void;
+ using difference_type = typename __iterator_traits_difference_type<_Ip>::type;
+ using pointer = void;
+ using reference = void;
+};
+
+template<class _Ip>
+struct iterator_traits : __iterator_traits<_Ip> {
+ using __primary_template = iterator_traits;
+};
+
+#else // !defined(_LIBCPP_HAS_NO_RANGES)
+
+template <class _Iter, bool> struct __iterator_traits {};
+
+template <class _Iter, bool> struct __iterator_traits_impl {};
+
+template <class _Iter>
+struct __iterator_traits_impl<_Iter, true>
+{
+ typedef typename _Iter::difference_type difference_type;
+ typedef typename _Iter::value_type value_type;
+ typedef typename _Iter::pointer pointer;
+ typedef typename _Iter::reference reference;
+ typedef typename _Iter::iterator_category iterator_category;
+};
+
+template <class _Iter>
+struct __iterator_traits<_Iter, true>
+ : __iterator_traits_impl
+ <
+ _Iter,
+ is_convertible<typename _Iter::iterator_category, input_iterator_tag>::value ||
+ is_convertible<typename _Iter::iterator_category, output_iterator_tag>::value
+ >
+{};
+
+// iterator_traits<Iterator> will only have the nested types if Iterator::iterator_category
+// exists. Else iterator_traits<Iterator> will be an empty class. This is a
+// conforming extension which allows some programs to compile and behave as
+// the client expects instead of failing at compile time.
+
+template <class _Iter>
+struct _LIBCPP_TEMPLATE_VIS iterator_traits
+ : __iterator_traits<_Iter, __has_iterator_typedefs<_Iter>::value> {
+
+ using __primary_template = iterator_traits;
+};
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+template<class _Tp>
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+requires is_object_v<_Tp>
+#endif
+struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
+{
+ typedef ptrdiff_t difference_type;
+ typedef typename remove_cv<_Tp>::type value_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+ typedef random_access_iterator_tag iterator_category;
+#if _LIBCPP_STD_VER > 17
+ typedef contiguous_iterator_tag iterator_concept;
+#endif
+};
+
+template <class _Tp, class _Up, bool = __has_iterator_category<iterator_traits<_Tp> >::value>
+struct __has_iterator_category_convertible_to
+ : is_convertible<typename iterator_traits<_Tp>::iterator_category, _Up>
+{};
+
+template <class _Tp, class _Up>
+struct __has_iterator_category_convertible_to<_Tp, _Up, false> : false_type {};
+
+template <class _Tp, class _Up, bool = __has_iterator_concept<_Tp>::value>
+struct __has_iterator_concept_convertible_to
+ : is_convertible<typename _Tp::iterator_concept, _Up>
+{};
+
+template <class _Tp, class _Up>
+struct __has_iterator_concept_convertible_to<_Tp, _Up, false> : false_type {};
+
+template <class _Tp>
+struct __is_cpp17_input_iterator : public __has_iterator_category_convertible_to<_Tp, input_iterator_tag> {};
+
+template <class _Tp>
+struct __is_cpp17_forward_iterator : public __has_iterator_category_convertible_to<_Tp, forward_iterator_tag> {};
+
+template <class _Tp>
+struct __is_cpp17_bidirectional_iterator : public __has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag> {};
+
+template <class _Tp>
+struct __is_cpp17_random_access_iterator : public __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag> {};
+
+// __is_cpp17_contiguous_iterator determines if an iterator is known by
+// libc++ to be contiguous, either because it advertises itself as such
+// (in C++20) or because it is a pointer type or a known trivial wrapper
+// around a (possibly fancy) pointer type, such as __wrap_iter<T*>.
+// Such iterators receive special "contiguous" optimizations in
+// std::copy and std::sort.
+//
+#if _LIBCPP_STD_VER > 17
+template <class _Tp>
+struct __is_cpp17_contiguous_iterator : _Or<
+ __has_iterator_category_convertible_to<_Tp, contiguous_iterator_tag>,
+ __has_iterator_concept_convertible_to<_Tp, contiguous_iterator_tag>
+> {};
+#else
+template <class _Tp>
+struct __is_cpp17_contiguous_iterator : false_type {};
+#endif
+
+// Any native pointer which is an iterator is also a contiguous iterator.
+template <class _Up>
+struct __is_cpp17_contiguous_iterator<_Up*> : true_type {};
+
+
+template <class _Tp>
+struct __is_exactly_cpp17_input_iterator
+ : public integral_constant<bool,
+ __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
+ !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
+
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class _InputIterator>
+using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
+
+template<class _InputIterator>
+using __iter_key_type = remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>;
+
+template<class _InputIterator>
+using __iter_mapped_type = typename iterator_traits<_InputIterator>::value_type::second_type;
+
+template<class _InputIterator>
+using __iter_to_alloc_type = pair<
+ add_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>,
+ typename iterator_traits<_InputIterator>::value_type::second_type>;
+#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_ITERATOR_TRAITS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_MOVE_ITERATOR_H
+#define _LIBCPP___ITERATOR_MOVE_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Iter>
+class _LIBCPP_TEMPLATE_VIS move_iterator
+{
+private:
+ _Iter __i;
+public:
+ typedef _Iter iterator_type;
+ typedef typename iterator_traits<iterator_type>::value_type value_type;
+ typedef typename iterator_traits<iterator_type>::difference_type difference_type;
+ typedef iterator_type pointer;
+ typedef _If<__is_cpp17_random_access_iterator<_Iter>::value,
+ random_access_iterator_tag,
+ typename iterator_traits<_Iter>::iterator_category> iterator_category;
+#if _LIBCPP_STD_VER > 17
+ typedef input_iterator_tag iterator_concept;
+#endif
+
+#ifndef _LIBCPP_CXX03_LANG
+ typedef typename iterator_traits<iterator_type>::reference __reference;
+ typedef typename conditional<
+ is_reference<__reference>::value,
+ typename remove_reference<__reference>::type&&,
+ __reference
+ >::type reference;
+#else
+ typedef typename iterator_traits<iterator_type>::reference reference;
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator() : __i() {}
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ explicit move_iterator(_Iter __x) : __i(__x) {}
+
+ template <class _Up, class = _EnableIf<
+ !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value
+ > >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {}
+
+ template <class _Up, class = _EnableIf<
+ !is_same<_Up, _Iter>::value &&
+ is_convertible<_Up const&, _Iter>::value &&
+ is_assignable<_Iter&, _Up const&>::value
+ > >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator=(const move_iterator<_Up>& __u) {
+ __i = __u.base();
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _Iter base() const {return __i;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator*() const { return static_cast<reference>(*__i); }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ pointer operator->() const { return __i;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator++() {++__i; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator++(int) {move_iterator __tmp(*this); ++__i; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator--() {--__i; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator--(int) {move_iterator __tmp(*this); --__i; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator+ (difference_type __n) const {return move_iterator(__i + __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator+=(difference_type __n) {__i += __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator- (difference_type __n) const {return move_iterator(__i - __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator-=(difference_type __n) {__i -= __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator[](difference_type __n) const { return static_cast<reference>(__i[__n]); }
+};
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+{
+ return __x.base() == __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+{
+ return __x.base() < __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+{
+ return __x.base() != __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+{
+ return __x.base() > __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+{
+ return __x.base() >= __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+{
+ return __x.base() <= __y.base();
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto
+operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+-> decltype(__x.base() - __y.base())
+{
+ return __x.base() - __y.base();
+}
+#else
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename move_iterator<_Iter1>::difference_type
+operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+{
+ return __x.base() - __y.base();
+}
+#endif
+
+template <class _Iter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+move_iterator<_Iter>
+operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x)
+{
+ return move_iterator<_Iter>(__x.base() + __n);
+}
+
+template <class _Iter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+move_iterator<_Iter>
+make_move_iterator(_Iter __i)
+{
+ return move_iterator<_Iter>(__i);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_MOVE_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_NEXT_H
+#define _LIBCPP___ITERATOR_NEXT_H
+
+#include <__config>
+#include <__debug>
+#include <__function_like.h>
+#include <__iterator/advance.h>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ typename enable_if<__is_cpp17_input_iterator<_InputIter>::value, _InputIter>::type
+ next(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) {
+ _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
+ "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
+
+ _VSTD::advance(__x, __n);
+ return __x;
+}
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+struct __next_fn final : private __function_like {
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit __next_fn(__tag __x) noexcept : __function_like(__x) {}
+
+ template <input_or_output_iterator _Ip>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Ip operator()(_Ip __x) const {
+ ++__x;
+ return __x;
+ }
+
+ template <input_or_output_iterator _Ip>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const {
+ ranges::advance(__x, __n);
+ return __x;
+ }
+
+ template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Ip operator()(_Ip __x, _Sp __bound) const {
+ ranges::advance(__x, __bound);
+ return __x;
+ }
+
+ template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Sp __bound) const {
+ ranges::advance(__x, __n, __bound);
+ return __x;
+ }
+};
+
+inline constexpr auto next = __next_fn(__function_like::__tag());
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_PRIMITIVES_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H
+#define _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/addressof.h>
+#include <iosfwd> // for forward declarations of char_traits and basic_ostream
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS ostream_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<output_iterator_tag, void, void, void, void>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+public:
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+#if _LIBCPP_STD_VER > 17
+ typedef ptrdiff_t difference_type;
+#else
+ typedef void difference_type;
+#endif
+ typedef void pointer;
+ typedef void reference;
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
+
+private:
+ ostream_type* __out_stream_;
+ const char_type* __delim_;
+public:
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT
+ : __out_stream_(_VSTD::addressof(__s)), __delim_(nullptr) {}
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT
+ : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)
+ {
+ *__out_stream_ << __value_;
+ if (__delim_)
+ *__out_stream_ << __delim_;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator*() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++(int) {return *this;}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
+#define _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <iosfwd> // for forward declaration of basic_streambuf
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _CharT, class _Traits>
+class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<output_iterator_tag, void, void, void, void>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+public:
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+#if _LIBCPP_STD_VER > 17
+ typedef ptrdiff_t difference_type;
+#else
+ typedef void difference_type;
+#endif
+ typedef void pointer;
+ typedef void reference;
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
+
+private:
+ streambuf_type* __sbuf_;
+public:
+ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) _NOEXCEPT
+ : __sbuf_(__s.rdbuf()) {}
+ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) _NOEXCEPT
+ : __sbuf_(__s) {}
+ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
+ {
+ if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof()))
+ __sbuf_ = nullptr;
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
+ _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == nullptr;}
+
+ template <class _Ch, class _Tr>
+ friend
+ _LIBCPP_HIDDEN
+ ostreambuf_iterator<_Ch, _Tr>
+ __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
+ const _Ch* __ob, const _Ch* __op, const _Ch* __oe,
+ ios_base& __iob, _Ch __fl);
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_PREV_H
+#define _LIBCPP___ITERATOR_PREV_H
+
+#include <__config>
+#include <__debug>
+#include <__function_like.h>
+#include <__iterator/advance.h>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ typename enable_if<__is_cpp17_input_iterator<_InputIter>::value, _InputIter>::type
+ prev(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) {
+ _LIBCPP_ASSERT(__n <= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
+ "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
+ _VSTD::advance(__x, -__n);
+ return __x;
+}
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+struct __prev_fn final : private __function_like {
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit __prev_fn(__tag __x) noexcept : __function_like(__x) {}
+
+ template <bidirectional_iterator _Ip>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Ip operator()(_Ip __x) const {
+ --__x;
+ return __x;
+ }
+
+ template <bidirectional_iterator _Ip>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const {
+ ranges::advance(__x, -__n);
+ return __x;
+ }
+
+ template <bidirectional_iterator _Ip>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Ip __bound) const {
+ ranges::advance(__x, -__n, __bound);
+ return __x;
+ }
+};
+
+inline constexpr auto prev = __prev_fn(__function_like::__tag());
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_PREV_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___ITERATOR_PROJECTED_H
+#define _LIBCPP___ITERATOR_PROJECTED_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+template<indirectly_readable _It, indirectly_regular_unary_invocable<_It> _Proj>
+struct projected {
+ using value_type = remove_cvref_t<indirect_result_t<_Proj&, _It>>;
+ indirect_result_t<_Proj&, _It> operator*() const; // not defined
+};
+
+template<weakly_incrementable _It, class _Proj>
+struct incrementable_traits<projected<_It, _Proj>> {
+ using difference_type = iter_difference_t<_It>;
+};
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_PROJECTED_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_READABLE_TRAITS_H
+#define _LIBCPP___ITERATOR_READABLE_TRAITS_H
+
+#include <__config>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// [readable.traits]
+template<class> struct __cond_value_type {};
+
+template<class _Tp>
+requires is_object_v<_Tp>
+struct __cond_value_type<_Tp> { using value_type = remove_cv_t<_Tp>; };
+
+template<class _Tp>
+concept __has_member_value_type = requires { typename _Tp::value_type; };
+
+template<class _Tp>
+concept __has_member_element_type = requires { typename _Tp::element_type; };
+
+template<class> struct indirectly_readable_traits {};
+
+template<class _Ip>
+requires is_array_v<_Ip>
+struct indirectly_readable_traits<_Ip> {
+ using value_type = remove_cv_t<remove_extent_t<_Ip>>;
+};
+
+template<class _Ip>
+struct indirectly_readable_traits<const _Ip> : indirectly_readable_traits<_Ip> {};
+
+template<class _Tp>
+struct indirectly_readable_traits<_Tp*> : __cond_value_type<_Tp> {};
+
+template<__has_member_value_type _Tp>
+struct indirectly_readable_traits<_Tp>
+ : __cond_value_type<typename _Tp::value_type> {};
+
+template<__has_member_element_type _Tp>
+struct indirectly_readable_traits<_Tp>
+ : __cond_value_type<typename _Tp::element_type> {};
+
+// Pre-emptively applies LWG3541
+template<__has_member_value_type _Tp>
+requires __has_member_element_type<_Tp>
+struct indirectly_readable_traits<_Tp> {};
+template<__has_member_value_type _Tp>
+requires __has_member_element_type<_Tp> &&
+ same_as<remove_cv_t<typename _Tp::element_type>,
+ remove_cv_t<typename _Tp::value_type>>
+struct indirectly_readable_traits<_Tp>
+ : __cond_value_type<typename _Tp::value_type> {};
+
+template <class>
+struct iterator_traits;
+
+// Let `RI` be `remove_cvref_t<I>`. The type `iter_value_t<I>` denotes
+// `indirectly_readable_traits<RI>::value_type` if `iterator_traits<RI>` names a specialization
+// generated from the primary template, and `iterator_traits<RI>::value_type` otherwise.
+template <class _Ip>
+using iter_value_t = typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,
+ indirectly_readable_traits<remove_cvref_t<_Ip> >,
+ iterator_traits<remove_cvref_t<_Ip> > >::value_type;
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_READABLE_TRAITS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_REVERSE_ACCESS_H
+#define _LIBCPP___ITERATOR_REVERSE_ACCESS_H
+
+#include <__config>
+#include <__iterator/reverse_iterator.h>
+#include <cstddef>
+#include <initializer_list>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_CXX03_LANG)
+
+#if _LIBCPP_STD_VER > 11
+
+template <class _Tp, size_t _Np>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np])
+{
+ return reverse_iterator<_Tp*>(__array + _Np);
+}
+
+template <class _Tp, size_t _Np>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np])
+{
+ return reverse_iterator<_Tp*>(__array);
+}
+
+template <class _Ep>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il)
+{
+ return reverse_iterator<const _Ep*>(__il.end());
+}
+
+template <class _Ep>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il)
+{
+ return reverse_iterator<const _Ep*>(__il.begin());
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto rbegin(_Cp& __c) -> decltype(__c.rbegin())
+{
+ return __c.rbegin();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto rbegin(const _Cp& __c) -> decltype(__c.rbegin())
+{
+ return __c.rbegin();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto rend(_Cp& __c) -> decltype(__c.rend())
+{
+ return __c.rend();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto rend(const _Cp& __c) -> decltype(__c.rend())
+{
+ return __c.rend();
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c))
+{
+ return _VSTD::rbegin(__c);
+}
+
+template <class _Cp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
+{
+ return _VSTD::rend(__c);
+}
+
+#endif
+
+#endif // !defined(_LIBCPP_CXX03_LANG)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_REVERSE_ACCESS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_REVERSE_ITERATOR_H
+#define _LIBCPP___ITERATOR_REVERSE_ITERATOR_H
+
+#include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/addressof.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class = void>
+struct __is_stashing_iterator : false_type {};
+
+template <class _Tp>
+struct __is_stashing_iterator<_Tp, typename __void_t<typename _Tp::__stashing_iterator_tag>::type>
+ : true_type {};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Iter>
+class _LIBCPP_TEMPLATE_VIS reverse_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<typename iterator_traits<_Iter>::iterator_category,
+ typename iterator_traits<_Iter>::value_type,
+ typename iterator_traits<_Iter>::difference_type,
+ typename iterator_traits<_Iter>::pointer,
+ typename iterator_traits<_Iter>::reference>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+private:
+#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES
+ _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break
+#endif
+
+ static_assert(!__is_stashing_iterator<_Iter>::value,
+ "The specified iterator type cannot be used with reverse_iterator; "
+ "Using stashing iterators with reverse_iterator causes undefined behavior");
+
+protected:
+ _Iter current;
+public:
+ typedef _Iter iterator_type;
+ typedef typename iterator_traits<_Iter>::difference_type difference_type;
+ typedef typename iterator_traits<_Iter>::reference reference;
+ typedef typename iterator_traits<_Iter>::pointer pointer;
+ typedef _If<__is_cpp17_random_access_iterator<_Iter>::value,
+ random_access_iterator_tag,
+ typename iterator_traits<_Iter>::iterator_category> iterator_category;
+ typedef typename iterator_traits<_Iter>::value_type value_type;
+
+#if _LIBCPP_STD_VER > 17
+ typedef _If<__is_cpp17_random_access_iterator<_Iter>::value,
+ random_access_iterator_tag,
+ bidirectional_iterator_tag> iterator_concept;
+#endif
+
+#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator() : __t(), current() {}
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
+
+ template <class _Up, class = _EnableIf<
+ !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value
+ > >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator(const reverse_iterator<_Up>& __u)
+ : __t(__u.base()), current(__u.base())
+ { }
+
+ template <class _Up, class = _EnableIf<
+ !is_same<_Up, _Iter>::value &&
+ is_convertible<_Up const&, _Iter>::value &&
+ is_assignable<_Up const&, _Iter>::value
+ > >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator=(const reverse_iterator<_Up>& __u) {
+ __t = current = __u.base();
+ return *this;
+ }
+#else
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator() : current() {}
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ explicit reverse_iterator(_Iter __x) : current(__x) {}
+
+ template <class _Up, class = _EnableIf<
+ !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value
+ > >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator(const reverse_iterator<_Up>& __u)
+ : current(__u.base())
+ { }
+
+ template <class _Up, class = _EnableIf<
+ !is_same<_Up, _Iter>::value &&
+ is_convertible<_Up const&, _Iter>::value &&
+ is_assignable<_Up const&, _Iter>::value
+ > >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator=(const reverse_iterator<_Up>& __u) {
+ current = __u.base();
+ return *this;
+ }
+#endif
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ _Iter base() const {return current;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator*() const {_Iter __tmp = current; return *--__tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ pointer operator->() const {return _VSTD::addressof(operator*());}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator++() {--current; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator++(int) {reverse_iterator __tmp(*this); --current; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator--() {++current; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator--(int) {reverse_iterator __tmp(*this); ++current; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator+ (difference_type __n) const {return reverse_iterator(current - __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator+=(difference_type __n) {current -= __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator- (difference_type __n) const {return reverse_iterator(current + __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator[](difference_type __n) const {return *(*this + __n);}
+};
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+{
+ return __x.base() == __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+{
+ return __x.base() > __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+{
+ return __x.base() != __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+{
+ return __x.base() < __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+{
+ return __x.base() <= __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+bool
+operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+{
+ return __x.base() >= __y.base();
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto
+operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+-> decltype(__y.base() - __x.base())
+{
+ return __y.base() - __x.base();
+}
+#else
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename reverse_iterator<_Iter1>::difference_type
+operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+{
+ return __y.base() - __x.base();
+}
+#endif
+
+template <class _Iter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+reverse_iterator<_Iter>
+operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x)
+{
+ return reverse_iterator<_Iter>(__x.base() - __n);
+}
+
+#if _LIBCPP_STD_VER > 11
+template <class _Iter>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+reverse_iterator<_Iter> make_reverse_iterator(_Iter __i)
+{
+ return reverse_iterator<_Iter>(__i);
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_REVERSE_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_SIZE_H
+#define _LIBCPP___ITERATOR_SIZE_H
+
+#include <__config>
+#include <cstddef>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+template <class _Cont>
+_LIBCPP_INLINE_VISIBILITY
+constexpr auto size(const _Cont& __c)
+_NOEXCEPT_(noexcept(__c.size()))
+-> decltype (__c.size())
+{ return __c.size(); }
+
+template <class _Tp, size_t _Sz>
+_LIBCPP_INLINE_VISIBILITY
+constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
+
+#if _LIBCPP_STD_VER > 17
+template <class _Cont>
+_LIBCPP_INLINE_VISIBILITY
+constexpr auto ssize(const _Cont& __c)
+_NOEXCEPT_(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size())))
+-> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>
+{ return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size()); }
+
+template <class _Tp, ptrdiff_t _Sz>
+_LIBCPP_INLINE_VISIBILITY
+constexpr ptrdiff_t ssize(const _Tp (&)[_Sz]) noexcept { return _Sz; }
+#endif
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_SIZE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_WRAP_ITER_H
+#define _LIBCPP___ITERATOR_WRAP_ITER_H
+
+#include <__config>
+#include <__debug>
+#include <__iterator/iterator_traits.h>
+#include <__memory/pointer_traits.h> // __to_address
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Iter>
+class __wrap_iter
+{
+public:
+ typedef _Iter iterator_type;
+ typedef typename iterator_traits<iterator_type>::value_type value_type;
+ typedef typename iterator_traits<iterator_type>::difference_type difference_type;
+ typedef typename iterator_traits<iterator_type>::pointer pointer;
+ typedef typename iterator_traits<iterator_type>::reference reference;
+ typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
+#if _LIBCPP_STD_VER > 17
+ typedef contiguous_iterator_tag iterator_concept;
+#endif
+
+private:
+ iterator_type __i;
+public:
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter() _NOEXCEPT
+#if _LIBCPP_STD_VER > 11
+ : __i{}
+#endif
+ {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ __get_db()->__insert_i(this);
+#endif
+ }
+ template <class _Up> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+ __wrap_iter(const __wrap_iter<_Up>& __u,
+ typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) _NOEXCEPT
+ : __i(__u.base())
+ {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ __get_db()->__iterator_copy(this, &__u);
+#endif
+ }
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+ __wrap_iter(const __wrap_iter& __x)
+ : __i(__x.base())
+ {
+ __get_db()->__iterator_copy(this, &__x);
+ }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+ __wrap_iter& operator=(const __wrap_iter& __x)
+ {
+ if (this != &__x)
+ {
+ __get_db()->__iterator_copy(this, &__x);
+ __i = __x.__i;
+ }
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+ ~__wrap_iter()
+ {
+ __get_db()->__erase_i(this);
+ }
+#endif
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT
+ {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to dereference a non-dereferenceable iterator");
+#endif
+ return *__i;
+ }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT
+ {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to dereference a non-dereferenceable iterator");
+#endif
+ return _VSTD::__to_address(__i);
+ }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT
+ {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to increment a non-incrementable iterator");
+#endif
+ ++__i;
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator++(int) _NOEXCEPT
+ {__wrap_iter __tmp(*this); ++(*this); return __tmp;}
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT
+ {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
+ "Attempted to decrement a non-decrementable iterator");
+#endif
+ --__i;
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator--(int) _NOEXCEPT
+ {__wrap_iter __tmp(*this); --(*this); return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator+ (difference_type __n) const _NOEXCEPT
+ {__wrap_iter __w(*this); __w += __n; return __w;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
+ {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
+ "Attempted to add/subtract an iterator outside its valid range");
+#endif
+ __i += __n;
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator- (difference_type __n) const _NOEXCEPT
+ {return *this + (-__n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator-=(difference_type __n) _NOEXCEPT
+ {*this += -__n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT
+ {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
+ "Attempted to subscript an iterator outside its valid range");
+#endif
+ return __i[__n];
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT {return __i;}
+
+private:
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
+ {
+ __get_db()->__insert_ic(this, __p);
+ }
+#else
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
+#endif
+
+ template <class _Up> friend class __wrap_iter;
+ template <class _CharT, class _Traits, class _Alloc> friend class basic_string;
+ template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;
+ template <class _Tp, size_t> friend class _LIBCPP_TEMPLATE_VIS span;
+};
+
+template <class _Iter1>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return __x.base() == __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+{
+ return __x.base() == __y.base();
+}
+
+template <class _Iter1>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
+ "Attempted to compare incomparable iterators");
+#endif
+ return __x.base() < __y.base();
+}
+
+template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+{
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
+ "Attempted to compare incomparable iterators");
+#endif
+ return __x.base() < __y.base();
+}
+
+template <class _Iter1>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return !(__x == __y);
+}
+
+template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+{
+ return !(__x == __y);
+}
+
+template <class _Iter1>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return __y < __x;
+}
+
+template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+{
+ return __y < __x;
+}
+
+template <class _Iter1>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return !(__x < __y);
+}
+
+template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+{
+ return !(__x < __y);
+}
+
+template <class _Iter1>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return !(__y < __x);
+}
+
+template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+bool operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+{
+ return !(__y < __x);
+}
+
+template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+#ifndef _LIBCPP_CXX03_LANG
+auto operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+ -> decltype(__x.base() - __y.base())
+#else
+typename __wrap_iter<_Iter1>::difference_type
+operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+#endif // C++03
+{
+#if _LIBCPP_DEBUG_LEVEL == 2
+ _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
+ "Attempted to subtract incompatible iterators");
+#endif
+ return __x.base() - __y.base();
+}
+
+template <class _Iter1>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+__wrap_iter<_Iter1> operator+(typename __wrap_iter<_Iter1>::difference_type __n, __wrap_iter<_Iter1> __x) _NOEXCEPT
+{
+ __x += __n;
+ return __x;
+}
+
+#if _LIBCPP_STD_VER <= 17
+template <class _It>
+struct __is_cpp17_contiguous_iterator<__wrap_iter<_It> > : true_type {};
+#endif
+
+template <class _Iter>
+_LIBCPP_CONSTEXPR
+decltype(_VSTD::__to_address(declval<_Iter>()))
+__to_address(__wrap_iter<_Iter> __w) _NOEXCEPT {
+ return _VSTD::__to_address(__w.base());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ITERATOR_WRAP_ITER_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_ADDRESSOF_H
+#define _LIBCPP___MEMORY_ADDRESSOF_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+
+template <class _Tp>
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
+_Tp*
+addressof(_Tp& __x) _NOEXCEPT
+{
+ return __builtin_addressof(__x);
+}
+
+#else
+
+template <class _Tp>
+inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
+_Tp*
+addressof(_Tp& __x) _NOEXCEPT
+{
+ return reinterpret_cast<_Tp *>(
+ const_cast<char *>(&reinterpret_cast<const volatile char &>(__x)));
+}
+
+#endif // _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+
+#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
+// Objective-C++ Automatic Reference Counting uses qualified pointers
+// that require special addressof() signatures. When
+// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
+// itself is providing these definitions. Otherwise, we provide them.
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__strong _Tp*
+addressof(__strong _Tp& __x) _NOEXCEPT
+{
+ return &__x;
+}
+
+#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__weak _Tp*
+addressof(__weak _Tp& __x) _NOEXCEPT
+{
+ return &__x;
+}
+#endif
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__autoreleasing _Tp*
+addressof(__autoreleasing _Tp& __x) _NOEXCEPT
+{
+ return &__x;
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__unsafe_unretained _Tp*
+addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
+{
+ return &__x;
+}
+#endif
+
+#if !defined(_LIBCPP_CXX03_LANG)
+template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_ADDRESSOF_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_ALLOCATION_GUARD_H
+#define _LIBCPP___MEMORY_ALLOCATION_GUARD_H
+
+#include <__config>
+#include <__memory/allocator_traits.h>
+#include <cstddef>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Helper class to allocate memory using an Allocator in an exception safe
+// manner.
+//
+// The intended usage of this class is as follows:
+//
+// 0
+// 1 __allocation_guard<SomeAllocator> guard(alloc, 10);
+// 2 do_some_initialization_that_may_throw(guard.__get());
+// 3 save_allocated_pointer_in_a_noexcept_operation(guard.__release_ptr());
+// 4
+//
+// If line (2) throws an exception during initialization of the memory, the
+// guard's destructor will be called, and the memory will be released using
+// Allocator deallocation. Otherwise, we release the memory from the guard on
+// line (3) in an operation that can't throw -- after that, the guard is not
+// responsible for the memory anymore.
+//
+// This is similar to a unique_ptr, except it's easier to use with a
+// custom allocator.
+template<class _Alloc>
+struct __allocation_guard {
+ using _Pointer = typename allocator_traits<_Alloc>::pointer;
+ using _Size = typename allocator_traits<_Alloc>::size_type;
+
+ template<class _AllocT> // we perform the allocator conversion inside the constructor
+ _LIBCPP_HIDE_FROM_ABI
+ explicit __allocation_guard(_AllocT __alloc, _Size __n)
+ : __alloc_(_VSTD::move(__alloc))
+ , __n_(__n)
+ , __ptr_(allocator_traits<_Alloc>::allocate(__alloc_, __n_)) // initialization order is important
+ { }
+
+ _LIBCPP_HIDE_FROM_ABI
+ ~__allocation_guard() _NOEXCEPT {
+ if (__ptr_ != nullptr) {
+ allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __n_);
+ }
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Pointer __release_ptr() _NOEXCEPT { // not called __release() because it's a keyword in objective-c++
+ _Pointer __tmp = __ptr_;
+ __ptr_ = nullptr;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Pointer __get() const _NOEXCEPT {
+ return __ptr_;
+ }
+
+private:
+ _Alloc __alloc_;
+ _Size __n_;
+ _Pointer __ptr_;
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_ALLOCATION_GUARD_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_ALLOCATOR_H
+#define _LIBCPP___MEMORY_ALLOCATOR_H
+
+#include <__config>
+#include <__memory/allocator_traits.h>
+#include <__utility/forward.h>
+#include <cstddef>
+#include <new>
+#include <stdexcept>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp> class allocator;
+
+#if _LIBCPP_STD_VER <= 17
+template <>
+class _LIBCPP_TEMPLATE_VIS allocator<void>
+{
+public:
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef void* pointer;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* const_pointer;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef void value_type;
+
+ template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
+};
+
+template <>
+class _LIBCPP_TEMPLATE_VIS allocator<const void>
+{
+public:
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* pointer;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* const_pointer;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const void value_type;
+
+ template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
+};
+#endif
+
+// This class provides a non-trivial default constructor to the class that derives from it
+// if the condition is satisfied.
+//
+// The second template parameter exists to allow giving a unique type to __non_trivial_if,
+// which makes it possible to avoid breaking the ABI when making this a base class of an
+// existing class. Without that, imagine we have classes D1 and D2, both of which used to
+// have no base classes, but which now derive from __non_trivial_if. The layout of a class
+// that inherits from both D1 and D2 will change because the two __non_trivial_if base
+// classes are not allowed to share the same address.
+//
+// By making those __non_trivial_if base classes unique, we work around this problem and
+// it is safe to start deriving from __non_trivial_if in existing classes.
+template <bool _Cond, class _Unique>
+struct __non_trivial_if { };
+
+template <class _Unique>
+struct __non_trivial_if<true, _Unique> {
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR __non_trivial_if() _NOEXCEPT { }
+};
+
+// allocator
+//
+// Note: For ABI compatibility between C++20 and previous standards, we make
+// allocator<void> trivial in C++20.
+
+template <class _Tp>
+class _LIBCPP_TEMPLATE_VIS allocator
+ : private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> >
+{
+public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp value_type;
+ typedef true_type propagate_on_container_move_assignment;
+ typedef true_type is_always_equal;
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ allocator() _NOEXCEPT _LIBCPP_DEFAULT
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ allocator(const allocator<_Up>&) _NOEXCEPT { }
+
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ _Tp* allocate(size_t __n) {
+ if (__n > allocator_traits<allocator>::max_size(*this))
+ __throw_length_error("allocator<T>::allocate(size_t n)"
+ " 'n' exceeds maximum supported size");
+ if (__libcpp_is_constant_evaluated()) {
+ return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
+ } else {
+ return static_cast<_Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
+ }
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ void deallocate(_Tp* __p, size_t __n) _NOEXCEPT {
+ if (__libcpp_is_constant_evaluated()) {
+ ::operator delete(__p);
+ } else {
+ _VSTD::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
+ }
+ }
+
+ // C++20 Removed members
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* pointer;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp& reference;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
+
+ template <class _Up>
+ struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
+ typedef allocator<_Up> other;
+ };
+
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+ pointer address(reference __x) const _NOEXCEPT {
+ return _VSTD::addressof(__x);
+ }
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+ const_pointer address(const_reference __x) const _NOEXCEPT {
+ return _VSTD::addressof(__x);
+ }
+
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
+ _Tp* allocate(size_t __n, const void*) {
+ return allocate(__n);
+ }
+
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
+ return size_type(~0) / sizeof(_Tp);
+ }
+
+ template <class _Up, class... _Args>
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+ void construct(_Up* __p, _Args&&... __args) {
+ ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
+ }
+
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+ void destroy(pointer __p) {
+ __p->~_Tp();
+ }
+#endif
+};
+
+template <class _Tp>
+class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
+ : private __non_trivial_if<!is_void<_Tp>::value, allocator<const _Tp> >
+{
+public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef const _Tp value_type;
+ typedef true_type propagate_on_container_move_assignment;
+ typedef true_type is_always_equal;
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ allocator() _NOEXCEPT _LIBCPP_DEFAULT
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ allocator(const allocator<_Up>&) _NOEXCEPT { }
+
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ const _Tp* allocate(size_t __n) {
+ if (__n > allocator_traits<allocator>::max_size(*this))
+ __throw_length_error("allocator<const T>::allocate(size_t n)"
+ " 'n' exceeds maximum supported size");
+ if (__libcpp_is_constant_evaluated()) {
+ return static_cast<const _Tp*>(::operator new(__n * sizeof(_Tp)));
+ } else {
+ return static_cast<const _Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
+ }
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ void deallocate(const _Tp* __p, size_t __n) {
+ if (__libcpp_is_constant_evaluated()) {
+ ::operator delete(const_cast<_Tp*>(__p));
+ } else {
+ _VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
+ }
+ }
+
+ // C++20 Removed members
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
+
+ template <class _Up>
+ struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
+ typedef allocator<_Up> other;
+ };
+
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+ const_pointer address(const_reference __x) const _NOEXCEPT {
+ return _VSTD::addressof(__x);
+ }
+
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
+ const _Tp* allocate(size_t __n, const void*) {
+ return allocate(__n);
+ }
+
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
+ return size_type(~0) / sizeof(_Tp);
+ }
+
+ template <class _Up, class... _Args>
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+ void construct(_Up* __p, _Args&&... __args) {
+ ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
+ }
+
+ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+ void destroy(pointer __p) {
+ __p->~_Tp();
+ }
+#endif
+};
+
+template <class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}
+
+template <class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_ALLOCATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FUNCTIONAL___ALLOCATOR_ARG_T_H
+#define _LIBCPP___FUNCTIONAL___ALLOCATOR_ARG_T_H
+
+#include <__config>
+#include <__memory/uses_allocator.h>
+#include <__utility/forward.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { explicit allocator_arg_t() = default; };
+
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
+extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg;
+#else
+/* _LIBCPP_INLINE_VAR */ constexpr allocator_arg_t allocator_arg = allocator_arg_t();
+#endif
+
+#ifndef _LIBCPP_CXX03_LANG
+
+// allocator construction
+
+template <class _Tp, class _Alloc, class ..._Args>
+struct __uses_alloc_ctor_imp
+{
+ typedef _LIBCPP_NODEBUG_TYPE typename __uncvref<_Alloc>::type _RawAlloc;
+ static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value;
+ static const bool __ic =
+ is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
+ static const int value = __ua ? 2 - __ic : 0;
+};
+
+template <class _Tp, class _Alloc, class ..._Args>
+struct __uses_alloc_ctor
+ : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value>
+ {};
+
+template <class _Tp, class _Allocator, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args )
+{
+ new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
+}
+
+// FIXME: This should have a version which takes a non-const alloc.
+template <class _Tp, class _Allocator, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
+{
+ new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
+}
+
+// FIXME: This should have a version which takes a non-const alloc.
+template <class _Tp, class _Allocator, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
+{
+ new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
+}
+
+#endif // _LIBCPP_CXX03_LANG
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FUNCTIONAL___ALLOCATOR_ARG_T_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
+#define _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
+
+#include <__config>
+#include <__memory/construct_at.h>
+#include <__memory/pointer_traits.h>
+#include <__utility/forward.h>
+#include <limits>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#define _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(NAME, PROPERTY) \
+ template <class _Tp, class = void> struct NAME : false_type { }; \
+ template <class _Tp> struct NAME<_Tp, typename __void_t<typename _Tp:: PROPERTY >::type> : true_type { }
+
+// __pointer
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_pointer, pointer);
+template <class _Tp, class _Alloc,
+ class _RawAlloc = typename remove_reference<_Alloc>::type,
+ bool = __has_pointer<_RawAlloc>::value>
+struct __pointer {
+ using type _LIBCPP_NODEBUG_TYPE = typename _RawAlloc::pointer;
+};
+template <class _Tp, class _Alloc, class _RawAlloc>
+struct __pointer<_Tp, _Alloc, _RawAlloc, false> {
+ using type _LIBCPP_NODEBUG_TYPE = _Tp*;
+};
+
+// __const_pointer
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_const_pointer, const_pointer);
+template <class _Tp, class _Ptr, class _Alloc,
+ bool = __has_const_pointer<_Alloc>::value>
+struct __const_pointer {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::const_pointer;
+};
+template <class _Tp, class _Ptr, class _Alloc>
+struct __const_pointer<_Tp, _Ptr, _Alloc, false> {
+#ifdef _LIBCPP_CXX03_LANG
+ using type = typename pointer_traits<_Ptr>::template rebind<const _Tp>::other;
+#else
+ using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<const _Tp>;
+#endif
+};
+
+// __void_pointer
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_void_pointer, void_pointer);
+template <class _Ptr, class _Alloc,
+ bool = __has_void_pointer<_Alloc>::value>
+struct __void_pointer {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::void_pointer;
+};
+template <class _Ptr, class _Alloc>
+struct __void_pointer<_Ptr, _Alloc, false> {
+#ifdef _LIBCPP_CXX03_LANG
+ using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<void>::other;
+#else
+ using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<void>;
+#endif
+};
+
+// __const_void_pointer
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_const_void_pointer, const_void_pointer);
+template <class _Ptr, class _Alloc,
+ bool = __has_const_void_pointer<_Alloc>::value>
+struct __const_void_pointer {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::const_void_pointer;
+};
+template <class _Ptr, class _Alloc>
+struct __const_void_pointer<_Ptr, _Alloc, false> {
+#ifdef _LIBCPP_CXX03_LANG
+ using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<const void>::other;
+#else
+ using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<const void>;
+#endif
+};
+
+// __size_type
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_size_type, size_type);
+template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value>
+struct __size_type : make_unsigned<_DiffType> { };
+template <class _Alloc, class _DiffType>
+struct __size_type<_Alloc, _DiffType, true> {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::size_type;
+};
+
+// __alloc_traits_difference_type
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_alloc_traits_difference_type, difference_type);
+template <class _Alloc, class _Ptr, bool = __has_alloc_traits_difference_type<_Alloc>::value>
+struct __alloc_traits_difference_type {
+ using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::difference_type;
+};
+template <class _Alloc, class _Ptr>
+struct __alloc_traits_difference_type<_Alloc, _Ptr, true> {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::difference_type;
+};
+
+// __propagate_on_container_copy_assignment
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_copy_assignment, propagate_on_container_copy_assignment);
+template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value>
+struct __propagate_on_container_copy_assignment : false_type { };
+template <class _Alloc>
+struct __propagate_on_container_copy_assignment<_Alloc, true> {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::propagate_on_container_copy_assignment;
+};
+
+// __propagate_on_container_move_assignment
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_move_assignment, propagate_on_container_move_assignment);
+template <class _Alloc, bool = __has_propagate_on_container_move_assignment<_Alloc>::value>
+struct __propagate_on_container_move_assignment : false_type { };
+template <class _Alloc>
+struct __propagate_on_container_move_assignment<_Alloc, true> {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::propagate_on_container_move_assignment;
+};
+
+// __propagate_on_container_swap
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_swap, propagate_on_container_swap);
+template <class _Alloc, bool = __has_propagate_on_container_swap<_Alloc>::value>
+struct __propagate_on_container_swap : false_type { };
+template <class _Alloc>
+struct __propagate_on_container_swap<_Alloc, true> {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::propagate_on_container_swap;
+};
+
+// __is_always_equal
+_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_is_always_equal, is_always_equal);
+template <class _Alloc, bool = __has_is_always_equal<_Alloc>::value>
+struct __is_always_equal : is_empty<_Alloc> { };
+template <class _Alloc>
+struct __is_always_equal<_Alloc, true> {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::is_always_equal;
+};
+
+// __allocator_traits_rebind
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp, class _Up, class = void>
+struct __has_rebind_other : false_type { };
+template <class _Tp, class _Up>
+struct __has_rebind_other<_Tp, _Up, typename __void_t<
+ typename _Tp::template rebind<_Up>::other
+>::type> : true_type { };
+
+template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value>
+struct __allocator_traits_rebind {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Tp::template rebind<_Up>::other;
+};
+template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
+struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true> {
+ using type _LIBCPP_NODEBUG_TYPE = typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other;
+};
+template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
+struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false> {
+ using type _LIBCPP_NODEBUG_TYPE = _Alloc<_Up, _Args...>;
+};
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
+template<class _Alloc, class _Tp>
+using __allocator_traits_rebind_t = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+
+// __has_allocate_hint
+template <class _Alloc, class _SizeType, class _ConstVoidPtr, class = void>
+struct __has_allocate_hint : false_type { };
+
+template <class _Alloc, class _SizeType, class _ConstVoidPtr>
+struct __has_allocate_hint<_Alloc, _SizeType, _ConstVoidPtr, decltype(
+ (void)declval<_Alloc>().allocate(declval<_SizeType>(), declval<_ConstVoidPtr>())
+)> : true_type { };
+
+// __has_construct
+template <class, class _Alloc, class ..._Args>
+struct __has_construct_impl : false_type { };
+
+template <class _Alloc, class ..._Args>
+struct __has_construct_impl<decltype(
+ (void)declval<_Alloc>().construct(declval<_Args>()...)
+), _Alloc, _Args...> : true_type { };
+
+template <class _Alloc, class ..._Args>
+struct __has_construct : __has_construct_impl<void, _Alloc, _Args...> { };
+
+// __has_destroy
+template <class _Alloc, class _Pointer, class = void>
+struct __has_destroy : false_type { };
+
+template <class _Alloc, class _Pointer>
+struct __has_destroy<_Alloc, _Pointer, decltype(
+ (void)declval<_Alloc>().destroy(declval<_Pointer>())
+)> : true_type { };
+
+// __has_max_size
+template <class _Alloc, class = void>
+struct __has_max_size : false_type { };
+
+template <class _Alloc>
+struct __has_max_size<_Alloc, decltype(
+ (void)declval<_Alloc&>().max_size()
+)> : true_type { };
+
+// __has_select_on_container_copy_construction
+template <class _Alloc, class = void>
+struct __has_select_on_container_copy_construction : false_type { };
+
+template <class _Alloc>
+struct __has_select_on_container_copy_construction<_Alloc, decltype(
+ (void)declval<_Alloc>().select_on_container_copy_construction()
+)> : true_type { };
+
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
+template <class _Alloc>
+struct _LIBCPP_TEMPLATE_VIS allocator_traits
+{
+ using allocator_type = _Alloc;
+ using value_type = typename allocator_type::value_type;
+ using pointer = typename __pointer<value_type, allocator_type>::type;
+ using const_pointer = typename __const_pointer<value_type, pointer, allocator_type>::type;
+ using void_pointer = typename __void_pointer<pointer, allocator_type>::type;
+ using const_void_pointer = typename __const_void_pointer<pointer, allocator_type>::type;
+ using difference_type = typename __alloc_traits_difference_type<allocator_type, pointer>::type;
+ using size_type = typename __size_type<allocator_type, difference_type>::type;
+ using propagate_on_container_copy_assignment = typename __propagate_on_container_copy_assignment<allocator_type>::type;
+ using propagate_on_container_move_assignment = typename __propagate_on_container_move_assignment<allocator_type>::type;
+ using propagate_on_container_swap = typename __propagate_on_container_swap<allocator_type>::type;
+ using is_always_equal = typename __is_always_equal<allocator_type>::type;
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _Tp>
+ using rebind_alloc = __allocator_traits_rebind_t<allocator_type, _Tp>;
+ template <class _Tp>
+ using rebind_traits = allocator_traits<rebind_alloc<_Tp> >;
+#else // _LIBCPP_CXX03_LANG
+ template <class _Tp>
+ struct rebind_alloc {
+ using other = __allocator_traits_rebind_t<allocator_type, _Tp>;
+ };
+ template <class _Tp>
+ struct rebind_traits {
+ using other = allocator_traits<typename rebind_alloc<_Tp>::other>;
+ };
+#endif // _LIBCPP_CXX03_LANG
+
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static pointer allocate(allocator_type& __a, size_type __n) {
+ return __a.allocate(__n);
+ }
+
+ template <class _Ap = _Alloc, class =
+ _EnableIf<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) {
+ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+ return __a.allocate(__n, __hint);
+ _LIBCPP_SUPPRESS_DEPRECATED_POP
+ }
+ template <class _Ap = _Alloc, class = void, class =
+ _EnableIf<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer) {
+ return __a.allocate(__n);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static void deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT {
+ __a.deallocate(__p, __n);
+ }
+
+ template <class _Tp, class... _Args, class =
+ _EnableIf<__has_construct<allocator_type, _Tp*, _Args...>::value> >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args) {
+ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+ __a.construct(__p, _VSTD::forward<_Args>(__args)...);
+ _LIBCPP_SUPPRESS_DEPRECATED_POP
+ }
+ template <class _Tp, class... _Args, class = void, class =
+ _EnableIf<!__has_construct<allocator_type, _Tp*, _Args...>::value> >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static void construct(allocator_type&, _Tp* __p, _Args&&... __args) {
+#if _LIBCPP_STD_VER > 17
+ _VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...);
+#else
+ ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
+#endif
+ }
+
+ template <class _Tp, class =
+ _EnableIf<__has_destroy<allocator_type, _Tp*>::value> >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static void destroy(allocator_type& __a, _Tp* __p) {
+ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+ __a.destroy(__p);
+ _LIBCPP_SUPPRESS_DEPRECATED_POP
+ }
+ template <class _Tp, class = void, class =
+ _EnableIf<!__has_destroy<allocator_type, _Tp*>::value> >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static void destroy(allocator_type&, _Tp* __p) {
+#if _LIBCPP_STD_VER > 17
+ _VSTD::destroy_at(__p);
+#else
+ __p->~_Tp();
+#endif
+ }
+
+ template <class _Ap = _Alloc, class =
+ _EnableIf<__has_max_size<const _Ap>::value> >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static size_type max_size(const allocator_type& __a) _NOEXCEPT {
+ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+ return __a.max_size();
+ _LIBCPP_SUPPRESS_DEPRECATED_POP
+ }
+ template <class _Ap = _Alloc, class = void, class =
+ _EnableIf<!__has_max_size<const _Ap>::value> >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static size_type max_size(const allocator_type&) _NOEXCEPT {
+ return numeric_limits<size_type>::max() / sizeof(value_type);
+ }
+
+ template <class _Ap = _Alloc, class =
+ _EnableIf<__has_select_on_container_copy_construction<const _Ap>::value> >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static allocator_type select_on_container_copy_construction(const allocator_type& __a) {
+ return __a.select_on_container_copy_construction();
+ }
+ template <class _Ap = _Alloc, class = void, class =
+ _EnableIf<!__has_select_on_container_copy_construction<const _Ap>::value> >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static allocator_type select_on_container_copy_construction(const allocator_type& __a) {
+ return __a;
+ }
+};
+
+template <class _Traits, class _Tp>
+struct __rebind_alloc_helper {
+#ifndef _LIBCPP_CXX03_LANG
+ using type _LIBCPP_NODEBUG_TYPE = typename _Traits::template rebind_alloc<_Tp>;
+#else
+ using type = typename _Traits::template rebind_alloc<_Tp>::other;
+#endif
+};
+
+// __is_default_allocator
+template <class _Tp>
+struct __is_default_allocator : false_type { };
+
+template <class> class allocator;
+
+template <class _Tp>
+struct __is_default_allocator<allocator<_Tp> > : true_type { };
+
+// __is_cpp17_move_insertable
+template <class _Alloc, class = void>
+struct __is_cpp17_move_insertable
+ : is_move_constructible<typename _Alloc::value_type>
+{ };
+
+template <class _Alloc>
+struct __is_cpp17_move_insertable<_Alloc, _EnableIf<
+ !__is_default_allocator<_Alloc>::value &&
+ __has_construct<_Alloc, typename _Alloc::value_type*, typename _Alloc::value_type&&>::value
+> > : true_type { };
+
+// __is_cpp17_copy_insertable
+template <class _Alloc, class = void>
+struct __is_cpp17_copy_insertable
+ : integral_constant<bool,
+ is_copy_constructible<typename _Alloc::value_type>::value &&
+ __is_cpp17_move_insertable<_Alloc>::value
+ >
+{ };
+
+template <class _Alloc>
+struct __is_cpp17_copy_insertable<_Alloc, _EnableIf<
+ !__is_default_allocator<_Alloc>::value &&
+ __has_construct<_Alloc, typename _Alloc::value_type*, const typename _Alloc::value_type&>::value
+> >
+ : __is_cpp17_move_insertable<_Alloc>
+{ };
+
+#undef _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_AUTO_PTR_H
+#define _LIBCPP___MEMORY_AUTO_PTR_H
+
+#include <__config>
+#include <__nullptr>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr_ref
+{
+ _Tp* __ptr_;
+};
+
+template<class _Tp>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
+{
+private:
+ _Tp* __ptr_;
+public:
+ typedef _Tp element_type;
+
+ _LIBCPP_INLINE_VISIBILITY explicit auto_ptr(_Tp* __p = 0) _NOEXCEPT : __ptr_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr& __p) _NOEXCEPT : __ptr_(__p.release()) {}
+ template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr<_Up>& __p) _NOEXCEPT
+ : __ptr_(__p.release()) {}
+ _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr& __p) _NOEXCEPT
+ {reset(__p.release()); return *this;}
+ template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr<_Up>& __p) _NOEXCEPT
+ {reset(__p.release()); return *this;}
+ _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr_ref<_Tp> __p) _NOEXCEPT
+ {reset(__p.__ptr_); return *this;}
+ _LIBCPP_INLINE_VISIBILITY ~auto_ptr() _NOEXCEPT {delete __ptr_;}
+
+ _LIBCPP_INLINE_VISIBILITY _Tp& operator*() const _NOEXCEPT
+ {return *__ptr_;}
+ _LIBCPP_INLINE_VISIBILITY _Tp* operator->() const _NOEXCEPT {return __ptr_;}
+ _LIBCPP_INLINE_VISIBILITY _Tp* get() const _NOEXCEPT {return __ptr_;}
+ _LIBCPP_INLINE_VISIBILITY _Tp* release() _NOEXCEPT
+ {
+ _Tp* __t = __ptr_;
+ __ptr_ = nullptr;
+ return __t;
+ }
+ _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT
+ {
+ if (__ptr_ != __p)
+ delete __ptr_;
+ __ptr_ = __p;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr_ref<_Tp> __p) _NOEXCEPT : __ptr_(__p.__ptr_) {}
+ template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr_ref<_Up>() _NOEXCEPT
+ {auto_ptr_ref<_Up> __t; __t.__ptr_ = release(); return __t;}
+ template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr<_Up>() _NOEXCEPT
+ {return auto_ptr<_Up>(release());}
+};
+
+template <>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr<void>
+{
+public:
+ typedef void element_type;
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_AUTO_PTR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_COMPRESSED_PAIR_H
+#define _LIBCPP___MEMORY_COMPRESSED_PAIR_H
+
+#include <__config>
+#include <__utility/forward.h>
+#include <tuple> // needed in c++03 for some constructors
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Tag used to default initialize one or both of the pair's elements.
+struct __default_init_tag {};
+struct __value_init_tag {};
+
+template <class _Tp, int _Idx,
+ bool _CanBeEmptyBase =
+ is_empty<_Tp>::value && !__libcpp_is_final<_Tp>::value>
+struct __compressed_pair_elem {
+ typedef _Tp _ParamT;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __compressed_pair_elem(__default_init_tag) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __compressed_pair_elem(__value_init_tag) : __value_() {}
+
+ template <class _Up, class = typename enable_if<
+ !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
+ >::type>
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR explicit
+ __compressed_pair_elem(_Up&& __u)
+ : __value_(_VSTD::forward<_Up>(__u))
+ {
+ }
+
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class... _Args, size_t... _Indexes>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
+ __tuple_indices<_Indexes...>)
+ : __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
+#endif
+
+
+ _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return __value_; }
+ _LIBCPP_INLINE_VISIBILITY
+ const_reference __get() const _NOEXCEPT { return __value_; }
+
+private:
+ _Tp __value_;
+};
+
+template <class _Tp, int _Idx>
+struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
+ typedef _Tp _ParamT;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp __value_type;
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __compressed_pair_elem() = default;
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __compressed_pair_elem(__default_init_tag) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __compressed_pair_elem(__value_init_tag) : __value_type() {}
+
+ template <class _Up, class = typename enable_if<
+ !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
+ >::type>
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR explicit
+ __compressed_pair_elem(_Up&& __u)
+ : __value_type(_VSTD::forward<_Up>(__u))
+ {}
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class... _Args, size_t... _Indexes>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
+ __tuple_indices<_Indexes...>)
+ : __value_type(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return *this; }
+ _LIBCPP_INLINE_VISIBILITY
+ const_reference __get() const _NOEXCEPT { return *this; }
+};
+
+template <class _T1, class _T2>
+class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
+ private __compressed_pair_elem<_T2, 1> {
+public:
+ // NOTE: This static assert should never fire because __compressed_pair
+ // is *almost never* used in a scenario where it's possible for T1 == T2.
+ // (The exception is std::function where it is possible that the function
+ // object and the allocator have the same type).
+ static_assert((!is_same<_T1, _T2>::value),
+ "__compressed_pair cannot be instantiated when T1 and T2 are the same type; "
+ "The current implementation is NOT ABI-compatible with the previous "
+ "implementation for this configuration");
+
+ typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T1, 0> _Base1;
+ typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T2, 1> _Base2;
+
+ template <bool _Dummy = true,
+ class = typename enable_if<
+ __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
+ __dependent_type<is_default_constructible<_T2>, _Dummy>::value
+ >::type
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR __compressed_pair() : _Base1(__value_init_tag()), _Base2(__value_init_tag()) {}
+
+ template <class _U1, class _U2>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __compressed_pair(_U1&& __t1, _U2&& __t2)
+ : _Base1(_VSTD::forward<_U1>(__t1)), _Base2(_VSTD::forward<_U2>(__t2)) {}
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class... _Args1, class... _Args2>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
+ tuple<_Args2...> __second_args)
+ : _Base1(__pc, _VSTD::move(__first_args),
+ typename __make_tuple_indices<sizeof...(_Args1)>::type()),
+ _Base2(__pc, _VSTD::move(__second_args),
+ typename __make_tuple_indices<sizeof...(_Args2)>::type()) {}
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY
+ typename _Base1::reference first() _NOEXCEPT {
+ return static_cast<_Base1&>(*this).__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ typename _Base1::const_reference first() const _NOEXCEPT {
+ return static_cast<_Base1 const&>(*this).__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ typename _Base2::reference second() _NOEXCEPT {
+ return static_cast<_Base2&>(*this).__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ typename _Base2::const_reference second() const _NOEXCEPT {
+ return static_cast<_Base2 const&>(*this).__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ static _Base1* __get_first_base(__compressed_pair* __pair) _NOEXCEPT {
+ return static_cast<_Base1*>(__pair);
+ }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ static _Base2* __get_second_base(__compressed_pair* __pair) _NOEXCEPT {
+ return static_cast<_Base2*>(__pair);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(__compressed_pair& __x)
+ _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+ __is_nothrow_swappable<_T2>::value)
+ {
+ using _VSTD::swap;
+ swap(first(), __x.first());
+ swap(second(), __x.second());
+ }
+};
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
+ _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+ __is_nothrow_swappable<_T2>::value) {
+ __x.swap(__y);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_COMPRESSED_PAIR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_CONSTRUCT_AT_H
+#define _LIBCPP___MEMORY_CONSTRUCT_AT_H
+
+#include <__config>
+#include <__debug>
+#include <__utility/forward.h>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// construct_at
+
+#if _LIBCPP_STD_VER > 17
+
+template<class _Tp, class ..._Args, class = decltype(
+ ::new (declval<void*>()) _Tp(declval<_Args>()...)
+)>
+_LIBCPP_INLINE_VISIBILITY
+constexpr _Tp* construct_at(_Tp* __location, _Args&& ...__args) {
+ _LIBCPP_ASSERT(__location, "null pointer given to construct_at");
+ return ::new ((void*)__location) _Tp(_VSTD::forward<_Args>(__args)...);
+}
+
+#endif
+
+// destroy_at
+
+#if _LIBCPP_STD_VER > 14
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void destroy_at(_Tp* __loc) {
+ _LIBCPP_ASSERT(__loc, "null pointer given to destroy_at");
+ __loc->~_Tp();
+}
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_CONSTRUCT_AT_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_POINTER_SAFETY_H
+#define _LIBCPP___MEMORY_POINTER_SAFETY_H
+
+#include <__config>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_CXX03_LANG)
+
+enum class pointer_safety : unsigned char {
+ relaxed,
+ preferred,
+ strict
+};
+
+inline _LIBCPP_INLINE_VISIBILITY
+pointer_safety get_pointer_safety() _NOEXCEPT {
+ return pointer_safety::relaxed;
+}
+
+_LIBCPP_FUNC_VIS void declare_reachable(void* __p);
+_LIBCPP_FUNC_VIS void declare_no_pointers(char* __p, size_t __n);
+_LIBCPP_FUNC_VIS void undeclare_no_pointers(char* __p, size_t __n);
+_LIBCPP_FUNC_VIS void* __undeclare_reachable(void* __p);
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_Tp*
+undeclare_reachable(_Tp* __p)
+{
+ return static_cast<_Tp*>(__undeclare_reachable(__p));
+}
+
+#endif // !C++03
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_POINTER_SAFETY_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_POINTER_TRAITS_H
+#define _LIBCPP___MEMORY_POINTER_TRAITS_H
+
+#include <__config>
+#include <__memory/addressof.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class = void>
+struct __has_element_type : false_type {};
+
+template <class _Tp>
+struct __has_element_type<_Tp,
+ typename __void_t<typename _Tp::element_type>::type> : true_type {};
+
+template <class _Ptr, bool = __has_element_type<_Ptr>::value>
+struct __pointer_traits_element_type;
+
+template <class _Ptr>
+struct __pointer_traits_element_type<_Ptr, true>
+{
+ typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::element_type type;
+};
+
+template <template <class, class...> class _Sp, class _Tp, class ..._Args>
+struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true>
+{
+ typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::element_type type;
+};
+
+template <template <class, class...> class _Sp, class _Tp, class ..._Args>
+struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false>
+{
+ typedef _LIBCPP_NODEBUG_TYPE _Tp type;
+};
+
+template <class _Tp, class = void>
+struct __has_difference_type : false_type {};
+
+template <class _Tp>
+struct __has_difference_type<_Tp,
+ typename __void_t<typename _Tp::difference_type>::type> : true_type {};
+
+template <class _Ptr, bool = __has_difference_type<_Ptr>::value>
+struct __pointer_traits_difference_type
+{
+ typedef _LIBCPP_NODEBUG_TYPE ptrdiff_t type;
+};
+
+template <class _Ptr>
+struct __pointer_traits_difference_type<_Ptr, true>
+{
+ typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::difference_type type;
+};
+
+template <class _Tp, class _Up>
+struct __has_rebind
+{
+private:
+ struct __two {char __lx; char __lxx;};
+ template <class _Xp> static __two __test(...);
+ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+ template <class _Xp> static char __test(typename _Xp::template rebind<_Up>* = 0);
+ _LIBCPP_SUPPRESS_DEPRECATED_POP
+public:
+ static const bool value = sizeof(__test<_Tp>(0)) == 1;
+};
+
+template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
+struct __pointer_traits_rebind
+{
+#ifndef _LIBCPP_CXX03_LANG
+ typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up> type;
+#else
+ typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up>::other type;
+#endif
+};
+
+template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
+struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
+{
+#ifndef _LIBCPP_CXX03_LANG
+ typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
+#else
+ typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
+#endif
+};
+
+template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
+struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
+{
+ typedef _Sp<_Up, _Args...> type;
+};
+
+template <class _Ptr>
+struct _LIBCPP_TEMPLATE_VIS pointer_traits
+{
+ typedef _Ptr pointer;
+ typedef typename __pointer_traits_element_type<pointer>::type element_type;
+ typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
+#else
+ template <class _Up> struct rebind
+ {typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
+#endif // _LIBCPP_CXX03_LANG
+
+private:
+ struct __nat {};
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ static pointer pointer_to(typename conditional<is_void<element_type>::value,
+ __nat, element_type>::type& __r)
+ {return pointer::pointer_to(__r);}
+};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*>
+{
+ typedef _Tp* pointer;
+ typedef _Tp element_type;
+ typedef ptrdiff_t difference_type;
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _Up> using rebind = _Up*;
+#else
+ template <class _Up> struct rebind {typedef _Up* other;};
+#endif
+
+private:
+ struct __nat {};
+public:
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ static pointer pointer_to(typename conditional<is_void<element_type>::value,
+ __nat, element_type>::type& __r) _NOEXCEPT
+ {return _VSTD::addressof(__r);}
+};
+
+template <class _From, class _To>
+struct __rebind_pointer {
+#ifndef _LIBCPP_CXX03_LANG
+ typedef typename pointer_traits<_From>::template rebind<_To> type;
+#else
+ typedef typename pointer_traits<_From>::template rebind<_To>::other type;
+#endif
+};
+
+// to_address
+
+template <class _Pointer, class = void>
+struct __to_address_helper;
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_Tp* __to_address(_Tp* __p) _NOEXCEPT {
+ static_assert(!is_function<_Tp>::value, "_Tp is a function type");
+ return __p;
+}
+
+// enable_if is needed here to avoid instantiating checks for fancy pointers on raw pointers
+template <class _Pointer, class = _EnableIf<!is_pointer<_Pointer>::value> >
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename decay<decltype(__to_address_helper<_Pointer>::__call(declval<const _Pointer&>()))>::type
+__to_address(const _Pointer& __p) _NOEXCEPT {
+ return __to_address_helper<_Pointer>::__call(__p);
+}
+
+template <class _Pointer, class>
+struct __to_address_helper {
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ static decltype(_VSTD::__to_address(declval<const _Pointer&>().operator->()))
+ __call(const _Pointer&__p) _NOEXCEPT {
+ return _VSTD::__to_address(__p.operator->());
+ }
+};
+
+template <class _Pointer>
+struct __to_address_helper<_Pointer, decltype((void)pointer_traits<_Pointer>::to_address(declval<const _Pointer&>()))> {
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ static decltype(pointer_traits<_Pointer>::to_address(declval<const _Pointer&>()))
+ __call(const _Pointer&__p) _NOEXCEPT {
+ return pointer_traits<_Pointer>::to_address(__p);
+ }
+};
+
+#if _LIBCPP_STD_VER > 17
+template <class _Pointer>
+inline _LIBCPP_INLINE_VISIBILITY constexpr
+auto to_address(const _Pointer& __p) noexcept {
+ return _VSTD::__to_address(__p);
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_POINTER_TRAITS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
+#define _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
+
+#include <__config>
+#include <__memory/addressof.h>
+#include <cstddef>
+#include <iterator>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _OutputIterator, class _Tp>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
+#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+ : public iterator<output_iterator_tag, void, void, void, void>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+private:
+ _OutputIterator __x_;
+public:
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+#if _LIBCPP_STD_VER > 17
+ typedef ptrdiff_t difference_type;
+#else
+ typedef void difference_type;
+#endif
+ typedef void pointer;
+ typedef void reference;
+
+ _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}
+ _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}
+ _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element)
+ {::new ((void*)_VSTD::addressof(*__x_)) _Tp(__element); return *this;}
+#if _LIBCPP_STD_VER >= 14
+ _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element)
+ {::new ((void*)_VSTD::addressof(*__x_)) _Tp(_VSTD::move(__element)); return *this;}
+#endif
+ _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}
+ _LIBCPP_INLINE_VISIBILITY raw_storage_iterator operator++(int)
+ {raw_storage_iterator __t(*this); ++__x_; return __t;}
+#if _LIBCPP_STD_VER >= 14
+ _LIBCPP_INLINE_VISIBILITY _OutputIterator base() const { return __x_; }
+#endif
+};
+
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_SHARED_PTR_H
+#define _LIBCPP___MEMORY_SHARED_PTR_H
+
+#include <__availability>
+#include <__config>
+#include <__functional_base>
+#include <__functional/binary_function.h>
+#include <__functional/operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__memory/addressof.h>
+#include <__memory/allocation_guard.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/allocator.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/unique_ptr.h>
+#include <__utility/forward.h>
+#include <cstddef>
+#include <cstdlib> // abort
+#include <iosfwd>
+#include <stdexcept>
+#include <typeinfo>
+#include <type_traits>
+#include <utility>
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
+# include <atomic>
+#endif
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+# include <__memory/auto_ptr.h>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Alloc>
+class __allocator_destructor
+{
+ typedef _LIBCPP_NODEBUG_TYPE allocator_traits<_Alloc> __alloc_traits;
+public:
+ typedef _LIBCPP_NODEBUG_TYPE typename __alloc_traits::pointer pointer;
+ typedef _LIBCPP_NODEBUG_TYPE typename __alloc_traits::size_type size_type;
+private:
+ _Alloc& __alloc_;
+ size_type __s_;
+public:
+ _LIBCPP_INLINE_VISIBILITY __allocator_destructor(_Alloc& __a, size_type __s)
+ _NOEXCEPT
+ : __alloc_(__a), __s_(__s) {}
+ _LIBCPP_INLINE_VISIBILITY
+ void operator()(pointer __p) _NOEXCEPT
+ {__alloc_traits::deallocate(__alloc_, __p, __s_);}
+};
+
+// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)
+// should be sufficient for thread safety.
+// See https://llvm.org/PR22803
+#if defined(__clang__) && __has_builtin(__atomic_add_fetch) \
+ && defined(__ATOMIC_RELAXED) \
+ && defined(__ATOMIC_ACQ_REL)
+# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT
+#elif defined(_LIBCPP_COMPILER_GCC)
+# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT
+#endif
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+_ValueType __libcpp_relaxed_load(_ValueType const* __value) {
+#if !defined(_LIBCPP_HAS_NO_THREADS) && \
+ defined(__ATOMIC_RELAXED) && \
+ (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
+ return __atomic_load_n(__value, __ATOMIC_RELAXED);
+#else
+ return *__value;
+#endif
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+_ValueType __libcpp_acquire_load(_ValueType const* __value) {
+#if !defined(_LIBCPP_HAS_NO_THREADS) && \
+ defined(__ATOMIC_ACQUIRE) && \
+ (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
+ return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
+#else
+ return *__value;
+#endif
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _Tp
+__libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT
+{
+#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
+ return __atomic_add_fetch(&__t, 1, __ATOMIC_RELAXED);
+#else
+ return __t += 1;
+#endif
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _Tp
+__libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT
+{
+#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
+ return __atomic_add_fetch(&__t, -1, __ATOMIC_ACQ_REL);
+#else
+ return __t -= 1;
+#endif
+}
+
+class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
+ : public std::exception
+{
+public:
+ bad_weak_ptr() _NOEXCEPT = default;
+ bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default;
+ virtual ~bad_weak_ptr() _NOEXCEPT;
+ virtual const char* what() const _NOEXCEPT;
+};
+
+_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+void __throw_bad_weak_ptr()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_weak_ptr();
+#else
+ _VSTD::abort();
+#endif
+}
+
+template<class _Tp> class _LIBCPP_TEMPLATE_VIS weak_ptr;
+
+class _LIBCPP_TYPE_VIS __shared_count
+{
+ __shared_count(const __shared_count&);
+ __shared_count& operator=(const __shared_count&);
+
+protected:
+ long __shared_owners_;
+ virtual ~__shared_count();
+private:
+ virtual void __on_zero_shared() _NOEXCEPT = 0;
+
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __shared_count(long __refs = 0) _NOEXCEPT
+ : __shared_owners_(__refs) {}
+
+#if defined(_LIBCPP_BUILDING_LIBRARY) && \
+ defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
+ void __add_shared() _NOEXCEPT;
+ bool __release_shared() _NOEXCEPT;
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ void __add_shared() _NOEXCEPT {
+ __libcpp_atomic_refcount_increment(__shared_owners_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ bool __release_shared() _NOEXCEPT {
+ if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1) {
+ __on_zero_shared();
+ return true;
+ }
+ return false;
+ }
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ long use_count() const _NOEXCEPT {
+ return __libcpp_relaxed_load(&__shared_owners_) + 1;
+ }
+};
+
+class _LIBCPP_TYPE_VIS __shared_weak_count
+ : private __shared_count
+{
+ long __shared_weak_owners_;
+
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __shared_weak_count(long __refs = 0) _NOEXCEPT
+ : __shared_count(__refs),
+ __shared_weak_owners_(__refs) {}
+protected:
+ virtual ~__shared_weak_count();
+
+public:
+#if defined(_LIBCPP_BUILDING_LIBRARY) && \
+ defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
+ void __add_shared() _NOEXCEPT;
+ void __add_weak() _NOEXCEPT;
+ void __release_shared() _NOEXCEPT;
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ void __add_shared() _NOEXCEPT {
+ __shared_count::__add_shared();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void __add_weak() _NOEXCEPT {
+ __libcpp_atomic_refcount_increment(__shared_weak_owners_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void __release_shared() _NOEXCEPT {
+ if (__shared_count::__release_shared())
+ __release_weak();
+ }
+#endif
+ void __release_weak() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ long use_count() const _NOEXCEPT {return __shared_count::use_count();}
+ __shared_weak_count* lock() _NOEXCEPT;
+
+ virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
+private:
+ virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
+};
+
+template <class _Tp, class _Dp, class _Alloc>
+class __shared_ptr_pointer
+ : public __shared_weak_count
+{
+ __compressed_pair<__compressed_pair<_Tp, _Dp>, _Alloc> __data_;
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
+ : __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
+
+#ifndef _LIBCPP_NO_RTTI
+ virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
+#endif
+
+private:
+ virtual void __on_zero_shared() _NOEXCEPT;
+ virtual void __on_zero_shared_weak() _NOEXCEPT;
+};
+
+#ifndef _LIBCPP_NO_RTTI
+
+template <class _Tp, class _Dp, class _Alloc>
+const void*
+__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT
+{
+ return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr;
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template <class _Tp, class _Dp, class _Alloc>
+void
+__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared() _NOEXCEPT
+{
+ __data_.first().second()(__data_.first().first());
+ __data_.first().second().~_Dp();
+}
+
+template <class _Tp, class _Dp, class _Alloc>
+void
+__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
+{
+ typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_pointer>::type _Al;
+ typedef allocator_traits<_Al> _ATraits;
+ typedef pointer_traits<typename _ATraits::pointer> _PTraits;
+
+ _Al __a(__data_.second());
+ __data_.second().~_Alloc();
+ __a.deallocate(_PTraits::pointer_to(*this), 1);
+}
+
+template <class _Tp, class _Alloc>
+struct __shared_ptr_emplace
+ : __shared_weak_count
+{
+ template<class ..._Args>
+ _LIBCPP_HIDE_FROM_ABI
+ explicit __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
+ : __storage_(_VSTD::move(__a))
+ {
+#if _LIBCPP_STD_VER > 17
+ using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
+ _TpAlloc __tmp(*__get_alloc());
+ allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), _VSTD::forward<_Args>(__args)...);
+#else
+ ::new ((void*)__get_elem()) _Tp(_VSTD::forward<_Args>(__args)...);
+#endif
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Alloc* __get_alloc() _NOEXCEPT { return __storage_.__get_alloc(); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
+
+private:
+ virtual void __on_zero_shared() _NOEXCEPT {
+#if _LIBCPP_STD_VER > 17
+ using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
+ _TpAlloc __tmp(*__get_alloc());
+ allocator_traits<_TpAlloc>::destroy(__tmp, __get_elem());
+#else
+ __get_elem()->~_Tp();
+#endif
+ }
+
+ virtual void __on_zero_shared_weak() _NOEXCEPT {
+ using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type;
+ using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer;
+ _ControlBlockAlloc __tmp(*__get_alloc());
+ __storage_.~_Storage();
+ allocator_traits<_ControlBlockAlloc>::deallocate(__tmp,
+ pointer_traits<_ControlBlockPointer>::pointer_to(*this), 1);
+ }
+
+ // This class implements the control block for non-array shared pointers created
+ // through `std::allocate_shared` and `std::make_shared`.
+ //
+ // In previous versions of the library, we used a compressed pair to store
+ // both the _Alloc and the _Tp. This implies using EBO, which is incompatible
+ // with Allocator construction for _Tp. To allow implementing P0674 in C++20,
+ // we now use a properly aligned char buffer while making sure that we maintain
+ // the same layout that we had when we used a compressed pair.
+ using _CompressedPair = __compressed_pair<_Alloc, _Tp>;
+ struct _ALIGNAS_TYPE(_CompressedPair) _Storage {
+ char __blob_[sizeof(_CompressedPair)];
+
+ _LIBCPP_HIDE_FROM_ABI explicit _Storage(_Alloc&& __a) {
+ ::new ((void*)__get_alloc()) _Alloc(_VSTD::move(__a));
+ }
+ _LIBCPP_HIDE_FROM_ABI ~_Storage() {
+ __get_alloc()->~_Alloc();
+ }
+ _Alloc* __get_alloc() _NOEXCEPT {
+ _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_);
+ typename _CompressedPair::_Base1* __first = _CompressedPair::__get_first_base(__as_pair);
+ _Alloc *__alloc = reinterpret_cast<_Alloc*>(__first);
+ return __alloc;
+ }
+ _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT {
+ _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_);
+ typename _CompressedPair::_Base2* __second = _CompressedPair::__get_second_base(__as_pair);
+ _Tp *__elem = reinterpret_cast<_Tp*>(__second);
+ return __elem;
+ }
+ };
+
+ static_assert(_LIBCPP_ALIGNOF(_Storage) == _LIBCPP_ALIGNOF(_CompressedPair), "");
+ static_assert(sizeof(_Storage) == sizeof(_CompressedPair), "");
+ _Storage __storage_;
+};
+
+struct __shared_ptr_dummy_rebind_allocator_type;
+template <>
+class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
+{
+public:
+ template <class _Other>
+ struct rebind
+ {
+ typedef allocator<_Other> other;
+ };
+};
+
+template<class _Tp> class _LIBCPP_TEMPLATE_VIS enable_shared_from_this;
+
+template<class _Tp, class _Up>
+struct __compatible_with
+#if _LIBCPP_STD_VER > 14
+ : is_convertible<remove_extent_t<_Tp>*, remove_extent_t<_Up>*> {};
+#else
+ : is_convertible<_Tp*, _Up*> {};
+#endif // _LIBCPP_STD_VER > 14
+
+template <class _Ptr, class = void>
+struct __is_deletable : false_type { };
+template <class _Ptr>
+struct __is_deletable<_Ptr, decltype(delete declval<_Ptr>())> : true_type { };
+
+template <class _Ptr, class = void>
+struct __is_array_deletable : false_type { };
+template <class _Ptr>
+struct __is_array_deletable<_Ptr, decltype(delete[] declval<_Ptr>())> : true_type { };
+
+template <class _Dp, class _Pt,
+ class = decltype(declval<_Dp>()(declval<_Pt>()))>
+static true_type __well_formed_deleter_test(int);
+
+template <class, class>
+static false_type __well_formed_deleter_test(...);
+
+template <class _Dp, class _Pt>
+struct __well_formed_deleter : decltype(__well_formed_deleter_test<_Dp, _Pt>(0)) {};
+
+template<class _Dp, class _Tp, class _Yp>
+struct __shared_ptr_deleter_ctor_reqs
+{
+ static const bool value = __compatible_with<_Tp, _Yp>::value &&
+ is_move_constructible<_Dp>::value &&
+ __well_formed_deleter<_Dp, _Tp*>::value;
+};
+
+#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)
+# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
+#else
+# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI
+#endif
+
+template<class _Tp>
+class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
+{
+public:
+#if _LIBCPP_STD_VER > 14
+ typedef weak_ptr<_Tp> weak_type;
+ typedef remove_extent_t<_Tp> element_type;
+#else
+ typedef _Tp element_type;
+#endif
+
+private:
+ element_type* __ptr_;
+ __shared_weak_count* __cntrl_;
+
+ struct __nat {int __for_bool_;};
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT;
+
+ template<class _Yp, class = _EnableIf<
+ _And<
+ __compatible_with<_Yp, _Tp>
+ // In C++03 we get errors when trying to do SFINAE with the
+ // delete operator, so we always pretend that it's deletable.
+ // The same happens on GCC.
+#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_COMPILER_GCC)
+ , _If<is_array<_Tp>::value, __is_array_deletable<_Yp*>, __is_deletable<_Yp*> >
+#endif
+ >::value
+ > >
+ explicit shared_ptr(_Yp* __p) : __ptr_(__p) {
+ unique_ptr<_Yp> __hold(__p);
+ typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
+ typedef __shared_ptr_pointer<_Yp*, __shared_ptr_default_delete<_Tp, _Yp>, _AllocT > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__p, __shared_ptr_default_delete<_Tp, _Yp>(), _AllocT());
+ __hold.release();
+ __enable_weak_this(__p, __p);
+ }
+
+ template<class _Yp, class _Dp>
+ shared_ptr(_Yp* __p, _Dp __d,
+ typename enable_if<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value, __nat>::type = __nat());
+ template<class _Yp, class _Dp, class _Alloc>
+ shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
+ typename enable_if<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value, __nat>::type = __nat());
+ template <class _Dp> shared_ptr(nullptr_t __p, _Dp __d);
+ template <class _Dp, class _Alloc> shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a);
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ shared_ptr(const shared_ptr& __r) _NOEXCEPT;
+ template<class _Yp>
+ _LIBCPP_INLINE_VISIBILITY
+ shared_ptr(const shared_ptr<_Yp>& __r,
+ typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())
+ _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ shared_ptr(shared_ptr&& __r) _NOEXCEPT;
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r,
+ typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())
+ _NOEXCEPT;
+ template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type= __nat());
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+ template<class _Yp>
+ shared_ptr(auto_ptr<_Yp>&& __r,
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
+#endif
+ template <class _Yp, class _Dp>
+ shared_ptr(unique_ptr<_Yp, _Dp>&&,
+ typename enable_if
+ <
+ !is_lvalue_reference<_Dp>::value &&
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
+ __nat
+ >::type = __nat());
+ template <class _Yp, class _Dp>
+ shared_ptr(unique_ptr<_Yp, _Dp>&&,
+ typename enable_if
+ <
+ is_lvalue_reference<_Dp>::value &&
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
+ __nat
+ >::type = __nat());
+
+ ~shared_ptr();
+
+ _LIBCPP_INLINE_VISIBILITY
+ shared_ptr& operator=(const shared_ptr& __r) _NOEXCEPT;
+ template<class _Yp>
+ typename enable_if
+ <
+ __compatible_with<_Yp, element_type>::value,
+ shared_ptr&
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
+ template<class _Yp>
+ typename enable_if
+ <
+ __compatible_with<_Yp, element_type>::value,
+ shared_ptr&
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ operator=(shared_ptr<_Yp>&& __r);
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+ template<class _Yp>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if
+ <
+ !is_array<_Yp>::value &&
+ is_convertible<_Yp*, element_type*>::value,
+ shared_ptr
+ >::type&
+ operator=(auto_ptr<_Yp>&& __r);
+#endif
+ template <class _Yp, class _Dp>
+ typename enable_if
+ <
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
+ shared_ptr&
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ operator=(unique_ptr<_Yp, _Dp>&& __r);
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(shared_ptr& __r) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() _NOEXCEPT;
+ template<class _Yp>
+ typename enable_if
+ <
+ __compatible_with<_Yp, element_type>::value,
+ void
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ reset(_Yp* __p);
+ template<class _Yp, class _Dp>
+ typename enable_if
+ <
+ __compatible_with<_Yp, element_type>::value,
+ void
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ reset(_Yp* __p, _Dp __d);
+ template<class _Yp, class _Dp, class _Alloc>
+ typename enable_if
+ <
+ __compatible_with<_Yp, element_type>::value,
+ void
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ reset(_Yp* __p, _Dp __d, _Alloc __a);
+
+ _LIBCPP_INLINE_VISIBILITY
+ element_type* get() const _NOEXCEPT {return __ptr_;}
+ _LIBCPP_INLINE_VISIBILITY
+ typename add_lvalue_reference<element_type>::type operator*() const _NOEXCEPT
+ {return *__ptr_;}
+ _LIBCPP_INLINE_VISIBILITY
+ element_type* operator->() const _NOEXCEPT
+ {
+ static_assert(!is_array<_Tp>::value,
+ "std::shared_ptr<T>::operator-> is only valid when T is not an array type.");
+ return __ptr_;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ long use_count() const _NOEXCEPT {return __cntrl_ ? __cntrl_->use_count() : 0;}
+ _LIBCPP_INLINE_VISIBILITY
+ bool unique() const _NOEXCEPT {return use_count() == 1;}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit operator bool() const _NOEXCEPT {return get() != nullptr;}
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT
+ {return __cntrl_ < __p.__cntrl_;}
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool owner_before(weak_ptr<_Up> const& __p) const _NOEXCEPT
+ {return __cntrl_ < __p.__cntrl_;}
+ _LIBCPP_INLINE_VISIBILITY
+ bool
+ __owner_equivalent(const shared_ptr& __p) const
+ {return __cntrl_ == __p.__cntrl_;}
+
+#if _LIBCPP_STD_VER > 14
+ typename add_lvalue_reference<element_type>::type
+ _LIBCPP_INLINE_VISIBILITY
+ operator[](ptrdiff_t __i) const
+ {
+ static_assert(is_array<_Tp>::value,
+ "std::shared_ptr<T>::operator[] is only valid when T is an array type.");
+ return __ptr_[__i];
+ }
+#endif
+
+#ifndef _LIBCPP_NO_RTTI
+ template <class _Dp>
+ _LIBCPP_INLINE_VISIBILITY
+ _Dp* __get_deleter() const _NOEXCEPT
+ {return static_cast<_Dp*>(__cntrl_
+ ? const_cast<void *>(__cntrl_->__get_deleter(typeid(_Dp)))
+ : nullptr);}
+#endif // _LIBCPP_NO_RTTI
+
+ template<class _Yp, class _CntrlBlk>
+ static shared_ptr<_Tp>
+ __create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl) _NOEXCEPT
+ {
+ shared_ptr<_Tp> __r;
+ __r.__ptr_ = __p;
+ __r.__cntrl_ = __cntrl;
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
+ return __r;
+ }
+
+private:
+ template <class _Yp, bool = is_function<_Yp>::value>
+ struct __shared_ptr_default_allocator
+ {
+ typedef allocator<_Yp> type;
+ };
+
+ template <class _Yp>
+ struct __shared_ptr_default_allocator<_Yp, true>
+ {
+ typedef allocator<__shared_ptr_dummy_rebind_allocator_type> type;
+ };
+
+ template <class _Yp, class _OrigPtr>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<is_convertible<_OrigPtr*,
+ const enable_shared_from_this<_Yp>*
+ >::value,
+ void>::type
+ __enable_weak_this(const enable_shared_from_this<_Yp>* __e,
+ _OrigPtr* __ptr) _NOEXCEPT
+ {
+ typedef typename remove_cv<_Yp>::type _RawYp;
+ if (__e && __e->__weak_this_.expired())
+ {
+ __e->__weak_this_ = shared_ptr<_RawYp>(*this,
+ const_cast<_RawYp*>(static_cast<const _Yp*>(__ptr)));
+ }
+ }
+
+ _LIBCPP_INLINE_VISIBILITY void __enable_weak_this(...) _NOEXCEPT {}
+
+ template <class, class _Yp>
+ struct __shared_ptr_default_delete
+ : default_delete<_Yp> {};
+
+ template <class _Yp, class _Un, size_t _Sz>
+ struct __shared_ptr_default_delete<_Yp[_Sz], _Un>
+ : default_delete<_Yp[]> {};
+
+ template <class _Yp, class _Un>
+ struct __shared_ptr_default_delete<_Yp[], _Un>
+ : default_delete<_Yp[]> {};
+
+ template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
+ template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
+};
+
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class _Tp>
+shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
+template<class _Tp, class _Dp>
+shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>;
+#endif
+
+template<class _Tp>
+inline
+_LIBCPP_CONSTEXPR
+shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
+ : __ptr_(nullptr),
+ __cntrl_(nullptr)
+{
+}
+
+template<class _Tp>
+inline
+_LIBCPP_CONSTEXPR
+shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
+ : __ptr_(nullptr),
+ __cntrl_(nullptr)
+{
+}
+
+template<class _Tp>
+template<class _Yp, class _Dp>
+shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d,
+ typename enable_if<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value, __nat>::type)
+ : __ptr_(__p)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
+ typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk;
+#ifndef _LIBCPP_CXX03_LANG
+ __cntrl_ = new _CntrlBlk(__p, _VSTD::move(__d), _AllocT());
+#else
+ __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
+#endif // not _LIBCPP_CXX03_LANG
+ __enable_weak_this(__p, __p);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ __d(__p);
+ throw;
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+}
+
+template<class _Tp>
+template<class _Dp>
+shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d)
+ : __ptr_(nullptr)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
+ typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT > _CntrlBlk;
+#ifndef _LIBCPP_CXX03_LANG
+ __cntrl_ = new _CntrlBlk(__p, _VSTD::move(__d), _AllocT());
+#else
+ __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
+#endif // not _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ __d(__p);
+ throw;
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+}
+
+template<class _Tp>
+template<class _Yp, class _Dp, class _Alloc>
+shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
+ typename enable_if<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value, __nat>::type)
+ : __ptr_(__p)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
+ typedef __allocator_destructor<_A2> _D2;
+ _A2 __a2(__a);
+ unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
+ ::new ((void*)_VSTD::addressof(*__hold2.get()))
+#ifndef _LIBCPP_CXX03_LANG
+ _CntrlBlk(__p, _VSTD::move(__d), __a);
+#else
+ _CntrlBlk(__p, __d, __a);
+#endif // not _LIBCPP_CXX03_LANG
+ __cntrl_ = _VSTD::addressof(*__hold2.release());
+ __enable_weak_this(__p, __p);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ __d(__p);
+ throw;
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+}
+
+template<class _Tp>
+template<class _Dp, class _Alloc>
+shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
+ : __ptr_(nullptr)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
+ typedef __allocator_destructor<_A2> _D2;
+ _A2 __a2(__a);
+ unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
+ ::new ((void*)_VSTD::addressof(*__hold2.get()))
+#ifndef _LIBCPP_CXX03_LANG
+ _CntrlBlk(__p, _VSTD::move(__d), __a);
+#else
+ _CntrlBlk(__p, __d, __a);
+#endif // not _LIBCPP_CXX03_LANG
+ __cntrl_ = _VSTD::addressof(*__hold2.release());
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ __d(__p);
+ throw;
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) _NOEXCEPT
+ : __ptr_(__p),
+ __cntrl_(__r.__cntrl_)
+{
+ if (__cntrl_)
+ __cntrl_->__add_shared();
+}
+
+template<class _Tp>
+inline
+shared_ptr<_Tp>::shared_ptr(const shared_ptr& __r) _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ if (__cntrl_)
+ __cntrl_->__add_shared();
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
+ typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type)
+ _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ if (__cntrl_)
+ __cntrl_->__add_shared();
+}
+
+template<class _Tp>
+inline
+shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ __r.__ptr_ = nullptr;
+ __r.__cntrl_ = nullptr;
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
+ typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type)
+ _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ __r.__ptr_ = nullptr;
+ __r.__cntrl_ = nullptr;
+}
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+template<class _Tp>
+template<class _Yp>
+shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r,
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
+ : __ptr_(__r.get())
+{
+ typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__r.get(), default_delete<_Yp>(), allocator<_Yp>());
+ __enable_weak_this(__r.get(), __r.get());
+ __r.release();
+}
+#endif
+
+template<class _Tp>
+template <class _Yp, class _Dp>
+shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
+ typename enable_if
+ <
+ !is_lvalue_reference<_Dp>::value &&
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
+ __nat
+ >::type)
+ : __ptr_(__r.get())
+{
+#if _LIBCPP_STD_VER > 11
+ if (__ptr_ == nullptr)
+ __cntrl_ = nullptr;
+ else
+#endif
+ {
+ typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
+ typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer, _Dp, _AllocT > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), _AllocT());
+ __enable_weak_this(__r.get(), __r.get());
+ }
+ __r.release();
+}
+
+template<class _Tp>
+template <class _Yp, class _Dp>
+shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
+ typename enable_if
+ <
+ is_lvalue_reference<_Dp>::value &&
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
+ __nat
+ >::type)
+ : __ptr_(__r.get())
+{
+#if _LIBCPP_STD_VER > 11
+ if (__ptr_ == nullptr)
+ __cntrl_ = nullptr;
+ else
+#endif
+ {
+ typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
+ typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer,
+ reference_wrapper<typename remove_reference<_Dp>::type>,
+ _AllocT > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__r.get(), _VSTD::ref(__r.get_deleter()), _AllocT());
+ __enable_weak_this(__r.get(), __r.get());
+ }
+ __r.release();
+}
+
+template<class _Tp>
+shared_ptr<_Tp>::~shared_ptr()
+{
+ if (__cntrl_)
+ __cntrl_->__release_shared();
+}
+
+template<class _Tp>
+inline
+shared_ptr<_Tp>&
+shared_ptr<_Tp>::operator=(const shared_ptr& __r) _NOEXCEPT
+{
+ shared_ptr(__r).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+typename enable_if
+<
+ __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
+ shared_ptr<_Tp>&
+>::type
+shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
+{
+ shared_ptr(__r).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+inline
+shared_ptr<_Tp>&
+shared_ptr<_Tp>::operator=(shared_ptr&& __r) _NOEXCEPT
+{
+ shared_ptr(_VSTD::move(__r)).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+typename enable_if
+<
+ __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
+ shared_ptr<_Tp>&
+>::type
+shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
+{
+ shared_ptr(_VSTD::move(__r)).swap(*this);
+ return *this;
+}
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+template<class _Tp>
+template<class _Yp>
+inline
+typename enable_if
+<
+ !is_array<_Yp>::value &&
+ is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
+ shared_ptr<_Tp>
+>::type&
+shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
+{
+ shared_ptr(_VSTD::move(__r)).swap(*this);
+ return *this;
+}
+#endif
+
+template<class _Tp>
+template <class _Yp, class _Dp>
+inline
+typename enable_if
+<
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer,
+ typename shared_ptr<_Tp>::element_type*>::value,
+ shared_ptr<_Tp>&
+>::type
+shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
+{
+ shared_ptr(_VSTD::move(__r)).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+inline
+void
+shared_ptr<_Tp>::swap(shared_ptr& __r) _NOEXCEPT
+{
+ _VSTD::swap(__ptr_, __r.__ptr_);
+ _VSTD::swap(__cntrl_, __r.__cntrl_);
+}
+
+template<class _Tp>
+inline
+void
+shared_ptr<_Tp>::reset() _NOEXCEPT
+{
+ shared_ptr().swap(*this);
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+typename enable_if
+<
+ __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
+ void
+>::type
+shared_ptr<_Tp>::reset(_Yp* __p)
+{
+ shared_ptr(__p).swap(*this);
+}
+
+template<class _Tp>
+template<class _Yp, class _Dp>
+inline
+typename enable_if
+<
+ __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
+ void
+>::type
+shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d)
+{
+ shared_ptr(__p, __d).swap(*this);
+}
+
+template<class _Tp>
+template<class _Yp, class _Dp, class _Alloc>
+inline
+typename enable_if
+<
+ __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
+ void
+>::type
+shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a)
+{
+ shared_ptr(__p, __d, __a).swap(*this);
+}
+
+//
+// std::allocate_shared and std::make_shared
+//
+template<class _Tp, class _Alloc, class ..._Args, class = _EnableIf<!is_array<_Tp>::value> >
+_LIBCPP_HIDE_FROM_ABI
+shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&& ...__args)
+{
+ using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>;
+ using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;
+ __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);
+ ::new ((void*)_VSTD::addressof(*__guard.__get())) _ControlBlock(__a, _VSTD::forward<_Args>(__args)...);
+ auto __control_block = __guard.__release_ptr();
+ return shared_ptr<_Tp>::__create_with_control_block((*__control_block).__get_elem(), _VSTD::addressof(*__control_block));
+}
+
+template<class _Tp, class ..._Args, class = _EnableIf<!is_array<_Tp>::value> >
+_LIBCPP_HIDE_FROM_ABI
+shared_ptr<_Tp> make_shared(_Args&& ...__args)
+{
+ return _VSTD::allocate_shared<_Tp>(allocator<_Tp>(), _VSTD::forward<_Args>(__args)...);
+}
+
+template<class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
+{
+ return __x.get() == __y.get();
+}
+
+template<class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
+{
+ return !(__x == __y);
+}
+
+template<class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
+{
+#if _LIBCPP_STD_VER <= 11
+ typedef typename common_type<_Tp*, _Up*>::type _Vp;
+ return less<_Vp>()(__x.get(), __y.get());
+#else
+ return less<>()(__x.get(), __y.get());
+#endif
+
+}
+
+template<class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
+{
+ return __y < __x;
+}
+
+template<class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
+{
+ return !(__y < __x);
+}
+
+template<class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
+{
+ return !(__x < __y);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
+{
+ return !__x;
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
+{
+ return !__x;
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
+{
+ return static_cast<bool>(__x);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
+{
+ return static_cast<bool>(__x);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
+{
+ return less<_Tp*>()(__x.get(), nullptr);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
+{
+ return less<_Tp*>()(nullptr, __x.get());
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
+{
+ return nullptr < __x;
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
+{
+ return __x < nullptr;
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
+{
+ return !(nullptr < __x);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
+{
+ return !(__x < nullptr);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
+{
+ return !(__x < nullptr);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
+{
+ return !(nullptr < __x);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __y) _NOEXCEPT
+{
+ __x.swap(__y);
+}
+
+template<class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+shared_ptr<_Tp>
+static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
+{
+ return shared_ptr<_Tp>(__r,
+ static_cast<
+ typename shared_ptr<_Tp>::element_type*>(__r.get()));
+}
+
+template<class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+shared_ptr<_Tp>
+dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
+{
+ typedef typename shared_ptr<_Tp>::element_type _ET;
+ _ET* __p = dynamic_cast<_ET*>(__r.get());
+ return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>();
+}
+
+template<class _Tp, class _Up>
+shared_ptr<_Tp>
+const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
+{
+ typedef typename shared_ptr<_Tp>::element_type _RTp;
+ return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get()));
+}
+
+template<class _Tp, class _Up>
+shared_ptr<_Tp>
+reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
+{
+ return shared_ptr<_Tp>(__r,
+ reinterpret_cast<
+ typename shared_ptr<_Tp>::element_type*>(__r.get()));
+}
+
+#ifndef _LIBCPP_NO_RTTI
+
+template<class _Dp, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_Dp*
+get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
+{
+ return __p.template __get_deleter<_Dp>();
+}
+
+#endif // _LIBCPP_NO_RTTI
+
+template<class _Tp>
+class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
+{
+public:
+ typedef _Tp element_type;
+private:
+ element_type* __ptr_;
+ __shared_weak_count* __cntrl_;
+
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT;
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r,
+ typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
+ _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ weak_ptr(weak_ptr const& __r) _NOEXCEPT;
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r,
+ typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
+ _NOEXCEPT;
+
+ _LIBCPP_INLINE_VISIBILITY
+ weak_ptr(weak_ptr&& __r) _NOEXCEPT;
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
+ typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
+ _NOEXCEPT;
+ ~weak_ptr();
+
+ _LIBCPP_INLINE_VISIBILITY
+ weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT;
+ template<class _Yp>
+ typename enable_if
+ <
+ is_convertible<_Yp*, element_type*>::value,
+ weak_ptr&
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;
+
+ _LIBCPP_INLINE_VISIBILITY
+ weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;
+ template<class _Yp>
+ typename enable_if
+ <
+ is_convertible<_Yp*, element_type*>::value,
+ weak_ptr&
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
+
+ template<class _Yp>
+ typename enable_if
+ <
+ is_convertible<_Yp*, element_type*>::value,
+ weak_ptr&
+ >::type
+ _LIBCPP_INLINE_VISIBILITY
+ operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT;
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(weak_ptr& __r) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() _NOEXCEPT;
+
+ _LIBCPP_INLINE_VISIBILITY
+ long use_count() const _NOEXCEPT
+ {return __cntrl_ ? __cntrl_->use_count() : 0;}
+ _LIBCPP_INLINE_VISIBILITY
+ bool expired() const _NOEXCEPT
+ {return __cntrl_ == nullptr || __cntrl_->use_count() == 0;}
+ shared_ptr<_Tp> lock() const _NOEXCEPT;
+ template<class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT
+ {return __cntrl_ < __r.__cntrl_;}
+ template<class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool owner_before(const weak_ptr<_Up>& __r) const _NOEXCEPT
+ {return __cntrl_ < __r.__cntrl_;}
+
+ template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
+ template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
+};
+
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class _Tp>
+weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
+#endif
+
+template<class _Tp>
+inline
+_LIBCPP_CONSTEXPR
+weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
+ : __ptr_(nullptr),
+ __cntrl_(nullptr)
+{
+}
+
+template<class _Tp>
+inline
+weak_ptr<_Tp>::weak_ptr(weak_ptr const& __r) _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ if (__cntrl_)
+ __cntrl_->__add_weak();
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r,
+ typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
+ _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ if (__cntrl_)
+ __cntrl_->__add_weak();
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
+ typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
+ _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ if (__cntrl_)
+ __cntrl_->__add_weak();
+}
+
+template<class _Tp>
+inline
+weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ __r.__ptr_ = nullptr;
+ __r.__cntrl_ = nullptr;
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r,
+ typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
+ _NOEXCEPT
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_)
+{
+ __r.__ptr_ = nullptr;
+ __r.__cntrl_ = nullptr;
+}
+
+template<class _Tp>
+weak_ptr<_Tp>::~weak_ptr()
+{
+ if (__cntrl_)
+ __cntrl_->__release_weak();
+}
+
+template<class _Tp>
+inline
+weak_ptr<_Tp>&
+weak_ptr<_Tp>::operator=(weak_ptr const& __r) _NOEXCEPT
+{
+ weak_ptr(__r).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+typename enable_if
+<
+ is_convertible<_Yp*, _Tp*>::value,
+ weak_ptr<_Tp>&
+>::type
+weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT
+{
+ weak_ptr(__r).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+inline
+weak_ptr<_Tp>&
+weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT
+{
+ weak_ptr(_VSTD::move(__r)).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+typename enable_if
+<
+ is_convertible<_Yp*, _Tp*>::value,
+ weak_ptr<_Tp>&
+>::type
+weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
+{
+ weak_ptr(_VSTD::move(__r)).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+template<class _Yp>
+inline
+typename enable_if
+<
+ is_convertible<_Yp*, _Tp*>::value,
+ weak_ptr<_Tp>&
+>::type
+weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT
+{
+ weak_ptr(__r).swap(*this);
+ return *this;
+}
+
+template<class _Tp>
+inline
+void
+weak_ptr<_Tp>::swap(weak_ptr& __r) _NOEXCEPT
+{
+ _VSTD::swap(__ptr_, __r.__ptr_);
+ _VSTD::swap(__cntrl_, __r.__cntrl_);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+swap(weak_ptr<_Tp>& __x, weak_ptr<_Tp>& __y) _NOEXCEPT
+{
+ __x.swap(__y);
+}
+
+template<class _Tp>
+inline
+void
+weak_ptr<_Tp>::reset() _NOEXCEPT
+{
+ weak_ptr().swap(*this);
+}
+
+template<class _Tp>
+template<class _Yp>
+shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r,
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
+ : __ptr_(__r.__ptr_),
+ __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_)
+{
+ if (__cntrl_ == nullptr)
+ __throw_bad_weak_ptr();
+}
+
+template<class _Tp>
+shared_ptr<_Tp>
+weak_ptr<_Tp>::lock() const _NOEXCEPT
+{
+ shared_ptr<_Tp> __r;
+ __r.__cntrl_ = __cntrl_ ? __cntrl_->lock() : __cntrl_;
+ if (__r.__cntrl_)
+ __r.__ptr_ = __ptr_;
+ return __r;
+}
+
+#if _LIBCPP_STD_VER > 14
+template <class _Tp = void> struct owner_less;
+#else
+template <class _Tp> struct owner_less;
+#endif
+
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS owner_less<shared_ptr<_Tp> >
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> second_argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+};
+
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS owner_less<weak_ptr<_Tp> >
+#if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+ : binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool>
+#endif
+{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef weak_ptr<_Tp> first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef weak_ptr<_Tp> second_argument_type;
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+};
+
+#if _LIBCPP_STD_VER > 14
+template <>
+struct _LIBCPP_TEMPLATE_VIS owner_less<void>
+{
+ template <class _Tp, class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+ template <class _Tp, class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+ template <class _Tp, class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+ template <class _Tp, class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT
+ {return __x.owner_before(__y);}
+ typedef void is_transparent;
+};
+#endif
+
+template<class _Tp>
+class _LIBCPP_TEMPLATE_VIS enable_shared_from_this
+{
+ mutable weak_ptr<_Tp> __weak_this_;
+protected:
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ enable_shared_from_this() _NOEXCEPT {}
+ _LIBCPP_INLINE_VISIBILITY
+ enable_shared_from_this(enable_shared_from_this const&) _NOEXCEPT {}
+ _LIBCPP_INLINE_VISIBILITY
+ enable_shared_from_this& operator=(enable_shared_from_this const&) _NOEXCEPT
+ {return *this;}
+ _LIBCPP_INLINE_VISIBILITY
+ ~enable_shared_from_this() {}
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ shared_ptr<_Tp> shared_from_this()
+ {return shared_ptr<_Tp>(__weak_this_);}
+ _LIBCPP_INLINE_VISIBILITY
+ shared_ptr<_Tp const> shared_from_this() const
+ {return shared_ptr<const _Tp>(__weak_this_);}
+
+#if _LIBCPP_STD_VER > 14
+ _LIBCPP_INLINE_VISIBILITY
+ weak_ptr<_Tp> weak_from_this() _NOEXCEPT
+ { return __weak_this_; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT
+ { return __weak_this_; }
+#endif // _LIBCPP_STD_VER > 14
+
+ template <class _Up> friend class shared_ptr;
+};
+
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS hash<shared_ptr<_Tp> >
+{
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(const shared_ptr<_Tp>& __ptr) const _NOEXCEPT
+ {
+ return hash<typename shared_ptr<_Tp>::element_type*>()(__ptr.get());
+ }
+};
+
+template<class _CharT, class _Traits, class _Yp>
+inline _LIBCPP_INLINE_VISIBILITY
+basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
+
+
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
+
+class _LIBCPP_TYPE_VIS __sp_mut
+{
+ void* __lx;
+public:
+ void lock() _NOEXCEPT;
+ void unlock() _NOEXCEPT;
+
+private:
+ _LIBCPP_CONSTEXPR __sp_mut(void*) _NOEXCEPT;
+ __sp_mut(const __sp_mut&);
+ __sp_mut& operator=(const __sp_mut&);
+
+ friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
+};
+
+_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+__sp_mut& __get_sp_mut(const void*);
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+atomic_is_lock_free(const shared_ptr<_Tp>*)
+{
+ return false;
+}
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+shared_ptr<_Tp>
+atomic_load(const shared_ptr<_Tp>* __p)
+{
+ __sp_mut& __m = __get_sp_mut(__p);
+ __m.lock();
+ shared_ptr<_Tp> __q = *__p;
+ __m.unlock();
+ return __q;
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+shared_ptr<_Tp>
+atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
+{
+ return atomic_load(__p);
+}
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+void
+atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
+{
+ __sp_mut& __m = __get_sp_mut(__p);
+ __m.lock();
+ __p->swap(__r);
+ __m.unlock();
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+void
+atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
+{
+ atomic_store(__p, __r);
+}
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+shared_ptr<_Tp>
+atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
+{
+ __sp_mut& __m = __get_sp_mut(__p);
+ __m.lock();
+ __p->swap(__r);
+ __m.unlock();
+ return __r;
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+shared_ptr<_Tp>
+atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
+{
+ return atomic_exchange(__p, __r);
+}
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+bool
+atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
+{
+ shared_ptr<_Tp> __temp;
+ __sp_mut& __m = __get_sp_mut(__p);
+ __m.lock();
+ if (__p->__owner_equivalent(*__v))
+ {
+ _VSTD::swap(__temp, *__p);
+ *__p = __w;
+ __m.unlock();
+ return true;
+ }
+ _VSTD::swap(__temp, *__v);
+ *__v = *__p;
+ __m.unlock();
+ return false;
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+bool
+atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
+{
+ return atomic_compare_exchange_strong(__p, __v, __w);
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+bool
+atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
+ shared_ptr<_Tp> __w, memory_order, memory_order)
+{
+ return atomic_compare_exchange_strong(__p, __v, __w);
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+bool
+atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
+ shared_ptr<_Tp> __w, memory_order, memory_order)
+{
+ return atomic_compare_exchange_weak(__p, __v, __w);
+}
+
+#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_SHARED_PTR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_TEMPORARY_BUFFER_H
+#define _LIBCPP___MEMORY_TEMPORARY_BUFFER_H
+
+#include <__config>
+#include <cstddef>
+#include <new>
+#include <utility> // pair
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT _LIBCPP_NO_CFI
+pair<_Tp*, ptrdiff_t>
+get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT
+{
+ pair<_Tp*, ptrdiff_t> __r(0, 0);
+ const ptrdiff_t __m = (~ptrdiff_t(0) ^
+ ptrdiff_t(ptrdiff_t(1) << (sizeof(ptrdiff_t) * __CHAR_BIT__ - 1)))
+ / sizeof(_Tp);
+ if (__n > __m)
+ __n = __m;
+ while (__n > 0)
+ {
+#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
+ if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))
+ {
+ align_val_t __al =
+ align_val_t(alignment_of<_Tp>::value);
+ __r.first = static_cast<_Tp*>(::operator new(
+ __n * sizeof(_Tp), __al, nothrow));
+ } else {
+ __r.first = static_cast<_Tp*>(::operator new(
+ __n * sizeof(_Tp), nothrow));
+ }
+#else
+ if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))
+ {
+ // Since aligned operator new is unavailable, return an empty
+ // buffer rather than one with invalid alignment.
+ return __r;
+ }
+
+ __r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), nothrow));
+#endif
+
+ if (__r.first)
+ {
+ __r.second = __n;
+ break;
+ }
+ __n /= 2;
+ }
+ return __r;
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+void return_temporary_buffer(_Tp* __p) _NOEXCEPT
+{
+ _VSTD::__libcpp_deallocate_unsized((void*)__p, _LIBCPP_ALIGNOF(_Tp));
+}
+
+struct __return_temporary_buffer
+{
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_VSTD::return_temporary_buffer(__p);}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_TEMPORARY_BUFFER_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H
+#define _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H
+
+#include <__config>
+#include <__memory/addressof.h>
+#include <__memory/construct_at.h>
+#include <iterator>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _InputIterator, class _ForwardIterator>
+_ForwardIterator
+uninitialized_copy(_InputIterator __f, _InputIterator __l, _ForwardIterator __r)
+{
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ _ForwardIterator __s = __r;
+ try
+ {
+#endif
+ for (; __f != __l; ++__f, (void) ++__r)
+ ::new ((void*)_VSTD::addressof(*__r)) value_type(*__f);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ for (; __s != __r; ++__s)
+ __s->~value_type();
+ throw;
+ }
+#endif
+ return __r;
+}
+
+template <class _InputIterator, class _Size, class _ForwardIterator>
+_ForwardIterator
+uninitialized_copy_n(_InputIterator __f, _Size __n, _ForwardIterator __r)
+{
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ _ForwardIterator __s = __r;
+ try
+ {
+#endif
+ for (; __n > 0; ++__f, (void) ++__r, (void) --__n)
+ ::new ((void*)_VSTD::addressof(*__r)) value_type(*__f);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ for (; __s != __r; ++__s)
+ __s->~value_type();
+ throw;
+ }
+#endif
+ return __r;
+}
+
+template <class _ForwardIterator, class _Tp>
+void
+uninitialized_fill(_ForwardIterator __f, _ForwardIterator __l, const _Tp& __x)
+{
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ _ForwardIterator __s = __f;
+ try
+ {
+#endif
+ for (; __f != __l; ++__f)
+ ::new ((void*)_VSTD::addressof(*__f)) value_type(__x);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ for (; __s != __f; ++__s)
+ __s->~value_type();
+ throw;
+ }
+#endif
+}
+
+template <class _ForwardIterator, class _Size, class _Tp>
+_ForwardIterator
+uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
+{
+ typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ _ForwardIterator __s = __f;
+ try
+ {
+#endif
+ for (; __n > 0; ++__f, (void) --__n)
+ ::new ((void*)_VSTD::addressof(*__f)) value_type(__x);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ for (; __s != __f; ++__s)
+ __s->~value_type();
+ throw;
+ }
+#endif
+ return __f;
+}
+
+#if _LIBCPP_STD_VER > 14
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+void destroy(_ForwardIterator __first, _ForwardIterator __last) {
+ for (; __first != __last; ++__first)
+ _VSTD::destroy_at(_VSTD::addressof(*__first));
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
+ for (; __n > 0; (void)++__first, --__n)
+ _VSTD::destroy_at(_VSTD::addressof(*__first));
+ return __first;
+}
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __idx != __last; ++__idx)
+ ::new ((void*)_VSTD::addressof(*__idx)) _Vt;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; (void)++__idx, --__n)
+ ::new ((void*)_VSTD::addressof(*__idx)) _Vt;
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __idx != __last; ++__idx)
+ ::new ((void*)_VSTD::addressof(*__idx)) _Vt();
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; (void)++__idx, --__n)
+ ::new ((void*)_VSTD::addressof(*__idx)) _Vt();
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+
+template <class _InputIt, class _ForwardIt>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIt uninitialized_move(_InputIt __first, _InputIt __last, _ForwardIt __first_res) {
+ using _Vt = typename iterator_traits<_ForwardIt>::value_type;
+ auto __idx = __first_res;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __first != __last; (void)++__idx, ++__first)
+ ::new ((void*)_VSTD::addressof(*__idx)) _Vt(_VSTD::move(*__first));
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first_res, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _InputIt, class _Size, class _ForwardIt>
+inline _LIBCPP_INLINE_VISIBILITY
+pair<_InputIt, _ForwardIt>
+uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) {
+ using _Vt = typename iterator_traits<_ForwardIt>::value_type;
+ auto __idx = __first_res;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; ++__idx, (void)++__first, --__n)
+ ::new ((void*)_VSTD::addressof(*__idx)) _Vt(_VSTD::move(*__first));
+ return {__first, __idx};
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first_res, __idx);
+ throw;
+ }
+#endif
+}
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_UNIQUE_PTR_H
+#define _LIBCPP___MEMORY_UNIQUE_PTR_H
+
+#include <__config>
+#include <__functional_base>
+#include <__functional/hash.h>
+#include <__functional/operations.h>
+#include <__memory/allocator_traits.h> // __pointer
+#include <__memory/compressed_pair.h>
+#include <__utility/forward.h>
+#include <cstddef>
+#include <type_traits>
+#include <utility>
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+# include <__memory/auto_ptr.h>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS default_delete {
+ static_assert(!is_function<_Tp>::value,
+ "default_delete cannot be instantiated for function types");
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default;
+#else
+ _LIBCPP_INLINE_VISIBILITY default_delete() {}
+#endif
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ default_delete(const default_delete<_Up>&,
+ typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* =
+ 0) _NOEXCEPT {}
+
+ _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __ptr) const _NOEXCEPT {
+ static_assert(sizeof(_Tp) > 0,
+ "default_delete can not delete incomplete type");
+ static_assert(!is_void<_Tp>::value,
+ "default_delete can not delete incomplete type");
+ delete __ptr;
+ }
+};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS default_delete<_Tp[]> {
+private:
+ template <class _Up>
+ struct _EnableIfConvertible
+ : enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value> {};
+
+public:
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default;
+#else
+ _LIBCPP_INLINE_VISIBILITY default_delete() {}
+#endif
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ default_delete(const default_delete<_Up[]>&,
+ typename _EnableIfConvertible<_Up>::type* = 0) _NOEXCEPT {}
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _EnableIfConvertible<_Up>::type
+ operator()(_Up* __ptr) const _NOEXCEPT {
+ static_assert(sizeof(_Tp) > 0,
+ "default_delete can not delete incomplete type");
+ static_assert(!is_void<_Tp>::value,
+ "default_delete can not delete void type");
+ delete[] __ptr;
+ }
+};
+
+template <class _Deleter>
+struct __unique_ptr_deleter_sfinae {
+ static_assert(!is_reference<_Deleter>::value, "incorrect specialization");
+ typedef const _Deleter& __lval_ref_type;
+ typedef _Deleter&& __good_rval_ref_type;
+ typedef true_type __enable_rval_overload;
+};
+
+template <class _Deleter>
+struct __unique_ptr_deleter_sfinae<_Deleter const&> {
+ typedef const _Deleter& __lval_ref_type;
+ typedef const _Deleter&& __bad_rval_ref_type;
+ typedef false_type __enable_rval_overload;
+};
+
+template <class _Deleter>
+struct __unique_ptr_deleter_sfinae<_Deleter&> {
+ typedef _Deleter& __lval_ref_type;
+ typedef _Deleter&& __bad_rval_ref_type;
+ typedef false_type __enable_rval_overload;
+};
+
+#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)
+# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
+#else
+# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI
+#endif
+
+template <class _Tp, class _Dp = default_delete<_Tp> >
+class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
+public:
+ typedef _Tp element_type;
+ typedef _Dp deleter_type;
+ typedef _LIBCPP_NODEBUG_TYPE typename __pointer<_Tp, deleter_type>::type pointer;
+
+ static_assert(!is_rvalue_reference<deleter_type>::value,
+ "the specified deleter type cannot be an rvalue reference");
+
+private:
+ __compressed_pair<pointer, deleter_type> __ptr_;
+
+ struct __nat { int __for_bool_; };
+
+ typedef _LIBCPP_NODEBUG_TYPE __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
+
+ template <bool _Dummy>
+ using _LValRefType _LIBCPP_NODEBUG_TYPE =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
+
+ template <bool _Dummy>
+ using _GoodRValRefType _LIBCPP_NODEBUG_TYPE =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
+
+ template <bool _Dummy>
+ using _BadRValRefType _LIBCPP_NODEBUG_TYPE =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
+
+ template <bool _Dummy, class _Deleter = typename __dependent_type<
+ __identity<deleter_type>, _Dummy>::type>
+ using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG_TYPE =
+ typename enable_if<is_default_constructible<_Deleter>::value &&
+ !is_pointer<_Deleter>::value>::type;
+
+ template <class _ArgType>
+ using _EnableIfDeleterConstructible _LIBCPP_NODEBUG_TYPE =
+ typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
+
+ template <class _UPtr, class _Up>
+ using _EnableIfMoveConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
+ is_convertible<typename _UPtr::pointer, pointer>::value &&
+ !is_array<_Up>::value
+ >::type;
+
+ template <class _UDel>
+ using _EnableIfDeleterConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
+ (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
+ (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
+ >::type;
+
+ template <class _UDel>
+ using _EnableIfDeleterAssignable = typename enable_if<
+ is_assignable<_Dp&, _UDel&&>::value
+ >::type;
+
+public:
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy> >
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(pointer(), __default_init_tag()) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy> >
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(pointer(), __default_init_tag()) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy> >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit unique_ptr(pointer __p) _NOEXCEPT : __ptr_(__p, __default_init_tag()) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(pointer __p, _LValRefType<_Dummy> __d) _NOEXCEPT
+ : __ptr_(__p, __d) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
+ : __ptr_(__p, _VSTD::move(__d)) {
+ static_assert(!is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference");
+ }
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> > >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete;
+
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(unique_ptr&& __u) _NOEXCEPT
+ : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
+ }
+
+ template <class _Up, class _Ep,
+ class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
+ class = _EnableIfDeleterConvertible<_Ep>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
+ : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(auto_ptr<_Up>&& __p,
+ typename enable_if<is_convertible<_Up*, _Tp*>::value &&
+ is_same<_Dp, default_delete<_Tp> >::value,
+ __nat>::type = __nat()) _NOEXCEPT
+ : __ptr_(__p.release(), __default_init_tag()) {}
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+ return *this;
+ }
+
+ template <class _Up, class _Ep,
+ class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
+ class = _EnableIfDeleterAssignable<_Ep>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+ return *this;
+ }
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<is_convertible<_Up*, _Tp*>::value &&
+ is_same<_Dp, default_delete<_Tp> >::value,
+ unique_ptr&>::type
+ operator=(auto_ptr<_Up> __p) {
+ reset(__p.release());
+ return *this;
+ }
+#endif
+
+#ifdef _LIBCPP_CXX03_LANG
+ unique_ptr(unique_ptr const&) = delete;
+ unique_ptr& operator=(unique_ptr const&) = delete;
+#endif
+
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~unique_ptr() { reset(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(nullptr_t) _NOEXCEPT {
+ reset();
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ typename add_lvalue_reference<_Tp>::type
+ operator*() const {
+ return *__ptr_.first();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ pointer operator->() const _NOEXCEPT {
+ return __ptr_.first();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ pointer get() const _NOEXCEPT {
+ return __ptr_.first();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ deleter_type& get_deleter() _NOEXCEPT {
+ return __ptr_.second();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ const deleter_type& get_deleter() const _NOEXCEPT {
+ return __ptr_.second();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ explicit operator bool() const _NOEXCEPT {
+ return __ptr_.first() != nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ pointer release() _NOEXCEPT {
+ pointer __t = __ptr_.first();
+ __ptr_.first() = pointer();
+ return __t;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void reset(pointer __p = pointer()) _NOEXCEPT {
+ pointer __tmp = __ptr_.first();
+ __ptr_.first() = __p;
+ if (__tmp)
+ __ptr_.second()(__tmp);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(unique_ptr& __u) _NOEXCEPT {
+ __ptr_.swap(__u.__ptr_);
+ }
+};
+
+
+template <class _Tp, class _Dp>
+class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {
+public:
+ typedef _Tp element_type;
+ typedef _Dp deleter_type;
+ typedef typename __pointer<_Tp, deleter_type>::type pointer;
+
+private:
+ __compressed_pair<pointer, deleter_type> __ptr_;
+
+ template <class _From>
+ struct _CheckArrayPointerConversion : is_same<_From, pointer> {};
+
+ template <class _FromElem>
+ struct _CheckArrayPointerConversion<_FromElem*>
+ : integral_constant<bool,
+ is_same<_FromElem*, pointer>::value ||
+ (is_same<pointer, element_type*>::value &&
+ is_convertible<_FromElem(*)[], element_type(*)[]>::value)
+ >
+ {};
+
+ typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
+
+ template <bool _Dummy>
+ using _LValRefType _LIBCPP_NODEBUG_TYPE =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
+
+ template <bool _Dummy>
+ using _GoodRValRefType _LIBCPP_NODEBUG_TYPE =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
+
+ template <bool _Dummy>
+ using _BadRValRefType _LIBCPP_NODEBUG_TYPE =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
+
+ template <bool _Dummy, class _Deleter = typename __dependent_type<
+ __identity<deleter_type>, _Dummy>::type>
+ using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG_TYPE =
+ typename enable_if<is_default_constructible<_Deleter>::value &&
+ !is_pointer<_Deleter>::value>::type;
+
+ template <class _ArgType>
+ using _EnableIfDeleterConstructible _LIBCPP_NODEBUG_TYPE =
+ typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
+
+ template <class _Pp>
+ using _EnableIfPointerConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
+ _CheckArrayPointerConversion<_Pp>::value
+ >::type;
+
+ template <class _UPtr, class _Up,
+ class _ElemT = typename _UPtr::element_type>
+ using _EnableIfMoveConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
+ is_array<_Up>::value &&
+ is_same<pointer, element_type*>::value &&
+ is_same<typename _UPtr::pointer, _ElemT*>::value &&
+ is_convertible<_ElemT(*)[], element_type(*)[]>::value
+ >::type;
+
+ template <class _UDel>
+ using _EnableIfDeleterConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
+ (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
+ (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
+ >::type;
+
+ template <class _UDel>
+ using _EnableIfDeleterAssignable _LIBCPP_NODEBUG_TYPE = typename enable_if<
+ is_assignable<_Dp&, _UDel&&>::value
+ >::type;
+
+public:
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy> >
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(pointer(), __default_init_tag()) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy> >
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(pointer(), __default_init_tag()) {}
+
+ template <class _Pp, bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy>,
+ class = _EnableIfPointerConvertible<_Pp> >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit unique_ptr(_Pp __p) _NOEXCEPT
+ : __ptr_(__p, __default_init_tag()) {}
+
+ template <class _Pp, bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> >,
+ class = _EnableIfPointerConvertible<_Pp> >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) _NOEXCEPT
+ : __ptr_(__p, __d) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) _NOEXCEPT
+ : __ptr_(nullptr, __d) {}
+
+ template <class _Pp, bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> >,
+ class = _EnableIfPointerConvertible<_Pp> >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
+ : __ptr_(__p, _VSTD::move(__d)) {
+ static_assert(!is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference");
+ }
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
+ : __ptr_(nullptr, _VSTD::move(__d)) {
+ static_assert(!is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference");
+ }
+
+ template <class _Pp, bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> >,
+ class = _EnableIfPointerConvertible<_Pp> >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete;
+
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(unique_ptr&& __u) _NOEXCEPT
+ : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+ return *this;
+ }
+
+ template <class _Up, class _Ep,
+ class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
+ class = _EnableIfDeleterConvertible<_Ep>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
+ : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {
+ }
+
+ template <class _Up, class _Ep,
+ class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
+ class = _EnableIfDeleterAssignable<_Ep>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr&
+ operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+ return *this;
+ }
+
+#ifdef _LIBCPP_CXX03_LANG
+ unique_ptr(unique_ptr const&) = delete;
+ unique_ptr& operator=(unique_ptr const&) = delete;
+#endif
+
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ ~unique_ptr() { reset(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(nullptr_t) _NOEXCEPT {
+ reset();
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ typename add_lvalue_reference<_Tp>::type
+ operator[](size_t __i) const {
+ return __ptr_.first()[__i];
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ pointer get() const _NOEXCEPT {
+ return __ptr_.first();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ deleter_type& get_deleter() _NOEXCEPT {
+ return __ptr_.second();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const deleter_type& get_deleter() const _NOEXCEPT {
+ return __ptr_.second();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ explicit operator bool() const _NOEXCEPT {
+ return __ptr_.first() != nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ pointer release() _NOEXCEPT {
+ pointer __t = __ptr_.first();
+ __ptr_.first() = pointer();
+ return __t;
+ }
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<
+ _CheckArrayPointerConversion<_Pp>::value
+ >::type
+ reset(_Pp __p) _NOEXCEPT {
+ pointer __tmp = __ptr_.first();
+ __ptr_.first() = __p;
+ if (__tmp)
+ __ptr_.second()(__tmp);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void reset(nullptr_t = nullptr) _NOEXCEPT {
+ pointer __tmp = __ptr_.first();
+ __ptr_.first() = nullptr;
+ if (__tmp)
+ __ptr_.second()(__tmp);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(unique_ptr& __u) _NOEXCEPT {
+ __ptr_.swap(__u.__ptr_);
+ }
+
+};
+
+template <class _Tp, class _Dp>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if<
+ __is_swappable<_Dp>::value,
+ void
+>::type
+swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) _NOEXCEPT {__x.swap(__y);}
+
+template <class _T1, class _D1, class _T2, class _D2>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __x.get() == __y.get();}
+
+template <class _T1, class _D1, class _T2, class _D2>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x == __y);}
+
+template <class _T1, class _D1, class _T2, class _D2>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator< (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y)
+{
+ typedef typename unique_ptr<_T1, _D1>::pointer _P1;
+ typedef typename unique_ptr<_T2, _D2>::pointer _P2;
+ typedef typename common_type<_P1, _P2>::type _Vp;
+ return less<_Vp>()(__x.get(), __y.get());
+}
+
+template <class _T1, class _D1, class _T2, class _D2>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator> (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __y < __x;}
+
+template <class _T1, class _D1, class _T2, class _D2>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__y < __x);}
+
+template <class _T1, class _D1, class _T2, class _D2>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x < __y);}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
+{
+ return !__x;
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
+{
+ return !__x;
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t)
+{
+ typedef typename unique_ptr<_T1, _D1>::pointer _P1;
+ return less<_P1>()(__x.get(), nullptr);
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<(nullptr_t, const unique_ptr<_T1, _D1>& __x)
+{
+ typedef typename unique_ptr<_T1, _D1>::pointer _P1;
+ return less<_P1>()(nullptr, __x.get());
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>(const unique_ptr<_T1, _D1>& __x, nullptr_t)
+{
+ return nullptr < __x;
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>(nullptr_t, const unique_ptr<_T1, _D1>& __x)
+{
+ return __x < nullptr;
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
+{
+ return !(nullptr < __x);
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
+{
+ return !(__x < nullptr);
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
+{
+ return !(__x < nullptr);
+}
+
+template <class _T1, class _D1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
+{
+ return !(nullptr < __x);
+}
+
+#if _LIBCPP_STD_VER > 11
+
+template<class _Tp>
+struct __unique_if
+{
+ typedef unique_ptr<_Tp> __unique_single;
+};
+
+template<class _Tp>
+struct __unique_if<_Tp[]>
+{
+ typedef unique_ptr<_Tp[]> __unique_array_unknown_bound;
+};
+
+template<class _Tp, size_t _Np>
+struct __unique_if<_Tp[_Np]>
+{
+ typedef void __unique_array_known_bound;
+};
+
+template<class _Tp, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __unique_if<_Tp>::__unique_single
+make_unique(_Args&&... __args)
+{
+ return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __unique_if<_Tp>::__unique_array_unknown_bound
+make_unique(size_t __n)
+{
+ typedef typename remove_extent<_Tp>::type _Up;
+ return unique_ptr<_Tp>(new _Up[__n]());
+}
+
+template<class _Tp, class... _Args>
+ typename __unique_if<_Tp>::__unique_array_known_bound
+ make_unique(_Args&&...) = delete;
+
+#endif // _LIBCPP_STD_VER > 11
+
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
+
+template <class _Tp, class _Dp>
+#ifdef _LIBCPP_CXX03_LANG
+struct _LIBCPP_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> >
+#else
+struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper<
+ unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer> >
+#endif
+{
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef unique_ptr<_Tp, _Dp> argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(const unique_ptr<_Tp, _Dp>& __ptr) const
+ {
+ typedef typename unique_ptr<_Tp, _Dp>::pointer pointer;
+ return hash<pointer>()(__ptr.get());
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___MEMORY_UNIQUE_PTR_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_USES_ALLOCATOR_H
+#define _LIBCPP___MEMORY_USES_ALLOCATOR_H
+
+#include <__config>
+#include <cstddef>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct __has_allocator_type
+{
+private:
+ struct __two {char __lx; char __lxx;};
+ template <class _Up> static __two __test(...);
+ template <class _Up> static char __test(typename _Up::allocator_type* = 0);
+public:
+ static const bool value = sizeof(__test<_Tp>(0)) == 1;
+};
+
+template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value>
+struct __uses_allocator
+ : public integral_constant<bool,
+ is_convertible<_Alloc, typename _Tp::allocator_type>::value>
+{
+};
+
+template <class _Tp, class _Alloc>
+struct __uses_allocator<_Tp, _Alloc, false>
+ : public false_type
+{
+};
+
+template <class _Tp, class _Alloc>
+struct _LIBCPP_TEMPLATE_VIS uses_allocator
+ : public __uses_allocator<_Tp, _Alloc>
+{
+};
+
+#if _LIBCPP_STD_VER > 14
+template <class _Tp, class _Alloc>
+_LIBCPP_INLINE_VAR constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MEMORY_USES_ALLOCATOR_H
#define _LIBCPP___MUTEX_BASE
#include <__config>
+#include <__threading_support>
#include <chrono>
#include <system_error>
-#include <__threading_support>
-
#include <time.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
unique_lock& operator=(unique_lock const&); // = delete;
public:
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unique_lock(unique_lock&& __u) _NOEXCEPT
: __m_(__u.__m_), __owns_(__u.__owns_)
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
void lock();
bool try_lock();
_LIBCPP_INLINE_VISIBILITY
bool owns_lock() const _NOEXCEPT {return __owns_;}
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT
- operator bool () const _NOEXCEPT {return __owns_;}
+ explicit operator bool() const _NOEXCEPT {return __owns_;}
_LIBCPP_INLINE_VISIBILITY
mutex_type* mutex() const _NOEXCEPT {return __m_;}
};
using __ratio = ratio_divide<_Period, nano>;
using __ns_rep = nanoseconds::rep;
- __ns_rep __result_max = std::numeric_limits<__ns_rep>::max();
+ __ns_rep __result_max = numeric_limits<__ns_rep>::max();
if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) {
return nanoseconds::max();
}
- __ns_rep __result_min = std::numeric_limits<__ns_rep>::min();
+ __ns_rep __result_min = numeric_limits<__ns_rep>::min();
if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) {
return nanoseconds::min();
}
if (__t <= __now)
return cv_status::timeout;
- __clock_tp_ns __t_ns = __clock_tp_ns(__safe_nanosecond_cast(__t.time_since_epoch()));
+ __clock_tp_ns __t_ns = __clock_tp_ns(_VSTD::__safe_nanosecond_cast(__t.time_since_epoch()));
__do_timed_wait(__lk, __t_ns);
return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
using __clock_tp_ns = time_point<steady_clock, nanoseconds>;
- __ns_rep __now_count_ns = __safe_nanosecond_cast(__c_now.time_since_epoch()).count();
+ __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(__c_now.time_since_epoch()).count();
#else
using __clock_tp_ns = time_point<system_clock, nanoseconds>;
- __ns_rep __now_count_ns = __safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
+ __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
#endif
- __ns_rep __d_ns_count = __safe_nanosecond_cast(__d).count();
+ __ns_rep __d_ns_count = _VSTD::__safe_nanosecond_cast(__d).count();
if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {
__do_timed_wait(__lk, __clock_tp_ns::max());
_LIBCPP_POP_MACROS
-#endif // _LIBCPP___MUTEX_BASE
+#endif // _LIBCPP___MUTEX_BASE
#define _LIBCPP___NODE_HANDLE
#include <__config>
+#include <__debug>
#include <memory>
#include <optional>
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif
+#endif // _LIBCPP___NODE_HANDLE
typedef decltype(nullptr) nullptr_t;
}
-#endif // _LIBCPP_HAS_NO_NULLPTR
+#endif // _LIBCPP_HAS_NO_NULLPTR
-#endif // _LIBCPP_NULLPTR
+#endif // _LIBCPP_NULLPTR
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
+#define _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
+
+#include <__bits>
+#include <__config>
+#include <cstddef>
+#include <cstdint>
+#include <iosfwd>
+#include <limits>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// __independent_bits_engine
+
+template <unsigned long long _Xp, size_t _Rp>
+struct __log2_imp
+{
+ static const size_t value = _Xp & ((unsigned long long)(1) << _Rp) ? _Rp
+ : __log2_imp<_Xp, _Rp - 1>::value;
+};
+
+template <unsigned long long _Xp>
+struct __log2_imp<_Xp, 0>
+{
+ static const size_t value = 0;
+};
+
+template <size_t _Rp>
+struct __log2_imp<0, _Rp>
+{
+ static const size_t value = _Rp + 1;
+};
+
+template <class _UIntType, _UIntType _Xp>
+struct __log2
+{
+ static const size_t value = __log2_imp<_Xp,
+ sizeof(_UIntType) * __CHAR_BIT__ - 1>::value;
+};
+
+template<class _Engine, class _UIntType>
+class __independent_bits_engine
+{
+public:
+ // types
+ typedef _UIntType result_type;
+
+private:
+ typedef typename _Engine::result_type _Engine_result_type;
+ typedef typename conditional
+ <
+ sizeof(_Engine_result_type) <= sizeof(result_type),
+ result_type,
+ _Engine_result_type
+ >::type _Working_result_type;
+
+ _Engine& __e_;
+ size_t __w_;
+ size_t __w0_;
+ size_t __n_;
+ size_t __n0_;
+ _Working_result_type __y0_;
+ _Working_result_type __y1_;
+ _Engine_result_type __mask0_;
+ _Engine_result_type __mask1_;
+
+#ifdef _LIBCPP_CXX03_LANG
+ static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
+ + _Working_result_type(1);
+#else
+ static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
+ + _Working_result_type(1);
+#endif
+ static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
+ static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
+ static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
+
+public:
+ // constructors and seeding functions
+ __independent_bits_engine(_Engine& __e, size_t __w);
+
+ // generating functions
+ result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());}
+
+private:
+ result_type __eval(false_type);
+ result_type __eval(true_type);
+};
+
+template<class _Engine, class _UIntType>
+__independent_bits_engine<_Engine, _UIntType>
+ ::__independent_bits_engine(_Engine& __e, size_t __w)
+ : __e_(__e),
+ __w_(__w)
+{
+ __n_ = __w_ / __m + (__w_ % __m != 0);
+ __w0_ = __w_ / __n_;
+ if (_Rp == 0)
+ __y0_ = _Rp;
+ else if (__w0_ < _WDt)
+ __y0_ = (_Rp >> __w0_) << __w0_;
+ else
+ __y0_ = 0;
+ if (_Rp - __y0_ > __y0_ / __n_)
+ {
+ ++__n_;
+ __w0_ = __w_ / __n_;
+ if (__w0_ < _WDt)
+ __y0_ = (_Rp >> __w0_) << __w0_;
+ else
+ __y0_ = 0;
+ }
+ __n0_ = __n_ - __w_ % __n_;
+ if (__w0_ < _WDt - 1)
+ __y1_ = (_Rp >> (__w0_ + 1)) << (__w0_ + 1);
+ else
+ __y1_ = 0;
+ __mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) :
+ _Engine_result_type(0);
+ __mask1_ = __w0_ < _EDt - 1 ?
+ _Engine_result_type(~0) >> (_EDt - (__w0_ + 1)) :
+ _Engine_result_type(~0);
+}
+
+template<class _Engine, class _UIntType>
+inline
+_UIntType
+__independent_bits_engine<_Engine, _UIntType>::__eval(false_type)
+{
+ return static_cast<result_type>(__e_() & __mask0_);
+}
+
+template<class _Engine, class _UIntType>
+_UIntType
+__independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
+{
+ const size_t _WRt = numeric_limits<result_type>::digits;
+ result_type _Sp = 0;
+ for (size_t __k = 0; __k < __n0_; ++__k)
+ {
+ _Engine_result_type __u;
+ do
+ {
+ __u = __e_() - _Engine::min();
+ } while (__u >= __y0_);
+ if (__w0_ < _WRt)
+ _Sp <<= __w0_;
+ else
+ _Sp = 0;
+ _Sp += __u & __mask0_;
+ }
+ for (size_t __k = __n0_; __k < __n_; ++__k)
+ {
+ _Engine_result_type __u;
+ do
+ {
+ __u = __e_() - _Engine::min();
+ } while (__u >= __y1_);
+ if (__w0_ < _WRt - 1)
+ _Sp <<= __w0_ + 1;
+ else
+ _Sp = 0;
+ _Sp += __u & __mask1_;
+ }
+ return _Sp;
+}
+
+template<class _IntType = int>
+class uniform_int_distribution
+{
+public:
+ // types
+ typedef _IntType result_type;
+
+ class param_type
+ {
+ result_type __a_;
+ result_type __b_;
+ public:
+ typedef uniform_int_distribution distribution_type;
+
+ explicit param_type(result_type __a = 0,
+ result_type __b = numeric_limits<result_type>::max())
+ : __a_(__a), __b_(__b) {}
+
+ result_type a() const {return __a_;}
+ result_type b() const {return __b_;}
+
+ friend bool operator==(const param_type& __x, const param_type& __y)
+ {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;}
+ friend bool operator!=(const param_type& __x, const param_type& __y)
+ {return !(__x == __y);}
+ };
+
+private:
+ param_type __p_;
+
+public:
+ // constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ uniform_int_distribution() : uniform_int_distribution(0) {}
+ explicit uniform_int_distribution(
+ result_type __a, result_type __b = numeric_limits<result_type>::max())
+ : __p_(param_type(__a, __b)) {}
+#else
+ explicit uniform_int_distribution(
+ result_type __a = 0,
+ result_type __b = numeric_limits<result_type>::max())
+ : __p_(param_type(__a, __b)) {}
+#endif
+ explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}
+ void reset() {}
+
+ // generating functions
+ template<class _URNG> result_type operator()(_URNG& __g)
+ {return (*this)(__g, __p_);}
+ template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+
+ // property functions
+ result_type a() const {return __p_.a();}
+ result_type b() const {return __p_.b();}
+
+ param_type param() const {return __p_;}
+ void param(const param_type& __p) {__p_ = __p;}
+
+ result_type min() const {return a();}
+ result_type max() const {return b();}
+
+ friend bool operator==(const uniform_int_distribution& __x,
+ const uniform_int_distribution& __y)
+ {return __x.__p_ == __y.__p_;}
+ friend bool operator!=(const uniform_int_distribution& __x,
+ const uniform_int_distribution& __y)
+ {return !(__x == __y);}
+};
+
+template<class _IntType>
+template<class _URNG>
+typename uniform_int_distribution<_IntType>::result_type
+uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p)
+_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+{
+ typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t),
+ uint32_t, uint64_t>::type _UIntType;
+ const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
+ if (_Rp == 1)
+ return __p.a();
+ const size_t _Dt = numeric_limits<_UIntType>::digits;
+ typedef __independent_bits_engine<_URNG, _UIntType> _Eng;
+ if (_Rp == 0)
+ return static_cast<result_type>(_Eng(__g, _Dt)());
+ size_t __w = _Dt - __libcpp_clz(_Rp) - 1;
+ if ((_Rp & (numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)
+ ++__w;
+ _Eng __e(__g, __w);
+ _UIntType __u;
+ do
+ {
+ __u = __e();
+ } while (__u >= _Rp);
+ return static_cast<result_type>(__u + __p.a());
+}
+
+template <class _CharT, class _Traits, class _IT>
+basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os,
+ const uniform_int_distribution<_IT>& __x)
+{
+ __save_flags<_CharT, _Traits> __lx(__os);
+ typedef basic_ostream<_CharT, _Traits> _Ostream;
+ __os.flags(_Ostream::dec | _Ostream::left);
+ _CharT __sp = __os.widen(' ');
+ __os.fill(__sp);
+ return __os << __x.a() << __sp << __x.b();
+}
+
+template <class _CharT, class _Traits, class _IT>
+basic_istream<_CharT, _Traits>&
+operator>>(basic_istream<_CharT, _Traits>& __is,
+ uniform_int_distribution<_IT>& __x)
+{
+ typedef uniform_int_distribution<_IT> _Eng;
+ typedef typename _Eng::result_type result_type;
+ typedef typename _Eng::param_type param_type;
+ __save_flags<_CharT, _Traits> __lx(__is);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
+ result_type __a;
+ result_type __b;
+ __is >> __a >> __b;
+ if (!__is.fail())
+ __x.param(param_type(__a, __b));
+ return __is;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
--- /dev/null
+// -*- C++ -*-
+//===------------------------ __ranges/access.h ---------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_ACCESS_H
+#define _LIBCPP___RANGES_ACCESS_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/readable_traits.h>
+#include <__ranges/enable_borrowed_range.h>
+#include <__utility/__decay_copy.h>
+#include <__utility/forward.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// clang-format off
+
+namespace ranges {
+ template <class _Tp>
+ concept __can_borrow =
+ is_lvalue_reference_v<_Tp> || enable_borrowed_range<remove_cvref_t<_Tp> >;
+
+ template<class _Tp>
+ concept __is_complete = requires { sizeof(_Tp); };
+} // namespace ranges
+
+// [range.access.begin]
+namespace ranges::__begin {
+ template <class _Tp>
+ concept __member_begin =
+ __can_borrow<_Tp> &&
+ requires(_Tp&& __t) {
+ { _VSTD::__decay_copy(__t.begin()) } -> input_or_output_iterator;
+ };
+
+ void begin(auto&) = delete;
+ void begin(const auto&) = delete;
+
+ template <class _Tp>
+ concept __unqualified_begin =
+ !__member_begin<_Tp> &&
+ __can_borrow<_Tp> &&
+ __class_or_enum<remove_cvref_t<_Tp> > &&
+ requires(_Tp && __t) {
+ { _VSTD::__decay_copy(begin(__t)) } -> input_or_output_iterator;
+ };
+
+ struct __fn {
+ template <class _Tp>
+ requires is_array_v<remove_cv_t<_Tp>>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __t) const noexcept {
+ constexpr bool __complete = __is_complete<iter_value_t<_Tp> >;
+ if constexpr (__complete) { // used to disable cryptic diagnostic
+ return __t + 0;
+ }
+ else {
+ static_assert(__complete, "`std::ranges::begin` is SFINAE-unfriendly on arrays of an incomplete type.");
+ }
+ }
+
+ template <class _Tp>
+ requires __member_begin<_Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(_VSTD::__decay_copy(__t.begin())))
+ {
+ return __t.begin();
+ }
+
+ template <class _Tp>
+ requires __unqualified_begin<_Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(_VSTD::__decay_copy(begin(__t))))
+ {
+ return begin(__t);
+ }
+
+ void operator()(auto&&) const = delete;
+ };
+} // namespace ranges::__begin
+
+namespace ranges {
+ inline namespace __cpo {
+ inline constexpr auto begin = __begin::__fn{};
+ } // namespace __cpo
+
+ template <class _Tp>
+ using iterator_t = decltype(ranges::begin(declval<_Tp&>()));
+} // namespace ranges
+
+// [range.access.end]
+namespace ranges::__end {
+ template <class _Tp>
+ concept __member_end =
+ __can_borrow<_Tp> &&
+ requires(_Tp&& __t) {
+ typename iterator_t<_Tp>;
+ { _VSTD::__decay_copy(_VSTD::forward<_Tp>(__t).end()) } -> sentinel_for<iterator_t<_Tp> >;
+ };
+
+ void end(auto&) = delete;
+ void end(const auto&) = delete;
+
+ template <class _Tp>
+ concept __unqualified_end =
+ !__member_end<_Tp> &&
+ __can_borrow<_Tp> &&
+ __class_or_enum<remove_cvref_t<_Tp> > &&
+ requires(_Tp && __t) {
+ typename iterator_t<_Tp>;
+ { _VSTD::__decay_copy(end(_VSTD::forward<_Tp>(__t))) } -> sentinel_for<iterator_t<_Tp> >;
+ };
+
+ class __fn {
+ public:
+ template <class _Tp, size_t _Np>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept {
+ constexpr bool __complete = __is_complete<remove_cv_t<_Tp> >;
+ if constexpr (__complete) { // used to disable cryptic diagnostic
+ return __t + _Np;
+ }
+ else {
+ static_assert(__complete, "`std::ranges::end` is SFINAE-unfriendly on arrays of an incomplete type.");
+ }
+ }
+
+ template <class _Tp>
+ requires __member_end<_Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(_VSTD::__decay_copy(__t.end())))
+ {
+ return _VSTD::forward<_Tp>(__t).end();
+ }
+
+ template <class _Tp>
+ requires __unqualified_end<_Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(_VSTD::__decay_copy(end(__t))))
+ {
+ return end(__t);
+ }
+
+ void operator()(auto&&) const = delete;
+ };
+} // namespace ranges::__end
+
+namespace ranges::inline __cpo {
+ inline constexpr auto end = __end::__fn{};
+} // namespace ranges::__cpo
+
+namespace ranges::__cbegin {
+ struct __fn {
+ template <class _Tp>
+ requires invocable<decltype(ranges::begin), _Tp const&>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __t) const
+ noexcept(noexcept(ranges::begin(_VSTD::as_const(__t))))
+ {
+ return ranges::begin(_VSTD::as_const(__t));
+ }
+
+ template <class _Tp>
+ requires is_rvalue_reference_v<_Tp> && invocable<decltype(ranges::begin), _Tp const&&>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(ranges::begin(static_cast<_Tp const&&>(__t))))
+ {
+ return ranges::begin(static_cast<_Tp const&&>(__t));
+ }
+ };
+} // namespace ranges::__cbegin
+
+namespace ranges::inline __cpo {
+ inline constexpr auto cbegin = __cbegin::__fn{};
+} // namespace ranges::__cpo
+
+namespace ranges::__cend {
+ struct __fn {
+ template <class _Tp>
+ requires invocable<decltype(ranges::end), _Tp const&>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __t) const
+ noexcept(noexcept(ranges::end(_VSTD::as_const(__t))))
+ {
+ return ranges::end(_VSTD::as_const(__t));
+ }
+
+ template <class _Tp>
+ requires is_rvalue_reference_v<_Tp> && invocable<decltype(ranges::end), _Tp const&&>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(ranges::end(static_cast<_Tp const&&>(__t))))
+ {
+ return ranges::end(static_cast<_Tp const&&>(__t));
+ }
+ };
+} // namespace ranges::__cend
+
+namespace ranges::inline __cpo {
+ inline constexpr auto cend = __cend::__fn{};
+} // namespace ranges::__cpo
+
+// clang-format off
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_ACCESS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_ALL_H
+#define _LIBCPP___RANGES_ALL_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/ref_view.h>
+#include <__ranges/subrange.h>
+#include <__utility/__decay_copy.h>
+#include <__utility/declval.h>
+#include <__utility/forward.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace views {
+
+namespace __all {
+ struct __fn {
+ template<class _Tp>
+ requires ranges::view<decay_t<_Tp>>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(_VSTD::__decay_copy(_VSTD::forward<_Tp>(__t))))
+ {
+ return _VSTD::forward<_Tp>(__t);
+ }
+
+ template<class _Tp>
+ requires (!ranges::view<decay_t<_Tp>>) &&
+ requires (_Tp&& __t) { ranges::ref_view{_VSTD::forward<_Tp>(__t)}; }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(ranges::ref_view{_VSTD::forward<_Tp>(__t)}))
+ {
+ return ranges::ref_view{_VSTD::forward<_Tp>(__t)};
+ }
+
+ template<class _Tp>
+ requires (!ranges::view<decay_t<_Tp>> &&
+ !requires (_Tp&& __t) { ranges::ref_view{_VSTD::forward<_Tp>(__t)}; } &&
+ requires (_Tp&& __t) { ranges::subrange{_VSTD::forward<_Tp>(__t)}; })
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto operator()(_Tp&& __t) const
+ noexcept(noexcept(ranges::subrange{_VSTD::forward<_Tp>(__t)}))
+ {
+ return ranges::subrange{_VSTD::forward<_Tp>(__t)};
+ }
+ };
+}
+
+inline namespace __cpo {
+ inline constexpr auto all = __all::__fn{};
+} // namespace __cpo
+
+template<ranges::viewable_range _Range>
+using all_t = decltype(views::all(declval<_Range>()));
+
+} // namespace views
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_ALL_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_COMMON_VIEW_H
+#define _LIBCPP___RANGES_COMMON_VIEW_H
+
+#include <__config>
+#include <__iterator/common_iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+
+template<view _View>
+ requires (!common_range<_View> && copyable<iterator_t<_View>>)
+class common_view : public view_interface<common_view<_View>> {
+ _View __base_ = _View();
+
+public:
+ _LIBCPP_HIDE_FROM_ABI
+ common_view() requires default_initializable<_View> = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit common_view(_View __v) : __base_(_VSTD::move(__v)) { }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _View base() && { return _VSTD::move(__base_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto begin() {
+ if constexpr (random_access_range<_View> && sized_range<_View>)
+ return ranges::begin(__base_);
+ else
+ return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::begin(__base_));
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto begin() const requires range<const _View> {
+ if constexpr (random_access_range<const _View> && sized_range<const _View>)
+ return ranges::begin(__base_);
+ else
+ return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::begin(__base_));
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto end() {
+ if constexpr (random_access_range<_View> && sized_range<_View>)
+ return ranges::begin(__base_) + ranges::size(__base_);
+ else
+ return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::end(__base_));
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto end() const requires range<const _View> {
+ if constexpr (random_access_range<const _View> && sized_range<const _View>)
+ return ranges::begin(__base_) + ranges::size(__base_);
+ else
+ return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::end(__base_));
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size() requires sized_range<_View> {
+ return ranges::size(__base_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size() const requires sized_range<const _View> {
+ return ranges::size(__base_);
+ }
+};
+
+template<class _Range>
+common_view(_Range&&)
+ -> common_view<views::all_t<_Range>>;
+
+template<class _View>
+inline constexpr bool enable_borrowed_range<common_view<_View>> = enable_borrowed_range<_View>;
+
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_COMMON_VIEW_H
--- /dev/null
+// -*- C++ -*-
+//===--------------------- __ranges/concepts.h ----------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_CONCEPTS_H
+#define _LIBCPP___RANGES_CONCEPTS_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/readable_traits.h>
+#include <__ranges/access.h>
+#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/data.h>
+#include <__ranges/enable_view.h>
+#include <__ranges/size.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// clang-format off
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+ // [range.range]
+ template <class _Tp>
+ concept range = requires(_Tp& __t) {
+ ranges::begin(__t); // sometimes equality-preserving
+ ranges::end(__t);
+ };
+
+ template<class _Range>
+ concept borrowed_range = range<_Range> &&
+ (is_lvalue_reference_v<_Range> || enable_borrowed_range<remove_cvref_t<_Range>>);
+
+ // `iterator_t` defined in <__ranges/access.h>
+
+ template <range _Rp>
+ using sentinel_t = decltype(ranges::end(declval<_Rp&>()));
+
+ template <range _Rp>
+ using range_difference_t = iter_difference_t<iterator_t<_Rp>>;
+
+ template <range _Rp>
+ using range_value_t = iter_value_t<iterator_t<_Rp>>;
+
+ template <range _Rp>
+ using range_reference_t = iter_reference_t<iterator_t<_Rp>>;
+
+ template <range _Rp>
+ using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<_Rp>>;
+
+ // [range.sized]
+ template <class _Tp>
+ concept sized_range = range<_Tp> && requires(_Tp& __t) { ranges::size(__t); };
+
+ template<sized_range _Rp>
+ using range_size_t = decltype(ranges::size(declval<_Rp&>()));
+
+ // `disable_sized_range` defined in `<__ranges/size.h>`
+
+ // [range.view], views
+
+ // `enable_view` defined in <__ranges/enable_view.h>
+ // `view_base` defined in <__ranges/enable_view.h>
+
+ template <class _Tp>
+ concept view =
+ range<_Tp> &&
+ movable<_Tp> &&
+ enable_view<_Tp>;
+
+ template<class _Range>
+ concept __simple_view =
+ view<_Range> && range<const _Range> &&
+ same_as<iterator_t<_Range>, iterator_t<const _Range>> &&
+ same_as<sentinel_t<_Range>, iterator_t<const _Range>>;
+
+ // [range.refinements], other range refinements
+ template <class _Rp, class _Tp>
+ concept output_range = range<_Rp> && output_iterator<iterator_t<_Rp>, _Tp>;
+
+ template <class _Tp>
+ concept input_range = range<_Tp> && input_iterator<iterator_t<_Tp>>;
+
+ template <class _Tp>
+ concept forward_range = input_range<_Tp> && forward_iterator<iterator_t<_Tp>>;
+
+ template <class _Tp>
+ concept bidirectional_range = forward_range<_Tp> && bidirectional_iterator<iterator_t<_Tp>>;
+
+ template <class _Tp>
+ concept random_access_range =
+ bidirectional_range<_Tp> && random_access_iterator<iterator_t<_Tp>>;
+
+ template<class _Tp>
+ concept contiguous_range =
+ random_access_range<_Tp> &&
+ contiguous_iterator<iterator_t<_Tp>> &&
+ requires(_Tp& __t) {
+ { ranges::data(__t) } -> same_as<add_pointer_t<range_reference_t<_Tp>>>;
+ };
+
+ template <class _Tp>
+ concept common_range = range<_Tp> && same_as<iterator_t<_Tp>, sentinel_t<_Tp>>;
+
+ template<class _Tp>
+ concept viewable_range =
+ range<_Tp> && (
+ (view<remove_cvref_t<_Tp>> && constructible_from<remove_cvref_t<_Tp>, _Tp>) ||
+ (!view<remove_cvref_t<_Tp>> && borrowed_range<_Tp>)
+ );
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+// clang-format on
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_CONCEPTS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___RANGES_COPYABLE_BOX_H
+#define _LIBCPP___RANGES_COPYABLE_BOX_H
+
+#include <__config>
+#include <__memory/addressof.h>
+#include <__memory/construct_at.h>
+#include <__utility/move.h>
+#include <concepts>
+#include <optional>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// __copyable_box allows turning a type that is copy-constructible (but maybe not copy-assignable) into
+// a type that is both copy-constructible and copy-assignable. It does that by introducing an empty state
+// and basically doing destroy-then-copy-construct in the assignment operator. The empty state is necessary
+// to handle the case where the copy construction fails after destroying the object.
+//
+// In some cases, we can completely avoid the use of an empty state; we provide a specialization of
+// __copyable_box that does this, see below for the details.
+
+template<class _Tp>
+concept __copy_constructible_object = copy_constructible<_Tp> && is_object_v<_Tp>;
+
+namespace ranges {
+ // Primary template - uses std::optional and introduces an empty state in case assignment fails.
+ template<__copy_constructible_object _Tp>
+ class __copyable_box {
+ [[no_unique_address]] optional<_Tp> __val_;
+
+ public:
+ template<class ..._Args>
+ requires is_constructible_v<_Tp, _Args...>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit __copyable_box(in_place_t, _Args&& ...__args)
+ noexcept(is_nothrow_constructible_v<_Tp, _Args...>)
+ : __val_(in_place, _VSTD::forward<_Args>(__args)...)
+ { }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>)
+ requires default_initializable<_Tp>
+ : __val_(in_place)
+ { }
+
+ _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __copyable_box& operator=(__copyable_box const& __other)
+ noexcept(is_nothrow_copy_constructible_v<_Tp>)
+ {
+ if (this != _VSTD::addressof(__other)) {
+ if (__other.__has_value()) __val_.emplace(*__other);
+ else __val_.reset();
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __copyable_box& operator=(__copyable_box&& __other)
+ noexcept(is_nothrow_move_constructible_v<_Tp>)
+ {
+ if (this != _VSTD::addressof(__other)) {
+ if (__other.__has_value()) __val_.emplace(_VSTD::move(*__other));
+ else __val_.reset();
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return *__val_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return *__val_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return __val_.has_value(); }
+ };
+
+ // This partial specialization implements an optimization for when we know we don't need to store
+ // an empty state to represent failure to perform an assignment. For copy-assignment, this happens:
+ //
+ // 1. If the type is copyable (which includes copy-assignment), we can use the type's own assignment operator
+ // directly and avoid using std::optional.
+ // 2. If the type is not copyable, but it is nothrow-copy-constructible, then we can implement assignment as
+ // destroy-and-then-construct and we know it will never fail, so we don't need an empty state.
+ //
+ // The exact same reasoning can be applied for move-assignment, with copyable replaced by movable and
+ // nothrow-copy-constructible replaced by nothrow-move-constructible. This specialization is enabled
+ // whenever we can apply any of these optimizations for both the copy assignment and the move assignment
+ // operator.
+ template<class _Tp>
+ concept __doesnt_need_empty_state_for_copy = copyable<_Tp> || is_nothrow_copy_constructible_v<_Tp>;
+
+ template<class _Tp>
+ concept __doesnt_need_empty_state_for_move = movable<_Tp> || is_nothrow_move_constructible_v<_Tp>;
+
+ template<__copy_constructible_object _Tp>
+ requires __doesnt_need_empty_state_for_copy<_Tp> && __doesnt_need_empty_state_for_move<_Tp>
+ class __copyable_box<_Tp> {
+ [[no_unique_address]] _Tp __val_;
+
+ public:
+ template<class ..._Args>
+ requires is_constructible_v<_Tp, _Args...>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit __copyable_box(in_place_t, _Args&& ...__args)
+ noexcept(is_nothrow_constructible_v<_Tp, _Args...>)
+ : __val_(_VSTD::forward<_Args>(__args)...)
+ { }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>)
+ requires default_initializable<_Tp>
+ : __val_()
+ { }
+
+ _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default;
+ _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default;
+
+ // Implementation of assignment operators in case we perform optimization (1)
+ _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box const&) requires copyable<_Tp> = default;
+ _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default;
+
+ // Implementation of assignment operators in case we perform optimization (2)
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __copyable_box& operator=(__copyable_box const& __other) noexcept {
+ static_assert(is_nothrow_copy_constructible_v<_Tp>);
+ if (this != _VSTD::addressof(__other)) {
+ _VSTD::destroy_at(_VSTD::addressof(__val_));
+ _VSTD::construct_at(_VSTD::addressof(__val_), __other.__val_);
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __copyable_box& operator=(__copyable_box&& __other) noexcept {
+ static_assert(is_nothrow_move_constructible_v<_Tp>);
+ if (this != _VSTD::addressof(__other)) {
+ _VSTD::destroy_at(_VSTD::addressof(__val_));
+ _VSTD::construct_at(_VSTD::addressof(__val_), _VSTD::move(__other.__val_));
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return __val_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return __val_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return true; }
+ };
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_COPYABLE_BOX_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___RANGES_DANGLING_H
+#define _LIBCPP___RANGES_DANGLING_H
+
+#include <__config>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+struct dangling {
+ dangling() = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr dangling(auto&&...) noexcept {}
+};
+
+template <range _Rp>
+using borrowed_iterator_t = _If<borrowed_range<_Rp>, iterator_t<_Rp>, dangling>;
+
+// borrowed_subrange_t defined in <__ranges/subrange.h>
+} // namespace ranges
+
+#endif // !_LIBCPP_HAS_NO_RANGES
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_DANGLING_H
--- /dev/null
+// -*- C++ -*-
+//===------------------------ __ranges/data.h ------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_DATA_H
+#define _LIBCPP___RANGES_DATA_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/pointer_traits.h>
+#include <__ranges/access.h>
+#include <__utility/forward.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// clang-format off
+namespace ranges {
+// [range.prim.data]
+namespace __data {
+ template <class _Tp>
+ concept __ptr_to_object = is_pointer_v<_Tp> && is_object_v<remove_pointer_t<_Tp>>;
+
+ template <class _Tp>
+ concept __member_data =
+ requires(_Tp&& __t) {
+ { _VSTD::forward<_Tp>(__t) } -> __can_borrow;
+ { __t.data() } -> __ptr_to_object;
+ };
+
+ template <class _Tp>
+ concept __ranges_begin_invocable =
+ !__member_data<_Tp> &&
+ requires(_Tp&& __t) {
+ { _VSTD::forward<_Tp>(__t) } -> __can_borrow;
+ { ranges::begin(_VSTD::forward<_Tp>(__t)) } -> contiguous_iterator;
+ };
+
+ struct __fn {
+ template <__member_data _Tp>
+ requires __can_borrow<_Tp>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __ptr_to_object auto operator()(_Tp&& __t) const
+ noexcept(noexcept(__t.data())) {
+ return __t.data();
+ }
+
+ template<__ranges_begin_invocable _Tp>
+ requires __can_borrow<_Tp>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __ptr_to_object auto operator()(_Tp&& __t) const
+ noexcept(noexcept(_VSTD::to_address(ranges::begin(_VSTD::forward<_Tp>(__t))))) {
+ return _VSTD::to_address(ranges::begin(_VSTD::forward<_Tp>(__t)));
+ }
+ };
+} // end namespace __data
+
+inline namespace __cpo {
+ inline constexpr const auto data = __data::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+// clang-format off
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_DATA_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_DROP_VIEW_H
+#define _LIBCPP___RANGES_DROP_VIEW_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/non_propagating_cache.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <__utility/move.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+ template<view _View>
+ class drop_view
+ : public view_interface<drop_view<_View>>
+ {
+ // We cache begin() whenever ranges::next is not guaranteed O(1) to provide an
+ // amortized O(1) begin() method. If this is an input_range, then we cannot cache
+ // begin because begin is not equality preserving.
+ // Note: drop_view<input-range>::begin() is still trivially amortized O(1) because
+ // one can't call begin() on it more than once.
+ static constexpr bool _UseCache = forward_range<_View> && !(random_access_range<_View> && sized_range<_View>);
+ using _Cache = _If<_UseCache, __non_propagating_cache<iterator_t<_View>>, __empty_cache>;
+ [[no_unique_address]] _Cache __cached_begin_ = _Cache();
+ range_difference_t<_View> __count_ = 0;
+ _View __base_ = _View();
+
+public:
+ drop_view() requires default_initializable<_View> = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr drop_view(_View __base, range_difference_t<_View> __count)
+ : __count_(__count)
+ , __base_(_VSTD::move(__base))
+ {
+ _LIBCPP_ASSERT(__count_ >= 0, "count must be greater than or equal to zero.");
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return _VSTD::move(__base_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto begin()
+ requires (!(__simple_view<_View> &&
+ random_access_range<const _View> && sized_range<const _View>))
+ {
+ if constexpr (_UseCache)
+ if (__cached_begin_.__has_value())
+ return *__cached_begin_;
+
+ auto __tmp = ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_));
+ if constexpr (_UseCache)
+ __cached_begin_.__set(__tmp);
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto begin() const
+ requires random_access_range<const _View> && sized_range<const _View>
+ {
+ return ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_));
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto end()
+ requires (!__simple_view<_View>)
+ { return ranges::end(__base_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto end() const
+ requires range<const _View>
+ { return ranges::end(__base_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ static constexpr auto __size(auto& __self) {
+ const auto __s = ranges::size(__self.__base_);
+ const auto __c = static_cast<decltype(__s)>(__self.__count_);
+ return __s < __c ? 0 : __s - __c;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size()
+ requires sized_range<_View>
+ { return __size(*this); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size() const
+ requires sized_range<const _View>
+ { return __size(*this); }
+ };
+
+ template<class _Range>
+ drop_view(_Range&&, range_difference_t<_Range>) -> drop_view<views::all_t<_Range>>;
+
+ template<class _Tp>
+ inline constexpr bool enable_borrowed_range<drop_view<_Tp>> = enable_borrowed_range<_Tp>;
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_DROP_VIEW_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_EMPTY_H
+#define _LIBCPP___RANGES_EMPTY_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__ranges/access.h>
+#include <__ranges/size.h>
+#include <__utility/forward.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// clang-format off
+namespace ranges {
+// [range.prim.empty]
+namespace __empty {
+ template <class _Tp>
+ concept __member_empty = requires(_Tp&& __t) {
+ bool(_VSTD::forward<_Tp>(__t).empty());
+ };
+
+ template<class _Tp>
+ concept __can_invoke_size =
+ !__member_empty<_Tp> &&
+ requires(_Tp&& __t) { ranges::size(_VSTD::forward<_Tp>(__t)); };
+
+ template <class _Tp>
+ concept __can_compare_begin_end =
+ !__member_empty<_Tp> &&
+ !__can_invoke_size<_Tp> &&
+ requires(_Tp&& __t) {
+ bool(ranges::begin(__t) == ranges::end(__t));
+ { ranges::begin(__t) } -> forward_iterator;
+ };
+
+ struct __fn {
+ template <__member_empty _Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
+ noexcept(noexcept(bool(__t.empty()))) {
+ return __t.empty();
+ }
+
+ template <__can_invoke_size _Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
+ noexcept(noexcept(ranges::size(_VSTD::forward<_Tp>(__t)))) {
+ return ranges::size(_VSTD::forward<_Tp>(__t)) == 0;
+ }
+
+ template<__can_compare_begin_end _Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
+ noexcept(noexcept(bool(ranges::begin(__t) == ranges::end(__t)))) {
+ return ranges::begin(__t) == ranges::end(__t);
+ }
+ };
+}
+
+inline namespace __cpo {
+ inline constexpr auto empty = __empty::__fn{};
+} // namespace __cpo
+} // namespace ranges
+// clang-format off
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_EMPTY_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_EMPTY_VIEW_H
+#define _LIBCPP___RANGES_EMPTY_VIEW_H
+
+#include <__config>
+#include <__ranges/view_interface.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+ template<class _Tp>
+ requires is_object_v<_Tp>
+ class empty_view : public view_interface<empty_view<_Tp>> {
+ public:
+ _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; }
+ _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; }
+ _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; }
+ _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; }
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; }
+ };
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_EMPTY_VIEW_H
--- /dev/null
+// -*- C++ -*-
+//===------------------ __ranges/enable_borrowed_range.h ------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H
+#define _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H
+
+// These customization variables are used in <span> and <string_view>. The
+// separate header is used to avoid including the entire <ranges> header in
+// <span> and <string_view>.
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges
+{
+
+// [range.range], ranges
+
+template <class>
+inline constexpr bool enable_borrowed_range = false;
+
+} // namespace ranges
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___RANGES_ENABLE_VIEW_H
+#define _LIBCPP___RANGES_ENABLE_VIEW_H
+
+#include <__config>
+#include <concepts>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+
+struct view_base { };
+
+template <class _Tp>
+inline constexpr bool enable_view = derived_from<_Tp, view_base>;
+
+} // end namespace ranges
+
+#endif // !_LIBCPP_HAS_NO_RANGES
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_ENABLE_VIEW_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H
+#define _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H
+
+#include <__config>
+#include <__iterator/concepts.h> // indirectly_readable
+#include <__iterator/iterator_traits.h> // iter_reference_t
+#include <__memory/addressof.h>
+#include <concepts> // constructible_from
+#include <optional>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// clang-format off
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+ // __non_propagating_cache is a helper type that allows storing an optional value in it,
+ // but which does not copy the source's value when it is copy constructed/assigned to,
+ // and which resets the source's value when it is moved-from.
+ //
+ // This type is used as an implementation detail of some views that need to cache the
+ // result of `begin()` in order to provide an amortized O(1) begin() method. Typically,
+ // we don't want to propagate the value of the cache upon copy because the cached iterator
+ // may refer to internal details of the source view.
+ template<class _Tp>
+ requires is_object_v<_Tp>
+ class _LIBCPP_TEMPLATE_VIS __non_propagating_cache {
+ optional<_Tp> __value_ = nullopt;
+
+ public:
+ _LIBCPP_HIDE_FROM_ABI __non_propagating_cache() = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __non_propagating_cache(__non_propagating_cache const&) noexcept
+ : __value_(nullopt)
+ { }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __non_propagating_cache(__non_propagating_cache&& __other) noexcept
+ : __value_(nullopt)
+ {
+ __other.__value_.reset();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __non_propagating_cache& operator=(__non_propagating_cache const& __other) noexcept {
+ if (this != _VSTD::addressof(__other)) {
+ __value_.reset();
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __non_propagating_cache& operator=(__non_propagating_cache&& __other) noexcept {
+ __value_.reset();
+ __other.__value_.reset();
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Tp& operator*() { return *__value_; }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Tp const& operator*() const { return *__value_; }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr bool __has_value() const { return __value_.has_value(); }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void __set(_Tp const& __value) { __value_.emplace(__value); }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void __set(_Tp&& __value) { __value_.emplace(_VSTD::move(__value)); }
+ };
+
+ struct __empty_cache { };
+} // namespace ranges
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_REF_VIEW_H
+#define _LIBCPP___RANGES_REF_VIEW_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
+#include <__memory/addressof.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/data.h>
+#include <__ranges/empty.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+ template<range _Range>
+ requires is_object_v<_Range>
+ class ref_view : public view_interface<ref_view<_Range>> {
+ _Range *__range_;
+
+ static void __fun(_Range&);
+ static void __fun(_Range&&) = delete;
+
+public:
+ template<class _Tp>
+ requires __different_from<_Tp, ref_view> &&
+ convertible_to<_Tp, _Range&> && requires { __fun(declval<_Tp>()); }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr ref_view(_Tp&& __t)
+ : __range_(_VSTD::addressof(static_cast<_Range&>(_VSTD::forward<_Tp>(__t))))
+ {}
+
+ _LIBCPP_HIDE_FROM_ABI constexpr _Range& base() const { return *__range_; }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Range> begin() const { return ranges::begin(*__range_); }
+ _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Range> end() const { return ranges::end(*__range_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr bool empty() const
+ requires requires { ranges::empty(*__range_); }
+ { return ranges::empty(*__range_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size() const
+ requires sized_range<_Range>
+ { return ranges::size(*__range_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto data() const
+ requires contiguous_range<_Range>
+ { return ranges::data(*__range_); }
+ };
+
+ template<class _Range>
+ ref_view(_Range&) -> ref_view<_Range>;
+
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_REF_VIEW_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_SIZE_H
+#define _LIBCPP___RANGES_SIZE_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__ranges/access.h>
+#include <__utility/__decay_copy.h>
+#include <__utility/forward.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// clang-format off
+namespace ranges {
+template<class>
+inline constexpr bool disable_sized_range = false;
+
+// [range.prim.size]
+namespace __size {
+ void size(auto&) = delete;
+ void size(const auto&) = delete;
+
+ template <class _Tp>
+ concept __size_enabled = !disable_sized_range<remove_cvref_t<_Tp>>;
+
+ template <class _Tp>
+ concept __member_size = __size_enabled<_Tp> && requires(_Tp&& __t) {
+ { _VSTD::__decay_copy(_VSTD::forward<_Tp>(__t).size()) } -> __integer_like;
+ };
+
+ template <class _Tp>
+ concept __unqualified_size =
+ __size_enabled<_Tp> &&
+ !__member_size<_Tp> &&
+ __class_or_enum<remove_cvref_t<_Tp>> &&
+ requires(_Tp&& __t) {
+ { _VSTD::__decay_copy(size(_VSTD::forward<_Tp>(__t))) } -> __integer_like;
+ };
+
+ template <class _Tp>
+ concept __difference =
+ !__member_size<_Tp> &&
+ !__unqualified_size<_Tp> &&
+ __class_or_enum<remove_cvref_t<_Tp>> &&
+ requires(_Tp&& __t) {
+ { ranges::begin(__t) } -> forward_iterator;
+ { ranges::end(__t) } -> sized_sentinel_for<decltype(ranges::begin(declval<_Tp>()))>;
+ };
+
+ struct __fn {
+ template <class _Tp, size_t _Sz>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t operator()(_Tp (&&)[_Sz]) const noexcept {
+ return _Sz;
+ }
+
+ template <class _Tp, size_t _Sz>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t operator()(_Tp (&)[_Sz]) const noexcept {
+ return _Sz;
+ }
+
+ template <__member_size _Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const
+ noexcept(noexcept(_VSTD::forward<_Tp>(__t).size())) {
+ return _VSTD::forward<_Tp>(__t).size();
+ }
+
+ template <__unqualified_size _Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const
+ noexcept(noexcept(size(_VSTD::forward<_Tp>(__t)))) {
+ return size(_VSTD::forward<_Tp>(__t));
+ }
+
+ template<__difference _Tp>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const
+ noexcept(noexcept(ranges::end(__t) - ranges::begin(__t))) {
+ return _VSTD::__to_unsigned_like(ranges::end(__t) - ranges::begin(__t));
+ }
+ };
+} // end namespace __size
+
+inline namespace __cpo {
+ inline constexpr auto size = __size::__fn{};
+} // namespace __cpo
+
+namespace __ssize {
+ struct __fn {
+ template<class _Tp>
+ requires requires (_Tp&& __t) { ranges::size(__t); }
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr integral auto operator()(_Tp&& __t) const
+ noexcept(noexcept(ranges::size(__t))) {
+ using _Signed = make_signed_t<decltype(ranges::size(__t))>;
+ if constexpr (sizeof(ptrdiff_t) > sizeof(_Signed))
+ return static_cast<ptrdiff_t>(ranges::size(__t));
+ else
+ return static_cast<_Signed>(ranges::size(__t));
+ }
+ };
+}
+
+inline namespace __cpo {
+ inline constexpr const auto ssize = __ssize::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+// clang-format off
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_SIZE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_SUBRANGE_H
+#define _LIBCPP___RANGES_SUBRANGE_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/advance.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+// clang-format off
+namespace ranges {
+ template<class _From, class _To>
+ concept __convertible_to_non_slicing =
+ convertible_to<_From, _To> &&
+ // If they're both pointers, they must have the same element type.
+ !(is_pointer_v<decay_t<_From>> &&
+ is_pointer_v<decay_t<_To>> &&
+ __different_from<remove_pointer_t<decay_t<_From>>, remove_pointer_t<decay_t<_To>>>);
+
+ template<class _Tp>
+ concept __pair_like =
+ !is_reference_v<_Tp> && requires(_Tp __t) {
+ typename tuple_size<_Tp>::type; // Ensures `tuple_size<T>` is complete.
+ requires derived_from<tuple_size<_Tp>, integral_constant<size_t, 2>>;
+ typename tuple_element_t<0, remove_const_t<_Tp>>;
+ typename tuple_element_t<1, remove_const_t<_Tp>>;
+ { _VSTD::get<0>(__t) } -> convertible_to<const tuple_element_t<0, _Tp>&>;
+ { _VSTD::get<1>(__t) } -> convertible_to<const tuple_element_t<1, _Tp>&>;
+ };
+
+ template<class _Pair, class _Iter, class _Sent>
+ concept __pair_like_convertible_from =
+ !range<_Pair> && __pair_like<_Pair> &&
+ constructible_from<_Pair, _Iter, _Sent> &&
+ __convertible_to_non_slicing<_Iter, tuple_element_t<0, _Pair>> &&
+ convertible_to<_Sent, tuple_element_t<1, _Pair>>;
+
+ enum class _LIBCPP_ENUM_VIS subrange_kind : bool { unsized, sized };
+
+ template<class _Iter, class _Sent, bool>
+ struct __subrange_base {
+ static constexpr bool __store_size = false;
+ _Iter __begin_ = _Iter();
+ _Sent __end_ = _Sent();
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __subrange_base() = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __subrange_base(_Iter __iter, _Sent __sent, make_unsigned_t<iter_difference_t<_Iter>> = 0)
+ : __begin_(_VSTD::move(__iter)), __end_(__sent) { }
+ };
+
+ template<class _Iter, class _Sent>
+ struct __subrange_base<_Iter, _Sent, true> {
+ static constexpr bool __store_size = true;
+ _Iter __begin_ = _Iter();
+ _Sent __end_ = _Sent();
+ make_unsigned_t<iter_difference_t<_Iter>> __size_ = 0;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __subrange_base() = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __subrange_base(_Iter __iter, _Sent __sent, decltype(__size_) __size)
+ : __begin_(_VSTD::move(__iter)), __end_(__sent), __size_(__size) { }
+ };
+
+ template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent = _Iter,
+ subrange_kind _Kind = sized_sentinel_for<_Sent, _Iter>
+ ? subrange_kind::sized
+ : subrange_kind::unsized>
+ requires (_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _Iter>)
+ struct _LIBCPP_TEMPLATE_VIS subrange
+ : public view_interface<subrange<_Iter, _Sent, _Kind>>,
+ private __subrange_base<_Iter, _Sent, _Kind == subrange_kind::sized && !sized_sentinel_for<_Sent, _Iter>> {
+
+ using _Base = __subrange_base<_Iter, _Sent, _Kind == subrange_kind::sized && !sized_sentinel_for<_Sent, _Iter>>;
+
+ _LIBCPP_HIDE_FROM_ABI
+ subrange() requires default_initializable<_Iter> = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent)
+ requires (!_Base::__store_size)
+ : _Base(_VSTD::move(__iter), __sent) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent,
+ make_unsigned_t<iter_difference_t<_Iter>> __n)
+ requires (_Kind == subrange_kind::sized)
+ : _Base(_VSTD::move(__iter), __sent, __n) { }
+
+ template<__different_from<subrange> _Range>
+ requires borrowed_range<_Range> &&
+ __convertible_to_non_slicing<iterator_t<_Range>, _Iter> &&
+ convertible_to<sentinel_t<_Range>, _Sent>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr subrange(_Range&& __range)
+ requires (!_Base::__store_size)
+ : subrange(ranges::begin(__range), ranges::end(__range)) { }
+
+ template<__different_from<subrange> _Range>
+ requires borrowed_range<_Range> &&
+ __convertible_to_non_slicing<iterator_t<_Range>, _Iter> &&
+ convertible_to<sentinel_t<_Range>, _Sent>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr subrange(_Range&& __range)
+ requires _Base::__store_size && sized_range<_Range>
+ : subrange(__range, ranges::size(__range)) { }
+
+
+ template<borrowed_range _Range>
+ requires __convertible_to_non_slicing<iterator_t<_Range>, _Iter> &&
+ convertible_to<sentinel_t<_Range>, _Sent>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr subrange(_Range&& __range, make_unsigned_t<iter_difference_t<_Iter>> __n)
+ requires (_Kind == subrange_kind::sized)
+ : subrange(ranges::begin(__range), ranges::end(__range), __n) { }
+
+ template<__different_from<subrange> _Pair>
+ requires __pair_like_convertible_from<_Pair, const _Iter&, const _Sent&>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr operator _Pair() const { return _Pair(this->__begin_, this->__end_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Iter begin() const requires copyable<_Iter> {
+ return this->__begin_;
+ }
+
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter begin() requires (!copyable<_Iter>) {
+ return _VSTD::move(this->__begin_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Sent end() const { return this->__end_; }
+
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { return this->__begin_ == this->__end_; }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr make_unsigned_t<iter_difference_t<_Iter>> size() const
+ requires (_Kind == subrange_kind::sized)
+ {
+ if constexpr (_Base::__store_size)
+ return this->__size_;
+ else
+ return __to_unsigned_like(this->__end_ - this->__begin_);
+ }
+
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) const&
+ requires forward_iterator<_Iter> {
+ auto __tmp = *this;
+ __tmp.advance(__n);
+ return __tmp;
+ }
+
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) && {
+ advance(__n);
+ return _VSTD::move(*this);
+ }
+
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange prev(iter_difference_t<_Iter> __n = 1) const
+ requires bidirectional_iterator<_Iter> {
+ auto __tmp = *this;
+ __tmp.advance(-__n);
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr subrange& advance(iter_difference_t<_Iter> __n) {
+ if constexpr (bidirectional_iterator<_Iter>) {
+ if (__n < 0) {
+ ranges::advance(this->__begin_, __n);
+ if constexpr (_Base::__store_size)
+ this->__size_ += _VSTD::__to_unsigned_like(-__n);
+ return *this;
+ }
+ }
+
+ auto __d = __n - ranges::advance(this->__begin_, __n, this->__end_);
+ if constexpr (_Base::__store_size)
+ this->__size_ -= _VSTD::__to_unsigned_like(__d);
+ return *this;
+ }
+ };
+
+ template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent>
+ subrange(_Iter, _Sent) -> subrange<_Iter, _Sent>;
+
+ template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent>
+ subrange(_Iter, _Sent, make_unsigned_t<iter_difference_t<_Iter>>)
+ -> subrange<_Iter, _Sent, subrange_kind::sized>;
+
+ template<borrowed_range _Range>
+ subrange(_Range&&) -> subrange<iterator_t<_Range>, sentinel_t<_Range>,
+ (sized_range<_Range> || sized_sentinel_for<sentinel_t<_Range>, iterator_t<_Range>>)
+ ? subrange_kind::sized : subrange_kind::unsized>;
+
+ template<borrowed_range _Range>
+ subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>)
+ -> subrange<iterator_t<_Range>, sentinel_t<_Range>, subrange_kind::sized>;
+
+ template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
+ requires (_Index < 2)
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __subrange) {
+ if constexpr (_Index == 0)
+ return __subrange.begin();
+ else
+ return __subrange.end();
+ }
+
+ template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
+ requires (_Index < 2)
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto get(subrange<_Iter, _Sent, _Kind>&& __subrange) {
+ if constexpr (_Index == 0)
+ return __subrange.begin();
+ else
+ return __subrange.end();
+ }
+
+ template<class _Ip, class _Sp, subrange_kind _Kp>
+ inline constexpr bool enable_borrowed_range<subrange<_Ip, _Sp, _Kp>> = true;
+
+ template<range _Rp>
+ using borrowed_subrange_t = _If<borrowed_range<_Rp>, subrange<iterator_t<_Rp> >, dangling>;
+} // namespace ranges
+
+using ranges::get;
+
+// clang-format off
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_SUBRANGE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_TRANSFORM_VIEW_H
+#define _LIBCPP___RANGES_TRANSFORM_VIEW_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/copyable_box.h>
+#include <__ranges/empty.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+
+template<class _View, class _Fn>
+concept __transform_view_constraints =
+ view<_View> && is_object_v<_Fn> &&
+ regular_invocable<_Fn&, range_reference_t<_View>> &&
+ __referenceable<invoke_result_t<_Fn&, range_reference_t<_View>>>;
+
+template<input_range _View, copy_constructible _Fn>
+ requires __transform_view_constraints<_View, _Fn>
+class transform_view : public view_interface<transform_view<_View, _Fn>> {
+ template<bool> class __iterator;
+ template<bool> class __sentinel;
+
+ [[no_unique_address]] __copyable_box<_Fn> __func_;
+ [[no_unique_address]] _View __base_ = _View();
+
+public:
+ _LIBCPP_HIDE_FROM_ABI
+ transform_view()
+ requires default_initializable<_View> && default_initializable<_Fn> = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr transform_view(_View __base, _Fn __func)
+ : __func_(_VSTD::in_place, _VSTD::move(__func)), __base_(_VSTD::move(__base)) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _View base() && { return _VSTD::move(__base_); }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator<false> begin() {
+ return __iterator<false>{*this, ranges::begin(__base_)};
+ }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator<true> begin() const
+ requires range<const _View> &&
+ regular_invocable<const _Fn&, range_reference_t<const _View>>
+ {
+ return __iterator<true>(*this, ranges::begin(__base_));
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __sentinel<false> end() {
+ return __sentinel<false>(ranges::end(__base_));
+ }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator<false> end()
+ requires common_range<_View>
+ {
+ return __iterator<false>(*this, ranges::end(__base_));
+ }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __sentinel<true> end() const
+ requires range<const _View> &&
+ regular_invocable<const _Fn&, range_reference_t<const _View>>
+ {
+ return __sentinel<true>(ranges::end(__base_));
+ }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator<true> end() const
+ requires common_range<const _View> &&
+ regular_invocable<const _Fn&, range_reference_t<const _View>>
+ {
+ return __iterator<true>(*this, ranges::end(__base_));
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size() requires sized_range<_View> { return ranges::size(__base_); }
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size() const requires sized_range<const _View> { return ranges::size(__base_); }
+};
+
+template<class _Range, class _Fn>
+transform_view(_Range&&, _Fn) -> transform_view<views::all_t<_Range>, _Fn>;
+
+template<class _View>
+struct __transform_view_iterator_concept { using type = input_iterator_tag; };
+
+template<random_access_range _View>
+struct __transform_view_iterator_concept<_View> { using type = random_access_iterator_tag; };
+
+template<bidirectional_range _View>
+struct __transform_view_iterator_concept<_View> { using type = bidirectional_iterator_tag; };
+
+template<forward_range _View>
+struct __transform_view_iterator_concept<_View> { using type = forward_iterator_tag; };
+
+template<class, class>
+struct __transform_view_iterator_category_base {};
+
+template<forward_range _View, class _Fn>
+struct __transform_view_iterator_category_base<_View, _Fn> {
+ using _Cat = typename iterator_traits<iterator_t<_View>>::iterator_category;
+
+ using iterator_category = conditional_t<
+ is_lvalue_reference_v<invoke_result_t<_Fn&, range_reference_t<_View>>>,
+ conditional_t<
+ derived_from<_Cat, contiguous_iterator_tag>,
+ random_access_iterator_tag,
+ _Cat
+ >,
+ input_iterator_tag
+ >;
+};
+
+template<input_range _View, copy_constructible _Fn>
+ requires __transform_view_constraints<_View, _Fn>
+template<bool _Const>
+class transform_view<_View, _Fn>::__iterator
+ : public __transform_view_iterator_category_base<_View, _Fn> {
+
+ using _Parent = __maybe_const<_Const, transform_view>;
+ using _Base = __maybe_const<_Const, _View>;
+
+ _Parent *__parent_ = nullptr;
+
+ template<bool>
+ friend class transform_view<_View, _Fn>::__iterator;
+
+ template<bool>
+ friend class transform_view<_View, _Fn>::__sentinel;
+
+public:
+ iterator_t<_Base> __current_ = iterator_t<_Base>();
+
+ using iterator_concept = typename __transform_view_iterator_concept<_View>::type;
+ using value_type = remove_cvref_t<invoke_result_t<_Fn&, range_reference_t<_Base>>>;
+ using difference_type = range_difference_t<_Base>;
+
+ _LIBCPP_HIDE_FROM_ABI
+ __iterator() requires default_initializable<iterator_t<_Base>> = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator(_Parent& __parent, iterator_t<_Base> __current)
+ : __parent_(_VSTD::addressof(__parent)), __current_(_VSTD::move(__current)) {}
+
+ // Note: `__i` should always be `__iterator<false>`, but directly using
+ // `__iterator<false>` is ill-formed when `_Const` is false
+ // (see http://wg21.link/class.copy.ctor#5).
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator(__iterator<!_Const> __i)
+ requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
+ : __parent_(__i.__parent_), __current_(_VSTD::move(__i.__current_)) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr iterator_t<_Base> base() const&
+ requires copyable<iterator_t<_Base>>
+ {
+ return __current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr iterator_t<_Base> base() && {
+ return _VSTD::move(__current_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) operator*() const
+ noexcept(noexcept(_VSTD::invoke(*__parent_->__func_, *__current_)))
+ {
+ return _VSTD::invoke(*__parent_->__func_, *__current_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator& operator++() {
+ ++__current_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void operator++(int) { ++__current_; }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator operator++(int)
+ requires forward_range<_Base>
+ {
+ auto __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator& operator--()
+ requires bidirectional_range<_Base>
+ {
+ --__current_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator operator--(int)
+ requires bidirectional_range<_Base>
+ {
+ auto __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator& operator+=(difference_type __n)
+ requires random_access_range<_Base>
+ {
+ __current_ += __n;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator& operator-=(difference_type __n)
+ requires random_access_range<_Base>
+ {
+ __current_ -= __n;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) operator[](difference_type __n) const
+ noexcept(noexcept(_VSTD::invoke(*__parent_->__func_, __current_[__n])))
+ requires random_access_range<_Base>
+ {
+ return _VSTD::invoke(*__parent_->__func_, __current_[__n]);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
+ requires equality_comparable<iterator_t<_Base>>
+ {
+ return __x.__current_ == __y.__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
+ requires random_access_range<_Base>
+ {
+ return __x.__current_ < __y.__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
+ requires random_access_range<_Base>
+ {
+ return __x.__current_ > __y.__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
+ requires random_access_range<_Base>
+ {
+ return __x.__current_ <= __y.__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
+ requires random_access_range<_Base>
+ {
+ return __x.__current_ >= __y.__current_;
+ }
+
+// TODO: Fix this as soon as soon as three_way_comparable is implemented.
+// _LIBCPP_HIDE_FROM_ABI
+// friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
+// requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>>
+// {
+// return __x.__current_ <=> __y.__current_;
+// }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr __iterator operator+(__iterator __i, difference_type __n)
+ requires random_access_range<_Base>
+ {
+ return __iterator{*__i.__parent_, __i.__current_ + __n};
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr __iterator operator+(difference_type __n, __iterator __i)
+ requires random_access_range<_Base>
+ {
+ return __iterator{*__i.__parent_, __i.__current_ + __n};
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr __iterator operator-(__iterator __i, difference_type __n)
+ requires random_access_range<_Base>
+ {
+ return __iterator{*__i.__parent_, __i.__current_ - __n};
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)
+ requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
+ {
+ return __x.__current_ - __y.__current_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr decltype(auto) iter_move(const __iterator& __i)
+ noexcept(noexcept(*__i))
+ {
+ if constexpr (is_lvalue_reference_v<decltype(*__i)>)
+ return _VSTD::move(*__i);
+ else
+ return *__i;
+ }
+};
+
+template<input_range _View, copy_constructible _Fn>
+ requires __transform_view_constraints<_View, _Fn>
+template<bool _Const>
+class transform_view<_View, _Fn>::__sentinel {
+ using _Parent = __maybe_const<_Const, transform_view>;
+ using _Base = __maybe_const<_Const, _View>;
+
+ sentinel_t<_Base> __end_ = sentinel_t<_Base>();
+
+ template<bool>
+ friend class transform_view<_View, _Fn>::__iterator;
+
+ template<bool>
+ friend class transform_view<_View, _Fn>::__sentinel;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI
+ __sentinel() = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {}
+
+ // Note: `__i` should always be `__sentinel<false>`, but directly using
+ // `__sentinel<false>` is ill-formed when `_Const` is false
+ // (see http://wg21.link/class.copy.ctor#5).
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __sentinel(__sentinel<!_Const> __i)
+ requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
+ : __end_(_VSTD::move(__i.__end_)) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr sentinel_t<_Base> base() const { return __end_; }
+
+ template<bool _OtherConst>
+ requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
+ return __x.__current_ == __y.__end_;
+ }
+
+ template<bool _OtherConst>
+ requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
+ operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
+ return __x.__current_ - __y.__end_;
+ }
+
+ template<bool _OtherConst>
+ requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
+ operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
+ return __x.__end_ - __y.__current_;
+ }
+};
+
+} // namespace ranges
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_TRANSFORM_VIEW_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP___RANGES_VIEW_INTERFACE_H
+#define _LIBCPP___RANGES_VIEW_INTERFACE_H
+
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/prev.h>
+#include <__memory/pointer_traits.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__ranges/empty.h>
+#include <__ranges/enable_view.h>
+#include <concepts>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+
+namespace ranges {
+
+template<class _Tp>
+concept __can_empty = requires(_Tp __t) { ranges::empty(__t); };
+
+template<class _Tp>
+void __implicitly_convert_to(type_identity_t<_Tp>) noexcept;
+
+template<class _Derived>
+ requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>
+class view_interface : public view_base {
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Derived& __derived() noexcept {
+ return static_cast<_Derived&>(*this);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Derived const& __derived() const noexcept {
+ return static_cast<_Derived const&>(*this);
+ }
+
+public:
+ template<class _D2 = _Derived>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty()
+ noexcept(noexcept(__implicitly_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived()))))
+ requires forward_range<_D2>
+ {
+ return ranges::begin(__derived()) == ranges::end(__derived());
+ }
+
+ template<class _D2 = _Derived>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const
+ noexcept(noexcept(__implicitly_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived()))))
+ requires forward_range<const _D2>
+ {
+ return ranges::begin(__derived()) == ranges::end(__derived());
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit operator bool()
+ noexcept(noexcept(ranges::empty(declval<_D2>())))
+ requires __can_empty<_D2>
+ {
+ return !ranges::empty(__derived());
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit operator bool() const
+ noexcept(noexcept(ranges::empty(declval<const _D2>())))
+ requires __can_empty<const _D2>
+ {
+ return !ranges::empty(__derived());
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto data()
+ noexcept(noexcept(_VSTD::to_address(ranges::begin(__derived()))))
+ requires contiguous_iterator<iterator_t<_D2>>
+ {
+ return _VSTD::to_address(ranges::begin(__derived()));
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto data() const
+ noexcept(noexcept(_VSTD::to_address(ranges::begin(__derived()))))
+ requires range<const _D2> && contiguous_iterator<iterator_t<const _D2>>
+ {
+ return _VSTD::to_address(ranges::begin(__derived()));
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size()
+ noexcept(noexcept(ranges::end(__derived()) - ranges::begin(__derived())))
+ requires forward_range<_D2>
+ && sized_sentinel_for<sentinel_t<_D2>, iterator_t<_D2>>
+ {
+ return ranges::end(__derived()) - ranges::begin(__derived());
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr auto size() const
+ noexcept(noexcept(ranges::end(__derived()) - ranges::begin(__derived())))
+ requires forward_range<const _D2>
+ && sized_sentinel_for<sentinel_t<const _D2>, iterator_t<const _D2>>
+ {
+ return ranges::end(__derived()) - ranges::begin(__derived());
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) front()
+ noexcept(noexcept(*ranges::begin(__derived())))
+ requires forward_range<_D2>
+ {
+ _LIBCPP_ASSERT(!empty(),
+ "Precondition `!empty()` not satisfied. `.front()` called on an empty view.");
+ return *ranges::begin(__derived());
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) front() const
+ noexcept(noexcept(*ranges::begin(__derived())))
+ requires forward_range<const _D2>
+ {
+ _LIBCPP_ASSERT(!empty(),
+ "Precondition `!empty()` not satisfied. `.front()` called on an empty view.");
+ return *ranges::begin(__derived());
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) back()
+ noexcept(noexcept(*ranges::prev(ranges::end(__derived()))))
+ requires bidirectional_range<_D2> && common_range<_D2>
+ {
+ _LIBCPP_ASSERT(!empty(),
+ "Precondition `!empty()` not satisfied. `.back()` called on an empty view.");
+ return *ranges::prev(ranges::end(__derived()));
+ }
+
+ template<class _D2 = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) back() const
+ noexcept(noexcept(*ranges::prev(ranges::end(__derived()))))
+ requires bidirectional_range<const _D2> && common_range<const _D2>
+ {
+ _LIBCPP_ASSERT(!empty(),
+ "Precondition `!empty()` not satisfied. `.back()` called on an empty view.");
+ return *ranges::prev(ranges::end(__derived()));
+ }
+
+ template<random_access_range _RARange = _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) operator[](range_difference_t<_RARange> __index)
+ noexcept(noexcept(ranges::begin(__derived())[__index]))
+ {
+ return ranges::begin(__derived())[__index];
+ }
+
+ template<random_access_range _RARange = const _Derived>
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) const
+ noexcept(noexcept(ranges::begin(__derived())[__index]))
+ {
+ return ranges::begin(__derived())[__index];
+ }
+};
+
+}
+
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___RANGES_VIEW_INTERFACE_H
#define _LIBCPP_SPLIT_BUFFER
#include <__config>
-#include <type_traits>
+#include <__utility/forward.h>
#include <algorithm>
+#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
class __split_buffer_common
{
protected:
- void __throw_length_error() const;
- void __throw_out_of_range() const;
+ _LIBCPP_NORETURN void __throw_length_error() const;
+ _LIBCPP_NORETURN void __throw_out_of_range() const;
};
template <class _Tp, class _Allocator = allocator<_Tp> >
__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
~__split_buffer();
-#ifndef _LIBCPP_CXX03_LANG
__split_buffer(__split_buffer&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
__split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::value) ||
!__alloc_traits::propagate_on_container_move_assignment::value);
-#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;}
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
void shrink_to_fit() _NOEXCEPT;
void push_front(const_reference __x);
_LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
-#ifndef _LIBCPP_CXX03_LANG
void push_front(value_type&& __x);
void push_back(value_type&& __x);
template <class... _Args>
void emplace_back(_Args&&... __args);
-#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
_LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
>::type
__split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)
{
- _ConstructTransaction __tx(&this->__end_, std::distance(__first, __last));
+ _ConstructTransaction __tx(&this->__end_, _VSTD::distance(__first, __last));
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, ++__first) {
__alloc_traits::construct(this->__alloc(),
_VSTD::__to_address(__tx.__pos_), *__first);
__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
{
while (__begin_ != __new_begin)
- __alloc_traits::destroy(__alloc(), __to_address(__begin_++));
+ __alloc_traits::destroy(__alloc(), _VSTD::__to_address(__begin_++));
}
template <class _Tp, class _Allocator>
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
{
while (__new_last != __end_)
- __alloc_traits::destroy(__alloc(), __to_address(--__end_));
+ __alloc_traits::destroy(__alloc(), _VSTD::__to_address(--__end_));
}
template <class _Tp, class _Allocator>
__alloc_traits::deallocate(__alloc(), __first_, capacity());
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
void
__split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
_VSTD::swap(__begin_, __x.__begin_);
_VSTD::swap(__end_, __x.__end_);
_VSTD::swap(__end_cap(), __x.__end_cap());
- __swap_allocator(__alloc(), __x.__alloc());
+ _VSTD::__swap_allocator(__alloc(), __x.__alloc());
}
template <class _Tp, class _Allocator>
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__split_buffer<value_type, __alloc_rr&> __t(size(), 0, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
--__begin_;
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
void
__split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
--__begin_;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
++__end_;
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
void
__split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
++__end_;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_SPLIT_BUFFER
+#endif // _LIBCPP_SPLIT_BUFFER
#define _LIBCPP___STD_STREAM
#include <__config>
-#include <ostream>
-#include <istream>
#include <__locale>
#include <cstdio>
+#include <istream>
+#include <ostream>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
_LIBCPP_POP_MACROS
-#endif // _LIBCPP___STD_STREAM
+#endif // _LIBCPP___STD_STREAM
#ifndef _LIBCPP___STRING
#define _LIBCPP___STRING
-/*
- string synopsis
-
-namespace std
-{
-
-template <class charT>
-struct char_traits
-{
- typedef charT char_type;
- typedef ... int_type;
- typedef streamoff off_type;
- typedef streampos pos_type;
- typedef mbstate_t state_type;
-
- static constexpr void assign(char_type& c1, const char_type& c2) noexcept;
- static constexpr bool eq(char_type c1, char_type c2) noexcept;
- static constexpr bool lt(char_type c1, char_type c2) noexcept;
-
- static constexpr int compare(const char_type* s1, const char_type* s2, size_t n);
- static constexpr size_t length(const char_type* s);
- static constexpr const char_type*
- find(const char_type* s, size_t n, const char_type& a);
-
- static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n); // constexpr in C++20
- static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n); // constexpr in C++20
- static constexpr char_type* assign(char_type* s, size_t n, char_type a); // constexpr in C++20
-
- static constexpr int_type not_eof(int_type c) noexcept;
- static constexpr char_type to_char_type(int_type c) noexcept;
- static constexpr int_type to_int_type(char_type c) noexcept;
- static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept;
- static constexpr int_type eof() noexcept;
-};
-
-template <> struct char_traits<char>;
-template <> struct char_traits<wchar_t>;
-template <> struct char_traits<char8_t>; // c++20
-
-} // std
-
-*/
-
#include <__config>
-#include <algorithm> // for search and min
-#include <cstdio> // For EOF.
-#include <memory> // for __murmur2_or_cityhash
+#include <__algorithm/copy.h>
+#include <__algorithm/copy_backward.h>
+#include <__algorithm/copy_n.h>
+#include <__algorithm/fill_n.h>
+#include <__algorithm/find_first_of.h>
+#include <__algorithm/find_end.h>
+#include <__algorithm/min.h>
+#include <__functional/hash.h> // for __murmur2_or_cityhash
+#include <__iterator/iterator_traits.h>
+#include <cstdio> // for EOF
+#include <cstdint> // for uint_least16_t
+#include <cstring> // for memcpy
+#include <cwchar> // for wmemcpy
+#include <type_traits> // for __libcpp_is_constant_evaluated
#include <__debug>
_Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, std::allocator<_CharType> const&)) \
+ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, allocator<_CharType> const&)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, std::allocator<_CharType> const&)) \
+ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
_Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
- _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, std::allocator<_CharType> const&)) \
+ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
_Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
_Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
return __s;
++__s;
}
- return 0;
+ return nullptr;
}
template <class _CharT>
// constexpr versions of move/copy/assign.
template <class _CharT>
-static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
_CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
{
if (__n == 0) return __s1;
}
template <class _CharT>
-static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
_CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
{
_VSTD::copy_n(__s2, __n, __s1);
}
template <class _CharT>
-static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
_CharT* __assign_constexpr(_CharT* __s, size_t __n, _CharT __a) _NOEXCEPT
{
_VSTD::fill_n(__s, __n, __a);
length(const char_type* __s) _NOEXCEPT {return __builtin_strlen(__s);}
static _LIBCPP_CONSTEXPR_AFTER_CXX14
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
- static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
{
return __libcpp_is_constant_evaluated()
- ? __move_constexpr(__s1, __s2, __n)
- : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n);
+ ? _VSTD::__move_constexpr(__s1, __s2, __n)
+ : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n);
}
- static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
{
_LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
return __libcpp_is_constant_evaluated()
- ? __copy_constexpr(__s1, __s2, __n)
- : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
+ ? _VSTD::__copy_constexpr(__s1, __s2, __n)
+ : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n);
}
- static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
{
return __libcpp_is_constant_evaluated()
- ? __assign_constexpr(__s, __n, __a)
- : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);
+ ? _VSTD::__assign_constexpr(__s, __n, __a)
+ : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n);
}
static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
#if __has_feature(cxx_constexpr_string_builtins)
return __builtin_memcmp(__s1, __s2, __n);
#elif _LIBCPP_STD_VER <= 14
- return memcmp(__s1, __s2, __n);
+ return _VSTD::memcmp(__s1, __s2, __n);
#else
for (; __n; --__n, ++__s1, ++__s2)
{
#if __has_feature(cxx_constexpr_string_builtins)
return __builtin_char_memchr(__s, to_int_type(__a), __n);
#elif _LIBCPP_STD_VER <= 14
- return (const char_type*) memchr(__s, to_int_type(__a), __n);
+ return (const char_type*) _VSTD::memchr(__s, to_int_type(__a), __n);
#else
for (; __n; --__n)
{
size_t length(const char_type* __s) _NOEXCEPT;
static _LIBCPP_CONSTEXPR_AFTER_CXX14
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
- static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
{
return __libcpp_is_constant_evaluated()
- ? __move_constexpr(__s1, __s2, __n)
- : __n == 0 ? __s1 : wmemmove(__s1, __s2, __n);
+ ? _VSTD::__move_constexpr(__s1, __s2, __n)
+ : __n == 0 ? __s1 : _VSTD::wmemmove(__s1, __s2, __n);
}
- static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
{
_LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
return __libcpp_is_constant_evaluated()
- ? __copy_constexpr(__s1, __s2, __n)
- : __n == 0 ? __s1 : wmemcpy(__s1, __s2, __n);
+ ? _VSTD::__copy_constexpr(__s1, __s2, __n)
+ : __n == 0 ? __s1 : _VSTD::wmemcpy(__s1, __s2, __n);
}
- static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
{
return __libcpp_is_constant_evaluated()
- ? __assign_constexpr(__s, __n, __a)
- : __n == 0 ? __s : wmemset(__s, __a, __n);
+ ? _VSTD::__assign_constexpr(__s, __n, __a)
+ : __n == 0 ? __s : _VSTD::wmemset(__s, __a, __n);
}
static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
#if __has_feature(cxx_constexpr_string_builtins)
return __builtin_wmemcmp(__s1, __s2, __n);
#elif _LIBCPP_STD_VER <= 14
- return wmemcmp(__s1, __s2, __n);
+ return _VSTD::wmemcmp(__s1, __s2, __n);
#else
for (; __n; --__n, ++__s1, ++__s2)
{
#if __has_feature(cxx_constexpr_string_builtins)
return __builtin_wcslen(__s);
#elif _LIBCPP_STD_VER <= 14
- return wcslen(__s);
+ return _VSTD::wcslen(__s);
#else
size_t __len = 0;
for (; !eq(*__s, char_type(0)); ++__s)
#if __has_feature(cxx_constexpr_string_builtins)
return __builtin_wmemchr(__s, __a, __n);
#elif _LIBCPP_STD_VER <= 14
- return wmemchr(__s, __a, __n);
+ return _VSTD::wmemchr(__s, __a, __n);
#else
for (; __n; --__n)
{
}
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
template <>
struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>
_LIBCPP_INLINE_VISIBILITY static constexpr
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
- static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
{
return __libcpp_is_constant_evaluated()
- ? __move_constexpr(__s1, __s2, __n)
- : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n);
+ ? _VSTD::__move_constexpr(__s1, __s2, __n)
+ : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n);
}
- static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
{
_LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
return __libcpp_is_constant_evaluated()
- ? __copy_constexpr(__s1, __s2, __n)
- : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
+ ? _VSTD::__copy_constexpr(__s1, __s2, __n)
+ : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n);
}
- static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
+ static _LIBCPP_CONSTEXPR_AFTER_CXX17
char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
{
return __libcpp_is_constant_evaluated()
- ? __assign_constexpr(__s, __n, __a)
- : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);
+ ? _VSTD::__assign_constexpr(__s, __n, __a)
+ : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n);
}
static inline constexpr int_type not_eof(int_type __c) noexcept
return __s;
++__s;
}
- return 0;
+ return nullptr;
}
-#endif // #_LIBCPP_NO_HAS_CHAR8_T
+#endif // #_LIBCPP_HAS_NO_CHAR8_T
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
return __s;
++__s;
}
- return 0;
+ return nullptr;
}
inline _LIBCPP_CONSTEXPR_AFTER_CXX17
return __s;
++__s;
}
- return 0;
+ return nullptr;
}
inline _LIBCPP_CONSTEXPR_AFTER_CXX17
return __r;
}
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
// helper fns for basic_string and string_view
if (__pos >= __sz)
return __npos;
const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
- if (__r == 0)
+ if (__r == nullptr)
return __npos;
return static_cast<_SizeT>(__r - __p);
}
template <class _CharT, class _Traits>
inline _LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT *
__search_substring(const _CharT *__first1, const _CharT *__last1,
- const _CharT *__first2, const _CharT *__last2) {
+ const _CharT *__first2, const _CharT *__last2) _NOEXCEPT {
// Take advantage of knowing source and pattern lengths.
// Stop short when source is smaller than pattern.
const ptrdiff_t __len2 = __last2 - __first2;
// Find __f2 the first byte matching in __first1.
__first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2);
- if (__first1 == 0)
+ if (__first1 == nullptr)
return __last1;
// It is faster to compare from the first byte of __first1 even if we
{
const _CharT* __pe = __p + __sz;
for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
- if (_Traits::find(__s, __n, *__ps) == 0)
+ if (_Traits::find(__s, __n, *__ps) == nullptr)
return static_cast<_SizeT>(__ps - __p);
}
return __npos;
else
__pos = __sz;
for (const _CharT* __ps = __p + __pos; __ps != __p;)
- if (_Traits::find(__s, __n, *--__ps) == 0)
+ if (_Traits::find(__s, __n, *--__ps) == nullptr)
return static_cast<_SizeT>(__ps - __p);
return __npos;
}
_LIBCPP_POP_MACROS
-#endif // _LIBCPP___STRING
+#endif // _LIBCPP___STRING
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
+#define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
+
+#if defined(__BIONIC__)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+#include <xlocale.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#if defined(__ANDROID__)
+
+#include <android/api-level.h>
+#include <android/ndk-version.h>
+#if __ANDROID_API__ < 21
+#include <__support/xlocale/__posix_l_fallback.h>
+#endif
+// In NDK versions later than 16, locale-aware functions are provided by
+// legacy_stdlib_inlines.h
+#if __NDK_MAJOR__ <= 16
+#if __ANDROID_API__ < 21
+#include <__support/xlocale/__strtonum_fallback.h>
+#elif __ANDROID_API__ < 26
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char* __nptr, char** __endptr,
+ locale_t) {
+ return ::strtof(__nptr, __endptr);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char* __nptr,
+ char** __endptr, locale_t) {
+ return ::strtod(__nptr, __endptr);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY long strtol_l(const char* __nptr, char** __endptr,
+ int __base, locale_t) {
+ return ::strtol(__nptr, __endptr, __base);
+}
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // __ANDROID_API__ < 26
+
+#endif // __NDK_MAJOR__ <= 16
+#endif // defined(__ANDROID__)
+
+#endif // defined(__BIONIC__)
+#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
+#define _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
+
+#if defined(__Fuchsia__)
+
+#include <cstdlib>
+#include <cwchar>
+#include <__support/xlocale/__posix_l_fallback.h>
+#include <__support/xlocale/__strtonum_fallback.h>
+
+#endif // defined(__Fuchsia__)
+
+#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H
+#define _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H
+
+#include <time.h>
+
+static inline int gettimeofdayMonotonic(struct timespec64* Output) {
+
+ // The POSIX gettimeofday() function is not available on z/OS. Therefore,
+ // we will call stcke and other hardware instructions in implement equivalent.
+ // Note that nanoseconds alone will overflow when reaching new epoch in 2042.
+
+ struct _t {
+ uint64_t Hi;
+ uint64_t Lo;
+ };
+ struct _t Value = {0, 0};
+ uint64_t CC = 0;
+ asm(" stcke %0\n"
+ " ipm %1\n"
+ " srlg %1,%1,28\n"
+ : "=m"(Value), "+r"(CC)::);
+
+ if (CC != 0) {
+ errno = EMVSTODNOTSET;
+ return CC;
+ }
+ uint64_t us = (Value.Hi >> 4);
+ uint64_t ns = ((Value.Hi & 0x0F) << 8) + (Value.Lo >> 56);
+ ns = (ns * 1000) >> 12;
+ us = us - 2208988800000000;
+
+ register uint64_t DivPair0 asm("r0"); // dividend (upper half), remainder
+ DivPair0 = 0;
+ register uint64_t DivPair1 asm("r1"); // dividend (lower half), quotient
+ DivPair1 = us;
+ uint64_t Divisor = 1000000;
+ asm(" dlgr %0,%2" : "+r"(DivPair0), "+r"(DivPair1) : "r"(Divisor) :);
+
+ Output->tv_sec = DivPair1;
+ Output->tv_nsec = DivPair0 * 1000 + ns;
+ return 0;
+}
+
+#endif // _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_IBM_LIMITS_H
+#define _LIBCPP_SUPPORT_IBM_LIMITS_H
+
+#if !defined(_AIX) // Linux
+#include <math.h> // for HUGE_VAL, HUGE_VALF, HUGE_VALL, and NAN
+
+static const unsigned int _QNAN_F = 0x7fc00000;
+#define NANF (*((float *)(&_QNAN_F)))
+static const unsigned int _QNAN_LDBL128[4] = {0x7ff80000, 0x0, 0x0, 0x0};
+#define NANL (*((long double *)(&_QNAN_LDBL128)))
+static const unsigned int _SNAN_F= 0x7f855555;
+#define NANSF (*((float *)(&_SNAN_F)))
+static const unsigned int _SNAN_D[2] = {0x7ff55555, 0x55555555};
+#define NANS (*((double *)(&_SNAN_D)))
+static const unsigned int _SNAN_LDBL128[4] = {0x7ff55555, 0x55555555, 0x0, 0x0};
+#define NANSL (*((long double *)(&_SNAN_LDBL128)))
+
+#define __builtin_huge_val() HUGE_VAL
+#define __builtin_huge_valf() HUGE_VALF
+#define __builtin_huge_vall() HUGE_VALL
+#define __builtin_nan(__dummy) NAN
+#define __builtin_nanf(__dummy) NANF
+#define __builtin_nanl(__dummy) NANL
+#define __builtin_nans(__dummy) NANS
+#define __builtin_nansf(__dummy) NANSF
+#define __builtin_nansl(__dummy) NANSL
+
+#else
+
+#include <math.h>
+#include <float.h> // limit constants
+
+#define __builtin_huge_val() HUGE_VAL //0x7ff0000000000000
+#define __builtin_huge_valf() HUGE_VALF //0x7f800000
+#define __builtin_huge_vall() HUGE_VALL //0x7ff0000000000000
+#define __builtin_nan(__dummy) nan(__dummy) //0x7ff8000000000000
+#define __builtin_nanf(__dummy) nanf(__dummy) // 0x7ff80000
+#define __builtin_nanl(__dummy) nanl(__dummy) //0x7ff8000000000000
+#define __builtin_nans(__dummy) DBL_SNAN //0x7ff5555555555555
+#define __builtin_nansf(__dummy) FLT_SNAN //0x7f855555
+#define __builtin_nansl(__dummy) DBL_SNAN //0x7ff5555555555555
+
+#define __FLT_MANT_DIG__ FLT_MANT_DIG
+#define __FLT_DIG__ FLT_DIG
+#define __FLT_RADIX__ FLT_RADIX
+#define __FLT_MIN_EXP__ FLT_MIN_EXP
+#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP
+#define __FLT_MAX_EXP__ FLT_MAX_EXP
+#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP
+#define __FLT_MIN__ FLT_MIN
+#define __FLT_MAX__ FLT_MAX
+#define __FLT_EPSILON__ FLT_EPSILON
+// predefined by XLC on LoP
+#define __FLT_DENORM_MIN__ 1.40129846e-45F
+
+#define __DBL_MANT_DIG__ DBL_MANT_DIG
+#define __DBL_DIG__ DBL_DIG
+#define __DBL_MIN_EXP__ DBL_MIN_EXP
+#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP
+#define __DBL_MAX_EXP__ DBL_MAX_EXP
+#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP
+#define __DBL_MIN__ DBL_MIN
+#define __DBL_MAX__ DBL_MAX
+#define __DBL_EPSILON__ DBL_EPSILON
+// predefined by XLC on LoP
+#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+
+#define __LDBL_MANT_DIG__ LDBL_MANT_DIG
+#define __LDBL_DIG__ LDBL_DIG
+#define __LDBL_MIN_EXP__ LDBL_MIN_EXP
+#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP
+#define __LDBL_MAX_EXP__ LDBL_MAX_EXP
+#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP
+#define __LDBL_MIN__ LDBL_MIN
+#define __LDBL_MAX__ LDBL_MAX
+#define __LDBL_EPSILON__ LDBL_EPSILON
+// predefined by XLC on LoP
+#if __LONGDOUBLE128
+#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
+#else
+#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
+#endif
+
+// predefined by XLC on LoP
+#define __CHAR_BIT__ 8
+
+#endif // _AIX
+
+#endif // _LIBCPP_SUPPORT_IBM_LIMITS_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
+#define _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
+
+#if defined(_AIX)
+#include "cstdlib"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_AIX71)
+// AIX 7.1 and higher has these definitions. Definitions and stubs
+// are provied here as a temporary workaround on AIX 6.1.
+
+#define LC_COLLATE_MASK 1
+#define LC_CTYPE_MASK 2
+#define LC_MESSAGES_MASK 4
+#define LC_MONETARY_MASK 8
+#define LC_NUMERIC_MASK 16
+#define LC_TIME_MASK 32
+#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | \
+ LC_MESSAGES_MASK | LC_MONETARY_MASK |\
+ LC_NUMERIC_MASK | LC_TIME_MASK)
+
+typedef void* locale_t;
+
+// The following are stubs. They are not supported on AIX 6.1.
+static inline
+locale_t newlocale(int category_mask, const char *locale, locale_t base)
+{
+ _LC_locale_t *newloc, *loc;
+ if ((loc = (_LC_locale_t *)__xopen_locale(locale)) == NULL)
+ {
+ errno = EINVAL;
+ return (locale_t)0;
+ }
+ if ((newloc = (_LC_locale_t *)calloc(1, sizeof(_LC_locale_t))) == NULL)
+ {
+ errno = ENOMEM;
+ return (locale_t)0;
+ }
+ if (!base)
+ base = (_LC_locale_t *)__xopen_locale("C");
+ memcpy(newloc, base, sizeof (_LC_locale_t));
+ if (category_mask & LC_COLLATE_MASK)
+ newloc->lc_collate = loc->lc_collate;
+ if (category_mask & LC_CTYPE_MASK)
+ newloc->lc_ctype = loc->lc_ctype;
+ //if (category_mask & LC_MESSAGES_MASK)
+ // newloc->lc_messages = loc->lc_messages;
+ if (category_mask & LC_MONETARY_MASK)
+ newloc->lc_monetary = loc->lc_monetary;
+ if (category_mask & LC_TIME_MASK)
+ newloc->lc_time = loc->lc_time;
+ if (category_mask & LC_NUMERIC_MASK)
+ newloc->lc_numeric = loc->lc_numeric;
+ return (locale_t)newloc;
+}
+static inline
+void freelocale(locale_t locobj)
+{
+ free(locobj);
+}
+static inline
+locale_t uselocale(locale_t newloc)
+{
+ return (locale_t)0;
+}
+#endif // !defined(_AIX71)
+
+#ifdef __cplusplus
+}
+#endif
+#endif // defined(_AIX)
+#endif // _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
+#define _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
+
+#if defined(__MVS__)
+#include <locale.h>
+#include <string>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define _LC_MAX LC_MESSAGES /* highest real category */
+#define _NCAT (_LC_MAX + 1) /* maximum + 1 */
+
+#define _CATMASK(n) (1 << (n))
+#define LC_COLLATE_MASK _CATMASK(LC_COLLATE)
+#define LC_CTYPE_MASK _CATMASK(LC_CTYPE)
+#define LC_MONETARY_MASK _CATMASK(LC_MONETARY)
+#define LC_NUMERIC_MASK _CATMASK(LC_NUMERIC)
+#define LC_TIME_MASK _CATMASK(LC_TIME)
+#define LC_MESSAGES_MASK _CATMASK(LC_MESSAGES)
+#define LC_ALL_MASK (_CATMASK(_NCAT) - 1)
+
+typedef struct locale_struct {
+ int category_mask;
+ std::string lc_collate;
+ std::string lc_ctype;
+ std::string lc_monetary;
+ std::string lc_numeric;
+ std::string lc_time;
+ std::string lc_messages;
+} * locale_t;
+
+// z/OS does not have newlocale, freelocale and uselocale.
+// The functions below are workarounds in single thread mode.
+locale_t newlocale(int category_mask, const char* locale, locale_t base);
+void freelocale(locale_t locobj);
+locale_t uselocale(locale_t newloc);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // defined(__MVS__)
+#endif // _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
+#define _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
+
+#include <unistd.h>
+
+inline int nanosleep(const struct timespec* __req, struct timespec* __rem) {
+ // The nanosleep() function is not available on z/OS. Therefore, we will call
+ // sleep() to sleep for whole seconds and usleep() to sleep for any remaining
+ // fraction of a second. Any remaining nanoseconds will round up to the next
+ // microsecond.
+ if (__req->tv_sec < 0 || __req->tv_nsec < 0 || __req->tv_nsec > 999999999) {
+ errno = EINVAL;
+ return -1;
+ }
+ useconds_t __micro_sec =
+ static_cast<useconds_t>((__req->tv_nsec + 999) / 1000);
+ time_t __sec = __req->tv_sec;
+ if (__micro_sec > 999999) {
+ ++__sec;
+ __micro_sec -= 1000000;
+ }
+ __sec = sleep(static_cast<unsigned int>(__sec));
+ if (__sec) {
+ if (__rem) {
+ // Updating the remaining time to sleep in case of unsuccessful call to sleep().
+ __rem->tv_sec = __sec;
+ __rem->tv_nsec = __micro_sec * 1000;
+ }
+ errno = EINTR;
+ return -1;
+ }
+ if (__micro_sec) {
+ int __rt = usleep(__micro_sec);
+ if (__rt != 0 && __rem) {
+ // The usleep() does not provide the amount of remaining time upon its failure,
+ // so the time slept will be ignored.
+ __rem->tv_sec = 0;
+ __rem->tv_nsec = __micro_sec * 1000;
+ // The errno is already set.
+ return -1;
+ }
+ return __rt;
+ }
+ return 0;
+}
+
+#endif // _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_IBM_SUPPORT_H
+#define _LIBCPP_SUPPORT_IBM_SUPPORT_H
+
+extern "builtin" int __popcnt4(unsigned int);
+extern "builtin" int __popcnt8(unsigned long long);
+extern "builtin" unsigned int __cnttz4(unsigned int);
+extern "builtin" unsigned int __cnttz8(unsigned long long);
+extern "builtin" unsigned int __cntlz4(unsigned int);
+extern "builtin" unsigned int __cntlz8(unsigned long long);
+
+// Builtin functions for counting population
+#define __builtin_popcount(x) __popcnt4(x)
+#define __builtin_popcountll(x) __popcnt8(x)
+#if defined(__64BIT__)
+#define __builtin_popcountl(x) __builtin_popcountll(x)
+#else
+#define __builtin_popcountl(x) __builtin_popcount(x)
+#endif
+
+// Builtin functions for counting trailing zeros
+#define __builtin_ctz(x) __cnttz4(x)
+#define __builtin_ctzll(x) __cnttz8(x)
+#if defined(__64BIT__)
+#define __builtin_ctzl(x) __builtin_ctzll(x)
+#else
+#define __builtin_ctzl(x) __builtin_ctz(x)
+#endif
+
+// Builtin functions for counting leading zeros
+#define __builtin_clz(x) __cntlz4(x)
+#define __builtin_clzll(x) __cntlz8(x)
+#if defined(__64BIT__)
+#define __builtin_clzl(x) __builtin_clzll(x)
+#else
+#define __builtin_clzl(x) __builtin_clz(x)
+#endif
+
+#if defined(__64BIT__)
+#define __SIZE_WIDTH__ 64
+#else
+#define __SIZE_WIDTH__ 32
+#endif
+
+#endif // _LIBCPP_SUPPORT_IBM_SUPPORT_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_IBM_XLOCALE_H
+#define _LIBCPP_SUPPORT_IBM_XLOCALE_H
+
+#include <__support/ibm/locale_mgmt_aix.h>
+#include <__support/ibm/locale_mgmt_zos.h>
+#include <stdarg.h>
+
+#include "cstdlib"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_AIX)
+#if !defined(_AIX71)
+// AIX 7.1 and higher has these definitions. Definitions and stubs
+// are provied here as a temporary workaround on AIX 6.1.
+static inline
+int isalnum_l(int c, locale_t locale)
+{
+ return __xisalnum(locale, c);
+}
+static inline
+int isalpha_l(int c, locale_t locale)
+{
+ return __xisalpha(locale, c);
+}
+static inline
+int isblank_l(int c, locale_t locale)
+{
+ return __xisblank(locale, c);
+}
+static inline
+int iscntrl_l(int c, locale_t locale)
+{
+ return __xiscntrl(locale, c);
+}
+static inline
+int isdigit_l(int c, locale_t locale)
+{
+ return __xisdigit(locale, c);
+}
+static inline
+int isgraph_l(int c, locale_t locale)
+{
+ return __xisgraph(locale, c);
+}
+static inline
+int islower_l(int c, locale_t locale)
+{
+ return __xislower(locale, c);
+}
+static inline
+int isprint_l(int c, locale_t locale)
+{
+ return __xisprint(locale, c);
+}
+
+static inline
+int ispunct_l(int c, locale_t locale)
+{
+ return __xispunct(locale, c);
+}
+static inline
+int isspace_l(int c, locale_t locale)
+{
+ return __xisspace(locale, c);
+}
+static inline
+int isupper_l(int c, locale_t locale)
+{
+ return __xisupper(locale, c);
+}
+
+static inline
+int isxdigit_l(int c, locale_t locale)
+{
+ return __xisxdigit(locale, c);
+}
+
+static inline
+int iswalnum_l(wchar_t wc, locale_t locale)
+{
+ return __xiswalnum(locale, wc);
+}
+
+static inline
+int iswalpha_l(wchar_t wc, locale_t locale)
+{
+ return __xiswalpha(locale, wc);
+}
+
+static inline
+int iswblank_l(wchar_t wc, locale_t locale)
+{
+ return __xiswblank(locale, wc);
+}
+
+static inline
+int iswcntrl_l(wchar_t wc, locale_t locale)
+{
+ return __xiswcntrl(locale, wc);
+}
+
+static inline
+int iswdigit_l(wchar_t wc, locale_t locale)
+{
+ return __xiswdigit(locale, wc);
+}
+
+static inline
+int iswgraph_l(wchar_t wc, locale_t locale)
+{
+ return __xiswgraph(locale, wc);
+}
+
+static inline
+int iswlower_l(wchar_t wc, locale_t locale)
+{
+ return __xiswlower(locale, wc);
+}
+
+static inline
+int iswprint_l(wchar_t wc, locale_t locale)
+{
+ return __xiswprint(locale, wc);
+}
+
+static inline
+int iswpunct_l(wchar_t wc, locale_t locale)
+{
+ return __xiswpunct(locale, wc);
+}
+
+static inline
+int iswspace_l(wchar_t wc, locale_t locale)
+{
+ return __xiswspace(locale, wc);
+}
+
+static inline
+int iswupper_l(wchar_t wc, locale_t locale)
+{
+ return __xiswupper(locale, wc);
+}
+
+static inline
+int iswxdigit_l(wchar_t wc, locale_t locale)
+{
+ return __xiswxdigit(locale, wc);
+}
+
+static inline
+int iswctype_l(wint_t wc, wctype_t desc, locale_t locale)
+{
+ return __xiswctype(locale, wc, desc);
+}
+
+static inline
+int toupper_l(int c, locale_t locale)
+{
+ return __xtoupper(locale, c);
+}
+static inline
+int tolower_l(int c, locale_t locale)
+{
+ return __xtolower(locale, c);
+}
+static inline
+wint_t towupper_l(wint_t wc, locale_t locale)
+{
+ return __xtowupper(locale, wc);
+}
+static inline
+wint_t towlower_l(wint_t wc, locale_t locale)
+{
+ return __xtowlower(locale, wc);
+}
+
+static inline
+int strcoll_l(const char *__s1, const char *__s2, locale_t locale)
+{
+ return __xstrcoll(locale, __s1, __s2);
+}
+static inline
+int wcscoll_l(const wchar_t *__s1, const wchar_t *__s2, locale_t locale)
+{
+ return __xwcscoll(locale, __s1, __s2);
+}
+static inline
+size_t strxfrm_l(char *__s1, const char *__s2, size_t __n, locale_t locale)
+{
+ return __xstrxfrm(locale, __s1, __s2, __n);
+}
+
+static inline
+size_t wcsxfrm_l(wchar_t *__ws1, const wchar_t *__ws2, size_t __n,
+ locale_t locale)
+{
+ return __xwcsxfrm(locale, __ws1, __ws2, __n);
+}
+#endif // !defined(_AIX71)
+
+// strftime_l() is defined by POSIX. However, AIX 7.1 and z/OS do not have it
+// implemented yet. z/OS retrieves it from the POSIX fallbacks.
+#if !defined(_AIX72)
+static inline
+size_t strftime_l(char *__s, size_t __size, const char *__fmt,
+ const struct tm *__tm, locale_t locale) {
+ return __xstrftime(locale, __s, __size, __fmt, __tm);
+}
+#endif
+
+#elif defined(__MVS__)
+#include <wctype.h>
+// POSIX routines
+#include <__support/xlocale/__posix_l_fallback.h>
+#endif // defined(__MVS__)
+
+namespace {
+
+struct __setAndRestore {
+ explicit __setAndRestore(locale_t locale) {
+ if (locale == (locale_t)0) {
+ __cloc = newlocale(LC_ALL_MASK, "C", /* base */ (locale_t)0);
+ __stored = uselocale(__cloc);
+ } else {
+ __stored = uselocale(locale);
+ }
+ }
+
+ ~__setAndRestore() {
+ uselocale(__stored);
+ if (__cloc)
+ freelocale(__cloc);
+ }
+
+private:
+ locale_t __stored = (locale_t)0;
+ locale_t __cloc = (locale_t)0;
+};
+
+} // namespace
+
+// The following are not POSIX routines. These are quick-and-dirty hacks
+// to make things pretend to work
+static inline
+long long strtoll_l(const char *__nptr, char **__endptr,
+ int __base, locale_t locale) {
+ __setAndRestore __newloc(locale);
+ return strtoll(__nptr, __endptr, __base);
+}
+
+static inline
+long strtol_l(const char *__nptr, char **__endptr,
+ int __base, locale_t locale) {
+ __setAndRestore __newloc(locale);
+ return strtol(__nptr, __endptr, __base);
+}
+
+static inline
+double strtod_l(const char *__nptr, char **__endptr,
+ locale_t locale) {
+ __setAndRestore __newloc(locale);
+ return strtod(__nptr, __endptr);
+}
+
+static inline
+float strtof_l(const char *__nptr, char **__endptr,
+ locale_t locale) {
+ __setAndRestore __newloc(locale);
+ return strtof(__nptr, __endptr);
+}
+
+static inline
+long double strtold_l(const char *__nptr, char **__endptr,
+ locale_t locale) {
+ __setAndRestore __newloc(locale);
+ return strtold(__nptr, __endptr);
+}
+
+static inline
+unsigned long long strtoull_l(const char *__nptr, char **__endptr,
+ int __base, locale_t locale) {
+ __setAndRestore __newloc(locale);
+ return strtoull(__nptr, __endptr, __base);
+}
+
+static inline
+unsigned long strtoul_l(const char *__nptr, char **__endptr,
+ int __base, locale_t locale) {
+ __setAndRestore __newloc(locale);
+ return strtoul(__nptr, __endptr, __base);
+}
+
+static inline
+int vasprintf(char **strp, const char *fmt, va_list ap) {
+ const size_t buff_size = 256;
+ if ((*strp = (char *)malloc(buff_size)) == NULL) {
+ return -1;
+ }
+
+ va_list ap_copy;
+ // va_copy may not be provided by the C library in C++ 03 mode.
+#if defined(_LIBCPP_CXX03_LANG) && __has_builtin(__builtin_va_copy)
+ __builtin_va_copy(ap_copy, ap);
+#else
+ va_copy(ap_copy, ap);
+#endif
+ int str_size = vsnprintf(*strp, buff_size, fmt, ap_copy);
+ va_end(ap_copy);
+
+ if ((size_t) str_size >= buff_size) {
+ if ((*strp = (char *)realloc(*strp, str_size + 1)) == NULL) {
+ return -1;
+ }
+ str_size = vsnprintf(*strp, str_size + 1, fmt, ap);
+ }
+ return str_size;
+}
+
+#ifdef __cplusplus
+}
+#endif
+#endif // _LIBCPP_SUPPORT_IBM_XLOCALE_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+// This adds support for the extended locale functions that are currently
+// missing from the Musl C library.
+//
+// This only works when the specified locale is "C" or "POSIX", but that's
+// about as good as we can do without implementing full xlocale support
+// in Musl.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_MUSL_XLOCALE_H
+#define _LIBCPP_SUPPORT_MUSL_XLOCALE_H
+
+#include <cstdlib>
+#include <cwchar>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline long long strtoll_l(const char *nptr, char **endptr, int base,
+ locale_t) {
+ return strtoll(nptr, endptr, base);
+}
+
+static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
+ int base, locale_t) {
+ return strtoull(nptr, endptr, base);
+}
+
+static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
+ int base, locale_t) {
+ return wcstoll(nptr, endptr, base);
+}
+
+static inline unsigned long long wcstoull_l(const wchar_t *nptr,
+ wchar_t **endptr, int base,
+ locale_t) {
+ return wcstoull(nptr, endptr, base);
+}
+
+static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
+ locale_t) {
+ return wcstold(nptr, endptr);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _LIBCPP_SUPPORT_MUSL_XLOCALE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
+#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
+
+#if defined(_NEWLIB_VERSION)
+
+#include <cstdlib>
+#include <clocale>
+#include <cwctype>
+#include <ctype.h>
+#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
+ __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
+#include <__support/xlocale/__nop_locale_mgmt.h>
+#include <__support/xlocale/__posix_l_fallback.h>
+#include <__support/xlocale/__strtonum_fallback.h>
+#endif
+
+#endif // _NEWLIB_VERSION
+
+#endif
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_NUTTX_XLOCALE_H
+#define _LIBCPP_SUPPORT_NUTTX_XLOCALE_H
+
+#if defined(__NuttX__)
+#include <__support/xlocale/__posix_l_fallback.h>
+#include <__support/xlocale/__strtonum_fallback.h>
+#endif // __NuttX__
+
+#endif
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H
+#define _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H
+
+#include <__support/xlocale/__strtonum_fallback.h>
+#include <clocale>
+#include <cstdlib>
+#include <ctype.h>
+#include <cwctype>
+
+#endif
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#define atof sun_atof
+#define strtod sun_strtod
+#include_next "floatingpoint.h"
+#undef atof
+#undef strtod
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#define iswalpha sun_iswalpha
+#define iswupper sun_iswupper
+#define iswlower sun_iswlower
+#define iswdigit sun_iswdigit
+#define iswxdigit sun_iswxdigit
+#define iswalnum sun_iswalnum
+#define iswspace sun_iswspace
+#define iswpunct sun_iswpunct
+#define iswprint sun_iswprint
+#define iswgraph sun_iswgraph
+#define iswcntrl sun_iswcntrl
+#define iswctype sun_iswctype
+#define towlower sun_towlower
+#define towupper sun_towupper
+#define wcswcs sun_wcswcs
+#define wcswidth sun_wcswidth
+#define wcwidth sun_wcwidth
+#define wctype sun_wctype
+#define _WCHAR_T 1
+#include_next "wchar.h"
+#undef iswalpha
+#undef iswupper
+#undef iswlower
+#undef iswdigit
+#undef iswxdigit
+#undef iswalnum
+#undef iswspace
+#undef iswpunct
+#undef iswprint
+#undef iswgraph
+#undef iswcntrl
+#undef iswctype
+#undef towlower
+#undef towupper
+#undef wcswcs
+#undef wcswidth
+#undef wcwidth
+#undef wctype
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+////////////////////////////////////////////////////////////////////////////////
+// Minimal xlocale implementation for Solaris. This implements the subset of
+// the xlocale APIs that libc++ depends on.
+////////////////////////////////////////////////////////////////////////////////
+#ifndef __XLOCALE_H_INCLUDED
+#define __XLOCALE_H_INCLUDED
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+int snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...);
+int asprintf_l(char **__s, locale_t __l, const char *__format, ...);
+
+int sscanf_l(const char *__s, locale_t __l, const char *__format, ...);
+
+int toupper_l(int __c, locale_t __l);
+int tolower_l(int __c, locale_t __l);
+
+struct lconv *localeconv(void);
+struct lconv *localeconv_l(locale_t __l);
+
+// FIXME: These are quick-and-dirty hacks to make things pretend to work
+static inline
+long long strtoll_l(const char *__nptr, char **__endptr,
+ int __base, locale_t __loc) {
+ return strtoll(__nptr, __endptr, __base);
+}
+static inline
+long strtol_l(const char *__nptr, char **__endptr,
+ int __base, locale_t __loc) {
+ return strtol(__nptr, __endptr, __base);
+}
+static inline
+unsigned long long strtoull_l(const char *__nptr, char **__endptr,
+ int __base, locale_t __loc) {
+ return strtoull(__nptr, __endptr, __base);
+}
+static inline
+unsigned long strtoul_l(const char *__nptr, char **__endptr,
+ int __base, locale_t __loc) {
+ return strtoul(__nptr, __endptr, __base);
+}
+static inline
+float strtof_l(const char *__nptr, char **__endptr,
+ locale_t __loc) {
+ return strtof(__nptr, __endptr);
+}
+static inline
+double strtod_l(const char *__nptr, char **__endptr,
+ locale_t __loc) {
+ return strtod(__nptr, __endptr);
+}
+static inline
+long double strtold_l(const char *__nptr, char **__endptr,
+ locale_t __loc) {
+ return strtold(__nptr, __endptr);
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
+#define _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
+
+#if !defined(_LIBCPP_MSVCRT)
+#error "This header complements the Microsoft C Runtime library, and should not be included otherwise."
+#endif
+#if defined(__clang__)
+#error "This header should only be included when using Microsofts C1XX frontend"
+#endif
+
+#include <float.h> // limit constants
+#include <limits.h> // CHAR_BIT
+#include <math.h> // HUGE_VAL
+#include <ymath.h> // internal MSVC header providing the needed functionality
+
+#define __CHAR_BIT__ CHAR_BIT
+
+#define __FLT_MANT_DIG__ FLT_MANT_DIG
+#define __FLT_DIG__ FLT_DIG
+#define __FLT_RADIX__ FLT_RADIX
+#define __FLT_MIN_EXP__ FLT_MIN_EXP
+#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP
+#define __FLT_MAX_EXP__ FLT_MAX_EXP
+#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP
+#define __FLT_MIN__ FLT_MIN
+#define __FLT_MAX__ FLT_MAX
+#define __FLT_EPSILON__ FLT_EPSILON
+// predefined by MinGW GCC
+#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F
+
+#define __DBL_MANT_DIG__ DBL_MANT_DIG
+#define __DBL_DIG__ DBL_DIG
+#define __DBL_RADIX__ DBL_RADIX
+#define __DBL_MIN_EXP__ DBL_MIN_EXP
+#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP
+#define __DBL_MAX_EXP__ DBL_MAX_EXP
+#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP
+#define __DBL_MIN__ DBL_MIN
+#define __DBL_MAX__ DBL_MAX
+#define __DBL_EPSILON__ DBL_EPSILON
+// predefined by MinGW GCC
+#define __DBL_DENORM_MIN__ double(4.94065645841246544177e-324L)
+
+#define __LDBL_MANT_DIG__ LDBL_MANT_DIG
+#define __LDBL_DIG__ LDBL_DIG
+#define __LDBL_RADIX__ LDBL_RADIX
+#define __LDBL_MIN_EXP__ LDBL_MIN_EXP
+#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP
+#define __LDBL_MAX_EXP__ LDBL_MAX_EXP
+#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP
+#define __LDBL_MIN__ LDBL_MIN
+#define __LDBL_MAX__ LDBL_MAX
+#define __LDBL_EPSILON__ LDBL_EPSILON
+// predefined by MinGW GCC
+#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
+
+// __builtin replacements/workarounds
+#define __builtin_huge_vall() _LInf._Long_double
+#define __builtin_nanl(__dummmy) _LNan._Long_double
+#define __builtin_nansl(__dummy) _LSnan._Long_double
+
+#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
+#define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
+
+#include <__config>
+#include <__nullptr>
+#include <locale.h> // _locale_t
+#include <stdio.h>
+
+#define _X_ALL LC_ALL
+#define _X_COLLATE LC_COLLATE
+#define _X_CTYPE LC_CTYPE
+#define _X_MONETARY LC_MONETARY
+#define _X_NUMERIC LC_NUMERIC
+#define _X_TIME LC_TIME
+#define _X_MAX LC_MAX
+#define _X_MESSAGES 6
+#define _NCAT (_X_MESSAGES + 1)
+
+#define _CATMASK(n) ((1 << (n)) >> 1)
+#define _M_COLLATE _CATMASK(_X_COLLATE)
+#define _M_CTYPE _CATMASK(_X_CTYPE)
+#define _M_MONETARY _CATMASK(_X_MONETARY)
+#define _M_NUMERIC _CATMASK(_X_NUMERIC)
+#define _M_TIME _CATMASK(_X_TIME)
+#define _M_MESSAGES _CATMASK(_X_MESSAGES)
+#define _M_ALL (_CATMASK(_NCAT) - 1)
+
+#define LC_COLLATE_MASK _M_COLLATE
+#define LC_CTYPE_MASK _M_CTYPE
+#define LC_MONETARY_MASK _M_MONETARY
+#define LC_NUMERIC_MASK _M_NUMERIC
+#define LC_TIME_MASK _M_TIME
+#define LC_MESSAGES_MASK _M_MESSAGES
+#define LC_ALL_MASK ( LC_COLLATE_MASK \
+ | LC_CTYPE_MASK \
+ | LC_MESSAGES_MASK \
+ | LC_MONETARY_MASK \
+ | LC_NUMERIC_MASK \
+ | LC_TIME_MASK )
+
+class __lconv_storage {
+public:
+ __lconv_storage(const lconv *__lc_input) {
+ __lc = *__lc_input;
+
+ __decimal_point = __lc_input->decimal_point;
+ __thousands_sep = __lc_input->thousands_sep;
+ __grouping = __lc_input->grouping;
+ __int_curr_symbol = __lc_input->int_curr_symbol;
+ __currency_symbol = __lc_input->currency_symbol;
+ __mon_decimal_point = __lc_input->mon_decimal_point;
+ __mon_thousands_sep = __lc_input->mon_thousands_sep;
+ __mon_grouping = __lc_input->mon_grouping;
+ __positive_sign = __lc_input->positive_sign;
+ __negative_sign = __lc_input->negative_sign;
+
+ __lc.decimal_point = const_cast<char *>(__decimal_point.c_str());
+ __lc.thousands_sep = const_cast<char *>(__thousands_sep.c_str());
+ __lc.grouping = const_cast<char *>(__grouping.c_str());
+ __lc.int_curr_symbol = const_cast<char *>(__int_curr_symbol.c_str());
+ __lc.currency_symbol = const_cast<char *>(__currency_symbol.c_str());
+ __lc.mon_decimal_point = const_cast<char *>(__mon_decimal_point.c_str());
+ __lc.mon_thousands_sep = const_cast<char *>(__mon_thousands_sep.c_str());
+ __lc.mon_grouping = const_cast<char *>(__mon_grouping.c_str());
+ __lc.positive_sign = const_cast<char *>(__positive_sign.c_str());
+ __lc.negative_sign = const_cast<char *>(__negative_sign.c_str());
+ }
+
+ lconv *__get() {
+ return &__lc;
+ }
+private:
+ lconv __lc;
+ std::string __decimal_point;
+ std::string __thousands_sep;
+ std::string __grouping;
+ std::string __int_curr_symbol;
+ std::string __currency_symbol;
+ std::string __mon_decimal_point;
+ std::string __mon_thousands_sep;
+ std::string __mon_grouping;
+ std::string __positive_sign;
+ std::string __negative_sign;
+};
+
+class locale_t {
+public:
+ locale_t()
+ : __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {}
+ locale_t(std::nullptr_t)
+ : __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {}
+ locale_t(_locale_t __xlocale, const char* __xlocale_str)
+ : __locale(__xlocale), __locale_str(__xlocale_str), __lc(nullptr) {}
+ locale_t(const locale_t &__l)
+ : __locale(__l.__locale), __locale_str(__l.__locale_str), __lc(nullptr) {}
+
+ ~locale_t() {
+ delete __lc;
+ }
+
+ locale_t &operator =(const locale_t &__l) {
+ __locale = __l.__locale;
+ __locale_str = __l.__locale_str;
+ // __lc not copied
+ return *this;
+ }
+
+ friend bool operator==(const locale_t& __left, const locale_t& __right) {
+ return __left.__locale == __right.__locale;
+ }
+
+ friend bool operator==(const locale_t& __left, int __right) {
+ return __left.__locale == nullptr && __right == 0;
+ }
+
+ friend bool operator==(const locale_t& __left, long long __right) {
+ return __left.__locale == nullptr && __right == 0;
+ }
+
+ friend bool operator==(const locale_t& __left, std::nullptr_t) {
+ return __left.__locale == nullptr;
+ }
+
+ friend bool operator==(int __left, const locale_t& __right) {
+ return __left == 0 && nullptr == __right.__locale;
+ }
+
+ friend bool operator==(std::nullptr_t, const locale_t& __right) {
+ return nullptr == __right.__locale;
+ }
+
+ friend bool operator!=(const locale_t& __left, const locale_t& __right) {
+ return !(__left == __right);
+ }
+
+ friend bool operator!=(const locale_t& __left, int __right) {
+ return !(__left == __right);
+ }
+
+ friend bool operator!=(const locale_t& __left, long long __right) {
+ return !(__left == __right);
+ }
+
+ friend bool operator!=(const locale_t& __left, std::nullptr_t __right) {
+ return !(__left == __right);
+ }
+
+ friend bool operator!=(int __left, const locale_t& __right) {
+ return !(__left == __right);
+ }
+
+ friend bool operator!=(std::nullptr_t __left, const locale_t& __right) {
+ return !(__left == __right);
+ }
+
+ operator bool() const {
+ return __locale != nullptr;
+ }
+
+ const char* __get_locale() const { return __locale_str; }
+
+ operator _locale_t() const {
+ return __locale;
+ }
+
+ lconv *__store_lconv(const lconv *__input_lc) {
+ delete __lc;
+ __lc = new __lconv_storage(__input_lc);
+ return __lc->__get();
+ }
+private:
+ _locale_t __locale;
+ const char* __locale_str;
+ __lconv_storage *__lc = nullptr;
+};
+
+// Locale management functions
+#define freelocale _free_locale
+// FIXME: base currently unused. Needs manual work to construct the new locale
+locale_t newlocale( int mask, const char * locale, locale_t base );
+// uselocale can't be implemented on Windows because Windows allows partial modification
+// of thread-local locale and so _get_current_locale() returns a copy while uselocale does
+// not create any copies.
+// We can still implement raii even without uselocale though.
+
+
+lconv *localeconv_l( locale_t &loc );
+size_t mbrlen_l( const char *__restrict s, size_t n,
+ mbstate_t *__restrict ps, locale_t loc);
+size_t mbsrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
+ size_t len, mbstate_t *__restrict ps, locale_t loc );
+size_t wcrtomb_l( char *__restrict s, wchar_t wc, mbstate_t *__restrict ps,
+ locale_t loc);
+size_t mbrtowc_l( wchar_t *__restrict pwc, const char *__restrict s,
+ size_t n, mbstate_t *__restrict ps, locale_t loc);
+size_t mbsnrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
+ size_t nms, size_t len, mbstate_t *__restrict ps, locale_t loc);
+size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src,
+ size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc);
+wint_t btowc_l( int c, locale_t loc );
+int wctob_l( wint_t c, locale_t loc );
+
+decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l );
+
+// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
+#define mbtowc_l _mbtowc_l
+#define strtoll_l _strtoi64_l
+#define strtoull_l _strtoui64_l
+#define strtod_l _strtod_l
+#if defined(_LIBCPP_MSVCRT)
+#define strtof_l _strtof_l
+#define strtold_l _strtold_l
+#else
+_LIBCPP_FUNC_VIS float strtof_l(const char*, char**, locale_t);
+_LIBCPP_FUNC_VIS long double strtold_l(const char*, char**, locale_t);
+#endif
+inline _LIBCPP_INLINE_VISIBILITY
+int
+islower_l(int c, _locale_t loc)
+{
+ return _islower_l((int)c, loc);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+int
+isupper_l(int c, _locale_t loc)
+{
+ return _isupper_l((int)c, loc);
+}
+
+#define isdigit_l _isdigit_l
+#define isxdigit_l _isxdigit_l
+#define strcoll_l _strcoll_l
+#define strxfrm_l _strxfrm_l
+#define wcscoll_l _wcscoll_l
+#define wcsxfrm_l _wcsxfrm_l
+#define toupper_l _toupper_l
+#define tolower_l _tolower_l
+#define iswspace_l _iswspace_l
+#define iswprint_l _iswprint_l
+#define iswcntrl_l _iswcntrl_l
+#define iswupper_l _iswupper_l
+#define iswlower_l _iswlower_l
+#define iswalpha_l _iswalpha_l
+#define iswdigit_l _iswdigit_l
+#define iswpunct_l _iswpunct_l
+#define iswxdigit_l _iswxdigit_l
+#define towupper_l _towupper_l
+#define towlower_l _towlower_l
+#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800
+_LIBCPP_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format,
+ const struct tm *tm, locale_t loc);
+#else
+#define strftime_l _strftime_l
+#endif
+#define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ )
+#define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
+#define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
+#define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
+_LIBCPP_FUNC_VIS int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...);
+_LIBCPP_FUNC_VIS int asprintf_l( char **ret, locale_t loc, const char *format, ... );
+_LIBCPP_FUNC_VIS int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
+
+// not-so-pressing FIXME: use locale to determine blank characters
+inline int isblank_l( int c, locale_t /*loc*/ )
+{
+ return ( c == ' ' || c == '\t' );
+}
+inline int iswblank_l( wint_t c, locale_t /*loc*/ )
+{
+ return ( c == L' ' || c == L'\t' );
+}
+
+#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
+#define _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Patch over lack of extended locale support
+typedef void *locale_t;
+static inline locale_t duplocale(locale_t) {
+ return NULL;
+}
+
+static inline void freelocale(locale_t) {
+}
+
+static inline locale_t newlocale(int, const char *, locale_t) {
+ return NULL;
+}
+
+static inline locale_t uselocale(locale_t) {
+ return NULL;
+}
+
+#define LC_COLLATE_MASK (1 << LC_COLLATE)
+#define LC_CTYPE_MASK (1 << LC_CTYPE)
+#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
+#define LC_MONETARY_MASK (1 << LC_MONETARY)
+#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
+#define LC_TIME_MASK (1 << LC_TIME)
+#define LC_ALL_MASK (LC_COLLATE_MASK|\
+ LC_CTYPE_MASK|\
+ LC_MONETARY_MASK|\
+ LC_NUMERIC_MASK|\
+ LC_TIME_MASK|\
+ LC_MESSAGES_MASK)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+// These are reimplementations of some extended locale functions ( *_l ) that
+// are normally part of POSIX. This shared implementation provides parts of the
+// extended locale support for libc's that normally don't have any (like
+// Android's bionic and Newlib).
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
+#define _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inline _LIBCPP_INLINE_VISIBILITY int isalnum_l(int c, locale_t) {
+ return ::isalnum(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int isalpha_l(int c, locale_t) {
+ return ::isalpha(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int isblank_l(int c, locale_t) {
+ return ::isblank(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iscntrl_l(int c, locale_t) {
+ return ::iscntrl(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int isdigit_l(int c, locale_t) {
+ return ::isdigit(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int isgraph_l(int c, locale_t) {
+ return ::isgraph(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int islower_l(int c, locale_t) {
+ return ::islower(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int isprint_l(int c, locale_t) {
+ return ::isprint(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int ispunct_l(int c, locale_t) {
+ return ::ispunct(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int isspace_l(int c, locale_t) {
+ return ::isspace(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int isupper_l(int c, locale_t) {
+ return ::isupper(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int isxdigit_l(int c, locale_t) {
+ return ::isxdigit(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswalnum_l(wint_t c, locale_t) {
+ return ::iswalnum(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswalpha_l(wint_t c, locale_t) {
+ return ::iswalpha(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswblank_l(wint_t c, locale_t) {
+ return ::iswblank(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) {
+ return ::iswcntrl(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswdigit_l(wint_t c, locale_t) {
+ return ::iswdigit(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswgraph_l(wint_t c, locale_t) {
+ return ::iswgraph(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswlower_l(wint_t c, locale_t) {
+ return ::iswlower(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswprint_l(wint_t c, locale_t) {
+ return ::iswprint(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswpunct_l(wint_t c, locale_t) {
+ return ::iswpunct(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswspace_l(wint_t c, locale_t) {
+ return ::iswspace(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswupper_l(wint_t c, locale_t) {
+ return ::iswupper(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int iswxdigit_l(wint_t c, locale_t) {
+ return ::iswxdigit(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int toupper_l(int c, locale_t) {
+ return ::toupper(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int tolower_l(int c, locale_t) {
+ return ::tolower(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY wint_t towupper_l(wint_t c, locale_t) {
+ return ::towupper(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY wint_t towlower_l(wint_t c, locale_t) {
+ return ::towlower(c);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int strcoll_l(const char *s1, const char *s2,
+ locale_t) {
+ return ::strcoll(s1, s2);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY size_t strxfrm_l(char *dest, const char *src,
+ size_t n, locale_t) {
+ return ::strxfrm(dest, src, n);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY size_t strftime_l(char *s, size_t max,
+ const char *format,
+ const struct tm *tm, locale_t) {
+ return ::strftime(s, max, format, tm);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int wcscoll_l(const wchar_t *ws1,
+ const wchar_t *ws2, locale_t) {
+ return ::wcscoll(ws1, ws2);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src,
+ size_t n, locale_t) {
+ return ::wcsxfrm(dest, src, n);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
--- /dev/null
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+// These are reimplementations of some extended locale functions ( *_l ) that
+// aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe
+// others). The unifying aspect in this case is that all of these functions
+// convert strings to some numeric type.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
+#define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char *nptr,
+ char **endptr, locale_t) {
+ return ::strtof(nptr, endptr);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char *nptr,
+ char **endptr, locale_t) {
+ return ::strtod(nptr, endptr);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY long double strtold_l(const char *nptr,
+ char **endptr, locale_t) {
+ return ::strtold(nptr, endptr);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY long long
+strtoll_l(const char *nptr, char **endptr, int base, locale_t) {
+ return ::strtoll(nptr, endptr, base);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY unsigned long long
+strtoull_l(const char *nptr, char **endptr, int base, locale_t) {
+ return ::strtoull(nptr, endptr, base);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY long long
+wcstoll_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
+ return ::wcstoll(nptr, endptr, base);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY unsigned long long
+wcstoull_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
+ return ::wcstoull(nptr, endptr, base);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY long double wcstold_l(const wchar_t *nptr,
+ wchar_t **endptr, locale_t) {
+ return ::wcstold(nptr, endptr);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
#ifndef _LIBCPP_THREADING_SUPPORT
#define _LIBCPP_THREADING_SUPPORT
+#include <__availability>
#include <__config>
#include <chrono>
-#include <iosfwd>
#include <errno.h>
+#include <iosfwd>
+#include <limits>
+
+#ifdef __MVS__
+# include <__support/ibm/nanosleep.h>
+#endif
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#pragma GCC system_header
# include <__external_threading>
#elif !defined(_LIBCPP_HAS_NO_THREADS)
+#if defined(__APPLE__) || defined(__MVS__)
+# define _LIBCPP_NO_NATIVE_SEMAPHORES
+#endif
+
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
# include <pthread.h>
# include <sched.h>
-# ifdef __APPLE__
-# define _LIBCPP_NO_NATIVE_SEMAPHORES
-# endif
# ifndef _LIBCPP_NO_NATIVE_SEMAPHORES
-# include <semaphore.h>
+# include <semaphore.h>
# endif
#elif defined(_LIBCPP_HAS_THREAD_API_C11)
# include <threads.h>
#define _LIBCPP_EXEC_ONCE_INITIALIZER PTHREAD_ONCE_INIT
// Thread id
-typedef pthread_t __libcpp_thread_id;
+#if defined(__MVS__)
+ typedef unsigned long long __libcpp_thread_id;
+#else
+ typedef pthread_t __libcpp_thread_id;
+#endif
// Thread
-#define _LIBCPP_NULL_THREAD 0U
-
+#define _LIBCPP_NULL_THREAD ((__libcpp_thread_t()))
typedef pthread_t __libcpp_thread_t;
// Thread Local Storage
// Semaphore
typedef void* __libcpp_semaphore_t;
+#if defined(_LIBCPP_HAS_THREAD_API_WIN32)
+# define _LIBCPP_SEMAPHORE_MAX (::std::numeric_limits<long>::max())
+#endif
// Execute Once
typedef void* __libcpp_exec_once_flag;
#endif // !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
struct __libcpp_timed_backoff_policy {
- _LIBCPP_THREAD_ABI_VISIBILITY
- bool operator()(chrono::nanoseconds __elapsed) const;
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(chrono::nanoseconds __elapsed) const
+ {
+ if(__elapsed > chrono::milliseconds(128))
+ __libcpp_thread_sleep_for(chrono::milliseconds(8));
+ else if(__elapsed > chrono::microseconds(64))
+ __libcpp_thread_sleep_for(__elapsed / 2);
+ else if(__elapsed > chrono::microseconds(4))
+ __libcpp_thread_yield();
+ else
+ {} // poll
+ return false;
+ }
};
-inline _LIBCPP_INLINE_VISIBILITY
-bool __libcpp_timed_backoff_policy::operator()(chrono::nanoseconds __elapsed) const
-{
- if(__elapsed > chrono::milliseconds(128))
- __libcpp_thread_sleep_for(chrono::milliseconds(8));
- else if(__elapsed > chrono::microseconds(64))
- __libcpp_thread_sleep_for(__elapsed / 2);
- else if(__elapsed > chrono::microseconds(4))
- __libcpp_thread_yield();
- else
- ; // poll
- return false;
-}
-
static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64;
template<class _Fn, class _BFn>
return pthread_mutex_trylock(__m) == 0;
}
-int __libcpp_recursive_mutex_unlock(__libcpp_mutex_t *__m)
+int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m)
{
return pthread_mutex_unlock(__m);
}
// Returns non-zero if the thread ids are equal, otherwise 0
bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)
{
- return pthread_equal(t1, t2) != 0;
+ return t1 == t2;
}
// Returns non-zero if t1 < t2, otherwise 0
// Thread
bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
- return *__t == 0;
+ return __libcpp_thread_get_id(__t) == 0;
}
int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
void *__arg)
{
- return pthread_create(__t, 0, __func, __arg);
+ return pthread_create(__t, nullptr, __func, __arg);
}
__libcpp_thread_id __libcpp_thread_get_current_id()
{
- return pthread_self();
+ const __libcpp_thread_t thread = pthread_self();
+ return __libcpp_thread_get_id(&thread);
}
__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
{
+#if defined(__MVS__)
+ return __t->__;
+#else
return *__t;
+#endif
}
int __libcpp_thread_join(__libcpp_thread_t *__t)
{
- return pthread_join(*__t, 0);
+ return pthread_join(*__t, nullptr);
}
int __libcpp_thread_detach(__libcpp_thread_t *__t)
return mtx_trylock(__m) == thrd_success;
}
-int __libcpp_recursive_mutex_unlock(__libcpp_mutex_t *__m)
+int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m)
{
return mtx_unlock(__m) == thrd_success ? 0 : EINVAL;
}
// Thread
bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
- return *__t == 0;
+ return __libcpp_thread_get_id(__t) == 0;
}
int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
#define _LIBCPP___TREE
#include <__config>
+#include <__utility/forward.h>
+#include <algorithm>
#include <iterator>
+#include <limits>
#include <memory>
#include <stdexcept>
-#include <algorithm>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
if (__x->__right_ && !__x->__right_->__is_black_)
return 0;
}
- unsigned __h = __tree_sub_invariant(__x->__left_);
+ unsigned __h = _VSTD::__tree_sub_invariant(__x->__left_);
if (__h == 0)
return 0; // invalid left subtree
- if (__h != __tree_sub_invariant(__x->__right_))
+ if (__h != _VSTD::__tree_sub_invariant(__x->__right_))
return 0; // invalid or different height right subtree
return __h + __x->__is_black_; // return black height of this node
}
// check __x->__parent_ consistency
if (__root->__parent_ == nullptr)
return false;
- if (!__tree_is_left_child(__root))
+ if (!_VSTD::__tree_is_left_child(__root))
return false;
// root must be black
if (!__root->__is_black_)
return false;
// do normal node checks
- return __tree_sub_invariant(__root) != 0;
+ return _VSTD::__tree_sub_invariant(__root) != 0;
}
// Returns: pointer to the left-most node under __x.
__tree_next(_NodePtr __x) _NOEXCEPT
{
if (__x->__right_ != nullptr)
- return __tree_min(__x->__right_);
- while (!__tree_is_left_child(__x))
+ return _VSTD::__tree_min(__x->__right_);
+ while (!_VSTD::__tree_is_left_child(__x))
__x = __x->__parent_unsafe();
return __x->__parent_unsafe();
}
__tree_next_iter(_NodePtr __x) _NOEXCEPT
{
if (__x->__right_ != nullptr)
- return static_cast<_EndNodePtr>(__tree_min(__x->__right_));
- while (!__tree_is_left_child(__x))
+ return static_cast<_EndNodePtr>(_VSTD::__tree_min(__x->__right_));
+ while (!_VSTD::__tree_is_left_child(__x))
__x = __x->__parent_unsafe();
return static_cast<_EndNodePtr>(__x->__parent_);
}
__tree_prev_iter(_EndNodePtr __x) _NOEXCEPT
{
if (__x->__left_ != nullptr)
- return __tree_max(__x->__left_);
+ return _VSTD::__tree_max(__x->__left_);
_NodePtr __xx = static_cast<_NodePtr>(__x);
- while (__tree_is_left_child(__xx))
+ while (_VSTD::__tree_is_left_child(__xx))
__xx = __xx->__parent_unsafe();
return __xx->__parent_unsafe();
}
if (__x->__right_ != nullptr)
__x->__right_->__set_parent(__x);
__y->__parent_ = __x->__parent_;
- if (__tree_is_left_child(__x))
+ if (_VSTD::__tree_is_left_child(__x))
__x->__parent_->__left_ = __y;
else
__x->__parent_unsafe()->__right_ = __y;
if (__x->__left_ != nullptr)
__x->__left_->__set_parent(__x);
__y->__parent_ = __x->__parent_;
- if (__tree_is_left_child(__x))
+ if (_VSTD::__tree_is_left_child(__x))
__x->__parent_->__left_ = __y;
else
__x->__parent_unsafe()->__right_ = __y;
while (__x != __root && !__x->__parent_unsafe()->__is_black_)
{
// __x->__parent_ != __root because __x->__parent_->__is_black == false
- if (__tree_is_left_child(__x->__parent_unsafe()))
+ if (_VSTD::__tree_is_left_child(__x->__parent_unsafe()))
{
_NodePtr __y = __x->__parent_unsafe()->__parent_unsafe()->__right_;
if (__y != nullptr && !__y->__is_black_)
}
else
{
- if (!__tree_is_left_child(__x))
+ if (!_VSTD::__tree_is_left_child(__x))
{
__x = __x->__parent_unsafe();
- __tree_left_rotate(__x);
+ _VSTD::__tree_left_rotate(__x);
}
__x = __x->__parent_unsafe();
__x->__is_black_ = true;
__x = __x->__parent_unsafe();
__x->__is_black_ = false;
- __tree_right_rotate(__x);
+ _VSTD::__tree_right_rotate(__x);
break;
}
}
}
else
{
- if (__tree_is_left_child(__x))
+ if (_VSTD::__tree_is_left_child(__x))
{
__x = __x->__parent_unsafe();
- __tree_right_rotate(__x);
+ _VSTD::__tree_right_rotate(__x);
}
__x = __x->__parent_unsafe();
__x->__is_black_ = true;
__x = __x->__parent_unsafe();
__x->__is_black_ = false;
- __tree_left_rotate(__x);
+ _VSTD::__tree_left_rotate(__x);
break;
}
}
// __y will have at most one child.
// __y will be the initial hole in the tree (make the hole at a leaf)
_NodePtr __y = (__z->__left_ == nullptr || __z->__right_ == nullptr) ?
- __z : __tree_next(__z);
+ __z : _VSTD::__tree_next(__z);
// __x is __y's possibly null single child
_NodePtr __x = __y->__left_ != nullptr ? __y->__left_ : __y->__right_;
// __w is __x's possibly null uncle (will become __x's sibling)
// link __x to __y's parent, and find __w
if (__x != nullptr)
__x->__parent_ = __y->__parent_;
- if (__tree_is_left_child(__y))
+ if (_VSTD::__tree_is_left_child(__y))
{
__y->__parent_->__left_ = __x;
if (__y != __root)
{
// __z->__left_ != nulptr but __z->__right_ might == __x == nullptr
__y->__parent_ = __z->__parent_;
- if (__tree_is_left_child(__z))
+ if (_VSTD::__tree_is_left_child(__z))
__y->__parent_->__left_ = __y;
else
__y->__parent_unsafe()->__right_ = __y;
// with a non-null black child).
while (true)
{
- if (!__tree_is_left_child(__w)) // if x is left child
+ if (!_VSTD::__tree_is_left_child(__w)) // if x is left child
{
if (!__w->__is_black_)
{
__w->__is_black_ = true;
__w->__parent_unsafe()->__is_black_ = false;
- __tree_left_rotate(__w->__parent_unsafe());
+ _VSTD::__tree_left_rotate(__w->__parent_unsafe());
// __x is still valid
// reset __root only if necessary
if (__root == __w->__left_)
break;
}
// reset sibling, and it still can't be null
- __w = __tree_is_left_child(__x) ?
+ __w = _VSTD::__tree_is_left_child(__x) ?
__x->__parent_unsafe()->__right_ :
__x->__parent_->__left_;
// continue;
// __w left child is non-null and red
__w->__left_->__is_black_ = true;
__w->__is_black_ = false;
- __tree_right_rotate(__w);
+ _VSTD::__tree_right_rotate(__w);
// __w is known not to be root, so root hasn't changed
// reset sibling, and it still can't be null
__w = __w->__parent_unsafe();
__w->__is_black_ = __w->__parent_unsafe()->__is_black_;
__w->__parent_unsafe()->__is_black_ = true;
__w->__right_->__is_black_ = true;
- __tree_left_rotate(__w->__parent_unsafe());
+ _VSTD::__tree_left_rotate(__w->__parent_unsafe());
break;
}
}
{
__w->__is_black_ = true;
__w->__parent_unsafe()->__is_black_ = false;
- __tree_right_rotate(__w->__parent_unsafe());
+ _VSTD::__tree_right_rotate(__w->__parent_unsafe());
// __x is still valid
// reset __root only if necessary
if (__root == __w->__right_)
break;
}
// reset sibling, and it still can't be null
- __w = __tree_is_left_child(__x) ?
+ __w = _VSTD::__tree_is_left_child(__x) ?
__x->__parent_unsafe()->__right_ :
__x->__parent_->__left_;
// continue;
// __w right child is non-null and red
__w->__right_->__is_black_ = true;
__w->__is_black_ = false;
- __tree_left_rotate(__w);
+ _VSTD::__tree_left_rotate(__w);
// __w is known not to be root, so root hasn't changed
// reset sibling, and it still can't be null
__w = __w->__parent_unsafe();
__w->__is_black_ = __w->__parent_unsafe()->__is_black_;
__w->__parent_unsafe()->__is_black_ = true;
__w->__left_->__is_black_ = true;
- __tree_right_rotate(__w->__parent_unsafe());
+ _VSTD::__tree_right_rotate(__w->__parent_unsafe());
break;
}
}
// node traits
-#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
struct __is_tree_value_type_imp : false_type {};
template <class _Key, class _Value>
-struct __is_tree_value_type_imp<__value_type<_Key, _Value>> : true_type {};
+struct __is_tree_value_type_imp<__value_type<_Key, _Value> > : true_type {};
template <class ..._Args>
struct __is_tree_value_type : false_type {};
template <class _One>
struct __is_tree_value_type<_One> : __is_tree_value_type_imp<typename __uncvref<_One>::type> {};
-#endif
template <class _Tp>
struct __tree_key_value_types {
static __container_value_type* __get_ptr(__node_value_type& __n) {
return _VSTD::addressof(__n);
}
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
static __container_value_type&& __move(__node_value_type& __v) {
return _VSTD::move(__v);
}
-#endif
};
template <class _Key, class _Tp>
return _VSTD::addressof(__n.__get_value());
}
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
return __v.__move();
}
-#endif
};
template <class _VoidPtr>
};
template <class _VoidPtr>
-class __tree_node_base
+class _LIBCPP_STANDALONE_DEBUG __tree_node_base
: public __tree_node_base_types<_VoidPtr>::__end_node_type
{
typedef __tree_node_base_types<_VoidPtr> _NodeBaseTypes;
};
template <class _Tp, class _VoidPtr>
-class __tree_node
+class _LIBCPP_STANDALONE_DEBUG __tree_node
: public __tree_node_base<_VoidPtr>
{
public:
_LIBCPP_INLINE_VISIBILITY
__tree_iterator& operator++() {
__ptr_ = static_cast<__iter_pointer>(
- __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
+ _VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
return *this;
}
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
__tree_iterator& operator--() {
- __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>(
+ __ptr_ = static_cast<__iter_pointer>(_VSTD::__tree_prev_iter<__node_base_pointer>(
static_cast<__end_node_pointer>(__ptr_)));
return *this;
}
_LIBCPP_INLINE_VISIBILITY
__tree_const_iterator& operator++() {
__ptr_ = static_cast<__iter_pointer>(
- __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
+ _VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
return *this;
}
_LIBCPP_INLINE_VISIBILITY
__tree_const_iterator& operator--() {
- __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>(
+ __ptr_ = static_cast<__iter_pointer>(_VSTD::__tree_prev_iter<__node_base_pointer>(
static_cast<__end_node_pointer>(__ptr_)));
return *this;
}
template<class _Tp, class _Compare>
#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
+ _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
"the specified comparator type does not provide a viable const call operator")
#endif
int __diagnose_non_const_comparator();
void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
template <class _InputIterator>
void __assign_multi(_InputIterator __first, _InputIterator __last);
-#ifndef _LIBCPP_CXX03_LANG
__tree(__tree&& __t)
_NOEXCEPT_(
is_nothrow_move_constructible<__node_allocator>::value &&
__node_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<value_compare>::value &&
is_nothrow_move_assignable<__node_allocator>::value);
-#endif // _LIBCPP_CXX03_LANG
-
~__tree();
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
- {return std::min<size_type>(
+ {return _VSTD::min<size_type>(
__node_traits::max_size(__node_alloc()),
numeric_limits<difference_type >::max());}
_NOEXCEPT_(__is_nothrow_swappable<value_compare>::value);
#endif
-#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class ..._Args>
pair<iterator, bool>
__emplace_unique_key_args(_Key const&, _Args&&... __args);
template <class _Key, class ..._Args>
- iterator
+ pair<iterator, bool>
__emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...);
template <class... _Args>
>::type __emplace_hint_unique(const_iterator __p, _First&& __f, _Second&& __s) {
return __emplace_hint_unique_key_args(__p, __f,
_VSTD::forward<_First>(__f),
- _VSTD::forward<_Second>(__s));
+ _VSTD::forward<_Second>(__s)).first;
}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator
__emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_self_tag) {
- return __emplace_hint_unique_key_args(__p, __x, _VSTD::forward<_Pp>(__x));
+ return __emplace_hint_unique_key_args(__p, __x, _VSTD::forward<_Pp>(__x)).first;
}
template <class _Pp>
_LIBCPP_INLINE_VISIBILITY
iterator
__emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_first_tag) {
- return __emplace_hint_unique_key_args(__p, __x.first, _VSTD::forward<_Pp>(__x));
+ return __emplace_hint_unique_key_args(__p, __x.first, _VSTD::forward<_Pp>(__x)).first;
}
-#else
- template <class _Key, class _Args>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args& __args);
- template <class _Key, class _Args>
- _LIBCPP_INLINE_VISIBILITY
- iterator __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&);
-#endif
-
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> __insert_unique(const __container_value_type& __v) {
return __emplace_unique_key_args(_NodeTypes::__get_key(__v), __v);
_LIBCPP_INLINE_VISIBILITY
iterator __insert_unique(const_iterator __p, const __container_value_type& __v) {
- return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), __v);
+ return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), __v).first;
}
-#ifdef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
- iterator __insert_multi(const __container_value_type& __v);
- _LIBCPP_INLINE_VISIBILITY
- iterator __insert_multi(const_iterator __p, const __container_value_type& __v);
-#else
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> __insert_unique(__container_value_type&& __v) {
return __emplace_unique_key_args(_NodeTypes::__get_key(__v), _VSTD::move(__v));
_LIBCPP_INLINE_VISIBILITY
iterator __insert_unique(const_iterator __p, __container_value_type&& __v) {
- return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), _VSTD::move(__v));
+ return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), _VSTD::move(__v)).first;
}
template <class _Vp, class = typename enable_if<
return __emplace_hint_multi(__p, _VSTD::forward<_Vp>(__v));
}
-#endif // !_LIBCPP_CXX03_LANG
-
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> __node_assign_unique(const __container_value_type& __v, __node_pointer __dest);
__node_base_pointer&
__find_leaf(const_iterator __hint,
__parent_pointer& __parent, const key_type& __v);
- // FIXME: Make this function const qualified. Unfortunetly doing so
+ // FIXME: Make this function const qualified. Unfortunately doing so
// breaks existing code which uses non-const callable comparators.
template <class _Key>
__node_base_pointer&
__node_base_pointer& __dummy,
const _Key& __v);
-#ifndef _LIBCPP_CXX03_LANG
template <class ..._Args>
__node_holder __construct_node(_Args&& ...__args);
-#else
- __node_holder __construct_node(const __container_value_type& __v);
-#endif
void destroy(__node_pointer __nd) _NOEXCEPT;
{
if (__cache->__parent_ == nullptr)
return nullptr;
- if (__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))
+ if (_VSTD::__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))
{
__cache->__parent_->__left_ = nullptr;
__cache = static_cast<__node_pointer>(__cache->__parent_);
if (__cache->__right_ == nullptr)
return __cache;
- return static_cast<__node_pointer>(__tree_leaf(__cache->__right_));
+ return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__right_));
}
// __cache is right child
__cache->__parent_unsafe()->__right_ = nullptr;
__cache = static_cast<__node_pointer>(__cache->__parent_);
if (__cache->__left_ == nullptr)
return __cache;
- return static_cast<__node_pointer>(__tree_leaf(__cache->__left_));
+ return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__left_));
}
template <class _Tp, class _Compare, class _Allocator>
__begin_node() = __end_node();
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
_NOEXCEPT_(
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::~__tree()
{
using _VSTD::swap;
swap(__begin_node_, __t.__begin_node_);
swap(__pair1_.first(), __t.__pair1_.first());
- __swap_allocator(__node_alloc(), __t.__node_alloc());
+ _VSTD::__swap_allocator(__node_alloc(), __t.__node_alloc());
__pair3_.swap(__t.__pair3_);
if (size() == 0)
__begin_node() = __end_node();
__child = __new_node;
if (__begin_node()->__left_ != nullptr)
__begin_node() = static_cast<__iter_pointer>(__begin_node()->__left_);
- __tree_balance_after_insert(__end_node()->__left_, __child);
+ _VSTD::__tree_balance_after_insert(__end_node()->__left_, __child);
++size();
}
-#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Compare, class _Allocator>
template <class _Key, class... _Args>
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)
-#else
-template <class _Tp, class _Compare, class _Allocator>
-template <class _Key, class _Args>
-pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
-__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args& __args)
-#endif
{
__parent_pointer __parent;
__node_base_pointer& __child = __find_equal(__parent, __k);
bool __inserted = false;
if (__child == nullptr)
{
-#ifndef _LIBCPP_CXX03_LANG
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
-#else
- __node_holder __h = __construct_node(__args);
-#endif
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
__r = __h.release();
__inserted = true;
return pair<iterator, bool>(iterator(__r), __inserted);
}
-
-#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Compare, class _Allocator>
template <class _Key, class... _Args>
-typename __tree<_Tp, _Compare, _Allocator>::iterator
+pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
const_iterator __p, _Key const& __k, _Args&&... __args)
-#else
-template <class _Tp, class _Compare, class _Allocator>
-template <class _Key, class _Args>
-typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
- const_iterator __p, _Key const& __k, _Args& __args)
-#endif
{
__parent_pointer __parent;
__node_base_pointer __dummy;
__node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __k);
__node_pointer __r = static_cast<__node_pointer>(__child);
+ bool __inserted = false;
if (__child == nullptr)
{
-#ifndef _LIBCPP_CXX03_LANG
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
-#else
- __node_holder __h = __construct_node(__args);
-#endif
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
__r = __h.release();
+ __inserted = true;
}
- return iterator(__r);
+ return pair<iterator, bool>(iterator(__r), __inserted);
}
-
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Compare, class _Allocator>
template <class ..._Args>
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
return iterator(static_cast<__node_pointer>(__h.release()));
}
-
-#else // _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Compare, class _Allocator>
-typename __tree<_Tp, _Compare, _Allocator>::__node_holder
-__tree<_Tp, _Compare, _Allocator>::__construct_node(const __container_value_type& __v)
-{
- __node_allocator& __na = __node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
- __h.get_deleter().__value_constructed = true;
- return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-#ifdef _LIBCPP_CXX03_LANG
-template <class _Tp, class _Compare, class _Allocator>
-typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__insert_multi(const __container_value_type& __v)
-{
- __parent_pointer __parent;
- __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__v));
- __node_holder __h = __construct_node(__v);
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
- return iterator(__h.release());
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const __container_value_type& __v)
-{
- __parent_pointer __parent;
- __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__v));
- __node_holder __h = __construct_node(__v);
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
- return iterator(__h.release());
-}
-#endif
-
template <class _Tp, class _Compare, class _Allocator>
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
__tree<_Tp, _Compare, _Allocator>::__node_assign_unique(const __container_value_type& __v, __node_pointer __nd)
if (__begin_node() == __ptr)
__begin_node() = __r.__ptr_;
--size();
- __tree_remove(__end_node()->__left_,
- static_cast<__node_base_pointer>(__ptr));
+ _VSTD::__tree_remove(__end_node()->__left_,
+ static_cast<__node_base_pointer>(__ptr));
return __r;
}
}
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER > 14
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::iterator
return _Pp(iterator(__rt),
iterator(
__rt->__right_ != nullptr ?
- static_cast<__iter_pointer>(__tree_min(__rt->__right_))
+ static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_))
: __result));
}
return _Pp(iterator(__result), iterator(__result));
return _Pp(const_iterator(__rt),
const_iterator(
__rt->__right_ != nullptr ?
- static_cast<__iter_pointer>(__tree_min(__rt->__right_))
+ static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_))
: __result));
}
return _Pp(const_iterator(__result), const_iterator(__result));
__begin_node() = static_cast<__iter_pointer>(__np->__parent_);
}
--size();
- __tree_remove(__end_node()->__left_,
- static_cast<__node_base_pointer>(__np));
+ _VSTD::__tree_remove(__end_node()->__left_,
+ static_cast<__node_base_pointer>(__np));
return __node_holder(__np, _Dp(__node_alloc(), true));
}
_LIBCPP_POP_MACROS
-#endif // _LIBCPP___TREE
+#endif // _LIBCPP___TREE
} // namespace detail
-#endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+#endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
#if __has_builtin(__make_integer_seq)
template <size_t _Ep, size_t _Sp>
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP___TUPLE
+#endif // _LIBCPP___TUPLE
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TYPE_TRAITS_DECAY_COPY_H
+#define _LIBCPP___TYPE_TRAITS_DECAY_COPY_H
+
+#include <__config>
+#include <__utility/forward.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY typename decay<_Tp>::type __decay_copy(_Tp&& __t)
+#if _LIBCPP_STD_VER > 17
+ noexcept(is_nothrow_convertible_v<_Tp, remove_reference_t<_Tp> >)
+#endif
+{
+ return _VSTD::forward<_Tp>(__t);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___TYPE_TRAITS_DECAY_COPY_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_AS_CONST_H
+#define _LIBCPP___UTILITY_AS_CONST_H
+
+#include <__config>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
+
+template <class _Tp>
+void as_const(const _Tp&&) = delete;
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_AS_CONST_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_CMP_H
+#define _LIBCPP___UTILITY_CMP_H
+
+#include <__config>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <limits>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+template<class _Tp, class... _Up>
+struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {};
+
+template<class _Tp>
+concept __is_safe_integral_cmp = is_integral_v<_Tp> &&
+ !_IsSameAsAny<_Tp, bool, char,
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ char8_t,
+#endif
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+ char16_t, char32_t,
+#endif
+ wchar_t>::value;
+
+template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool cmp_equal(_Tp __t, _Up __u) noexcept
+{
+ if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
+ return __t == __u;
+ else if constexpr (is_signed_v<_Tp>)
+ return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u;
+ else
+ return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u);
+}
+
+template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool cmp_not_equal(_Tp __t, _Up __u) noexcept
+{
+ return !_VSTD::cmp_equal(__t, __u);
+}
+
+template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool cmp_less(_Tp __t, _Up __u) noexcept
+{
+ if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
+ return __t < __u;
+ else if constexpr (is_signed_v<_Tp>)
+ return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u;
+ else
+ return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u);
+}
+
+template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool cmp_greater(_Tp __t, _Up __u) noexcept
+{
+ return _VSTD::cmp_less(__u, __t);
+}
+
+template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool cmp_less_equal(_Tp __t, _Up __u) noexcept
+{
+ return !_VSTD::cmp_greater(__t, __u);
+}
+
+template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool cmp_greater_equal(_Tp __t, _Up __u) noexcept
+{
+ return !_VSTD::cmp_less(__t, __u);
+}
+
+template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool in_range(_Up __u) noexcept
+{
+ return _VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) &&
+ _VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min());
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_CMP_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_DECLVAL_H
+#define _LIBCPP___UTILITY_DECLVAL_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Suppress deprecation notice for volatile-qualified return type resulting
+// from volatile-qualified types _Tp.
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+template <class _Tp>
+_Tp&& __declval(int);
+template <class _Tp>
+_Tp __declval(long);
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
+template <class _Tp>
+decltype(__declval<_Tp>(0)) declval() _NOEXCEPT;
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_DECLVAL_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_EXCHANGE_H
+#define _LIBCPP___UTILITY_EXCHANGE_H
+
+#include <__config>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 11
+template<class _T1, class _T2 = _T1>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_T1 exchange(_T1& __obj, _T2 && __new_value)
+{
+ _T1 __old_value = _VSTD::move(__obj);
+ __obj = _VSTD::forward<_T2>(__new_value);
+ return __old_value;
+}
+#endif // _LIBCPP_STD_VER > 11
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_EXCHANGE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_FORWARD_H
+#define _LIBCPP___UTILITY_FORWARD_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&&
+forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT {
+ return static_cast<_Tp&&>(__t);
+}
+
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&&
+forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT {
+ static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue");
+ return static_cast<_Tp&&>(__t);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_FORWARD_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_IN_PLACE_H
+#define _LIBCPP___UTILITY_IN_PLACE_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+struct _LIBCPP_TYPE_VIS in_place_t {
+ explicit in_place_t() = default;
+};
+_LIBCPP_INLINE_VAR constexpr in_place_t in_place{};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS in_place_type_t {
+ explicit in_place_type_t() = default;
+};
+template <class _Tp>
+_LIBCPP_INLINE_VAR constexpr in_place_type_t<_Tp> in_place_type{};
+
+template <size_t _Idx>
+struct _LIBCPP_TEMPLATE_VIS in_place_index_t {
+ explicit in_place_index_t() = default;
+};
+template <size_t _Idx>
+_LIBCPP_INLINE_VAR constexpr in_place_index_t<_Idx> in_place_index{};
+
+template <class _Tp> struct __is_inplace_type_imp : false_type {};
+template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
+
+template <class _Tp>
+using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>;
+
+template <class _Tp> struct __is_inplace_index_imp : false_type {};
+template <size_t _Idx> struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {};
+
+template <class _Tp>
+using __is_inplace_index = __is_inplace_index_imp<__uncvref_t<_Tp>>;
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_IN_PLACE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_INTEGER_SEQUENCE_H
+#define _LIBCPP___UTILITY_INTEGER_SEQUENCE_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 11
+
+template<class _Tp, _Tp... _Ip>
+struct _LIBCPP_TEMPLATE_VIS integer_sequence
+{
+ typedef _Tp value_type;
+ static_assert( is_integral<_Tp>::value,
+ "std::integer_sequence can only be instantiated with an integral type" );
+ static
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ size_t
+ size() noexcept { return sizeof...(_Ip); }
+};
+
+template<size_t... _Ip>
+ using index_sequence = integer_sequence<size_t, _Ip...>;
+
+#if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+
+template <class _Tp, _Tp _Ep>
+using __make_integer_sequence _LIBCPP_NODEBUG_TYPE = __make_integer_seq<integer_sequence, _Tp, _Ep>;
+
+#else
+
+template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked _LIBCPP_NODEBUG_TYPE =
+ typename __detail::__make<_Np>::type::template __convert<integer_sequence, _Tp>;
+
+template <class _Tp, _Tp _Ep>
+struct __make_integer_sequence_checked
+{
+ static_assert(is_integral<_Tp>::value,
+ "std::make_integer_sequence can only be instantiated with an integral type" );
+ static_assert(0 <= _Ep, "std::make_integer_sequence must have a non-negative sequence length");
+ // Workaround GCC bug by preventing bad installations when 0 <= _Ep
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68929
+ typedef _LIBCPP_NODEBUG_TYPE __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type;
+};
+
+template <class _Tp, _Tp _Ep>
+using __make_integer_sequence _LIBCPP_NODEBUG_TYPE = typename __make_integer_sequence_checked<_Tp, _Ep>::type;
+
+#endif
+
+template<class _Tp, _Tp _Np>
+ using make_integer_sequence = __make_integer_sequence<_Tp, _Np>;
+
+template<size_t _Np>
+ using make_index_sequence = make_integer_sequence<size_t, _Np>;
+
+template<class... _Tp>
+ using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
+
+#endif // _LIBCPP_STD_VER > 11
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_INTEGER_SEQUENCE_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_MOVE_H
+#define _LIBCPP___UTILITY_MOVE_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename remove_reference<_Tp>::type&&
+move(_Tp&& __t) _NOEXCEPT {
+ typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
+ return static_cast<_Up&&>(__t);
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp>
+using __move_if_noexcept_result_t =
+ typename conditional<!is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value, const _Tp&,
+ _Tp&&>::type;
+#else // _LIBCPP_CXX03_LANG
+template <class _Tp>
+using __move_if_noexcept_result_t = const _Tp&;
+#endif
+
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 __move_if_noexcept_result_t<_Tp>
+move_if_noexcept(_Tp& __x) _NOEXCEPT {
+ return _VSTD::move(__x);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_MOVE_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_PAIR_H
+#define _LIBCPP___UTILITY_PAIR_H
+
+#include <__config>
+#include <__functional/unwrap_ref.h>
+#include <__tuple>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <__utility/piecewise_construct.h>
+#include <cstddef>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+
+#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+template <class, class>
+struct __non_trivially_copyable_base {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ __non_trivially_copyable_base() _NOEXCEPT {}
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
+};
+#endif
+
+template <class _T1, class _T2>
+struct _LIBCPP_TEMPLATE_VIS pair
+#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+: private __non_trivially_copyable_base<_T1, _T2>
+#endif
+{
+ typedef _T1 first_type;
+ typedef _T2 second_type;
+
+ _T1 first;
+ _T2 second;
+
+#if !defined(_LIBCPP_CXX03_LANG)
+ pair(pair const&) = default;
+ pair(pair&&) = default;
+#else
+ // Use the implicitly declared copy constructor in C++03
+#endif
+
+#ifdef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ pair() : first(), second() {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
+
+ template <class _U1, class _U2>
+ _LIBCPP_INLINE_VISIBILITY
+ pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ pair& operator=(pair const& __p) {
+ first = __p.first;
+ second = __p.second;
+ return *this;
+ }
+#else
+ template <bool _Val>
+ using _EnableB _LIBCPP_NODEBUG_TYPE = typename enable_if<_Val, bool>::type;
+
+ struct _CheckArgs {
+ template <int&...>
+ static constexpr bool __enable_explicit_default() {
+ return is_default_constructible<_T1>::value
+ && is_default_constructible<_T2>::value
+ && !__enable_implicit_default<>();
+ }
+
+ template <int&...>
+ static constexpr bool __enable_implicit_default() {
+ return __is_implicitly_default_constructible<_T1>::value
+ && __is_implicitly_default_constructible<_T2>::value;
+ }
+
+ template <class _U1, class _U2>
+ static constexpr bool __enable_explicit() {
+ return is_constructible<first_type, _U1>::value
+ && is_constructible<second_type, _U2>::value
+ && (!is_convertible<_U1, first_type>::value
+ || !is_convertible<_U2, second_type>::value);
+ }
+
+ template <class _U1, class _U2>
+ static constexpr bool __enable_implicit() {
+ return is_constructible<first_type, _U1>::value
+ && is_constructible<second_type, _U2>::value
+ && is_convertible<_U1, first_type>::value
+ && is_convertible<_U2, second_type>::value;
+ }
+ };
+
+ template <bool _MaybeEnable>
+ using _CheckArgsDep _LIBCPP_NODEBUG_TYPE = typename conditional<
+ _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
+
+ struct _CheckTupleLikeConstructor {
+ template <class _Tuple>
+ static constexpr bool __enable_implicit() {
+ return __tuple_convertible<_Tuple, pair>::value;
+ }
+
+ template <class _Tuple>
+ static constexpr bool __enable_explicit() {
+ return __tuple_constructible<_Tuple, pair>::value
+ && !__tuple_convertible<_Tuple, pair>::value;
+ }
+
+ template <class _Tuple>
+ static constexpr bool __enable_assign() {
+ return __tuple_assignable<_Tuple, pair>::value;
+ }
+ };
+
+ template <class _Tuple>
+ using _CheckTLC _LIBCPP_NODEBUG_TYPE = typename conditional<
+ __tuple_like_with_size<_Tuple, 2>::value
+ && !is_same<typename decay<_Tuple>::type, pair>::value,
+ _CheckTupleLikeConstructor,
+ __check_tuple_constructor_fail
+ >::type;
+
+ template<bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::__enable_explicit_default()
+ > = false>
+ explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
+ is_nothrow_default_constructible<second_type>::value)
+ : first(), second() {}
+
+ template<bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::__enable_implicit_default()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
+ is_nothrow_default_constructible<second_type>::value)
+ : first(), second() {}
+
+ template <bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_T1 const& __t1, _T2 const& __t2)
+ _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
+ is_nothrow_copy_constructible<second_type>::value)
+ : first(__t1), second(__t2) {}
+
+ template<bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_T1 const& __t1, _T2 const& __t2)
+ _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
+ is_nothrow_copy_constructible<second_type>::value)
+ : first(__t1), second(__t2) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_U1&& __u1, _U2&& __u2)
+ _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
+ is_nothrow_constructible<second_type, _U2>::value))
+ : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_U1&& __u1, _U2&& __u2)
+ _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
+ is_nothrow_constructible<second_type, _U2>::value))
+ : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(pair<_U1, _U2> const& __p)
+ _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
+ is_nothrow_constructible<second_type, _U2 const&>::value))
+ : first(__p.first), second(__p.second) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(pair<_U1, _U2> const& __p)
+ _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
+ is_nothrow_constructible<second_type, _U2 const&>::value))
+ : first(__p.first), second(__p.second) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(pair<_U1, _U2>&&__p)
+ _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
+ is_nothrow_constructible<second_type, _U2&&>::value))
+ : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(pair<_U1, _U2>&& __p)
+ _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
+ is_nothrow_constructible<second_type, _U2&&>::value))
+ : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+
+ template<class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_explicit<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_Tuple&& __p)
+ : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
+ second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+
+ template<class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_implicit<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_Tuple&& __p)
+ : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
+ second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+
+ template <class... _Args1, class... _Args2>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ pair(piecewise_construct_t __pc,
+ tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
+ _NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value &&
+ is_nothrow_constructible<second_type, _Args2...>::value))
+ : pair(__pc, __first_args, __second_args,
+ typename __make_tuple_indices<sizeof...(_Args1)>::type(),
+ typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ pair& operator=(typename conditional<
+ is_copy_assignable<first_type>::value &&
+ is_copy_assignable<second_type>::value,
+ pair, __nat>::type const& __p)
+ _NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value &&
+ is_nothrow_copy_assignable<second_type>::value)
+ {
+ first = __p.first;
+ second = __p.second;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ pair& operator=(typename conditional<
+ is_move_assignable<first_type>::value &&
+ is_move_assignable<second_type>::value,
+ pair, __nat>::type&& __p)
+ _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
+ is_nothrow_move_assignable<second_type>::value)
+ {
+ first = _VSTD::forward<first_type>(__p.first);
+ second = _VSTD::forward<second_type>(__p.second);
+ return *this;
+ }
+
+ template <class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ pair& operator=(_Tuple&& __p) {
+ first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
+ second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
+ return *this;
+ }
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ void
+ swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
+ __is_nothrow_swappable<second_type>::value)
+ {
+ using _VSTD::swap;
+ swap(first, __p.first);
+ swap(second, __p.second);
+ }
+private:
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ pair(piecewise_construct_t,
+ tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
+ __tuple_indices<_I1...>, __tuple_indices<_I2...>);
+#endif
+};
+
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class _T1, class _T2>
+pair(_T1, _T2) -> pair<_T1, _T2>;
+#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+bool
+operator==(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+{
+ return __x.first == __y.first && __x.second == __y.second;
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+bool
+operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+{
+ return !(__x == __y);
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+bool
+operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+{
+ return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second);
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+bool
+operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+{
+ return __y < __x;
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+bool
+operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+{
+ return !(__x < __y);
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+bool
+operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+{
+ return !(__y < __x);
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+typename enable_if
+<
+ __is_swappable<_T1>::value &&
+ __is_swappable<_T2>::value,
+ void
+>::type
+swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
+ _NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
+ __is_nothrow_swappable<_T2>::value))
+{
+ __x.swap(__y);
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
+make_pair(_T1&& __t1, _T2&& __t2)
+{
+ return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
+ (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
+}
+
+#else // _LIBCPP_CXX03_LANG
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+pair<_T1,_T2>
+make_pair(_T1 __x, _T2 __y)
+{
+ return pair<_T1, _T2>(__x, __y);
+}
+
+#endif // _LIBCPP_CXX03_LANG
+
+template <class _T1, class _T2>
+ struct _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> >
+ : public integral_constant<size_t, 2> {};
+
+template <size_t _Ip, class _T1, class _T2>
+struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> >
+{
+ static_assert(_Ip < 2, "Index out of bounds in std::tuple_element<std::pair<T1, T2>>");
+};
+
+template <class _T1, class _T2>
+struct _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> >
+{
+ typedef _LIBCPP_NODEBUG_TYPE _T1 type;
+};
+
+template <class _T1, class _T2>
+struct _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> >
+{
+ typedef _LIBCPP_NODEBUG_TYPE _T2 type;
+};
+
+template <size_t _Ip> struct __get_pair;
+
+template <>
+struct __get_pair<0>
+{
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ _T1&
+ get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
+
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const _T1&
+ get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ _T1&&
+ get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
+
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const _T1&&
+ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
+#endif // _LIBCPP_CXX03_LANG
+};
+
+template <>
+struct __get_pair<1>
+{
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ _T2&
+ get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
+
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const _T2&
+ get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ _T2&&
+ get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
+
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const _T2&&
+ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
+#endif // _LIBCPP_CXX03_LANG
+};
+
+template <size_t _Ip, class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+typename tuple_element<_Ip, pair<_T1, _T2> >::type&
+get(pair<_T1, _T2>& __p) _NOEXCEPT
+{
+ return __get_pair<_Ip>::get(__p);
+}
+
+template <size_t _Ip, class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
+get(const pair<_T1, _T2>& __p) _NOEXCEPT
+{
+ return __get_pair<_Ip>::get(__p);
+}
+
+#ifndef _LIBCPP_CXX03_LANG
+template <size_t _Ip, class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
+get(pair<_T1, _T2>&& __p) _NOEXCEPT
+{
+ return __get_pair<_Ip>::get(_VSTD::move(__p));
+}
+
+template <size_t _Ip, class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
+get(const pair<_T1, _T2>&& __p) _NOEXCEPT
+{
+ return __get_pair<_Ip>::get(_VSTD::move(__p));
+}
+#endif // _LIBCPP_CXX03_LANG
+
+#if _LIBCPP_STD_VER > 11
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 & get(pair<_T1, _T2>& __p) _NOEXCEPT
+{
+ return __get_pair<0>::get(__p);
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 const & get(pair<_T1, _T2> const& __p) _NOEXCEPT
+{
+ return __get_pair<0>::get(__p);
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 && get(pair<_T1, _T2>&& __p) _NOEXCEPT
+{
+ return __get_pair<0>::get(_VSTD::move(__p));
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 const && get(pair<_T1, _T2> const&& __p) _NOEXCEPT
+{
+ return __get_pair<0>::get(_VSTD::move(__p));
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 & get(pair<_T2, _T1>& __p) _NOEXCEPT
+{
+ return __get_pair<1>::get(__p);
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 const & get(pair<_T2, _T1> const& __p) _NOEXCEPT
+{
+ return __get_pair<1>::get(__p);
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 && get(pair<_T2, _T1>&& __p) _NOEXCEPT
+{
+ return __get_pair<1>::get(_VSTD::move(__p));
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 const && get(pair<_T2, _T1> const&& __p) _NOEXCEPT
+{
+ return __get_pair<1>::get(_VSTD::move(__p));
+}
+
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_PAIR_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
+#define _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
+extern _LIBCPP_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
+#else
+/* _LIBCPP_INLINE_VAR */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_REL_OPS_H
+#define _LIBCPP___UTILITY_REL_OPS_H
+
+#include <__config>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace rel_ops
+{
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const _Tp& __x, const _Tp& __y)
+{
+ return !(__x == __y);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator> (const _Tp& __x, const _Tp& __y)
+{
+ return __y < __x;
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<=(const _Tp& __x, const _Tp& __y)
+{
+ return !(__y < __x);
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>=(const _Tp& __x, const _Tp& __y)
+{
+ return !(__x < __y);
+}
+
+} // rel_ops
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_REL_OPS_H
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_SWAP_H
+#define _LIBCPP___UTILITY_SWAP_H
+
+#include <__config>
+#include <__utility/declval.h>
+#include <__utility/move.h>
+#include <type_traits>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp>
+using __swap_result_t = typename enable_if<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>::type;
+#else
+template <class>
+using __swap_result_t = void;
+#endif
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_AFTER_CXX17 swap(_Tp& __x, _Tp& __y)
+ _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value&& is_nothrow_move_assignable<_Tp>::value) {
+ _Tp __t(_VSTD::move(__x));
+ __x = _VSTD::move(__y);
+ __y = _VSTD::move(__t);
+}
+
+template <class _Tp, size_t _Np>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if<__is_swappable<_Tp>::value>::type
+swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
+ for (size_t __i = 0; __i != _Np; ++__i) {
+ swap(__a[__i], __b[__i]);
+ }
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_SWAP_H
--- /dev/null
+// -*- C++ -*-
+//===----------------- __utility/to_underlying.h --------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_TO_UNDERLYING_H
+#define _LIBCPP___UTILITY_TO_UNDERLYING_H
+
+#include <__config>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr typename underlying_type<_Tp>::type
+__to_underlying(_Tp __val) noexcept {
+ return static_cast<typename underlying_type<_Tp>::type>(__val);
+}
+#endif // !_LIBCPP_CXX03_LANG
+
+#if _LIBCPP_STD_VER > 20
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY constexpr underlying_type_t<_Tp>
+to_underlying(_Tp __val) noexcept {
+ return _VSTD::__to_underlying(__val);
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___UTILITY_TO_UNDERLYING_H
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___VARIANT_MONOSTATE_H
+#define _LIBCPP___VARIANT_MONOSTATE_H
+
+#include <__config>
+#include <__functional/hash.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+struct _LIBCPP_TEMPLATE_VIS monostate {};
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<(monostate, monostate) noexcept { return false; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>(monostate, monostate) noexcept { return false; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<=(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>=(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator==(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator!=(monostate, monostate) noexcept { return false; }
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
+ using argument_type = monostate;
+ using result_type = size_t;
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ result_type operator()(const argument_type&) const _NOEXCEPT {
+ return 66740831; // return a fundamentally attractive random value.
+ }
+};
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___VARIANT_MONOSTATE_H
find_if(InputIterator first, InputIterator last, Predicate pred);
template<class InputIterator, class Predicate>
- InputIterator // constexpr in C++20
+ constexpr InputIterator // constexpr in C++20
find_if_not(InputIterator first, InputIterator last, Predicate pred);
template <class ForwardIterator1, class ForwardIterator2>
- ForwardIterator1 // constexpr in C++20
+ constexpr ForwardIterator1 // constexpr in C++20
find_end(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
- ForwardIterator1 // constexpr in C++20
+ constexpr ForwardIterator1 // constexpr in C++20
find_end(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);
BidirectionalIterator2 result);
template <class ForwardIterator1, class ForwardIterator2>
- ForwardIterator2
+ constexpr ForwardIterator2 // constexpr in C++20
swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2);
template <class ForwardIterator1, class ForwardIterator2>
- void
+ constexpr void // constexpr in C++20
iter_swap(ForwardIterator1 a, ForwardIterator2 b);
template <class InputIterator, class OutputIterator, class UnaryOperation>
remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred);
template <class ForwardIterator>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
unique(ForwardIterator first, ForwardIterator last);
template <class ForwardIterator, class BinaryPredicate>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred);
template <class InputIterator, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
unique_copy(InputIterator first, InputIterator last, OutputIterator result);
template <class InputIterator, class OutputIterator, class BinaryPredicate>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred);
template <class BidirectionalIterator>
- void
+ constexpr void // constexpr in C++20
reverse(BidirectionalIterator first, BidirectionalIterator last);
template <class BidirectionalIterator, class OutputIterator>
reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result);
template <class ForwardIterator>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last);
template <class ForwardIterator, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result);
template <class RandomAccessIterator>
void shuffle(RandomAccessIterator first, RandomAccessIterator last,
UniformRandomNumberGenerator&& g);
+template<class ForwardIterator>
+ constexpr ForwardIterator
+ shift_left(ForwardIterator first, ForwardIterator last,
+ typename iterator_traits<ForwardIterator>::difference_type n); // C++20
+
+template<class ForwardIterator>
+ constexpr ForwardIterator
+ shift_right(ForwardIterator first, ForwardIterator last,
+ typename iterator_traits<ForwardIterator>::difference_type n); // C++20
+
template <class InputIterator, class Predicate>
constexpr bool // constexpr in C++20
is_partitioned(InputIterator first, InputIterator last, Predicate pred);
template <class ForwardIterator, class Predicate>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
partition(ForwardIterator first, ForwardIterator last, Predicate pred);
template <class InputIterator, class OutputIterator1,
is_sorted(ForwardIterator first, ForwardIterator last);
template <class ForwardIterator, class Compare>
- bool
+ constexpr bool // constexpr in C++20
is_sorted(ForwardIterator first, ForwardIterator last, Compare comp);
template<class ForwardIterator>
is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp);
template <class RandomAccessIterator>
- void
+ constexpr void // constexpr in C++20
sort(RandomAccessIterator first, RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
- void
+ constexpr void // constexpr in C++20
sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
template <class RandomAccessIterator>
stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
template <class RandomAccessIterator>
- void
+ constexpr void // constexpr in C++20
partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
- void
+ constexpr void // constexpr in C++20
partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp);
template <class InputIterator, class RandomAccessIterator>
- RandomAccessIterator
+ constexpr RandomAccessIterator // constexpr in C++20
partial_sort_copy(InputIterator first, InputIterator last,
RandomAccessIterator result_first, RandomAccessIterator result_last);
template <class InputIterator, class RandomAccessIterator, class Compare>
- RandomAccessIterator
+ constexpr RandomAccessIterator // constexpr in C++20
partial_sort_copy(InputIterator first, InputIterator last,
RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp);
template <class RandomAccessIterator>
- void
+ constexpr void // constexpr in C++20
nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
- void
+ constexpr void // constexpr in C++20
nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp);
template <class ForwardIterator, class T>
binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);
template <class InputIterator1, class InputIterator2, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
merge(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result);
template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
merge(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp);
template <class InputIterator1, class InputIterator2, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
set_union(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result);
template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
set_union(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
template <class InputIterator1, class InputIterator2, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
set_difference(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result);
template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
set_difference(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
template <class InputIterator1, class InputIterator2, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result);
template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
template <class RandomAccessIterator>
- void
+ constexpr void // constexpr in C++20
push_heap(RandomAccessIterator first, RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
- void
+ constexpr void // constexpr in C++20
push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
template <class RandomAccessIterator>
- void
+ constexpr void // constexpr in C++20
pop_heap(RandomAccessIterator first, RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
- void
+ constexpr void // constexpr in C++20
pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
template <class RandomAccessIterator>
- void
+ constexpr void // constexpr in C++20
make_heap(RandomAccessIterator first, RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
- void
+ constexpr void // constexpr in C++20
make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
template <class RandomAccessIterator>
- void
+ constexpr void // constexpr in C++20
sort_heap(RandomAccessIterator first, RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
- void
+ constexpr void // constexpr in C++20
sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
template <class RandomAccessIterator>
is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp);
template <class ForwardIterator>
- ForwardIterator
- min_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14
+ constexpr ForwardIterator // constexpr in C++14
+ min_element(ForwardIterator first, ForwardIterator last);
template <class ForwardIterator, class Compare>
- ForwardIterator
- min_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14
+ constexpr ForwardIterator // constexpr in C++14
+ min_element(ForwardIterator first, ForwardIterator last, Compare comp);
template <class T>
- const T&
- min(const T& a, const T& b); // constexpr in C++14
+ constexpr const T& // constexpr in C++14
+ min(const T& a, const T& b);
template <class T, class Compare>
- const T&
- min(const T& a, const T& b, Compare comp); // constexpr in C++14
+ constexpr const T& // constexpr in C++14
+ min(const T& a, const T& b, Compare comp);
template<class T>
- T
- min(initializer_list<T> t); // constexpr in C++14
+ constexpr T // constexpr in C++14
+ min(initializer_list<T> t);
template<class T, class Compare>
- T
- min(initializer_list<T> t, Compare comp); // constexpr in C++14
+ constexpr T // constexpr in C++14
+ min(initializer_list<T> t, Compare comp);
template<class T>
- constexpr const T& clamp( const T& v, const T& lo, const T& hi ); // C++17
+ constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17
template<class T, class Compare>
- constexpr const T& clamp( const T& v, const T& lo, const T& hi, Compare comp ); // C++17
+ constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17
template <class ForwardIterator>
- ForwardIterator
- max_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14
+ constexpr ForwardIterator // constexpr in C++14
+ max_element(ForwardIterator first, ForwardIterator last);
template <class ForwardIterator, class Compare>
- ForwardIterator
- max_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14
+ constexpr ForwardIterator // constexpr in C++14
+ max_element(ForwardIterator first, ForwardIterator last, Compare comp);
template <class T>
- const T&
- max(const T& a, const T& b); // constexpr in C++14
+ constexpr const T& // constexpr in C++14
+ max(const T& a, const T& b);
template <class T, class Compare>
- const T&
- max(const T& a, const T& b, Compare comp); // constexpr in C++14
+ constexpr const T& // constexpr in C++14
+ max(const T& a, const T& b, Compare comp);
template<class T>
- T
- max(initializer_list<T> t); // constexpr in C++14
+ constexpr T // constexpr in C++14
+ max(initializer_list<T> t);
template<class T, class Compare>
- T
- max(initializer_list<T> t, Compare comp); // constexpr in C++14
+ constexpr T // constexpr in C++14
+ max(initializer_list<T> t, Compare comp);
template<class ForwardIterator>
- pair<ForwardIterator, ForwardIterator>
- minmax_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14
+ constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14
+ minmax_element(ForwardIterator first, ForwardIterator last);
template<class ForwardIterator, class Compare>
- pair<ForwardIterator, ForwardIterator>
- minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14
+ constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14
+ minmax_element(ForwardIterator first, ForwardIterator last, Compare comp);
template<class T>
- pair<const T&, const T&>
- minmax(const T& a, const T& b); // constexpr in C++14
+ constexpr pair<const T&, const T&> // constexpr in C++14
+ minmax(const T& a, const T& b);
template<class T, class Compare>
- pair<const T&, const T&>
- minmax(const T& a, const T& b, Compare comp); // constexpr in C++14
+ constexpr pair<const T&, const T&> // constexpr in C++14
+ minmax(const T& a, const T& b, Compare comp);
template<class T>
- pair<T, T>
- minmax(initializer_list<T> t); // constexpr in C++14
+ constexpr pair<T, T> // constexpr in C++14
+ minmax(initializer_list<T> t);
template<class T, class Compare>
- pair<T, T>
- minmax(initializer_list<T> t, Compare comp); // constexpr in C++14
+ constexpr pair<T, T> // constexpr in C++14
+ minmax(initializer_list<T> t, Compare comp);
template <class InputIterator1, class InputIterator2>
constexpr bool // constexpr in C++20
InputIterator2 first2, InputIterator2 last2, Compare comp);
template <class BidirectionalIterator>
- bool
+ constexpr bool // constexpr in C++20
next_permutation(BidirectionalIterator first, BidirectionalIterator last);
template <class BidirectionalIterator, class Compare>
- bool
+ constexpr bool // constexpr in C++20
next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);
template <class BidirectionalIterator>
- bool
+ constexpr bool // constexpr in C++20
prev_permutation(BidirectionalIterator first, BidirectionalIterator last);
template <class BidirectionalIterator, class Compare>
- bool
+ constexpr bool // constexpr in C++20
prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);
} // std
*/
#include <__config>
-#include <initializer_list>
-#include <type_traits>
+#include <__debug>
+#include <__bits> // __libcpp_clz
+#include <cstddef>
#include <cstring>
+#include <functional>
+#include <initializer_list>
#include <utility> // needed to provide swap_ranges.
#include <memory>
-#include <functional>
#include <iterator>
-#include <cstddef>
-#include <bit>
+#include <memory>
+#include <type_traits>
+#include <utility> // swap_ranges
#include <version>
-#include <__debug>
+#include <__algorithm/adjacent_find.h>
+#include <__algorithm/all_of.h>
+#include <__algorithm/any_of.h>
+#include <__algorithm/binary_search.h>
+#include <__algorithm/clamp.h>
+#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
+#include <__algorithm/copy.h>
+#include <__algorithm/copy_backward.h>
+#include <__algorithm/copy_if.h>
+#include <__algorithm/copy_n.h>
+#include <__algorithm/count.h>
+#include <__algorithm/count_if.h>
+#include <__algorithm/equal.h>
+#include <__algorithm/equal_range.h>
+#include <__algorithm/fill_n.h>
+#include <__algorithm/fill.h>
+#include <__algorithm/find.h>
+#include <__algorithm/find_end.h>
+#include <__algorithm/find_first_of.h>
+#include <__algorithm/find_if.h>
+#include <__algorithm/find_if_not.h>
+#include <__algorithm/for_each.h>
+#include <__algorithm/for_each_n.h>
+#include <__algorithm/generate_n.h>
+#include <__algorithm/generate.h>
+#include <__algorithm/half_positive.h>
+#include <__algorithm/includes.h>
+#include <__algorithm/inplace_merge.h>
+#include <__algorithm/is_heap.h>
+#include <__algorithm/is_heap_until.h>
+#include <__algorithm/is_partitioned.h>
+#include <__algorithm/is_permutation.h>
+#include <__algorithm/is_sorted.h>
+#include <__algorithm/is_sorted_until.h>
+#include <__algorithm/iter_swap.h>
+#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lower_bound.h>
+#include <__algorithm/make_heap.h>
+#include <__algorithm/max.h>
+#include <__algorithm/max_element.h>
+#include <__algorithm/merge.h>
+#include <__algorithm/min.h>
+#include <__algorithm/min_element.h>
+#include <__algorithm/minmax.h>
+#include <__algorithm/minmax_element.h>
+#include <__algorithm/mismatch.h>
+#include <__algorithm/move.h>
+#include <__algorithm/move_backward.h>
+#include <__algorithm/next_permutation.h>
+#include <__algorithm/none_of.h>
+#include <__algorithm/nth_element.h>
+#include <__algorithm/partial_sort.h>
+#include <__algorithm/partial_sort_copy.h>
+#include <__algorithm/partition.h>
+#include <__algorithm/partition_copy.h>
+#include <__algorithm/partition_point.h>
+#include <__algorithm/pop_heap.h>
+#include <__algorithm/prev_permutation.h>
+#include <__algorithm/push_heap.h>
+#include <__algorithm/remove.h>
+#include <__algorithm/remove_copy.h>
+#include <__algorithm/remove_copy_if.h>
+#include <__algorithm/remove_if.h>
+#include <__algorithm/replace.h>
+#include <__algorithm/replace_copy.h>
+#include <__algorithm/replace_copy_if.h>
+#include <__algorithm/replace_if.h>
+#include <__algorithm/reverse.h>
+#include <__algorithm/reverse_copy.h>
+#include <__algorithm/rotate.h>
+#include <__algorithm/rotate_copy.h>
+#include <__algorithm/sample.h>
+#include <__algorithm/search.h>
+#include <__algorithm/search_n.h>
+#include <__algorithm/set_difference.h>
+#include <__algorithm/set_intersection.h>
+#include <__algorithm/set_symmetric_difference.h>
+#include <__algorithm/set_union.h>
+#include <__algorithm/shift_left.h>
+#include <__algorithm/shift_right.h>
+#include <__algorithm/shuffle.h>
+#include <__algorithm/sift_down.h>
+#include <__algorithm/sort.h>
+#include <__algorithm/sort_heap.h>
+#include <__algorithm/stable_partition.h>
+#include <__algorithm/stable_sort.h>
+#include <__algorithm/swap_ranges.h>
+#include <__algorithm/transform.h>
+#include <__algorithm/unique_copy.h>
+#include <__algorithm/unique.h>
+#include <__algorithm/unwrap_iter.h>
+#include <__algorithm/upper_bound.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-// I'd like to replace these with _VSTD::equal_to<void>, but can't because:
-// * That only works with C++14 and later, and
-// * We haven't included <functional> here.
-template <class _T1, class _T2 = _T1>
-struct __equal_to
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
-};
-
-template <class _T1>
-struct __equal_to<_T1, _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
-};
-
-template <class _T1>
-struct __equal_to<const _T1, _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
-};
-
-template <class _T1>
-struct __equal_to<_T1, const _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
-};
-
-template <class _T1, class _T2 = _T1>
-struct __less
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;}
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;}
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;}
-};
-
-template <class _T1>
-struct __less<_T1, _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
-};
-
-template <class _T1>
-struct __less<const _T1, _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
-};
-
-template <class _T1>
-struct __less<_T1, const _T1>
-{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
-};
-
-template <class _Predicate>
-class __invert // invert the sense of a comparison
-{
-private:
- _Predicate __p_;
-public:
- _LIBCPP_INLINE_VISIBILITY __invert() {}
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __invert(_Predicate __p) : __p_(__p) {}
-
- template <class _T1>
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _T1& __x) {return !__p_(__x);}
-
- template <class _T1, class _T2>
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);}
-};
-
-// Perform division by two quickly for positive integers (llvm.org/PR39129)
-
-template <typename _Integral>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
- is_integral<_Integral>::value,
- _Integral
->::type
-__half_positive(_Integral __value)
-{
- return static_cast<_Integral>(static_cast<typename make_unsigned<_Integral>::type>(__value) / 2);
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
- !is_integral<_Tp>::value,
- _Tp
->::type
-__half_positive(_Tp __value)
-{
- return __value / 2;
-}
-
-#ifdef _LIBCPP_DEBUG
-
-template <class _Compare>
-struct __debug_less
-{
- _Compare &__comp_;
- _LIBCPP_CONSTEXPR_AFTER_CXX17
- __debug_less(_Compare& __c) : __comp_(__c) {}
-
- template <class _Tp, class _Up>
- _LIBCPP_CONSTEXPR_AFTER_CXX17
- bool operator()(const _Tp& __x, const _Up& __y)
- {
- bool __r = __comp_(__x, __y);
- if (__r)
- __do_compare_assert(0, __y, __x);
- return __r;
- }
-
- template <class _Tp, class _Up>
- _LIBCPP_CONSTEXPR_AFTER_CXX17
- bool operator()(_Tp& __x, _Up& __y)
- {
- bool __r = __comp_(__x, __y);
- if (__r)
- __do_compare_assert(0, __y, __x);
- return __r;
- }
-
- template <class _LHS, class _RHS>
- _LIBCPP_CONSTEXPR_AFTER_CXX17
- inline _LIBCPP_INLINE_VISIBILITY
- decltype((void)_VSTD::declval<_Compare&>()(
- _VSTD::declval<_LHS &>(), _VSTD::declval<_RHS &>()))
- __do_compare_assert(int, _LHS & __l, _RHS & __r) {
- _LIBCPP_ASSERT(!__comp_(__l, __r),
- "Comparator does not induce a strict weak ordering");
- }
-
- template <class _LHS, class _RHS>
- _LIBCPP_CONSTEXPR_AFTER_CXX17
- inline _LIBCPP_INLINE_VISIBILITY
- void __do_compare_assert(long, _LHS &, _RHS &) {}
-};
-
-#endif // _LIBCPP_DEBUG
-
-template <class _Comp>
-struct __comp_ref_type {
- // Pass the comparator by lvalue reference. Or in debug mode, using a
- // debugging wrapper that stores a reference.
-#ifndef _LIBCPP_DEBUG
- typedef typename add_lvalue_reference<_Comp>::type type;
-#else
- typedef __debug_less<_Comp> type;
-#endif
-};
-
-// all_of
-
-template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- if (!__pred(*__first))
- return false;
- return true;
-}
-
-// any_of
-
-template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- if (__pred(*__first))
- return true;
- return false;
-}
-
-// none_of
-
-template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- if (__pred(*__first))
- return false;
- return true;
-}
-
-// for_each
-
-template <class _InputIterator, class _Function>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_Function
-for_each(_InputIterator __first, _InputIterator __last, _Function __f)
-{
- for (; __first != __last; ++__first)
- __f(*__first);
- return __f;
-}
-
-#if _LIBCPP_STD_VER > 14
-// for_each_n
-
-template <class _InputIterator, class _Size, class _Function>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_InputIterator
-for_each_n(_InputIterator __first, _Size __orig_n, _Function __f)
-{
- typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
- _IntegralSize __n = __orig_n;
- while (__n > 0)
- {
- __f(*__first);
- ++__first;
- --__n;
- }
- return __first;
-}
-#endif
-
-// find
-
-template <class _InputIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_InputIterator
-find(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
-{
- for (; __first != __last; ++__first)
- if (*__first == __value_)
- break;
- return __first;
-}
-
-// find_if
-
-template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_InputIterator
-find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- if (__pred(*__first))
- break;
- return __first;
-}
-
-// find_if_not
-
-template<class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_InputIterator
-find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- if (!__pred(*__first))
- break;
- return __first;
-}
-
-// find_end
-
-template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
-__find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
- forward_iterator_tag, forward_iterator_tag)
-{
- // modeled after search algorithm
- _ForwardIterator1 __r = __last1; // __last1 is the "default" answer
- if (__first2 == __last2)
- return __r;
- while (true)
- {
- while (true)
- {
- if (__first1 == __last1) // if source exhausted return last correct answer
- return __r; // (or __last1 if never found)
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- }
- // *__first1 matches *__first2, now match elements after here
- _ForwardIterator1 __m1 = __first1;
- _ForwardIterator2 __m2 = __first2;
- while (true)
- {
- if (++__m2 == __last2)
- { // Pattern exhaused, record answer and search for another one
- __r = __first1;
- ++__first1;
- break;
- }
- if (++__m1 == __last1) // Source exhausted, return last answer
- return __r;
- if (!__pred(*__m1, *__m2)) // mismatch, restart with a new __first
- {
- ++__first1;
- break;
- } // else there is a match, check next elements
- }
- }
-}
-
-template <class _BinaryPredicate, class _BidirectionalIterator1, class _BidirectionalIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator1
-__find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1,
- _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BinaryPredicate __pred,
- bidirectional_iterator_tag, bidirectional_iterator_tag)
-{
- // modeled after search algorithm (in reverse)
- if (__first2 == __last2)
- return __last1; // Everything matches an empty sequence
- _BidirectionalIterator1 __l1 = __last1;
- _BidirectionalIterator2 __l2 = __last2;
- --__l2;
- while (true)
- {
- // Find last element in sequence 1 that matchs *(__last2-1), with a mininum of loop checks
- while (true)
- {
- if (__first1 == __l1) // return __last1 if no element matches *__first2
- return __last1;
- if (__pred(*--__l1, *__l2))
- break;
- }
- // *__l1 matches *__l2, now match elements before here
- _BidirectionalIterator1 __m1 = __l1;
- _BidirectionalIterator2 __m2 = __l2;
- while (true)
- {
- if (__m2 == __first2) // If pattern exhausted, __m1 is the answer (works for 1 element pattern)
- return __m1;
- if (__m1 == __first1) // Otherwise if source exhaused, pattern not found
- return __last1;
- if (!__pred(*--__m1, *--__m2)) // if there is a mismatch, restart with a new __l1
- {
- break;
- } // else there is a match, check next elements
- }
- }
-}
-
-template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1
-__find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
- random_access_iterator_tag, random_access_iterator_tag)
-{
- // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern
- typename iterator_traits<_RandomAccessIterator2>::difference_type __len2 = __last2 - __first2;
- if (__len2 == 0)
- return __last1;
- typename iterator_traits<_RandomAccessIterator1>::difference_type __len1 = __last1 - __first1;
- if (__len1 < __len2)
- return __last1;
- const _RandomAccessIterator1 __s = __first1 + (__len2 - 1); // End of pattern match can't go before here
- _RandomAccessIterator1 __l1 = __last1;
- _RandomAccessIterator2 __l2 = __last2;
- --__l2;
- while (true)
- {
- while (true)
- {
- if (__s == __l1)
- return __last1;
- if (__pred(*--__l1, *__l2))
- break;
- }
- _RandomAccessIterator1 __m1 = __l1;
- _RandomAccessIterator2 __m2 = __l2;
- while (true)
- {
- if (__m2 == __first2)
- return __m1;
- // no need to check range on __m1 because __s guarantees we have enough source
- if (!__pred(*--__m1, *--__m2))
- {
- break;
- }
- }
- }
-}
-
-template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator1
-find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
-{
- return _VSTD::__find_end<typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first1, __last1, __first2, __last2, __pred,
- typename iterator_traits<_ForwardIterator1>::iterator_category(),
- typename iterator_traits<_ForwardIterator2>::iterator_category());
-}
-
-template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator1
-find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2)
-{
- typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
- typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
- return _VSTD::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
-}
-
-// find_first_of
-
-template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1
-__find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
-{
- for (; __first1 != __last1; ++__first1)
- for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
- if (__pred(*__first1, *__j))
- return __first1;
- return __last1;
-}
-
-
-template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator1
-find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
-{
- return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred);
-}
-
-template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator1
-find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2)
-{
- typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
- typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
- return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
-}
-
-// adjacent_find
-
-template <class _ForwardIterator, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
-{
- if (__first != __last)
- {
- _ForwardIterator __i = __first;
- while (++__i != __last)
- {
- if (__pred(*__first, *__i))
- return __first;
- __first = __i;
- }
- }
- return __last;
-}
-
-template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
-{
- typedef typename iterator_traits<_ForwardIterator>::value_type __v;
- return _VSTD::adjacent_find(__first, __last, __equal_to<__v>());
-}
-
-// count
-
-template <class _InputIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-typename iterator_traits<_InputIterator>::difference_type
-count(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
-{
- typename iterator_traits<_InputIterator>::difference_type __r(0);
- for (; __first != __last; ++__first)
- if (*__first == __value_)
- ++__r;
- return __r;
-}
-
-// count_if
-
-template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-typename iterator_traits<_InputIterator>::difference_type
-count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
-{
- typename iterator_traits<_InputIterator>::difference_type __r(0);
- for (; __first != __last; ++__first)
- if (__pred(*__first))
- ++__r;
- return __r;
-}
-
-// mismatch
-
-template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-pair<_InputIterator1, _InputIterator2>
-mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _BinaryPredicate __pred)
-{
- for (; __first1 != __last1; ++__first1, (void) ++__first2)
- if (!__pred(*__first1, *__first2))
- break;
- return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
-}
-
-template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-pair<_InputIterator1, _InputIterator2>
-mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)
-{
- typedef typename iterator_traits<_InputIterator1>::value_type __v1;
- typedef typename iterator_traits<_InputIterator2>::value_type __v2;
- return _VSTD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>());
-}
-
-#if _LIBCPP_STD_VER > 11
-template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-pair<_InputIterator1, _InputIterator2>
-mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2,
- _BinaryPredicate __pred)
-{
- for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
- if (!__pred(*__first1, *__first2))
- break;
- return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
-}
-
-template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-pair<_InputIterator1, _InputIterator2>
-mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2)
-{
- typedef typename iterator_traits<_InputIterator1>::value_type __v1;
- typedef typename iterator_traits<_InputIterator2>::value_type __v2;
- return _VSTD::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
-}
-#endif
-
-// equal
-
-template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred)
-{
- for (; __first1 != __last1; ++__first1, (void) ++__first2)
- if (!__pred(*__first1, *__first2))
- return false;
- return true;
-}
-
-template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)
-{
- typedef typename iterator_traits<_InputIterator1>::value_type __v1;
- typedef typename iterator_traits<_InputIterator2>::value_type __v2;
- return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
-}
-
-#if _LIBCPP_STD_VER > 11
-template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-__equal(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred,
- input_iterator_tag, input_iterator_tag )
-{
- for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
- if (!__pred(*__first1, *__first2))
- return false;
- return __first1 == __last1 && __first2 == __last2;
-}
-
-template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
- random_access_iterator_tag, random_access_iterator_tag )
-{
- if ( _VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
- return false;
- return _VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2,
- typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first1, __last1, __first2, __pred );
-}
-
-template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred )
-{
- return _VSTD::__equal<typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first1, __last1, __first2, __last2, __pred,
- typename iterator_traits<_InputIterator1>::iterator_category(),
- typename iterator_traits<_InputIterator2>::iterator_category());
-}
-
-template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2)
-{
- typedef typename iterator_traits<_InputIterator1>::value_type __v1;
- typedef typename iterator_traits<_InputIterator2>::value_type __v2;
- return _VSTD::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(),
- typename iterator_traits<_InputIterator1>::iterator_category(),
- typename iterator_traits<_InputIterator2>::iterator_category());
-}
-#endif
-
-// is_permutation
-
-template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
-is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _BinaryPredicate __pred)
-{
-// shorten sequences as much as possible by lopping of any equal prefix
- for (; __first1 != __last1; ++__first1, (void) ++__first2)
- if (!__pred(*__first1, *__first2))
- break;
- if (__first1 == __last1)
- return true;
-
-// __first1 != __last1 && *__first1 != *__first2
- typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;
- _D1 __l1 = _VSTD::distance(__first1, __last1);
- if (__l1 == _D1(1))
- return false;
- _ForwardIterator2 __last2 = _VSTD::next(__first2, __l1);
- // For each element in [f1, l1) see if there are the same number of
- // equal elements in [f2, l2)
- for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i)
- {
- // Have we already counted the number of *__i in [f1, l1)?
- _ForwardIterator1 __match = __first1;
- for (; __match != __i; ++__match)
- if (__pred(*__match, *__i))
- break;
- if (__match == __i) {
- // Count number of *__i in [f2, l2)
- _D1 __c2 = 0;
- for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
- if (__pred(*__i, *__j))
- ++__c2;
- if (__c2 == 0)
- return false;
- // Count number of *__i in [__i, l1) (we can start with 1)
- _D1 __c1 = 1;
- for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j)
- if (__pred(*__i, *__j))
- ++__c1;
- if (__c1 != __c2)
- return false;
- }
- }
- return true;
-}
-
-template<class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2)
-{
- typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
- typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
- return _VSTD::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>());
-}
-
-#if _LIBCPP_STD_VER > 11
-template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
-__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2,
- _BinaryPredicate __pred,
- forward_iterator_tag, forward_iterator_tag )
-{
-// shorten sequences as much as possible by lopping of any equal prefix
- for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
- if (!__pred(*__first1, *__first2))
- break;
- if (__first1 == __last1)
- return __first2 == __last2;
- else if (__first2 == __last2)
- return false;
-
- typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;
- _D1 __l1 = _VSTD::distance(__first1, __last1);
-
- typedef typename iterator_traits<_ForwardIterator2>::difference_type _D2;
- _D2 __l2 = _VSTD::distance(__first2, __last2);
- if (__l1 != __l2)
- return false;
-
- // For each element in [f1, l1) see if there are the same number of
- // equal elements in [f2, l2)
- for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i)
- {
- // Have we already counted the number of *__i in [f1, l1)?
- _ForwardIterator1 __match = __first1;
- for (; __match != __i; ++__match)
- if (__pred(*__match, *__i))
- break;
- if (__match == __i) {
- // Count number of *__i in [f2, l2)
- _D1 __c2 = 0;
- for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
- if (__pred(*__i, *__j))
- ++__c2;
- if (__c2 == 0)
- return false;
- // Count number of *__i in [__i, l1) (we can start with 1)
- _D1 __c1 = 1;
- for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j)
- if (__pred(*__i, *__j))
- ++__c1;
- if (__c1 != __c2)
- return false;
- }
- }
- return true;
-}
-
-template<class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
-__is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1,
- _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2,
- _BinaryPredicate __pred,
- random_access_iterator_tag, random_access_iterator_tag )
-{
- if ( _VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
- return false;
- return _VSTD::is_permutation<_RandomAccessIterator1, _RandomAccessIterator2,
- typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first1, __last1, __first2, __pred );
-}
-
-template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2,
- _BinaryPredicate __pred )
-{
- return _VSTD::__is_permutation<typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first1, __last1, __first2, __last2, __pred,
- typename iterator_traits<_ForwardIterator1>::iterator_category(),
- typename iterator_traits<_ForwardIterator2>::iterator_category());
-}
-
-template<class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2)
-{
- typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
- typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
- return _VSTD::__is_permutation(__first1, __last1, __first2, __last2,
- __equal_to<__v1, __v2>(),
- typename iterator_traits<_ForwardIterator1>::iterator_category(),
- typename iterator_traits<_ForwardIterator2>::iterator_category());
-}
-#endif
-
-// search
-// __search is in <functional>
-
-template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator1
-search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
-{
- return _VSTD::__search<typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first1, __last1, __first2, __last2, __pred,
- typename iterator_traits<_ForwardIterator1>::iterator_category(),
- typename iterator_traits<_ForwardIterator2>::iterator_category())
- .first;
-}
-
-template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator1
-search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2)
-{
- typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
- typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
- return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
-}
-
-
-#if _LIBCPP_STD_VER > 14
-template <class _ForwardIterator, class _Searcher>
-_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s)
-{ return __s(__f, __l).first; }
-#endif
-
-// search_n
-
-template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-__search_n(_ForwardIterator __first, _ForwardIterator __last,
- _Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag)
-{
- if (__count <= 0)
- return __first;
- while (true)
- {
- // Find first element in sequence that matchs __value_, with a mininum of loop checks
- while (true)
- {
- if (__first == __last) // return __last if no element matches __value_
- return __last;
- if (__pred(*__first, __value_))
- break;
- ++__first;
- }
- // *__first matches __value_, now match elements after here
- _ForwardIterator __m = __first;
- _Size __c(0);
- while (true)
- {
- if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)
- return __first;
- if (++__m == __last) // Otherwise if source exhaused, pattern not found
- return __last;
- if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first
- {
- __first = __m;
- ++__first;
- break;
- } // else there is a match, check next elements
- }
- }
-}
-
-template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
-__search_n(_RandomAccessIterator __first, _RandomAccessIterator __last,
- _Size __count, const _Tp& __value_, _BinaryPredicate __pred, random_access_iterator_tag)
-{
- if (__count <= 0)
- return __first;
- _Size __len = static_cast<_Size>(__last - __first);
- if (__len < __count)
- return __last;
- const _RandomAccessIterator __s = __last - (__count - 1); // Start of pattern match can't go beyond here
- while (true)
- {
- // Find first element in sequence that matchs __value_, with a mininum of loop checks
- while (true)
- {
- if (__first >= __s) // return __last if no element matches __value_
- return __last;
- if (__pred(*__first, __value_))
- break;
- ++__first;
- }
- // *__first matches __value_, now match elements after here
- _RandomAccessIterator __m = __first;
- _Size __c(0);
- while (true)
- {
- if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)
- return __first;
- ++__m; // no need to check range on __m because __s guarantees we have enough source
- if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first
- {
- __first = __m;
- ++__first;
- break;
- } // else there is a match, check next elements
- }
- }
-}
-
-template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-search_n(_ForwardIterator __first, _ForwardIterator __last,
- _Size __count, const _Tp& __value_, _BinaryPredicate __pred)
-{
- return _VSTD::__search_n<typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first, __last, __convert_to_integral(__count), __value_, __pred,
- typename iterator_traits<_ForwardIterator>::iterator_category());
-}
-
-template <class _ForwardIterator, class _Size, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_)
-{
- typedef typename iterator_traits<_ForwardIterator>::value_type __v;
- return _VSTD::search_n(__first, __last, __convert_to_integral(__count),
- __value_, __equal_to<__v, _Tp>());
-}
-
-// copy
-template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_Iter
-__unwrap_iter(_Iter __i)
-{
- return __i;
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-typename enable_if
-<
- is_trivially_copy_assignable<_Tp>::value,
- _Tp*
->::type
-__unwrap_iter(move_iterator<_Tp*> __i)
-{
- return __i.base();
-}
-
-#if _LIBCPP_DEBUG_LEVEL < 2
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-typename enable_if
-<
- is_trivially_copy_assignable<_Tp>::value,
- _Tp*
->::type
-__unwrap_iter(__wrap_iter<_Tp*> __i)
-{
- return __i.base();
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-typename enable_if
-<
- is_trivially_copy_assignable<_Tp>::value,
- const _Tp*
->::type
-__unwrap_iter(__wrap_iter<const _Tp*> __i)
-{
- return __i.base();
-}
-
-#else
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-typename enable_if
-<
- is_trivially_copy_assignable<_Tp>::value,
- __wrap_iter<_Tp*>
->::type
-__unwrap_iter(__wrap_iter<_Tp*> __i)
-{
- return __i;
-}
-
-#endif // _LIBCPP_DEBUG_LEVEL < 2
-
-template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-__copy_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
-{
- for (; __first != __last; ++__first, (void) ++__result)
- *__result = *__first;
- return __result;
-}
-
-template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
-{
- return __copy_constexpr(__first, __last, __result);
-}
-
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_same<typename remove_const<_Tp>::type, _Up>::value &&
- is_trivially_copy_assignable<_Up>::value,
- _Up*
->::type
-__copy(_Tp* __first, _Tp* __last, _Up* __result)
-{
- const size_t __n = static_cast<size_t>(__last - __first);
- if (__n > 0)
- _VSTD::memmove(__result, __first, __n * sizeof(_Up));
- return __result + __n;
-}
-
-template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
-_OutputIterator
-copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
-{
- if (__libcpp_is_constant_evaluated()) {
- return _VSTD::__copy_constexpr(
- __unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
- } else {
- return _VSTD::__copy(
- __unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
- }
-}
-
-// copy_backward
-
-template <class _BidirectionalIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-__copy_backward_constexpr(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
-{
- while (__first != __last)
- *--__result = *--__last;
- return __result;
-}
-
-template <class _BidirectionalIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
-{
- return __copy_backward_constexpr(__first, __last, __result);
-}
-
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_same<typename remove_const<_Tp>::type, _Up>::value &&
- is_trivially_copy_assignable<_Up>::value,
- _Up*
->::type
-__copy_backward(_Tp* __first, _Tp* __last, _Up* __result)
-{
- const size_t __n = static_cast<size_t>(__last - __first);
- if (__n > 0)
- {
- __result -= __n;
- _VSTD::memmove(__result, __first, __n * sizeof(_Up));
- }
- return __result;
-}
-
-template <class _BidirectionalIterator1, class _BidirectionalIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
-_BidirectionalIterator2
-copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
- _BidirectionalIterator2 __result)
-{
- if (__libcpp_is_constant_evaluated()) {
- return _VSTD::__copy_backward_constexpr(__unwrap_iter(__first),
- __unwrap_iter(__last),
- __unwrap_iter(__result));
- } else {
- return _VSTD::__copy_backward(__unwrap_iter(__first),
- __unwrap_iter(__last),
- __unwrap_iter(__result));
- }
-}
-
-// copy_if
-
-template<class _InputIterator, class _OutputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-copy_if(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- {
- if (__pred(*__first))
- {
- *__result = *__first;
- ++__result;
- }
- }
- return __result;
-}
-
-// copy_n
-
-template<class _InputIterator, class _Size, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
-typename enable_if
-<
- __is_cpp17_input_iterator<_InputIterator>::value &&
- !__is_cpp17_random_access_iterator<_InputIterator>::value,
- _OutputIterator
->::type
-copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
-{
- typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
- _IntegralSize __n = __orig_n;
- if (__n > 0)
- {
- *__result = *__first;
- ++__result;
- for (--__n; __n > 0; --__n)
- {
- ++__first;
- *__result = *__first;
- ++__result;
- }
- }
- return __result;
-}
-
-template<class _InputIterator, class _Size, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
-typename enable_if
-<
- __is_cpp17_random_access_iterator<_InputIterator>::value,
- _OutputIterator
->::type
-copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
-{
- typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
- _IntegralSize __n = __orig_n;
- return _VSTD::copy(__first, __first + __n, __result);
-}
-
-// move
-
-template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
-{
- for (; __first != __last; ++__first, (void) ++__result)
- *__result = _VSTD::move(*__first);
- return __result;
-}
-
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_same<typename remove_const<_Tp>::type, _Up>::value &&
- is_trivially_copy_assignable<_Up>::value,
- _Up*
->::type
-__move(_Tp* __first, _Tp* __last, _Up* __result)
-{
- const size_t __n = static_cast<size_t>(__last - __first);
- if (__n > 0)
- _VSTD::memmove(__result, __first, __n * sizeof(_Up));
- return __result + __n;
-}
-
-template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
-{
- return _VSTD::__move(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
-}
-
-// move_backward
-
-template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
-{
- while (__first != __last)
- *--__result = _VSTD::move(*--__last);
- return __result;
-}
-
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_same<typename remove_const<_Tp>::type, _Up>::value &&
- is_trivially_copy_assignable<_Up>::value,
- _Up*
->::type
-__move_backward(_Tp* __first, _Tp* __last, _Up* __result)
-{
- const size_t __n = static_cast<size_t>(__last - __first);
- if (__n > 0)
- {
- __result -= __n;
- _VSTD::memmove(__result, __first, __n * sizeof(_Up));
- }
- return __result;
-}
-
-template <class _BidirectionalIterator1, class _BidirectionalIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
-_BidirectionalIterator2
-move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
- _BidirectionalIterator2 __result)
-{
- return _VSTD::__move_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
-}
-
-// iter_swap
-
-// moved to <type_traits> for better swap / noexcept support
-
-// transform
-
-template <class _InputIterator, class _OutputIterator, class _UnaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)
-{
- for (; __first != __last; ++__first, (void) ++__result)
- *__result = __op(*__first);
- return __result;
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
- _OutputIterator __result, _BinaryOperation __binary_op)
-{
- for (; __first1 != __last1; ++__first1, (void) ++__first2, ++__result)
- *__result = __binary_op(*__first1, *__first2);
- return __result;
-}
-
-// replace
-
-template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-void
-replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value)
-{
- for (; __first != __last; ++__first)
- if (*__first == __old_value)
- *__first = __new_value;
-}
-
-// replace_if
-
-template <class _ForwardIterator, class _Predicate, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-void
-replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value)
-{
- for (; __first != __last; ++__first)
- if (__pred(*__first))
- *__first = __new_value;
-}
-
-// replace_copy
-
-template <class _InputIterator, class _OutputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
- const _Tp& __old_value, const _Tp& __new_value)
-{
- for (; __first != __last; ++__first, (void) ++__result)
- if (*__first == __old_value)
- *__result = __new_value;
- else
- *__result = *__first;
- return __result;
-}
-
-// replace_copy_if
-
-template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
- _Predicate __pred, const _Tp& __new_value)
-{
- for (; __first != __last; ++__first, (void) ++__result)
- if (__pred(*__first))
- *__result = __new_value;
- else
- *__result = *__first;
- return __result;
-}
-
-// fill_n
-
-template <class _OutputIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
-{
- for (; __n > 0; ++__first, (void) --__n)
- *__first = __value_;
- return __first;
-}
-
-template <class _OutputIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
-{
- return _VSTD::__fill_n(__first, __convert_to_integral(__n), __value_);
-}
-
-// fill
-
-template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-void
-__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag)
-{
- for (; __first != __last; ++__first)
- *__first = __value_;
-}
-
-template <class _RandomAccessIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-void
-__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag)
-{
- _VSTD::fill_n(__first, __last - __first, __value_);
-}
-
-template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-void
-fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
-{
- _VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category());
-}
-
-// generate
-
-template <class _ForwardIterator, class _Generator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-void
-generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
-{
- for (; __first != __last; ++__first)
- *__first = __gen();
-}
-
-// generate_n
-
-template <class _OutputIterator, class _Size, class _Generator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)
-{
- typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
- _IntegralSize __n = __orig_n;
- for (; __n > 0; ++__first, (void) --__n)
- *__first = __gen();
- return __first;
-}
-
-// remove
-
-template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
-{
- __first = _VSTD::find(__first, __last, __value_);
- if (__first != __last)
- {
- _ForwardIterator __i = __first;
- while (++__i != __last)
- {
- if (!(*__i == __value_))
- {
- *__first = _VSTD::move(*__i);
- ++__first;
- }
- }
- }
- return __first;
-}
-
-// remove_if
-
-template <class _ForwardIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
-{
- __first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type>
- (__first, __last, __pred);
- if (__first != __last)
- {
- _ForwardIterator __i = __first;
- while (++__i != __last)
- {
- if (!__pred(*__i))
- {
- *__first = _VSTD::move(*__i);
- ++__first;
- }
- }
- }
- return __first;
-}
-
-// remove_copy
-
-template <class _InputIterator, class _OutputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_)
-{
- for (; __first != __last; ++__first)
- {
- if (!(*__first == __value_))
- {
- *__result = *__first;
- ++__result;
- }
- }
- return __result;
-}
-
-// remove_copy_if
-
-template <class _InputIterator, class _OutputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- {
- if (!__pred(*__first))
- {
- *__result = *__first;
- ++__result;
- }
- }
- return __result;
-}
-
-// unique
-
-template <class _ForwardIterator, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
-{
- __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first, __last, __pred);
- if (__first != __last)
- {
- // ... a a ? ...
- // f i
- _ForwardIterator __i = __first;
- for (++__i; ++__i != __last;)
- if (!__pred(*__first, *__i))
- *++__first = _VSTD::move(*__i);
- ++__first;
- }
- return __first;
-}
-
-template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-unique(_ForwardIterator __first, _ForwardIterator __last)
-{
- typedef typename iterator_traits<_ForwardIterator>::value_type __v;
- return _VSTD::unique(__first, __last, __equal_to<__v>());
-}
-
-// unique_copy
-
-template <class _BinaryPredicate, class _InputIterator, class _OutputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
-__unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred,
- input_iterator_tag, output_iterator_tag)
-{
- if (__first != __last)
- {
- typename iterator_traits<_InputIterator>::value_type __t(*__first);
- *__result = __t;
- ++__result;
- while (++__first != __last)
- {
- if (!__pred(__t, *__first))
- {
- __t = *__first;
- *__result = __t;
- ++__result;
- }
- }
- }
- return __result;
-}
-
-template <class _BinaryPredicate, class _ForwardIterator, class _OutputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
-__unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred,
- forward_iterator_tag, output_iterator_tag)
-{
- if (__first != __last)
- {
- _ForwardIterator __i = __first;
- *__result = *__i;
- ++__result;
- while (++__first != __last)
- {
- if (!__pred(*__i, *__first))
- {
- *__result = *__first;
- ++__result;
- __i = __first;
- }
- }
- }
- return __result;
-}
-
-template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-__unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred,
- input_iterator_tag, forward_iterator_tag)
-{
- if (__first != __last)
- {
- *__result = *__first;
- while (++__first != __last)
- if (!__pred(*__result, *__first))
- *++__result = *__first;
- ++__result;
- }
- return __result;
-}
-
-template <class _InputIterator, class _OutputIterator, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred)
-{
- return _VSTD::__unique_copy<typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first, __last, __result, __pred,
- typename iterator_traits<_InputIterator>::iterator_category(),
- typename iterator_traits<_OutputIterator>::iterator_category());
-}
-
-template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
-{
- typedef typename iterator_traits<_InputIterator>::value_type __v;
- return _VSTD::unique_copy(__first, __last, __result, __equal_to<__v>());
-}
-
-// reverse
-
-template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)
-{
- while (__first != __last)
- {
- if (__first == --__last)
- break;
- _VSTD::iter_swap(__first, __last);
- ++__first;
- }
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)
-{
- if (__first != __last)
- for (; __first < --__last; ++__first)
- _VSTD::iter_swap(__first, __last);
-}
-
-template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
-{
- _VSTD::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_category());
-}
-
-// reverse_copy
-
-template <class _BidirectionalIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
-{
- for (; __first != __last; ++__result)
- *__result = *--__last;
- return __result;
-}
-
-// rotate
-
-template <class _ForwardIterator>
-_ForwardIterator
-__rotate_left(_ForwardIterator __first, _ForwardIterator __last)
-{
- typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
- value_type __tmp = _VSTD::move(*__first);
- _ForwardIterator __lm1 = _VSTD::move(_VSTD::next(__first), __last, __first);
- *__lm1 = _VSTD::move(__tmp);
- return __lm1;
-}
-
-template <class _BidirectionalIterator>
-_BidirectionalIterator
-__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
-{
- typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
- _BidirectionalIterator __lm1 = _VSTD::prev(__last);
- value_type __tmp = _VSTD::move(*__lm1);
- _BidirectionalIterator __fp1 = _VSTD::move_backward(__first, __lm1, __last);
- *__first = _VSTD::move(__tmp);
- return __fp1;
-}
-
-template <class _ForwardIterator>
-_ForwardIterator
-__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
-{
- _ForwardIterator __i = __middle;
- while (true)
- {
- swap(*__first, *__i);
- ++__first;
- if (++__i == __last)
- break;
- if (__first == __middle)
- __middle = __i;
- }
- _ForwardIterator __r = __first;
- if (__first != __middle)
- {
- __i = __middle;
- while (true)
- {
- swap(*__first, *__i);
- ++__first;
- if (++__i == __last)
- {
- if (__first == __middle)
- break;
- __i = __middle;
- }
- else if (__first == __middle)
- __middle = __i;
- }
- }
- return __r;
-}
-
-template<typename _Integral>
-inline _LIBCPP_INLINE_VISIBILITY
-_Integral
-__algo_gcd(_Integral __x, _Integral __y)
-{
- do
- {
- _Integral __t = __x % __y;
- __x = __y;
- __y = __t;
- } while (__y);
- return __x;
-}
-
-template<typename _RandomAccessIterator>
-_RandomAccessIterator
-__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
-
- const difference_type __m1 = __middle - __first;
- const difference_type __m2 = __last - __middle;
- if (__m1 == __m2)
- {
- _VSTD::swap_ranges(__first, __middle, __middle);
- return __middle;
- }
- const difference_type __g = _VSTD::__algo_gcd(__m1, __m2);
- for (_RandomAccessIterator __p = __first + __g; __p != __first;)
- {
- value_type __t(_VSTD::move(*--__p));
- _RandomAccessIterator __p1 = __p;
- _RandomAccessIterator __p2 = __p1 + __m1;
- do
- {
- *__p1 = _VSTD::move(*__p2);
- __p1 = __p2;
- const difference_type __d = __last - __p2;
- if (__m1 < __d)
- __p2 += __m1;
- else
- __p2 = __first + (__m1 - __d);
- } while (__p2 != __p);
- *__p1 = _VSTD::move(__t);
- }
- return __first + __m2;
-}
-
-template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIterator
-__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
- _VSTD::forward_iterator_tag)
-{
- typedef typename _VSTD::iterator_traits<_ForwardIterator>::value_type value_type;
- if (_VSTD::is_trivially_move_assignable<value_type>::value)
- {
- if (_VSTD::next(__first) == __middle)
- return _VSTD::__rotate_left(__first, __last);
- }
- return _VSTD::__rotate_forward(__first, __middle, __last);
-}
-
-template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_BidirectionalIterator
-__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
- _VSTD::bidirectional_iterator_tag)
-{
- typedef typename _VSTD::iterator_traits<_BidirectionalIterator>::value_type value_type;
- if (_VSTD::is_trivially_move_assignable<value_type>::value)
- {
- if (_VSTD::next(__first) == __middle)
- return _VSTD::__rotate_left(__first, __last);
- if (_VSTD::next(__middle) == __last)
- return _VSTD::__rotate_right(__first, __last);
- }
- return _VSTD::__rotate_forward(__first, __middle, __last);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_RandomAccessIterator
-__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
- _VSTD::random_access_iterator_tag)
-{
- typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::value_type value_type;
- if (_VSTD::is_trivially_move_assignable<value_type>::value)
- {
- if (_VSTD::next(__first) == __middle)
- return _VSTD::__rotate_left(__first, __last);
- if (_VSTD::next(__middle) == __last)
- return _VSTD::__rotate_right(__first, __last);
- return _VSTD::__rotate_gcd(__first, __middle, __last);
- }
- return _VSTD::__rotate_forward(__first, __middle, __last);
-}
-
-template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIterator
-rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
-{
- if (__first == __middle)
- return __last;
- if (__middle == __last)
- return __first;
- return _VSTD::__rotate(__first, __middle, __last,
- typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category());
-}
-
-// rotate_copy
-
-template <class _ForwardIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)
-{
- return _VSTD::copy(__first, __middle, _VSTD::copy(__middle, __last, __result));
-}
-
-// min_element
-
-template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_ForwardIterator
-min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
-{
- static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
- "std::min_element requires a ForwardIterator");
- if (__first != __last)
- {
- _ForwardIterator __i = __first;
- while (++__i != __last)
- if (__comp(*__i, *__first))
- __first = __i;
- }
- return __first;
-}
-
-template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_ForwardIterator
-min_element(_ForwardIterator __first, _ForwardIterator __last)
-{
- return _VSTD::min_element(__first, __last,
- __less<typename iterator_traits<_ForwardIterator>::value_type>());
-}
-
-// min
-
-template <class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-const _Tp&
-min(const _Tp& __a, const _Tp& __b, _Compare __comp)
-{
- return __comp(__b, __a) ? __b : __a;
-}
-
-template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-const _Tp&
-min(const _Tp& __a, const _Tp& __b)
-{
- return _VSTD::min(__a, __b, __less<_Tp>());
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_Tp
-min(initializer_list<_Tp> __t, _Compare __comp)
-{
- return *_VSTD::min_element(__t.begin(), __t.end(), __comp);
-}
-
-template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_Tp
-min(initializer_list<_Tp> __t)
-{
- return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-// max_element
-
-template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_ForwardIterator
-max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
-{
- static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
- "std::max_element requires a ForwardIterator");
- if (__first != __last)
- {
- _ForwardIterator __i = __first;
- while (++__i != __last)
- if (__comp(*__first, *__i))
- __first = __i;
- }
- return __first;
-}
-
-
-template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_ForwardIterator
-max_element(_ForwardIterator __first, _ForwardIterator __last)
-{
- return _VSTD::max_element(__first, __last,
- __less<typename iterator_traits<_ForwardIterator>::value_type>());
-}
-
-// max
-
-template <class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-const _Tp&
-max(const _Tp& __a, const _Tp& __b, _Compare __comp)
-{
- return __comp(__a, __b) ? __b : __a;
-}
-
-template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-const _Tp&
-max(const _Tp& __a, const _Tp& __b)
-{
- return _VSTD::max(__a, __b, __less<_Tp>());
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_Tp
-max(initializer_list<_Tp> __t, _Compare __comp)
-{
- return *_VSTD::max_element(__t.begin(), __t.end(), __comp);
-}
-
-template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_Tp
-max(initializer_list<_Tp> __t)
-{
- return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-#if _LIBCPP_STD_VER > 14
-// clamp
-template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-const _Tp&
-clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
-{
- _LIBCPP_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
- return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
-
-}
-
-template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-const _Tp&
-clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
-{
- return _VSTD::clamp(__v, __lo, __hi, __less<_Tp>());
-}
-#endif
-
-// minmax_element
-
-template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11
-std::pair<_ForwardIterator, _ForwardIterator>
-minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
-{
- static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
- "std::minmax_element requires a ForwardIterator");
- std::pair<_ForwardIterator, _ForwardIterator> __result(__first, __first);
- if (__first != __last)
- {
- if (++__first != __last)
- {
- if (__comp(*__first, *__result.first))
- __result.first = __first;
- else
- __result.second = __first;
- while (++__first != __last)
- {
- _ForwardIterator __i = __first;
- if (++__first == __last)
- {
- if (__comp(*__i, *__result.first))
- __result.first = __i;
- else if (!__comp(*__i, *__result.second))
- __result.second = __i;
- break;
- }
- else
- {
- if (__comp(*__first, *__i))
- {
- if (__comp(*__first, *__result.first))
- __result.first = __first;
- if (!__comp(*__i, *__result.second))
- __result.second = __i;
- }
- else
- {
- if (__comp(*__i, *__result.first))
- __result.first = __i;
- if (!__comp(*__first, *__result.second))
- __result.second = __first;
- }
- }
- }
- }
- }
- return __result;
-}
-
-template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-std::pair<_ForwardIterator, _ForwardIterator>
-minmax_element(_ForwardIterator __first, _ForwardIterator __last)
-{
- return _VSTD::minmax_element(__first, __last,
- __less<typename iterator_traits<_ForwardIterator>::value_type>());
-}
-
-// minmax
-
-template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-pair<const _Tp&, const _Tp&>
-minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
-{
- return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) :
- pair<const _Tp&, const _Tp&>(__a, __b);
-}
-
-template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-pair<const _Tp&, const _Tp&>
-minmax(const _Tp& __a, const _Tp& __b)
-{
- return _VSTD::minmax(__a, __b, __less<_Tp>());
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-pair<_Tp, _Tp>
-minmax(initializer_list<_Tp> __t, _Compare __comp)
-{
- typedef typename initializer_list<_Tp>::const_iterator _Iter;
- _Iter __first = __t.begin();
- _Iter __last = __t.end();
- std::pair<_Tp, _Tp> __result(*__first, *__first);
-
- ++__first;
- if (__t.size() % 2 == 0)
- {
- if (__comp(*__first, __result.first))
- __result.first = *__first;
- else
- __result.second = *__first;
- ++__first;
- }
-
- while (__first != __last)
- {
- _Tp __prev = *__first++;
- if (__comp(*__first, __prev)) {
- if ( __comp(*__first, __result.first)) __result.first = *__first;
- if (!__comp(__prev, __result.second)) __result.second = __prev;
- }
- else {
- if ( __comp(__prev, __result.first)) __result.first = __prev;
- if (!__comp(*__first, __result.second)) __result.second = *__first;
- }
-
- __first++;
- }
- return __result;
-}
-
-template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-pair<_Tp, _Tp>
-minmax(initializer_list<_Tp> __t)
-{
- return _VSTD::minmax(__t, __less<_Tp>());
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-// random_shuffle
-
-// __independent_bits_engine
-
-template <unsigned long long _Xp, size_t _Rp>
-struct __log2_imp
-{
- static const size_t value = _Xp & ((unsigned long long)(1) << _Rp) ? _Rp
- : __log2_imp<_Xp, _Rp - 1>::value;
-};
-
-template <unsigned long long _Xp>
-struct __log2_imp<_Xp, 0>
-{
- static const size_t value = 0;
-};
-
-template <size_t _Rp>
-struct __log2_imp<0, _Rp>
-{
- static const size_t value = _Rp + 1;
-};
-
-template <class _UIntType, _UIntType _Xp>
-struct __log2
-{
- static const size_t value = __log2_imp<_Xp,
- sizeof(_UIntType) * __CHAR_BIT__ - 1>::value;
-};
-
-template<class _Engine, class _UIntType>
-class __independent_bits_engine
-{
-public:
- // types
- typedef _UIntType result_type;
-
-private:
- typedef typename _Engine::result_type _Engine_result_type;
- typedef typename conditional
- <
- sizeof(_Engine_result_type) <= sizeof(result_type),
- result_type,
- _Engine_result_type
- >::type _Working_result_type;
-
- _Engine& __e_;
- size_t __w_;
- size_t __w0_;
- size_t __n_;
- size_t __n0_;
- _Working_result_type __y0_;
- _Working_result_type __y1_;
- _Engine_result_type __mask0_;
- _Engine_result_type __mask1_;
-
-#ifdef _LIBCPP_CXX03_LANG
- static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
- + _Working_result_type(1);
-#else
- static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
- + _Working_result_type(1);
-#endif
- static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
- static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
- static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
-
-public:
- // constructors and seeding functions
- __independent_bits_engine(_Engine& __e, size_t __w);
-
- // generating functions
- result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());}
-
-private:
- result_type __eval(false_type);
- result_type __eval(true_type);
-};
-
-template<class _Engine, class _UIntType>
-__independent_bits_engine<_Engine, _UIntType>
- ::__independent_bits_engine(_Engine& __e, size_t __w)
- : __e_(__e),
- __w_(__w)
-{
- __n_ = __w_ / __m + (__w_ % __m != 0);
- __w0_ = __w_ / __n_;
- if (_Rp == 0)
- __y0_ = _Rp;
- else if (__w0_ < _WDt)
- __y0_ = (_Rp >> __w0_) << __w0_;
- else
- __y0_ = 0;
- if (_Rp - __y0_ > __y0_ / __n_)
- {
- ++__n_;
- __w0_ = __w_ / __n_;
- if (__w0_ < _WDt)
- __y0_ = (_Rp >> __w0_) << __w0_;
- else
- __y0_ = 0;
- }
- __n0_ = __n_ - __w_ % __n_;
- if (__w0_ < _WDt - 1)
- __y1_ = (_Rp >> (__w0_ + 1)) << (__w0_ + 1);
- else
- __y1_ = 0;
- __mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) :
- _Engine_result_type(0);
- __mask1_ = __w0_ < _EDt - 1 ?
- _Engine_result_type(~0) >> (_EDt - (__w0_ + 1)) :
- _Engine_result_type(~0);
-}
-
-template<class _Engine, class _UIntType>
-inline
-_UIntType
-__independent_bits_engine<_Engine, _UIntType>::__eval(false_type)
-{
- return static_cast<result_type>(__e_() & __mask0_);
-}
-
-template<class _Engine, class _UIntType>
-_UIntType
-__independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
-{
- const size_t _WRt = numeric_limits<result_type>::digits;
- result_type _Sp = 0;
- for (size_t __k = 0; __k < __n0_; ++__k)
- {
- _Engine_result_type __u;
- do
- {
- __u = __e_() - _Engine::min();
- } while (__u >= __y0_);
- if (__w0_ < _WRt)
- _Sp <<= __w0_;
- else
- _Sp = 0;
- _Sp += __u & __mask0_;
- }
- for (size_t __k = __n0_; __k < __n_; ++__k)
- {
- _Engine_result_type __u;
- do
- {
- __u = __e_() - _Engine::min();
- } while (__u >= __y1_);
- if (__w0_ < _WRt - 1)
- _Sp <<= __w0_ + 1;
- else
- _Sp = 0;
- _Sp += __u & __mask1_;
- }
- return _Sp;
-}
-
-// uniform_int_distribution
-
-template<class _IntType = int>
-class uniform_int_distribution
-{
-public:
- // types
- typedef _IntType result_type;
-
- class param_type
- {
- result_type __a_;
- result_type __b_;
- public:
- typedef uniform_int_distribution distribution_type;
-
- explicit param_type(result_type __a = 0,
- result_type __b = numeric_limits<result_type>::max())
- : __a_(__a), __b_(__b) {}
-
- result_type a() const {return __a_;}
- result_type b() const {return __b_;}
-
- friend bool operator==(const param_type& __x, const param_type& __y)
- {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;}
- friend bool operator!=(const param_type& __x, const param_type& __y)
- {return !(__x == __y);}
- };
-
-private:
- param_type __p_;
-
-public:
- // constructors and reset functions
- explicit uniform_int_distribution(result_type __a = 0,
- result_type __b = numeric_limits<result_type>::max())
- : __p_(param_type(__a, __b)) {}
- explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}
- void reset() {}
-
- // generating functions
- template<class _URNG> result_type operator()(_URNG& __g)
- {return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
-
- // property functions
- result_type a() const {return __p_.a();}
- result_type b() const {return __p_.b();}
-
- param_type param() const {return __p_;}
- void param(const param_type& __p) {__p_ = __p;}
-
- result_type min() const {return a();}
- result_type max() const {return b();}
-
- friend bool operator==(const uniform_int_distribution& __x,
- const uniform_int_distribution& __y)
- {return __x.__p_ == __y.__p_;}
- friend bool operator!=(const uniform_int_distribution& __x,
- const uniform_int_distribution& __y)
- {return !(__x == __y);}
-};
-
-template<class _IntType>
-template<class _URNG>
-typename uniform_int_distribution<_IntType>::result_type
-uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p)
-_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
-{
- typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t),
- uint32_t, uint64_t>::type _UIntType;
- const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
- if (_Rp == 1)
- return __p.a();
- const size_t _Dt = numeric_limits<_UIntType>::digits;
- typedef __independent_bits_engine<_URNG, _UIntType> _Eng;
- if (_Rp == 0)
- return static_cast<result_type>(_Eng(__g, _Dt)());
- size_t __w = _Dt - __libcpp_clz(_Rp) - 1;
- if ((_Rp & (std::numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)
- ++__w;
- _Eng __e(__g, __w);
- _UIntType __u;
- do
- {
- __u = __e();
- } while (__u >= _Rp);
- return static_cast<result_type>(__u + __p.a());
-}
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
- || defined(_LIBCPP_BUILDING_LIBRARY)
-class _LIBCPP_TYPE_VIS __rs_default;
-
-_LIBCPP_FUNC_VIS __rs_default __rs_get();
-
-class _LIBCPP_TYPE_VIS __rs_default
-{
- static unsigned __c_;
-
- __rs_default();
-public:
- typedef uint_fast32_t result_type;
-
- static const result_type _Min = 0;
- static const result_type _Max = 0xFFFFFFFF;
-
- __rs_default(const __rs_default&);
- ~__rs_default();
-
- result_type operator()();
-
- static _LIBCPP_CONSTEXPR result_type min() {return _Min;}
- static _LIBCPP_CONSTEXPR result_type max() {return _Max;}
-
- friend _LIBCPP_FUNC_VIS __rs_default __rs_get();
-};
-
-_LIBCPP_FUNC_VIS __rs_default __rs_get();
-
-template <class _RandomAccessIterator>
-_LIBCPP_DEPRECATED_IN_CXX14 void
-random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- typedef uniform_int_distribution<ptrdiff_t> _Dp;
- typedef typename _Dp::param_type _Pp;
- difference_type __d = __last - __first;
- if (__d > 1)
- {
- _Dp __uid;
- __rs_default __g = __rs_get();
- for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d)
- {
- difference_type __i = __uid(__g, _Pp(0, __d));
- if (__i != difference_type(0))
- swap(*__first, *(__first + __i));
- }
- }
-}
-
-template <class _RandomAccessIterator, class _RandomNumberGenerator>
-_LIBCPP_DEPRECATED_IN_CXX14 void
-random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
-#ifndef _LIBCPP_CXX03_LANG
- _RandomNumberGenerator&& __rand)
-#else
- _RandomNumberGenerator& __rand)
-#endif
-{
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- difference_type __d = __last - __first;
- if (__d > 1)
- {
- for (--__last; __first < __last; ++__first, (void) --__d)
- {
- difference_type __i = __rand(__d);
- if (__i != difference_type(0))
- swap(*__first, *(__first + __i));
- }
- }
-}
-#endif
-
-template <class _PopulationIterator, class _SampleIterator, class _Distance,
- class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator __sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __output_iter,
- _Distance __n,
- _UniformRandomNumberGenerator & __g,
- input_iterator_tag) {
-
- _Distance __k = 0;
- for (; __first != __last && __k < __n; ++__first, (void) ++__k)
- __output_iter[__k] = *__first;
- _Distance __sz = __k;
- for (; __first != __last; ++__first, (void) ++__k) {
- _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g);
- if (__r < __sz)
- __output_iter[__r] = *__first;
- }
- return __output_iter + _VSTD::min(__n, __k);
-}
-
-template <class _PopulationIterator, class _SampleIterator, class _Distance,
- class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator __sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __output_iter,
- _Distance __n,
- _UniformRandomNumberGenerator& __g,
- forward_iterator_tag) {
- _Distance __unsampled_sz = _VSTD::distance(__first, __last);
- for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {
- _Distance __r =
- _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);
- if (__r < __n) {
- *__output_iter++ = *__first;
- --__n;
- }
- }
- return __output_iter;
-}
-
-template <class _PopulationIterator, class _SampleIterator, class _Distance,
- class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator __sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __output_iter,
- _Distance __n, _UniformRandomNumberGenerator& __g) {
- typedef typename iterator_traits<_PopulationIterator>::iterator_category
- _PopCategory;
- typedef typename iterator_traits<_PopulationIterator>::difference_type
- _Difference;
- static_assert(__is_cpp17_forward_iterator<_PopulationIterator>::value ||
- __is_cpp17_random_access_iterator<_SampleIterator>::value,
- "SampleIterator must meet the requirements of RandomAccessIterator");
- typedef typename common_type<_Distance, _Difference>::type _CommonType;
- _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
- return _VSTD::__sample(
- __first, __last, __output_iter, _CommonType(__n),
- __g, _PopCategory());
-}
-
-#if _LIBCPP_STD_VER > 14
-template <class _PopulationIterator, class _SampleIterator, class _Distance,
- class _UniformRandomNumberGenerator>
-inline _LIBCPP_INLINE_VISIBILITY
-_SampleIterator sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __output_iter,
- _Distance __n, _UniformRandomNumberGenerator&& __g) {
- return _VSTD::__sample(__first, __last, __output_iter, __n, __g);
-}
-#endif // _LIBCPP_STD_VER > 14
-
-template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
- void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
- _UniformRandomNumberGenerator&& __g)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- typedef uniform_int_distribution<ptrdiff_t> _Dp;
- typedef typename _Dp::param_type _Pp;
- difference_type __d = __last - __first;
- if (__d > 1)
- {
- _Dp __uid;
- for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d)
- {
- difference_type __i = __uid(__g, _Pp(0, __d));
- if (__i != difference_type(0))
- swap(*__first, *(__first + __i));
- }
- }
-}
-
-template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
-is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- if (!__pred(*__first))
- break;
- if ( __first == __last )
- return true;
- ++__first;
- for (; __first != __last; ++__first)
- if (__pred(*__first))
- return false;
- return true;
-}
-
-// partition
-
-template <class _Predicate, class _ForwardIterator>
-_ForwardIterator
-__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag)
-{
- while (true)
- {
- if (__first == __last)
- return __first;
- if (!__pred(*__first))
- break;
- ++__first;
- }
- for (_ForwardIterator __p = __first; ++__p != __last;)
- {
- if (__pred(*__p))
- {
- swap(*__first, *__p);
- ++__first;
- }
- }
- return __first;
-}
-
-template <class _Predicate, class _BidirectionalIterator>
-_BidirectionalIterator
-__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
- bidirectional_iterator_tag)
-{
- while (true)
- {
- while (true)
- {
- if (__first == __last)
- return __first;
- if (!__pred(*__first))
- break;
- ++__first;
- }
- do
- {
- if (__first == --__last)
- return __first;
- } while (!__pred(*__last));
- swap(*__first, *__last);
- ++__first;
- }
-}
-
-template <class _ForwardIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIterator
-partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
-{
- return _VSTD::__partition<typename add_lvalue_reference<_Predicate>::type>
- (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
-}
-
-// partition_copy
-
-template <class _InputIterator, class _OutputIterator1,
- class _OutputIterator2, class _Predicate>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2>
-partition_copy(_InputIterator __first, _InputIterator __last,
- _OutputIterator1 __out_true, _OutputIterator2 __out_false,
- _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- {
- if (__pred(*__first))
- {
- *__out_true = *__first;
- ++__out_true;
- }
- else
- {
- *__out_false = *__first;
- ++__out_false;
- }
- }
- return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false);
-}
-
-// partition_point
-
-template<class _ForwardIterator, class _Predicate>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
-{
- typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
- difference_type __len = _VSTD::distance(__first, __last);
- while (__len != 0)
- {
- difference_type __l2 = _VSTD::__half_positive(__len);
- _ForwardIterator __m = __first;
- _VSTD::advance(__m, __l2);
- if (__pred(*__m))
- {
- __first = ++__m;
- __len -= __l2 + 1;
- }
- else
- __len = __l2;
- }
- return __first;
-}
-
-// stable_partition
-
-template <class _Predicate, class _ForwardIterator, class _Distance, class _Pair>
-_ForwardIterator
-__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- _Distance __len, _Pair __p, forward_iterator_tag __fit)
-{
- // *__first is known to be false
- // __len >= 1
- if (__len == 1)
- return __first;
- if (__len == 2)
- {
- _ForwardIterator __m = __first;
- if (__pred(*++__m))
- {
- swap(*__first, *__m);
- return __m;
- }
- return __first;
- }
- if (__len <= __p.second)
- { // The buffer is big enough to use
- typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h(__p.first, __d);
- // Move the falses into the temporary buffer, and the trues to the front of the line
- // Update __first to always point to the end of the trues
- value_type* __t = __p.first;
- ::new(__t) value_type(_VSTD::move(*__first));
- __d.__incr((value_type*)0);
- ++__t;
- _ForwardIterator __i = __first;
- while (++__i != __last)
- {
- if (__pred(*__i))
- {
- *__first = _VSTD::move(*__i);
- ++__first;
- }
- else
- {
- ::new(__t) value_type(_VSTD::move(*__i));
- __d.__incr((value_type*)0);
- ++__t;
- }
- }
- // All trues now at start of range, all falses in buffer
- // Move falses back into range, but don't mess up __first which points to first false
- __i = __first;
- for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i)
- *__i = _VSTD::move(*__t2);
- // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer
- return __first;
- }
- // Else not enough buffer, do in place
- // __len >= 3
- _ForwardIterator __m = __first;
- _Distance __len2 = __len / 2; // __len2 >= 2
- _VSTD::advance(__m, __len2);
- // recurse on [__first, __m), *__first know to be false
- // F?????????????????
- // f m l
- typedef typename add_lvalue_reference<_Predicate>::type _PredRef;
- _ForwardIterator __first_false = __stable_partition<_PredRef>(__first, __m, __pred, __len2, __p, __fit);
- // TTTFFFFF??????????
- // f ff m l
- // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true
- _ForwardIterator __m1 = __m;
- _ForwardIterator __second_false = __last;
- _Distance __len_half = __len - __len2;
- while (__pred(*__m1))
- {
- if (++__m1 == __last)
- goto __second_half_done;
- --__len_half;
- }
- // TTTFFFFFTTTF??????
- // f ff m m1 l
- __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit);
-__second_half_done:
- // TTTFFFFFTTTTTFFFFF
- // f ff m sf l
- return _VSTD::rotate(__first_false, __m, __second_false);
- // TTTTTTTTFFFFFFFFFF
- // |
-}
-
-struct __return_temporary_buffer
-{
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_VSTD::return_temporary_buffer(__p);}
-};
-
-template <class _Predicate, class _ForwardIterator>
-_ForwardIterator
-__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- forward_iterator_tag)
-{
- const unsigned __alloc_limit = 3; // might want to make this a function of trivial assignment
- // Either prove all true and return __first or point to first false
- while (true)
- {
- if (__first == __last)
- return __first;
- if (!__pred(*__first))
- break;
- ++__first;
- }
- // We now have a reduced range [__first, __last)
- // *__first is known to be false
- typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
- typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
- difference_type __len = _VSTD::distance(__first, __last);
- pair<value_type*, ptrdiff_t> __p(0, 0);
- unique_ptr<value_type, __return_temporary_buffer> __h;
- if (__len >= __alloc_limit)
- {
- __p = _VSTD::get_temporary_buffer<value_type>(__len);
- __h.reset(__p.first);
- }
- return __stable_partition<typename add_lvalue_reference<_Predicate>::type>
- (__first, __last, __pred, __len, __p, forward_iterator_tag());
-}
-
-template <class _Predicate, class _BidirectionalIterator, class _Distance, class _Pair>
-_BidirectionalIterator
-__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
- _Distance __len, _Pair __p, bidirectional_iterator_tag __bit)
-{
- // *__first is known to be false
- // *__last is known to be true
- // __len >= 2
- if (__len == 2)
- {
- swap(*__first, *__last);
- return __last;
- }
- if (__len == 3)
- {
- _BidirectionalIterator __m = __first;
- if (__pred(*++__m))
- {
- swap(*__first, *__m);
- swap(*__m, *__last);
- return __last;
- }
- swap(*__m, *__last);
- swap(*__first, *__m);
- return __m;
- }
- if (__len <= __p.second)
- { // The buffer is big enough to use
- typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h(__p.first, __d);
- // Move the falses into the temporary buffer, and the trues to the front of the line
- // Update __first to always point to the end of the trues
- value_type* __t = __p.first;
- ::new(__t) value_type(_VSTD::move(*__first));
- __d.__incr((value_type*)0);
- ++__t;
- _BidirectionalIterator __i = __first;
- while (++__i != __last)
- {
- if (__pred(*__i))
- {
- *__first = _VSTD::move(*__i);
- ++__first;
- }
- else
- {
- ::new(__t) value_type(_VSTD::move(*__i));
- __d.__incr((value_type*)0);
- ++__t;
- }
- }
- // move *__last, known to be true
- *__first = _VSTD::move(*__i);
- __i = ++__first;
- // All trues now at start of range, all falses in buffer
- // Move falses back into range, but don't mess up __first which points to first false
- for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i)
- *__i = _VSTD::move(*__t2);
- // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer
- return __first;
- }
- // Else not enough buffer, do in place
- // __len >= 4
- _BidirectionalIterator __m = __first;
- _Distance __len2 = __len / 2; // __len2 >= 2
- _VSTD::advance(__m, __len2);
- // recurse on [__first, __m-1], except reduce __m-1 until *(__m-1) is true, *__first know to be false
- // F????????????????T
- // f m l
- _BidirectionalIterator __m1 = __m;
- _BidirectionalIterator __first_false = __first;
- _Distance __len_half = __len2;
- while (!__pred(*--__m1))
- {
- if (__m1 == __first)
- goto __first_half_done;
- --__len_half;
- }
- // F???TFFF?????????T
- // f m1 m l
- typedef typename add_lvalue_reference<_Predicate>::type _PredRef;
- __first_false = __stable_partition<_PredRef>(__first, __m1, __pred, __len_half, __p, __bit);
-__first_half_done:
- // TTTFFFFF?????????T
- // f ff m l
- // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true
- __m1 = __m;
- _BidirectionalIterator __second_false = __last;
- ++__second_false;
- __len_half = __len - __len2;
- while (__pred(*__m1))
- {
- if (++__m1 == __last)
- goto __second_half_done;
- --__len_half;
- }
- // TTTFFFFFTTTF?????T
- // f ff m m1 l
- __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __bit);
-__second_half_done:
- // TTTFFFFFTTTTTFFFFF
- // f ff m sf l
- return _VSTD::rotate(__first_false, __m, __second_false);
- // TTTTTTTTFFFFFFFFFF
- // |
-}
-
-template <class _Predicate, class _BidirectionalIterator>
-_BidirectionalIterator
-__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
- bidirectional_iterator_tag)
-{
- typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
- typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
- const difference_type __alloc_limit = 4; // might want to make this a function of trivial assignment
- // Either prove all true and return __first or point to first false
- while (true)
- {
- if (__first == __last)
- return __first;
- if (!__pred(*__first))
- break;
- ++__first;
- }
- // __first points to first false, everything prior to __first is already set.
- // Either prove [__first, __last) is all false and return __first, or point __last to last true
- do
- {
- if (__first == --__last)
- return __first;
- } while (!__pred(*__last));
- // We now have a reduced range [__first, __last]
- // *__first is known to be false
- // *__last is known to be true
- // __len >= 2
- difference_type __len = _VSTD::distance(__first, __last) + 1;
- pair<value_type*, ptrdiff_t> __p(0, 0);
- unique_ptr<value_type, __return_temporary_buffer> __h;
- if (__len >= __alloc_limit)
- {
- __p = _VSTD::get_temporary_buffer<value_type>(__len);
- __h.reset(__p.first);
- }
- return __stable_partition<typename add_lvalue_reference<_Predicate>::type>
- (__first, __last, __pred, __len, __p, bidirectional_iterator_tag());
-}
-
-template <class _ForwardIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIterator
-stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
-{
- return __stable_partition<typename add_lvalue_reference<_Predicate>::type>
- (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
-}
-
-// is_sorted_until
-
-template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
-{
- if (__first != __last)
- {
- _ForwardIterator __i = __first;
- while (++__i != __last)
- {
- if (__comp(*__i, *__first))
- return __i;
- __first = __i;
- }
- }
- return __last;
-}
-
-template<class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
-{
- return _VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
-}
-
-// is_sorted
-
-template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
-{
- return _VSTD::is_sorted_until(__first, __last, __comp) == __last;
-}
-
-template<class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-is_sorted(_ForwardIterator __first, _ForwardIterator __last)
-{
- return _VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
-}
-
-// sort
-
-// stable, 2-3 compares, 0-2 swaps
-
-template <class _Compare, class _ForwardIterator>
-unsigned
-__sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z, _Compare __c)
-{
- unsigned __r = 0;
- if (!__c(*__y, *__x)) // if x <= y
- {
- if (!__c(*__z, *__y)) // if y <= z
- return __r; // x <= y && y <= z
- // x <= y && y > z
- swap(*__y, *__z); // x <= z && y < z
- __r = 1;
- if (__c(*__y, *__x)) // if x > y
- {
- swap(*__x, *__y); // x < y && y <= z
- __r = 2;
- }
- return __r; // x <= y && y < z
- }
- if (__c(*__z, *__y)) // x > y, if y > z
- {
- swap(*__x, *__z); // x < y && y < z
- __r = 1;
- return __r;
- }
- swap(*__x, *__y); // x > y && y <= z
- __r = 1; // x < y && x <= z
- if (__c(*__z, *__y)) // if y > z
- {
- swap(*__y, *__z); // x <= y && y < z
- __r = 2;
- }
- return __r;
-} // x <= y && y <= z
-
-// stable, 3-6 compares, 0-5 swaps
-
-template <class _Compare, class _ForwardIterator>
-unsigned
-__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
- _ForwardIterator __x4, _Compare __c)
-{
- unsigned __r = __sort3<_Compare>(__x1, __x2, __x3, __c);
- if (__c(*__x4, *__x3))
- {
- swap(*__x3, *__x4);
- ++__r;
- if (__c(*__x3, *__x2))
- {
- swap(*__x2, *__x3);
- ++__r;
- if (__c(*__x2, *__x1))
- {
- swap(*__x1, *__x2);
- ++__r;
- }
- }
- }
- return __r;
-}
-
-// stable, 4-10 compares, 0-9 swaps
-
-template <class _Compare, class _ForwardIterator>
-_LIBCPP_HIDDEN
-unsigned
-__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
- _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c)
-{
- unsigned __r = __sort4<_Compare>(__x1, __x2, __x3, __x4, __c);
- if (__c(*__x5, *__x4))
- {
- swap(*__x4, *__x5);
- ++__r;
- if (__c(*__x4, *__x3))
- {
- swap(*__x3, *__x4);
- ++__r;
- if (__c(*__x3, *__x2))
- {
- swap(*__x2, *__x3);
- ++__r;
- if (__c(*__x2, *__x1))
- {
- swap(*__x1, *__x2);
- ++__r;
- }
- }
- }
- }
- return __r;
-}
-
-// Assumes size > 0
-template <class _Compare, class _BirdirectionalIterator>
-void
-__selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)
-{
- _BirdirectionalIterator __lm1 = __last;
- for (--__lm1; __first != __lm1; ++__first)
- {
- _BirdirectionalIterator __i = _VSTD::min_element<_BirdirectionalIterator,
- typename add_lvalue_reference<_Compare>::type>
- (__first, __last, __comp);
- if (__i != __first)
- swap(*__first, *__i);
- }
-}
-
-template <class _Compare, class _BirdirectionalIterator>
-void
-__insertion_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)
-{
- typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;
- if (__first != __last)
- {
- _BirdirectionalIterator __i = __first;
- for (++__i; __i != __last; ++__i)
- {
- _BirdirectionalIterator __j = __i;
- value_type __t(_VSTD::move(*__j));
- for (_BirdirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j)
- *__j = _VSTD::move(*__k);
- *__j = _VSTD::move(__t);
- }
- }
-}
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- _RandomAccessIterator __j = __first+2;
- __sort3<_Compare>(__first, __first+1, __j, __comp);
- for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
- {
- if (__comp(*__i, *__j))
- {
- value_type __t(_VSTD::move(*__i));
- _RandomAccessIterator __k = __j;
- __j = __i;
- do
- {
- *__j = _VSTD::move(*__k);
- __j = __k;
- } while (__j != __first && __comp(__t, *--__k));
- *__j = _VSTD::move(__t);
- }
- __j = __i;
- }
-}
-
-template <class _Compare, class _RandomAccessIterator>
-bool
-__insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- switch (__last - __first)
- {
- case 0:
- case 1:
- return true;
- case 2:
- if (__comp(*--__last, *__first))
- swap(*__first, *__last);
- return true;
- case 3:
- _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
- return true;
- case 4:
- _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
- return true;
- case 5:
- _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
- return true;
- }
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- _RandomAccessIterator __j = __first+2;
- __sort3<_Compare>(__first, __first+1, __j, __comp);
- const unsigned __limit = 8;
- unsigned __count = 0;
- for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
- {
- if (__comp(*__i, *__j))
- {
- value_type __t(_VSTD::move(*__i));
- _RandomAccessIterator __k = __j;
- __j = __i;
- do
- {
- *__j = _VSTD::move(*__k);
- __j = __k;
- } while (__j != __first && __comp(__t, *--__k));
- *__j = _VSTD::move(__t);
- if (++__count == __limit)
- return ++__i == __last;
- }
- __j = __i;
- }
- return true;
-}
-
-template <class _Compare, class _BirdirectionalIterator>
-void
-__insertion_sort_move(_BirdirectionalIterator __first1, _BirdirectionalIterator __last1,
- typename iterator_traits<_BirdirectionalIterator>::value_type* __first2, _Compare __comp)
-{
- typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;
- if (__first1 != __last1)
- {
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
- value_type* __last2 = __first2;
- ::new(__last2) value_type(_VSTD::move(*__first1));
- __d.__incr((value_type*)0);
- for (++__last2; ++__first1 != __last1; ++__last2)
- {
- value_type* __j2 = __last2;
- value_type* __i2 = __j2;
- if (__comp(*__first1, *--__i2))
- {
- ::new(__j2) value_type(_VSTD::move(*__i2));
- __d.__incr((value_type*)0);
- for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
- *__j2 = _VSTD::move(*__i2);
- *__j2 = _VSTD::move(*__first1);
- }
- else
- {
- ::new(__j2) value_type(_VSTD::move(*__first1));
- __d.__incr((value_type*)0);
- }
- }
- __h.release();
- }
-}
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- // _Compare is known to be a reference type
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- const difference_type __limit = is_trivially_copy_constructible<value_type>::value &&
- is_trivially_copy_assignable<value_type>::value ? 30 : 6;
- while (true)
- {
- __restart:
- difference_type __len = __last - __first;
- switch (__len)
- {
- case 0:
- case 1:
- return;
- case 2:
- if (__comp(*--__last, *__first))
- swap(*__first, *__last);
- return;
- case 3:
- _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
- return;
- case 4:
- _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
- return;
- case 5:
- _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
- return;
- }
- if (__len <= __limit)
- {
- _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
- return;
- }
- // __len > 5
- _RandomAccessIterator __m = __first;
- _RandomAccessIterator __lm1 = __last;
- --__lm1;
- unsigned __n_swaps;
- {
- difference_type __delta;
- if (__len >= 1000)
- {
- __delta = __len/2;
- __m += __delta;
- __delta /= 2;
- __n_swaps = _VSTD::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp);
- }
- else
- {
- __delta = __len/2;
- __m += __delta;
- __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, __lm1, __comp);
- }
- }
- // *__m is median
- // partition [__first, __m) < *__m and *__m <= [__m, __last)
- // (this inhibits tossing elements equivalent to __m around unnecessarily)
- _RandomAccessIterator __i = __first;
- _RandomAccessIterator __j = __lm1;
- // j points beyond range to be tested, *__m is known to be <= *__lm1
- // The search going up is known to be guarded but the search coming down isn't.
- // Prime the downward search with a guard.
- if (!__comp(*__i, *__m)) // if *__first == *__m
- {
- // *__first == *__m, *__first doesn't go in first part
- // manually guard downward moving __j against __i
- while (true)
- {
- if (__i == --__j)
- {
- // *__first == *__m, *__m <= all other elements
- // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)
- ++__i; // __first + 1
- __j = __last;
- if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
- {
- while (true)
- {
- if (__i == __j)
- return; // [__first, __last) all equivalent elements
- if (__comp(*__first, *__i))
- {
- swap(*__i, *__j);
- ++__n_swaps;
- ++__i;
- break;
- }
- ++__i;
- }
- }
- // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
- if (__i == __j)
- return;
- while (true)
- {
- while (!__comp(*__first, *__i))
- ++__i;
- while (__comp(*__first, *--__j))
- ;
- if (__i >= __j)
- break;
- swap(*__i, *__j);
- ++__n_swaps;
- ++__i;
- }
- // [__first, __i) == *__first and *__first < [__i, __last)
- // The first part is sorted, sort the secod part
- // _VSTD::__sort<_Compare>(__i, __last, __comp);
- __first = __i;
- goto __restart;
- }
- if (__comp(*__j, *__m))
- {
- swap(*__i, *__j);
- ++__n_swaps;
- break; // found guard for downward moving __j, now use unguarded partition
- }
- }
- }
- // It is known that *__i < *__m
- ++__i;
- // j points beyond range to be tested, *__m is known to be <= *__lm1
- // if not yet partitioned...
- if (__i < __j)
- {
- // known that *(__i - 1) < *__m
- // known that __i <= __m
- while (true)
- {
- // __m still guards upward moving __i
- while (__comp(*__i, *__m))
- ++__i;
- // It is now known that a guard exists for downward moving __j
- while (!__comp(*--__j, *__m))
- ;
- if (__i > __j)
- break;
- swap(*__i, *__j);
- ++__n_swaps;
- // It is known that __m != __j
- // If __m just moved, follow it
- if (__m == __i)
- __m = __j;
- ++__i;
- }
- }
- // [__first, __i) < *__m and *__m <= [__i, __last)
- if (__i != __m && __comp(*__m, *__i))
- {
- swap(*__i, *__m);
- ++__n_swaps;
- }
- // [__first, __i) < *__i and *__i <= [__i+1, __last)
- // If we were given a perfect partition, see if insertion sort is quick...
- if (__n_swaps == 0)
- {
- bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
- if (_VSTD::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp))
- {
- if (__fs)
- return;
- __last = __i;
- continue;
- }
- else
- {
- if (__fs)
- {
- __first = ++__i;
- continue;
- }
- }
- }
- // sort smaller range with recursive call and larger with tail recursion elimination
- if (__i - __first < __last - __i)
- {
- _VSTD::__sort<_Compare>(__first, __i, __comp);
- // _VSTD::__sort<_Compare>(__i+1, __last, __comp);
- __first = ++__i;
- }
- else
- {
- _VSTD::__sort<_Compare>(__i+1, __last, __comp);
- // _VSTD::__sort<_Compare>(__first, __i, __comp);
- __last = __i;
- }
- }
-}
-
-// This forwarder keeps the top call and the recursive calls using the same instantiation, forcing a reference _Compare
-template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- _VSTD::__sort<_Comp_ref>(__first, __last, _Comp_ref(__comp));
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- _VSTD::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-sort(_Tp** __first, _Tp** __last)
-{
- _VSTD::sort((size_t*)__first, (size_t*)__last, __less<size_t>());
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last)
-{
- _VSTD::sort(__first.base(), __last.base());
-}
-
-template <class _Tp, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp)
-{
- typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
- _VSTD::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp);
-}
-
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<short>&, short*>(short*, short*, __less<short>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<int>&, int*>(int*, int*, __less<int>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long>&, long*>(long*, long*, __less<long>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<float>&, float*>(float*, float*, __less<float>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<double>&, double*>(double*, double*, __less<double>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&))
-
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&))
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&))
-
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&))
-
-// lower_bound
-
-template <class _Compare, class _ForwardIterator, class _Tp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-__lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
-{
- typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
- difference_type __len = _VSTD::distance(__first, __last);
- while (__len != 0)
- {
- difference_type __l2 = _VSTD::__half_positive(__len);
- _ForwardIterator __m = __first;
- _VSTD::advance(__m, __l2);
- if (__comp(*__m, __value_))
- {
- __first = ++__m;
- __len -= __l2 + 1;
- }
- else
- __len = __l2;
- }
- return __first;
-}
-
-template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
-{
- typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
- return __lower_bound<_Comp_ref>(__first, __last, __value_, __comp);
-}
-
-template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
-{
- return _VSTD::lower_bound(__first, __last, __value_,
- __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
-}
-
-// upper_bound
-
-template <class _Compare, class _ForwardIterator, class _Tp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
-__upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
-{
- typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
- difference_type __len = _VSTD::distance(__first, __last);
- while (__len != 0)
- {
- difference_type __l2 = _VSTD::__half_positive(__len);
- _ForwardIterator __m = __first;
- _VSTD::advance(__m, __l2);
- if (__comp(__value_, *__m))
- __len = __l2;
- else
- {
- __first = ++__m;
- __len -= __l2 + 1;
- }
- }
- return __first;
-}
-
-template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
-{
- typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
- return __upper_bound<_Comp_ref>(__first, __last, __value_, __comp);
-}
-
-template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator
-upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
-{
- return _VSTD::upper_bound(__first, __last, __value_,
- __less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>());
-}
-
-// equal_range
-
-template <class _Compare, class _ForwardIterator, class _Tp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
-__equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
-{
- typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
- difference_type __len = _VSTD::distance(__first, __last);
- while (__len != 0)
- {
- difference_type __l2 = _VSTD::__half_positive(__len);
- _ForwardIterator __m = __first;
- _VSTD::advance(__m, __l2);
- if (__comp(*__m, __value_))
- {
- __first = ++__m;
- __len -= __l2 + 1;
- }
- else if (__comp(__value_, *__m))
- {
- __last = __m;
- __len = __l2;
- }
- else
- {
- _ForwardIterator __mp1 = __m;
- return pair<_ForwardIterator, _ForwardIterator>
- (
- __lower_bound<_Compare>(__first, __m, __value_, __comp),
- __upper_bound<_Compare>(++__mp1, __last, __value_, __comp)
- );
- }
- }
- return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
-}
-
-template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-pair<_ForwardIterator, _ForwardIterator>
-equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __equal_range<_Comp_ref>(__first, __last, __value_, __comp);
-}
-
-template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-pair<_ForwardIterator, _ForwardIterator>
-equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
-{
- return _VSTD::equal_range(__first, __last, __value_,
- __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
-}
-
-// binary_search
-
-template <class _Compare, class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
-{
- __first = __lower_bound<_Compare>(__first, __last, __value_, __comp);
- return __first != __last && !__comp(__value_, *__first);
-}
-
-template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __binary_search<_Comp_ref>(__first, __last, __value_, __comp);
-}
-
-template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
-{
- return _VSTD::binary_search(__first, __last, __value_,
- __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
-}
-
-// merge
-
-template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_OutputIterator
-__merge(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- for (; __first1 != __last1; ++__result)
- {
- if (__first2 == __last2)
- return _VSTD::copy(__first1, __last1, __result);
- if (__comp(*__first2, *__first1))
- {
- *__result = *__first2;
- ++__first2;
- }
- else
- {
- *__result = *__first1;
- ++__first1;
- }
- }
- return _VSTD::copy(__first2, __last2, __result);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-merge(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-merge(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
-{
- typedef typename iterator_traits<_InputIterator1>::value_type __v1;
- typedef typename iterator_traits<_InputIterator2>::value_type __v2;
- return _VSTD::merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>());
-}
-
-// inplace_merge
-
-template <class _Compare, class _InputIterator1, class _InputIterator2,
- class _OutputIterator>
-void __half_inplace_merge(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2,
- _OutputIterator __result, _Compare __comp)
-{
- for (; __first1 != __last1; ++__result)
- {
- if (__first2 == __last2)
- {
- _VSTD::move(__first1, __last1, __result);
- return;
- }
-
- if (__comp(*__first2, *__first1))
- {
- *__result = _VSTD::move(*__first2);
- ++__first2;
- }
- else
- {
- *__result = _VSTD::move(*__first1);
- ++__first1;
- }
- }
- // __first2 through __last2 are already in the right spot.
-}
-
-template <class _Compare, class _BidirectionalIterator>
-void
-__buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
- _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1,
- typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
- typename iterator_traits<_BidirectionalIterator>::value_type* __buff)
-{
- typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
- if (__len1 <= __len2)
- {
- value_type* __p = __buff;
- for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), (void) ++__i, (void) ++__p)
- ::new(__p) value_type(_VSTD::move(*__i));
- __half_inplace_merge(__buff, __p, __middle, __last, __first, __comp);
- }
- else
- {
- value_type* __p = __buff;
- for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), (void) ++__i, (void) ++__p)
- ::new(__p) value_type(_VSTD::move(*__i));
- typedef reverse_iterator<_BidirectionalIterator> _RBi;
- typedef reverse_iterator<value_type*> _Rv;
- __half_inplace_merge(_Rv(__p), _Rv(__buff),
- _RBi(__middle), _RBi(__first),
- _RBi(__last), __invert<_Compare>(__comp));
- }
-}
-
-template <class _Compare, class _BidirectionalIterator>
-void
-__inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
- _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1,
- typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
- typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size)
-{
- typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
- while (true)
- {
- // if __middle == __last, we're done
- if (__len2 == 0)
- return;
- if (__len1 <= __buff_size || __len2 <= __buff_size)
- return __buffered_inplace_merge<_Compare>
- (__first, __middle, __last, __comp, __len1, __len2, __buff);
- // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0
- for (; true; ++__first, (void) --__len1)
- {
- if (__len1 == 0)
- return;
- if (__comp(*__middle, *__first))
- break;
- }
- // __first < __middle < __last
- // *__first > *__middle
- // partition [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) such that
- // all elements in:
- // [__first, __m1) <= [__middle, __m2)
- // [__middle, __m2) < [__m1, __middle)
- // [__m1, __middle) <= [__m2, __last)
- // and __m1 or __m2 is in the middle of its range
- _BidirectionalIterator __m1; // "median" of [__first, __middle)
- _BidirectionalIterator __m2; // "median" of [__middle, __last)
- difference_type __len11; // distance(__first, __m1)
- difference_type __len21; // distance(__middle, __m2)
- // binary search smaller range
- if (__len1 < __len2)
- { // __len >= 1, __len2 >= 2
- __len21 = __len2 / 2;
- __m2 = __middle;
- _VSTD::advance(__m2, __len21);
- __m1 = __upper_bound<_Compare>(__first, __middle, *__m2, __comp);
- __len11 = _VSTD::distance(__first, __m1);
- }
- else
- {
- if (__len1 == 1)
- { // __len1 >= __len2 && __len2 > 0, therefore __len2 == 1
- // It is known *__first > *__middle
- swap(*__first, *__middle);
- return;
- }
- // __len1 >= 2, __len2 >= 1
- __len11 = __len1 / 2;
- __m1 = __first;
- _VSTD::advance(__m1, __len11);
- __m2 = __lower_bound<_Compare>(__middle, __last, *__m1, __comp);
- __len21 = _VSTD::distance(__middle, __m2);
- }
- difference_type __len12 = __len1 - __len11; // distance(__m1, __middle)
- difference_type __len22 = __len2 - __len21; // distance(__m2, __last)
- // [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last)
- // swap middle two partitions
- __middle = _VSTD::rotate(__m1, __middle, __m2);
- // __len12 and __len21 now have swapped meanings
- // merge smaller range with recurisve call and larger with tail recursion elimination
- if (__len11 + __len21 < __len12 + __len22)
- {
- __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
-// __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
- __first = __middle;
- __middle = __m2;
- __len1 = __len12;
- __len2 = __len22;
- }
- else
- {
- __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
-// __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
- __last = __middle;
- __middle = __m1;
- __len1 = __len11;
- __len2 = __len21;
- }
- }
-}
-
-template <class _BidirectionalIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
- _Compare __comp)
-{
- typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
- typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
- difference_type __len1 = _VSTD::distance(__first, __middle);
- difference_type __len2 = _VSTD::distance(__middle, __last);
- difference_type __buf_size = _VSTD::min(__len1, __len2);
- pair<value_type*, ptrdiff_t> __buf = _VSTD::get_temporary_buffer<value_type>(__buf_size);
- unique_ptr<value_type, __return_temporary_buffer> __h(__buf.first);
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2,
- __buf.first, __buf.second);
-}
-
-template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last)
-{
- _VSTD::inplace_merge(__first, __middle, __last,
- __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
-}
-
-// stable_sort
-
-template <class _Compare, class _InputIterator1, class _InputIterator2>
-void
-__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2,
- typename iterator_traits<_InputIterator1>::value_type* __result, _Compare __comp)
-{
- typedef typename iterator_traits<_InputIterator1>::value_type value_type;
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h(__result, __d);
- for (; true; ++__result)
- {
- if (__first1 == __last1)
- {
- for (; __first2 != __last2; ++__first2, ++__result, (void) __d.__incr((value_type*)0))
- ::new (__result) value_type(_VSTD::move(*__first2));
- __h.release();
- return;
- }
- if (__first2 == __last2)
- {
- for (; __first1 != __last1; ++__first1, ++__result, (void) __d.__incr((value_type*)0))
- ::new (__result) value_type(_VSTD::move(*__first1));
- __h.release();
- return;
- }
- if (__comp(*__first2, *__first1))
- {
- ::new (__result) value_type(_VSTD::move(*__first2));
- __d.__incr((value_type*)0);
- ++__first2;
- }
- else
- {
- ::new (__result) value_type(_VSTD::move(*__first1));
- __d.__incr((value_type*)0);
- ++__first1;
- }
- }
-}
-
-template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
-void
-__merge_move_assign(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2,
- _OutputIterator __result, _Compare __comp)
-{
- for (; __first1 != __last1; ++__result)
- {
- if (__first2 == __last2)
- {
- for (; __first1 != __last1; ++__first1, (void) ++__result)
- *__result = _VSTD::move(*__first1);
- return;
- }
- if (__comp(*__first2, *__first1))
- {
- *__result = _VSTD::move(*__first2);
- ++__first2;
- }
- else
- {
- *__result = _VSTD::move(*__first1);
- ++__first1;
- }
- }
- for (; __first2 != __last2; ++__first2, (void) ++__result)
- *__result = _VSTD::move(*__first2);
-}
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- typename iterator_traits<_RandomAccessIterator>::difference_type __len,
- typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size);
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1, _Compare __comp,
- typename iterator_traits<_RandomAccessIterator>::difference_type __len,
- typename iterator_traits<_RandomAccessIterator>::value_type* __first2)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- switch (__len)
- {
- case 0:
- return;
- case 1:
- ::new(__first2) value_type(_VSTD::move(*__first1));
- return;
- case 2:
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h2(__first2, __d);
- if (__comp(*--__last1, *__first1))
- {
- ::new(__first2) value_type(_VSTD::move(*__last1));
- __d.__incr((value_type*)0);
- ++__first2;
- ::new(__first2) value_type(_VSTD::move(*__first1));
- }
- else
- {
- ::new(__first2) value_type(_VSTD::move(*__first1));
- __d.__incr((value_type*)0);
- ++__first2;
- ::new(__first2) value_type(_VSTD::move(*__last1));
- }
- __h2.release();
- return;
- }
- if (__len <= 8)
- {
- __insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp);
- return;
- }
- typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
- _RandomAccessIterator __m = __first1 + __l2;
- __stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2);
- __stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2);
- __merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp);
-}
-
-template <class _Tp>
-struct __stable_sort_switch
-{
- static const unsigned value = 128*is_trivially_copy_assignable<_Tp>::value;
-};
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- typename iterator_traits<_RandomAccessIterator>::difference_type __len,
- typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- switch (__len)
- {
- case 0:
- case 1:
- return;
- case 2:
- if (__comp(*--__last, *__first))
- swap(*__first, *__last);
- return;
- }
- if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value))
- {
- __insertion_sort<_Compare>(__first, __last, __comp);
- return;
- }
- typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
- _RandomAccessIterator __m = __first + __l2;
- if (__len <= __buff_size)
- {
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
- __stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff);
- __d.__set(__l2, (value_type*)0);
- __stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);
- __d.__set(__len, (value_type*)0);
- __merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);
-// __merge<_Compare>(move_iterator<value_type*>(__buff),
-// move_iterator<value_type*>(__buff + __l2),
-// move_iterator<_RandomAccessIterator>(__buff + __l2),
-// move_iterator<_RandomAccessIterator>(__buff + __len),
-// __first, __comp);
- return;
- }
- __stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size);
- __stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size);
- __inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size);
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- difference_type __len = __last - __first;
- pair<value_type*, ptrdiff_t> __buf(0, 0);
- unique_ptr<value_type, __return_temporary_buffer> __h;
- if (__len > static_cast<difference_type>(__stable_sort_switch<value_type>::value))
- {
- __buf = _VSTD::get_temporary_buffer<value_type>(__len);
- __h.reset(__buf.first);
- }
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- __stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- _VSTD::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// is_heap_until
-
-template <class _RandomAccessIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
-is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- difference_type __len = __last - __first;
- difference_type __p = 0;
- difference_type __c = 1;
- _RandomAccessIterator __pp = __first;
- while (__c < __len)
- {
- _RandomAccessIterator __cp = __first + __c;
- if (__comp(*__pp, *__cp))
- return __cp;
- ++__c;
- ++__cp;
- if (__c == __len)
- return __last;
- if (__comp(*__pp, *__cp))
- return __cp;
- ++__p;
- ++__pp;
- __c = 2 * __p + 1;
- }
- return __last;
-}
-
-template<class _RandomAccessIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_RandomAccessIterator
-is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- return _VSTD::is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// is_heap
-
-template <class _RandomAccessIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- return _VSTD::is_heap_until(__first, __last, __comp) == __last;
-}
-
-template<class _RandomAccessIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- return _VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// push_heap
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- typename iterator_traits<_RandomAccessIterator>::difference_type __len)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- if (__len > 1)
- {
- __len = (__len - 2) / 2;
- _RandomAccessIterator __ptr = __first + __len;
- if (__comp(*__ptr, *--__last))
- {
- value_type __t(_VSTD::move(*__last));
- do
- {
- *__last = _VSTD::move(*__ptr);
- __last = __ptr;
- if (__len == 0)
- break;
- __len = (__len - 1) / 2;
- __ptr = __first + __len;
- } while (__comp(*__ptr, __t));
- *__last = _VSTD::move(__t);
- }
- }
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- __sift_up<_Comp_ref>(__first, __last, __comp, __last - __first);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- _VSTD::push_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// pop_heap
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
- _Compare __comp,
- typename iterator_traits<_RandomAccessIterator>::difference_type __len,
- _RandomAccessIterator __start)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
- // left-child of __start is at 2 * __start + 1
- // right-child of __start is at 2 * __start + 2
- difference_type __child = __start - __first;
-
- if (__len < 2 || (__len - 2) / 2 < __child)
- return;
-
- __child = 2 * __child + 1;
- _RandomAccessIterator __child_i = __first + __child;
-
- if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) {
- // right-child exists and is greater than left-child
- ++__child_i;
- ++__child;
- }
-
- // check if we are in heap-order
- if (__comp(*__child_i, *__start))
- // we are, __start is larger than it's largest child
- return;
-
- value_type __top(_VSTD::move(*__start));
- do
- {
- // we are not in heap-order, swap the parent with it's largest child
- *__start = _VSTD::move(*__child_i);
- __start = __child_i;
-
- if ((__len - 2) / 2 < __child)
- break;
-
- // recompute the child based off of the updated parent
- __child = 2 * __child + 1;
- __child_i = __first + __child;
-
- if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) {
- // right-child exists and is greater than left-child
- ++__child_i;
- ++__child;
- }
-
- // check if we are in heap-order
- } while (!__comp(*__child_i, __top));
- *__start = _VSTD::move(__top);
-}
-
-template <class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- typename iterator_traits<_RandomAccessIterator>::difference_type __len)
-{
- if (__len > 1)
- {
- swap(*__first, *--__last);
- __sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);
- }
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- __pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- _VSTD::pop_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// make_heap
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- difference_type __n = __last - __first;
- if (__n > 1)
- {
- // start from the first parent, there is no need to consider children
- for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start)
- {
- __sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);
- }
- }
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- __make_heap<_Comp_ref>(__first, __last, __comp);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- _VSTD::make_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// sort_heap
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- for (difference_type __n = __last - __first; __n > 1; --__last, (void) --__n)
- __pop_heap<_Compare>(__first, __last, __comp, __n);
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- __sort_heap<_Comp_ref>(__first, __last, __comp);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- _VSTD::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// partial_sort
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
- _Compare __comp)
-{
- __make_heap<_Compare>(__first, __middle, __comp);
- typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first;
- for (_RandomAccessIterator __i = __middle; __i != __last; ++__i)
- {
- if (__comp(*__i, *__first))
- {
- swap(*__i, *__first);
- __sift_down<_Compare>(__first, __middle, __comp, __len, __first);
- }
- }
- __sort_heap<_Compare>(__first, __middle, __comp);
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
- _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- __partial_sort<_Comp_ref>(__first, __middle, __last, __comp);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
-{
- _VSTD::partial_sort(__first, __middle, __last,
- __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// partial_sort_copy
-
-template <class _Compare, class _InputIterator, class _RandomAccessIterator>
-_RandomAccessIterator
-__partial_sort_copy(_InputIterator __first, _InputIterator __last,
- _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)
-{
- _RandomAccessIterator __r = __result_first;
- if (__r != __result_last)
- {
- for (; __first != __last && __r != __result_last; ++__first, (void) ++__r)
- *__r = *__first;
- __make_heap<_Compare>(__result_first, __r, __comp);
- typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first;
- for (; __first != __last; ++__first)
- if (__comp(*__first, *__result_first))
- {
- *__result_first = *__first;
- __sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first);
- }
- __sort_heap<_Compare>(__result_first, __r, __comp);
- }
- return __r;
-}
-
-template <class _InputIterator, class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-_RandomAccessIterator
-partial_sort_copy(_InputIterator __first, _InputIterator __last,
- _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp);
-}
-
-template <class _InputIterator, class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_RandomAccessIterator
-partial_sort_copy(_InputIterator __first, _InputIterator __last,
- _RandomAccessIterator __result_first, _RandomAccessIterator __result_last)
-{
- return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last,
- __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// nth_element
-
-template <class _Compare, class _RandomAccessIterator>
-void
-__nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
-{
- // _Compare is known to be a reference type
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- const difference_type __limit = 7;
- while (true)
- {
- __restart:
- if (__nth == __last)
- return;
- difference_type __len = __last - __first;
- switch (__len)
- {
- case 0:
- case 1:
- return;
- case 2:
- if (__comp(*--__last, *__first))
- swap(*__first, *__last);
- return;
- case 3:
- {
- _RandomAccessIterator __m = __first;
- _VSTD::__sort3<_Compare>(__first, ++__m, --__last, __comp);
- return;
- }
- }
- if (__len <= __limit)
- {
- __selection_sort<_Compare>(__first, __last, __comp);
- return;
- }
- // __len > __limit >= 3
- _RandomAccessIterator __m = __first + __len/2;
- _RandomAccessIterator __lm1 = __last;
- unsigned __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, --__lm1, __comp);
- // *__m is median
- // partition [__first, __m) < *__m and *__m <= [__m, __last)
- // (this inhibits tossing elements equivalent to __m around unnecessarily)
- _RandomAccessIterator __i = __first;
- _RandomAccessIterator __j = __lm1;
- // j points beyond range to be tested, *__lm1 is known to be <= *__m
- // The search going up is known to be guarded but the search coming down isn't.
- // Prime the downward search with a guard.
- if (!__comp(*__i, *__m)) // if *__first == *__m
- {
- // *__first == *__m, *__first doesn't go in first part
- // manually guard downward moving __j against __i
- while (true)
- {
- if (__i == --__j)
- {
- // *__first == *__m, *__m <= all other elements
- // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)
- ++__i; // __first + 1
- __j = __last;
- if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
- {
- while (true)
- {
- if (__i == __j)
- return; // [__first, __last) all equivalent elements
- if (__comp(*__first, *__i))
- {
- swap(*__i, *__j);
- ++__n_swaps;
- ++__i;
- break;
- }
- ++__i;
- }
- }
- // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
- if (__i == __j)
- return;
- while (true)
- {
- while (!__comp(*__first, *__i))
- ++__i;
- while (__comp(*__first, *--__j))
- ;
- if (__i >= __j)
- break;
- swap(*__i, *__j);
- ++__n_swaps;
- ++__i;
- }
- // [__first, __i) == *__first and *__first < [__i, __last)
- // The first part is sorted,
- if (__nth < __i)
- return;
- // __nth_element the secod part
- // __nth_element<_Compare>(__i, __nth, __last, __comp);
- __first = __i;
- goto __restart;
- }
- if (__comp(*__j, *__m))
- {
- swap(*__i, *__j);
- ++__n_swaps;
- break; // found guard for downward moving __j, now use unguarded partition
- }
- }
- }
- ++__i;
- // j points beyond range to be tested, *__lm1 is known to be <= *__m
- // if not yet partitioned...
- if (__i < __j)
- {
- // known that *(__i - 1) < *__m
- while (true)
- {
- // __m still guards upward moving __i
- while (__comp(*__i, *__m))
- ++__i;
- // It is now known that a guard exists for downward moving __j
- while (!__comp(*--__j, *__m))
- ;
- if (__i >= __j)
- break;
- swap(*__i, *__j);
- ++__n_swaps;
- // It is known that __m != __j
- // If __m just moved, follow it
- if (__m == __i)
- __m = __j;
- ++__i;
- }
- }
- // [__first, __i) < *__m and *__m <= [__i, __last)
- if (__i != __m && __comp(*__m, *__i))
- {
- swap(*__i, *__m);
- ++__n_swaps;
- }
- // [__first, __i) < *__i and *__i <= [__i+1, __last)
- if (__nth == __i)
- return;
- if (__n_swaps == 0)
- {
- // We were given a perfectly partitioned sequence. Coincidence?
- if (__nth < __i)
- {
- // Check for [__first, __i) already sorted
- __j = __m = __first;
- while (++__j != __i)
- {
- if (__comp(*__j, *__m))
- // not yet sorted, so sort
- goto not_sorted;
- __m = __j;
- }
- // [__first, __i) sorted
- return;
- }
- else
- {
- // Check for [__i, __last) already sorted
- __j = __m = __i;
- while (++__j != __last)
- {
- if (__comp(*__j, *__m))
- // not yet sorted, so sort
- goto not_sorted;
- __m = __j;
- }
- // [__i, __last) sorted
- return;
- }
- }
-not_sorted:
- // __nth_element on range containing __nth
- if (__nth < __i)
- {
- // __nth_element<_Compare>(__first, __nth, __i, __comp);
- __last = __i;
- }
- else
- {
- // __nth_element<_Compare>(__i+1, __nth, __last, __comp);
- __first = ++__i;
- }
- }
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- __nth_element<_Comp_ref>(__first, __nth, __last, __comp);
-}
-
-template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last)
-{
- _VSTD::nth_element(__first, __nth, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
-}
-
-// includes
-
-template <class _Compare, class _InputIterator1, class _InputIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
-__includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
- _Compare __comp)
-{
- for (; __first2 != __last2; ++__first1)
- {
- if (__first1 == __last1 || __comp(*__first2, *__first1))
- return false;
- if (!__comp(*__first1, *__first2))
- ++__first2;
- }
- return true;
-}
-
-template <class _InputIterator1, class _InputIterator2, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
- _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
-}
-
-template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)
-{
- return _VSTD::includes(__first1, __last1, __first2, __last2,
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
-}
-
-// set_union
-
-template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_OutputIterator
-__set_union(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- for (; __first1 != __last1; ++__result)
- {
- if (__first2 == __last2)
- return _VSTD::copy(__first1, __last1, __result);
- if (__comp(*__first2, *__first1))
- {
- *__result = *__first2;
- ++__first2;
- }
- else
- {
- if (!__comp(*__first1, *__first2))
- ++__first2;
- *__result = *__first1;
- ++__first1;
- }
- }
- return _VSTD::copy(__first2, __last2, __result);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-set_union(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-set_union(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
-{
- return _VSTD::set_union(__first1, __last1, __first2, __last2, __result,
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
-}
-
-// set_intersection
-
-template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
-__set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- while (__first1 != __last1 && __first2 != __last2)
- {
- if (__comp(*__first1, *__first2))
- ++__first1;
- else
- {
- if (!__comp(*__first2, *__first1))
- {
- *__result = *__first1;
- ++__result;
- ++__first1;
- }
- ++__first2;
- }
- }
- return __result;
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_OutputIterator
-set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
-{
- return _VSTD::set_intersection(__first1, __last1, __first2, __last2, __result,
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
-}
-
-// set_difference
-
-template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_OutputIterator
-__set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- while (__first1 != __last1)
- {
- if (__first2 == __last2)
- return _VSTD::copy(__first1, __last1, __result);
- if (__comp(*__first1, *__first2))
- {
- *__result = *__first1;
- ++__result;
- ++__first1;
- }
- else
- {
- if (!__comp(*__first2, *__first1))
- ++__first1;
- ++__first2;
- }
- }
- return __result;
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
-{
- return _VSTD::set_difference(__first1, __last1, __first2, __last2, __result,
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
-}
-
-// set_symmetric_difference
-
-template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_OutputIterator
-__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- while (__first1 != __last1)
- {
- if (__first2 == __last2)
- return _VSTD::copy(__first1, __last1, __result);
- if (__comp(*__first1, *__first2))
- {
- *__result = *__first1;
- ++__result;
- ++__first1;
- }
- else
- {
- if (__comp(*__first2, *__first1))
- {
- *__result = *__first2;
- ++__result;
- }
- else
- ++__first1;
- ++__first2;
- }
- }
- return _VSTD::copy(__first2, __last2, __result);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
-}
-
-template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_OutputIterator
-set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
-{
- return _VSTD::set_symmetric_difference(__first1, __last1, __first2, __last2, __result,
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
-}
-
-// lexicographical_compare
-
-template <class _Compare, class _InputIterator1, class _InputIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
-__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
-{
- for (; __first2 != __last2; ++__first1, (void) ++__first2)
- {
- if (__first1 == __last1 || __comp(*__first1, *__first2))
- return true;
- if (__comp(*__first2, *__first1))
- return false;
- }
- return false;
-}
-
-template <class _InputIterator1, class _InputIterator2, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
-}
-
-template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-bool
-lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _InputIterator2 __last2)
-{
- return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2,
- __less<typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>());
-}
-
-// next_permutation
-
-template <class _Compare, class _BidirectionalIterator>
-bool
-__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
-{
- _BidirectionalIterator __i = __last;
- if (__first == __last || __first == --__i)
- return false;
- while (true)
- {
- _BidirectionalIterator __ip1 = __i;
- if (__comp(*--__i, *__ip1))
- {
- _BidirectionalIterator __j = __last;
- while (!__comp(*__i, *--__j))
- ;
- swap(*__i, *__j);
- _VSTD::reverse(__ip1, __last);
- return true;
- }
- if (__i == __first)
- {
- _VSTD::reverse(__first, __last);
- return false;
- }
- }
-}
-
-template <class _BidirectionalIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __next_permutation<_Comp_ref>(__first, __last, __comp);
-}
-
-template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
-{
- return _VSTD::next_permutation(__first, __last,
- __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
-}
-
-// prev_permutation
-
-template <class _Compare, class _BidirectionalIterator>
-bool
-__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
-{
- _BidirectionalIterator __i = __last;
- if (__first == __last || __first == --__i)
- return false;
- while (true)
- {
- _BidirectionalIterator __ip1 = __i;
- if (__comp(*__ip1, *--__i))
- {
- _BidirectionalIterator __j = __last;
- while (!__comp(*--__j, *__i))
- ;
- swap(*__i, *__j);
- _VSTD::reverse(__ip1, __last);
- return true;
- }
- if (__i == __first)
- {
- _VSTD::reverse(__first, __last);
- return false;
- }
- }
-}
-
-template <class _BidirectionalIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
-{
- typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
- return __prev_permutation<_Comp_ref>(__first, __last, __comp);
-}
-
-template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
-{
- return _VSTD::prev_permutation(__first, __last,
- __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
-}
-
-_LIBCPP_END_NAMESPACE_STD
-
_LIBCPP_POP_MACROS
#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
# include <__pstl_algorithm>
#endif
-#endif // _LIBCPP_ALGORITHM
+#endif // _LIBCPP_ALGORITHM
*/
-#include <experimental/__config>
+#include <__availability>
+#include <__config>
+#include <__utility/forward.h>
+#include <cstdlib>
#include <memory>
-#include <new>
-#include <typeinfo>
#include <type_traits>
-#include <cstdlib>
+#include <typeinfo>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
constexpr const void* __get_fallback_typeid() {
- return &__unique_typeinfo<decay_t<_Tp>>::__id;
+ return &__unique_typeinfo<remove_cv_t<remove_reference_t<_Tp>>>::__id;
}
template <class _Tp>
template <class ..._Args>
_LIBCPP_INLINE_VISIBILITY
static _Tp& __create(any & __dest, _Args&&... __args) {
- _Tp* __ret = ::new (static_cast<void*>(&__dest.__s.__buf)) _Tp(_VSTD::forward<_Args>(__args)...);
+ typedef allocator<_Tp> _Alloc;
+ typedef allocator_traits<_Alloc> _ATraits;
+ _Alloc __a;
+ _Tp * __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s.__buf));
+ _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
__dest.__h = &_SmallHandler::__handle;
return *__ret;
}
private:
_LIBCPP_INLINE_VISIBILITY
static void __destroy(any & __this) {
- _Tp & __value = *static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));
- __value.~_Tp();
+ typedef allocator<_Tp> _Alloc;
+ typedef allocator_traits<_Alloc> _ATraits;
+ _Alloc __a;
+ _Tp * __p = static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));
+ _ATraits::destroy(__a, __p);
__this.__h = nullptr;
}
_LIBCPP_INLINE_VISIBILITY
static _Tp& __create(any & __dest, _Args&&... __args) {
typedef allocator<_Tp> _Alloc;
+ typedef allocator_traits<_Alloc> _ATraits;
typedef __allocator_destructor<_Alloc> _Dp;
_Alloc __a;
- unique_ptr<_Tp, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
- _Tp* __ret = ::new ((void*)__hold.get()) _Tp(_VSTD::forward<_Args>(__args)...);
+ unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1));
+ _Tp * __ret = __hold.get();
+ _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
__dest.__s.__ptr = __hold.release();
__dest.__h = &_LargeHandler::__handle;
return *__ret;
_LIBCPP_INLINE_VISIBILITY
static void __destroy(any & __this){
- delete static_cast<_Tp*>(__this.__s.__ptr);
+ typedef allocator<_Tp> _Alloc;
+ typedef allocator_traits<_Alloc> _ATraits;
+ _Alloc __a;
+ _Tp * __p = static_cast<_Tp *>(__this.__s.__ptr);
+ _ATraits::destroy(__a, __p);
+ _ATraits::deallocate(__a, __p, 1);
__this.__h = nullptr;
}
*/
#include <__config>
+#include <__debug>
#include <__tuple>
-#include <type_traits>
-#include <utility>
-#include <iterator>
#include <algorithm>
-#include <stdexcept>
#include <cstdlib> // for _LIBCPP_UNREACHABLE
+#include <iterator>
+#include <stdexcept>
+#include <type_traits>
+#include <utility>
#include <version>
-#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
-
-
_LIBCPP_BEGIN_NAMESPACE_STD
-
template <class _Tp, size_t _Size>
struct _LIBCPP_TEMPLATE_VIS array
{
typedef const value_type* const_pointer;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
+ typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
_Tp __elems_[_Size];
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
- std::swap_ranges(data(), data() + _Size, __a.data());
+ _VSTD::swap_ranges(data(), data() + _Size, __a.data());
}
// iterators:
typedef const value_type* const_pointer;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
+ typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename conditional<is_const<_Tp>::value, const char,
char>::type _CharType;
return __a.__elems_[_Ip];
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <size_t _Ip, class _Tp, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&&
return _VSTD::move(__a.__elems_[_Ip]);
}
-#endif // !_LIBCPP_CXX03_LANG
-
#if _LIBCPP_STD_VER > 17
template <typename _Tp, size_t _Size, size_t... _Index>
static_assert(
is_constructible_v<_Tp, _Tp&>,
"[array.creation]/1: to_array requires copy constructible elements.");
- return __to_array_lvalue_impl(__arr, make_index_sequence<_Size>());
+ return _VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>());
}
template <typename _Tp, size_t _Size>
static_assert(
is_move_constructible_v<_Tp>,
"[array.creation]/4: to_array requires move constructible elements.");
- return __to_array_rvalue_impl(_VSTD::move(__arr),
- make_index_sequence<_Size>());
+ return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr),
+ make_index_sequence<_Size>());
}
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_ARRAY
+#endif // _LIBCPP_ARRAY
namespace std
{
-// feature test macro
+// feature test macro [version.syn]
-#define __cpp_lib_atomic_is_always_lock_free // as specified by SG10
+#define __cpp_lib_atomic_is_always_lock_free
+#define __cpp_lib_atomic_flag_test
+#define __cpp_lib_atomic_lock_free_type_aliases
+#define __cpp_lib_atomic_wait
// order and consistency
#define ATOMIC_BOOL_LOCK_FREE unspecified
#define ATOMIC_CHAR_LOCK_FREE unspecified
+#define ATOMIC_CHAR8_T_LOCK_FREE unspecified // C++20
#define ATOMIC_CHAR16_T_LOCK_FREE unspecified
#define ATOMIC_CHAR32_T_LOCK_FREE unspecified
#define ATOMIC_WCHAR_T_LOCK_FREE unspecified
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
- atomic() noexcept = default;
+ atomic() noexcept = default; // until C++20
+ constexpr atomic() noexcept(is_nothrow_default_constructible_v<T>); // since C++20
constexpr atomic(T desr) noexcept;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
struct atomic<integral>
{
using value_type = integral;
+ using difference_type = value_type;
static constexpr bool is_always_lock_free;
bool is_lock_free() const volatile noexcept;
struct atomic<T*>
{
using value_type = T*;
+ using difference_type = ptrdiff_t;
static constexpr bool is_always_lock_free;
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
- atomic() noexcept = default;
+ atomic() noexcept = default; // until C++20
+ constexpr atomic() noexcept; // since C++20
constexpr atomic(T* desr) noexcept;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
typedef atomic<unsigned long> atomic_ulong;
typedef atomic<long long> atomic_llong;
typedef atomic<unsigned long long> atomic_ullong;
+typedef atomic<char8_t> atomic_char8_t; // C++20
typedef atomic<char16_t> atomic_char16_t;
typedef atomic<char32_t> atomic_char32_t;
typedef atomic<wchar_t> atomic_wchar_t;
typedef atomic<uint_fast8_t> atomic_uint_fast8_t;
typedef atomic<int_fast16_t> atomic_int_fast16_t;
typedef atomic<uint_fast16_t> atomic_uint_fast16_t;
-typedef atomic<int_fast32_t> atomic_int_fast32_t;
+typedef atomic<int_fast32_t> atomic_int_fast32_t;
typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
typedef atomic<int_fast64_t> atomic_int_fast64_t;
typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
typedef struct atomic_flag
{
- atomic_flag() noexcept = default;
+ atomic_flag() noexcept = default; // until C++20
+ constexpr atomic_flag() noexcept; // since C++20
atomic_flag(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) volatile = delete;
*/
+#include <__availability>
#include <__config>
#include <__threading_support>
#include <cstddef>
template <typename _Tp> _LIBCPP_INLINE_VISIBILITY
bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {
- return memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0;
+ return _VSTD::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0;
}
static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),
"unexpected underlying type for std::memory_order");
#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \
- defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS)
+ defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS)
// [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
// the default operator= in an object is not volatile, a byte-by-byte copy
return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order));
}
+_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR memory_order __to_failure_order(memory_order __order) {
+ // Avoid switch statement to make this a constexpr.
+ return __order == memory_order_release ? memory_order_relaxed:
+ (__order == memory_order_acq_rel ? memory_order_acquire:
+ __order);
+}
+
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure));
+ return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
}
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure));
+ return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
}
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure));
+ return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
}
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure));
+ return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
}
template<class _Tp>
#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+# define ATOMIC_CHAR8_T_LOCK_FREE __CLANG_ATOMIC_CHAR8_T_LOCK_FREE
+#endif
# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
#elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)
# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+# define ATOMIC_CHAR8_T_LOCK_FREE __GCC_ATOMIC_CHAR8_T_LOCK_FREE
+#endif
# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
_LIBCPP_INLINE_VISIBILITY
bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,
_Tp* __expected, _Tp __value, memory_order, memory_order) {
- __a->__lock();
_Tp __temp;
+ __a->__lock();
__cxx_atomic_assign_volatile(__temp, __a->__a_value);
- bool __ret = __temp == *__expected;
+ bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
if(__ret)
__cxx_atomic_assign_volatile(__a->__a_value, __value);
else
bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,
_Tp* __expected, _Tp __value, memory_order, memory_order) {
__a->__lock();
- bool __ret = __a->__a_value == *__expected;
+ bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
if(__ret)
- __a->__a_value = __value;
+ _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
else
- *__expected = __a->__a_value;
+ _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
__a->__unlock();
return __ret;
}
_LIBCPP_INLINE_VISIBILITY
bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,
_Tp* __expected, _Tp __value, memory_order, memory_order) {
- __a->__lock();
_Tp __temp;
+ __a->__lock();
__cxx_atomic_assign_volatile(__temp, __a->__a_value);
- bool __ret = __temp == *__expected;
+ bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
if(__ret)
__cxx_atomic_assign_volatile(__a->__a_value, __value);
else
bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,
_Tp* __expected, _Tp __value, memory_order, memory_order) {
__a->__lock();
- bool __ret = __a->__a_value == *__expected;
+ bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
if(__ret)
- __a->__a_value = __value;
+ _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
else
- *__expected = __a->__a_value;
+ _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
__a->__unlock();
return __ret;
}
template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
template<> struct __cxx_is_always_lock_free<unsigned char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+template<> struct __cxx_is_always_lock_free<char8_t> { enum { __value = 2 == ATOMIC_CHAR8_T_LOCK_FREE }; };
+#endif
template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; };
template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; };
template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; };
using __cxx_contention_t = int64_t;
#endif //__linux__
-#if _LIBCPP_STD_VER >= 11
-
using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
#ifndef _LIBCPP_HAS_NO_PLATFORM_WAIT
else if(__elapsed > chrono::microseconds(4))
__libcpp_thread_yield();
else
- ; // poll
+ {} // poll
return false;
}
};
return __cxx_atomic_wait(__a, __test_fn);
}
-#endif //_LIBCPP_STD_VER >= 11
-
// general atomic<T>
template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_all() _NOEXCEPT
{__cxx_atomic_notify_all(&__a_);}
+#if _LIBCPP_STD_VER > 17
+ _LIBCPP_INLINE_VISIBILITY constexpr
+ __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {}
+#else
_LIBCPP_INLINE_VISIBILITY
__atomic_base() _NOEXCEPT _LIBCPP_DEFAULT
+#endif
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
__atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
#ifndef _LIBCPP_CXX03_LANG
__atomic_base(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) = delete;
- __atomic_base& operator=(const __atomic_base&) volatile = delete;
#else
private:
_LIBCPP_INLINE_VISIBILITY
__atomic_base(const __atomic_base&);
- _LIBCPP_INLINE_VISIBILITY
- __atomic_base& operator=(const __atomic_base&);
- _LIBCPP_INLINE_VISIBILITY
- __atomic_base& operator=(const __atomic_base&) volatile;
#endif
};
: public __atomic_base<_Tp, false>
{
typedef __atomic_base<_Tp, false> __base;
- _LIBCPP_INLINE_VISIBILITY
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
__atomic_base() _NOEXCEPT _LIBCPP_DEFAULT
+
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
{
typedef __atomic_base<_Tp> __base;
typedef _Tp value_type;
+ typedef value_type difference_type;
+
+#if _LIBCPP_STD_VER > 17
+ _LIBCPP_INLINE_VISIBILITY
+ atomic() = default;
+#else
_LIBCPP_INLINE_VISIBILITY
atomic() _NOEXCEPT _LIBCPP_DEFAULT
+#endif
+
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
_LIBCPP_INLINE_VISIBILITY
_Tp operator=(_Tp __d) _NOEXCEPT
{__base::store(__d); return __d;}
+
+ atomic& operator=(const atomic&) = delete;
+ atomic& operator=(const atomic&) volatile = delete;
};
// atomic<T*>
{
typedef __atomic_base<_Tp*> __base;
typedef _Tp* value_type;
+ typedef ptrdiff_t difference_type;
+
_LIBCPP_INLINE_VISIBILITY
atomic() _NOEXCEPT _LIBCPP_DEFAULT
+
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
_Tp* operator-=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
_LIBCPP_INLINE_VISIBILITY
_Tp* operator-=(ptrdiff_t __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
+
+ atomic& operator=(const atomic&) = delete;
+ atomic& operator=(const atomic&) volatile = delete;
};
// atomic_is_lock_free
// atomic_init
template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
void
-atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
+atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
__cxx_atomic_init(&__o->__a_, __d);
}
template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
void
-atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
+atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
__cxx_atomic_init(&__o->__a_, __d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
void
-atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
+atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
__o->store(__d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
void
-atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
+atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
__o->store(__d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
void
-atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
+atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
_LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
{
__o->store(__d, __m);
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
void
-atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
+atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
_LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
{
__o->store(__d, __m);
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
+atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
return __o->exchange(__d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
+atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
return __o->exchange(__d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
+atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
{
return __o->exchange(__d, __m);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
+atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
{
return __o->exchange(__d, __m);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
+atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
return __o->compare_exchange_weak(*__e, __d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
+atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
return __o->compare_exchange_weak(*__e, __d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
+atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
return __o->compare_exchange_strong(*__e, __d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
+atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
{
return __o->compare_exchange_strong(*__e, __d);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e,
- _Tp __d,
+atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
+ typename atomic<_Tp>::value_type __d,
memory_order __s, memory_order __f) _NOEXCEPT
_LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, _Tp* __e, _Tp __d,
+atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
memory_order __s, memory_order __f) _NOEXCEPT
_LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{
_LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
- _Tp* __e, _Tp __d,
+ typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
memory_order __s, memory_order __f) _NOEXCEPT
_LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, _Tp* __e,
- _Tp __d,
+atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
+ typename atomic<_Tp>::value_type __d,
memory_order __s, memory_order __f) _NOEXCEPT
_LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
_Tp
>::type
-atomic_fetch_add(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
{
return __o->fetch_add(__op);
}
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
_Tp
>::type
-atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
{
return __o->fetch_add(__op);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
+atomic_fetch_add(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
{
return __o->fetch_add(__op);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_add(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
+atomic_fetch_add(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
{
return __o->fetch_add(__op);
}
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
_Tp
>::type
-atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_add(__op, __m);
}
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
_Tp
>::type
-atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_add(__op, __m);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
- memory_order __m) _NOEXCEPT
+atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_add(__op, __m);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_add_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT
+atomic_fetch_add_explicit(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_add(__op, __m);
}
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
_Tp
>::type
-atomic_fetch_sub(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
{
return __o->fetch_sub(__op);
}
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
_Tp
>::type
-atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
{
return __o->fetch_sub(__op);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
+atomic_fetch_sub(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
{
return __o->fetch_sub(__op);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_sub(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
+atomic_fetch_sub(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
{
return __o->fetch_sub(__op);
}
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
_Tp
>::type
-atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_sub(__op, __m);
}
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
_Tp
>::type
-atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_sub(__op, __m);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
- memory_order __m) _NOEXCEPT
+atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_sub(__op, __m);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_sub_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT
+atomic_fetch_sub_explicit(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_sub(__op, __m);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_and(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
{
return __o->fetch_and(__op);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_and(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
{
return __o->fetch_and(__op);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_and(__op, __m);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_and_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_and(__op, __m);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_or(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
{
return __o->fetch_or(__op);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_or(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
{
return __o->fetch_or(__op);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_or(__op, __m);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_or_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_or(__op, __m);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_xor(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
{
return __o->fetch_xor(__op);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_xor(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
+atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
{
return __o->fetch_xor(__op);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_xor(__op, __m);
}
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_xor_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
+atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_xor(__op, __m);
}
void notify_all() _NOEXCEPT
{__cxx_atomic_notify_all(&__a_);}
+#if _LIBCPP_STD_VER > 17
+ _LIBCPP_INLINE_VISIBILITY constexpr
+ atomic_flag() _NOEXCEPT : __a_(false) {}
+#else
_LIBCPP_INLINE_VISIBILITY
atomic_flag() _NOEXCEPT _LIBCPP_DEFAULT
+#endif
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
typedef atomic<unsigned long> atomic_ulong;
typedef atomic<long long> atomic_llong;
typedef atomic<unsigned long long> atomic_ullong;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+typedef atomic<char8_t> atomic_char8_t;
+#endif
typedef atomic<char16_t> atomic_char16_t;
typedef atomic<char32_t> atomic_char32_t;
typedef atomic<wchar_t> atomic_wchar_t;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_ATOMIC
+#endif // _LIBCPP_ATOMIC
public:
using arrival_token = see below;
+ static constexpr ptrdiff_t max() noexcept;
+
constexpr explicit barrier(ptrdiff_t phase_count,
CompletionFunction f = CompletionFunction());
~barrier();
*/
+#include <__availability>
#include <__config>
#include <atomic>
#ifndef _LIBCPP_HAS_NO_TREE_BARRIER
# error <barrier> is not supported on this single threaded system
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
#if _LIBCPP_STD_VER >= 14
_LIBCPP_BEGIN_NAMESPACE_STD
template<class _CompletionF>
class __barrier_base {
-
ptrdiff_t __expected;
unique_ptr<__barrier_algorithm_base,
void (*)(__barrier_algorithm_base*)> __base;
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void wait(arrival_token&& __old_phase) const
{
- auto const __test_fn = [=]() -> bool {
+ auto const __test_fn = [this, __old_phase]() -> bool {
return __phase.load(memory_order_acquire) != __old_phase;
};
__libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy());
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())
- : __b(__count, std::move(__completion)) {
+ : __b(__count, _VSTD::move(__completion)) {
}
barrier(barrier const&) = delete;
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void wait(arrival_token&& __phase) const
{
- __b.wait(std::move(__phase));
+ __b.wait(_VSTD::move(__phase));
}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void arrive_and_wait()
{
wait(arrive());
- }
+ }
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void arrive_and_drop()
{
#endif // _LIBCPP_STD_VER >= 14
+_LIBCPP_POP_MACROS
+
#endif //_LIBCPP_BARRIER
// [bit.pow.two], integral powers of 2
template <class T>
- constexpr bool ispow2(T x) noexcept; // C++20
+ constexpr bool has_single_bit(T x) noexcept; // C++20
template <class T>
- constexpr T ceil2(T x); // C++20
+ constexpr T bit_ceil(T x); // C++20
template <class T>
- constexpr T floor2(T x) noexcept; // C++20
+ constexpr T bit_floor(T x) noexcept; // C++20
template <class T>
- constexpr T log2p1(T x) noexcept; // C++20
+ constexpr T bit_width(T x) noexcept; // C++20
// [bit.rotate], rotating
template<class T>
*/
#include <__config>
+#include <__bits> // __libcpp_clz
+#include <__debug>
#include <limits>
#include <type_traits>
#include <version>
-#include <__debug>
#if defined(__IBMCPP__)
-#include "support/ibm/support.h"
+#include "__support/ibm/support.h"
#endif
#if defined(_LIBCPP_COMPILER_MSVC)
#include <intrin.h>
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_COMPILER_MSVC
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_ctz(unsigned __x) _NOEXCEPT { return __builtin_ctz(__x); }
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_ctz(unsigned long __x) _NOEXCEPT { return __builtin_ctzl(__x); }
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); }
-
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_clz(unsigned __x) _NOEXCEPT { return __builtin_clz(__x); }
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_clz(unsigned long __x) _NOEXCEPT { return __builtin_clzl(__x); }
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); }
-
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_popcount(unsigned __x) _NOEXCEPT { return __builtin_popcount(__x); }
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_popcount(unsigned long __x) _NOEXCEPT { return __builtin_popcountl(__x); }
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popcountll(__x); }
-
-#else // _LIBCPP_COMPILER_MSVC
-
-// Precondition: __x != 0
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_ctz(unsigned __x) {
- static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
- static_assert(sizeof(unsigned long) == 4, "");
- unsigned long __where;
- if (_BitScanForward(&__where, __x))
- return static_cast<int>(__where);
- return 32;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_ctz(unsigned long __x) {
- static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
- return __ctz(static_cast<unsigned>(__x));
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_ctz(unsigned long long __x) {
- unsigned long __where;
-#if defined(_LIBCPP_HAS_BITSCAN64)
- (defined(_M_AMD64) || defined(__x86_64__))
- if (_BitScanForward64(&__where, __x))
- return static_cast<int>(__where);
-#else
- // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
- if (_BitScanForward(&__where, static_cast<unsigned long>(__x)))
- return static_cast<int>(__where);
- if (_BitScanForward(&__where, static_cast<unsigned long>(__x >> 32)))
- return static_cast<int>(__where + 32);
-#endif
- return 64;
-}
-
-// Precondition: __x != 0
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_clz(unsigned __x) {
- static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
- static_assert(sizeof(unsigned long) == 4, "");
- unsigned long __where;
- if (_BitScanReverse(&__where, __x))
- return static_cast<int>(31 - __where);
- return 32; // Undefined Behavior.
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_clz(unsigned long __x) {
- static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
- return __libcpp_clz(static_cast<unsigned>(__x));
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_clz(unsigned long long __x) {
- unsigned long __where;
-#if defined(_LIBCPP_HAS_BITSCAN64)
- if (_BitScanReverse64(&__where, __x))
- return static_cast<int>(63 - __where);
-#else
- // Win32 doesn't have _BitScanReverse64 so emulate it with two 32 bit calls.
- if (_BitScanReverse(&__where, static_cast<unsigned long>(__x >> 32)))
- return static_cast<int>(63 - (__where + 32));
- if (_BitScanReverse(&__where, static_cast<unsigned long>(__x)))
- return static_cast<int>(63 - __where);
-#endif
- return 64; // Undefined Behavior.
-}
-
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned __x) {
- static_assert(sizeof(unsigned) == 4, "");
- return __popcnt(__x);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long __x) {
- static_assert(sizeof(unsigned long) == 4, "");
- return __popcnt(__x);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long long __x) {
- static_assert(sizeof(unsigned long long) == 8, "");
- return __popcnt64(__x);
-}
-
-#endif // _LIBCPP_COMPILER_MSVC
-
-template <class _Tp>
-using __bitop_unsigned_integer _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
- is_integral<_Tp>::value &&
- is_unsigned<_Tp>::value &&
- _IsNotSame<typename remove_cv<_Tp>::type, bool>::value &&
- _IsNotSame<typename remove_cv<_Tp>::type, signed char>::value &&
- _IsNotSame<typename remove_cv<_Tp>::type, wchar_t>::value &&
- _IsNotSame<typename remove_cv<_Tp>::type, char16_t>::value &&
- _IsNotSame<typename remove_cv<_Tp>::type, char32_t>::value
- >;
-
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp __rotl(_Tp __t, unsigned int __cnt) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__rotl requires unsigned");
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__rotl requires an unsigned integer type");
const unsigned int __dig = numeric_limits<_Tp>::digits;
if ((__cnt % __dig) == 0)
return __t;
return (__t << (__cnt % __dig)) | (__t >> (__dig - (__cnt % __dig)));
}
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp __rotr(_Tp __t, unsigned int __cnt) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__rotr requires unsigned");
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__rotr requires an unsigned integer type");
const unsigned int __dig = numeric_limits<_Tp>::digits;
if ((__cnt % __dig) == 0)
return __t;
return (__t >> (__cnt % __dig)) | (__t << (__dig - (__cnt % __dig)));
}
-
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
int __countr_zero(_Tp __t) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__countr_zero requires unsigned");
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__countr_zero requires an unsigned integer type");
if (__t == 0)
return numeric_limits<_Tp>::digits;
else
{
int __ret = 0;
- int __iter = 0;
const unsigned int __ulldigits = numeric_limits<unsigned long long>::digits;
- while ((__iter = __libcpp_ctz(static_cast<unsigned long long>(__t))) == __ulldigits)
+ while (static_cast<unsigned long long>(__t) == 0uLL)
{
- __ret += __iter;
+ __ret += __ulldigits;
__t >>= __ulldigits;
}
- return __ret + __iter;
+ return __ret + __libcpp_ctz(static_cast<unsigned long long>(__t));
}
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
int __countl_zero(_Tp __t) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__countl_zero requires unsigned");
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__countl_zero requires an unsigned integer type");
if (__t == 0)
return numeric_limits<_Tp>::digits;
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
int __countl_one(_Tp __t) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__countl_one requires unsigned");
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__countl_one requires an unsigned integer type");
return __t != numeric_limits<_Tp>::max()
? __countl_zero(static_cast<_Tp>(~__t))
: numeric_limits<_Tp>::digits;
}
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
int __countr_one(_Tp __t) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__countr_one requires unsigned");
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__countr_one requires an unsigned integer type");
return __t != numeric_limits<_Tp>::max()
? __countr_zero(static_cast<_Tp>(~__t))
: numeric_limits<_Tp>::digits;
}
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-int
-__popcount(_Tp __t) _NOEXCEPT
+int __popcount(_Tp __t) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__libcpp_popcount requires unsigned");
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__popcount requires an unsigned integer type");
if (sizeof(_Tp) <= sizeof(unsigned int))
return __libcpp_popcount(static_cast<unsigned int>(__t));
else if (sizeof(_Tp) <= sizeof(unsigned long))
}
}
-
// integral log base 2
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
unsigned __bit_log2(_Tp __t) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__bit_log2 requires unsigned");
- return std::numeric_limits<_Tp>::digits - 1 - __countl_zero(__t);
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__bit_log2 requires an unsigned integer type");
+ return numeric_limits<_Tp>::digits - 1 - __countl_zero(__t);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-bool __ispow2(_Tp __t) _NOEXCEPT
+bool __has_single_bit(_Tp __t) _NOEXCEPT
{
- static_assert(__bitop_unsigned_integer<_Tp>::value, "__ispow2 requires unsigned");
+ static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__has_single_bit requires an unsigned integer type");
return __t != 0 && (((__t & (__t - 1)) == 0));
}
-
#if _LIBCPP_STD_VER > 17
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, _Tp>
rotl(_Tp __t, unsigned int __cnt) noexcept
{
return __rotl(__t, __cnt);
}
-
-// rotr
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, _Tp>
rotr(_Tp __t, unsigned int __cnt) noexcept
{
return __rotr(__t, __cnt);
}
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, int>
countl_zero(_Tp __t) noexcept
{
return __countl_zero(__t);
}
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, int>
countl_one(_Tp __t) noexcept
{
return __countl_one(__t);
}
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, int>
countr_zero(_Tp __t) noexcept
{
- return __countr_zero(__t);
+ return __countr_zero(__t);
}
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, int>
countr_one(_Tp __t) noexcept
{
return __countr_one(__t);
}
-
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, int>
popcount(_Tp __t) noexcept
{
return __popcount(__t);
}
-
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, bool>
-ispow2(_Tp __t) noexcept
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, bool>
+has_single_bit(_Tp __t) noexcept
{
- return __ispow2(__t);
+ return __has_single_bit(__t);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
-floor2(_Tp __t) noexcept
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, _Tp>
+bit_floor(_Tp __t) noexcept
{
return __t == 0 ? 0 : _Tp{1} << __bit_log2(__t);
}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
-ceil2(_Tp __t) noexcept
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, _Tp>
+bit_ceil(_Tp __t) noexcept
{
if (__t < 2) return 1;
const unsigned __n = numeric_limits<_Tp>::digits - countl_zero((_Tp)(__t - 1u));
- _LIBCPP_DEBUG_ASSERT(__libcpp_is_constant_evaluated() || __n != numeric_limits<_Tp>::digits, "Bad input to ceil2");
+ _LIBCPP_DEBUG_ASSERT(__libcpp_is_constant_evaluated() || __n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil");
if constexpr (sizeof(_Tp) >= sizeof(unsigned))
return _Tp{1} << __n;
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
-enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
-log2p1(_Tp __t) noexcept
+_EnableIf<__libcpp_is_unsigned_integer<_Tp>::value, _Tp>
+bit_width(_Tp __t) noexcept
{
return __t == 0 ? 0 : __bit_log2(__t) + 1;
}
-
enum class endian
{
little = 0xDEAD,
#include <__config>
#include <__bit_reference>
-#include <cstddef>
+#include <__functional_base>
#include <climits>
-#include <string>
-#include <stdexcept>
+#include <cstddef>
#include <iosfwd>
-#include <__functional_base>
+#include <stdexcept>
+#include <string>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
void __init(unsigned long long __v, false_type) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
void __init(unsigned long long __v, true_type) _NOEXCEPT;
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
unsigned long to_ulong(false_type) const;
_LIBCPP_INLINE_VISIBILITY
unsigned long to_ulong(true_type) const;
_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <size_t _N_words, size_t _Size>
inline
__bitset<_N_words, _Size>::to_ullong(true_type, true_type) const
{
unsigned long long __r = __first_[0];
- for (std::size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
+ for (size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
__r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);
return __r;
}
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
- {return reference(0, 1);}
+ {return reference(nullptr, 1);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT
- {return const_reference(0, 1);}
+ {return const_reference(nullptr, 1);}
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
- {return iterator(0, 0);}
+ {return iterator(nullptr, 0);}
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT
- {return const_iterator(0, 0);}
+ {return const_iterator(nullptr, 0);}
_LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}
_LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}
for (; __i < _Mp; ++__i)
{
_CharT __c = __str[_Mp - 1 - __i];
- if (__c == __zero)
- (*this)[__i] = false;
- else
- (*this)[__i] = true;
+ (*this)[__i] = (__c == __one);
}
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
}
for (; __i < _Mp; ++__i)
{
_CharT __c = __str[__pos + _Mp - 1 - __i];
- if (_Traits::eq(__c, __zero))
- (*this)[__i] = false;
- else
- (*this)[__i] = true;
+ (*this)[__i] = _Traits::eq(__c, __one);
}
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
}
size_t
bitset<_Size>::count() const _NOEXCEPT
{
- return static_cast<size_t>(__count_bool_true(base::__make_iter(0), _Size));
+ return static_cast<size_t>(_VSTD::__count_bool_true(base::__make_iter(0), _Size));
}
template <size_t _Size>
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_BITSET
+#endif // _LIBCPP_BITSET
// hh 080623 Created
-#endif // _LIBCPP_CCOMPLEX
+#endif // _LIBCPP_CCOMPLEX
#endif
-using ::isalnum;
-using ::isalpha;
-using ::isblank;
-using ::iscntrl;
-using ::isdigit;
-using ::isgraph;
-using ::islower;
-using ::isprint;
-using ::ispunct;
-using ::isspace;
-using ::isupper;
-using ::isxdigit;
-using ::tolower;
-using ::toupper;
+using ::isalnum _LIBCPP_USING_IF_EXISTS;
+using ::isalpha _LIBCPP_USING_IF_EXISTS;
+using ::isblank _LIBCPP_USING_IF_EXISTS;
+using ::iscntrl _LIBCPP_USING_IF_EXISTS;
+using ::isdigit _LIBCPP_USING_IF_EXISTS;
+using ::isgraph _LIBCPP_USING_IF_EXISTS;
+using ::islower _LIBCPP_USING_IF_EXISTS;
+using ::isprint _LIBCPP_USING_IF_EXISTS;
+using ::ispunct _LIBCPP_USING_IF_EXISTS;
+using ::isspace _LIBCPP_USING_IF_EXISTS;
+using ::isupper _LIBCPP_USING_IF_EXISTS;
+using ::isxdigit _LIBCPP_USING_IF_EXISTS;
+using ::tolower _LIBCPP_USING_IF_EXISTS;
+using ::toupper _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CCTYPE
+#endif // _LIBCPP_CCTYPE
#pragma GCC system_header
#endif
-#endif // _LIBCPP_CERRNO
+#endif // _LIBCPP_CERRNO
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::fenv_t;
-using ::fexcept_t;
-
-using ::feclearexcept;
-using ::fegetexceptflag;
-using ::feraiseexcept;
-using ::fesetexceptflag;
-using ::fetestexcept;
-using ::fegetround;
-using ::fesetround;
-using ::fegetenv;
-using ::feholdexcept;
-using ::fesetenv;
-using ::feupdateenv;
+using ::fenv_t _LIBCPP_USING_IF_EXISTS;
+using ::fexcept_t _LIBCPP_USING_IF_EXISTS;
+
+using ::feclearexcept _LIBCPP_USING_IF_EXISTS;
+using ::fegetexceptflag _LIBCPP_USING_IF_EXISTS;
+using ::feraiseexcept _LIBCPP_USING_IF_EXISTS;
+using ::fesetexceptflag _LIBCPP_USING_IF_EXISTS;
+using ::fetestexcept _LIBCPP_USING_IF_EXISTS;
+using ::fegetround _LIBCPP_USING_IF_EXISTS;
+using ::fesetround _LIBCPP_USING_IF_EXISTS;
+using ::fegetenv _LIBCPP_USING_IF_EXISTS;
+using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
+using ::fesetenv _LIBCPP_USING_IF_EXISTS;
+using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CFENV
+#endif // _LIBCPP_CFENV
#pragma GCC system_header
#endif
-#endif // _LIBCPP_CFLOAT
+#endif // _LIBCPP_CFLOAT
*/
+#include <__availability>
#include <__config>
#include <__errc>
-#include <type_traits>
+#include <__utility/to_underlying.h>
+#include <cmath> // for log2f
+#include <cstdint>
+#include <cstdlib> // for _LIBCPP_UNREACHABLE
+#include <cstring>
#include <limits>
-#include <stdint.h>
-#include <string.h>
-#include <math.h>
+#include <type_traits>
#include <__debug>
general = fixed | scientific
};
+inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
+operator~(chars_format __x) {
+ return chars_format(~_VSTD::__to_underlying(__x));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
+operator&(chars_format __x, chars_format __y) {
+ return chars_format(_VSTD::__to_underlying(__x) &
+ _VSTD::__to_underlying(__y));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
+operator|(chars_format __x, chars_format __y) {
+ return chars_format(_VSTD::__to_underlying(__x) |
+ _VSTD::__to_underlying(__y));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
+operator^(chars_format __x, chars_format __y) {
+ return chars_format(_VSTD::__to_underlying(__x) ^
+ _VSTD::__to_underlying(__y));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format&
+operator&=(chars_format& __x, chars_format __y) {
+ __x = __x & __y;
+ return __x;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format&
+operator|=(chars_format& __x, chars_format __y) {
+ __x = __x | __y;
+ return __x;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format&
+operator^=(chars_format& __x, chars_format __y) {
+ __x = __x ^ __y;
+ return __x;
+}
+
struct _LIBCPP_TYPE_VIS to_chars_result
{
char* ptr;
{
auto __c = __a * __b;
__r = __c;
- return __c > (numeric_limits<unsigned char>::max)();
+ return __c > numeric_limits<unsigned char>::max();
}
template <typename _Tp>
{
auto __c = __a * __b;
__r = __c;
- return __c > (numeric_limits<unsigned short>::max)();
+ return __c > numeric_limits<unsigned short>::max();
}
template <typename _Tp>
#if !defined(_LIBCPP_COMPILER_MSVC)
return __builtin_mul_overflow(__a, __b, &__r);
#else
- bool __did = __b && ((numeric_limits<_Tp>::max)() / __b) < __a;
+ bool __did = __b && (numeric_limits<_Tp>::max() / __b) < __a;
__r = __a * __b;
return __did;
#endif
return _Tp(~__x + 1);
}
-template <typename _Tp>
-inline _LIBCPP_INLINE_VISIBILITY typename make_unsigned<_Tp>::type
-__to_unsigned(_Tp __x)
-{
- return static_cast<typename make_unsigned<_Tp>::type>(__x);
-}
-
template <typename _Tp>
_LIBCPP_AVAILABILITY_TO_CHARS
inline _LIBCPP_INLINE_VISIBILITY to_chars_result
__to_chars_itoa(char* __first, char* __last, _Tp __value, true_type)
{
- auto __x = __to_unsigned(__value);
+ auto __x = __to_unsigned_like(__value);
if (__value < 0 && __first != __last)
{
*__first++ = '-';
auto __len = __p - __buf;
if (__len <= __diff)
{
- memcpy(__first, __buf, __len);
+ _VSTD::memcpy(__first, __buf, __len);
return {__first + __len, {}};
}
else
__to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
true_type)
{
- auto __x = __to_unsigned(__value);
+ auto __x = __to_unsigned_like(__value);
if (__value < 0 && __first != __last)
{
*__first++ = '-';
return __to_chars_integral(__first, __last, __x, __base, false_type());
}
+template <typename _Tp>
+_LIBCPP_AVAILABILITY_TO_CHARS _LIBCPP_INLINE_VISIBILITY int __to_chars_integral_width(_Tp __value, unsigned __base) {
+ _LIBCPP_ASSERT(__value >= 0, "The function requires a non-negative value.");
+
+ unsigned __base_2 = __base * __base;
+ unsigned __base_3 = __base_2 * __base;
+ unsigned __base_4 = __base_2 * __base_2;
+
+ int __r = 0;
+ while (true) {
+ if (__value < __base)
+ return __r + 1;
+ if (__value < __base_2)
+ return __r + 2;
+ if (__value < __base_3)
+ return __r + 3;
+ if (__value < __base_4)
+ return __r + 4;
+
+ __value /= __base_4;
+ __r += 4;
+ }
+
+ _LIBCPP_UNREACHABLE();
+}
+
template <typename _Tp>
_LIBCPP_AVAILABILITY_TO_CHARS
inline _LIBCPP_INLINE_VISIBILITY to_chars_result
__to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
false_type)
{
- if (__base == 10)
- return __to_chars_itoa(__first, __last, __value, false_type());
-
- auto __p = __last;
- while (__p != __first)
- {
- auto __c = __value % __base;
- __value /= __base;
- *--__p = "0123456789abcdefghijklmnopqrstuvwxyz"[__c];
- if (__value == 0)
- break;
- }
-
- auto __len = __last - __p;
- if (__value != 0 || !__len)
- return {__last, errc::value_too_large};
- else
- {
- memmove(__first, __p, __len);
- return {__first + __len, {}};
- }
+ if (__base == 10)
+ return __to_chars_itoa(__first, __last, __value, false_type());
+
+ ptrdiff_t __cap = __last - __first;
+ int __n = __to_chars_integral_width(__value, __base);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ do {
+ unsigned __c = __value % __base;
+ __value /= __base;
+ *--__p = "0123456789abcdefghijklmnopqrstuvwxyz"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
}
template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
__sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)
{
using __tl = numeric_limits<_Tp>;
- decltype(__to_unsigned(__value)) __x;
+ decltype(__to_unsigned_like(__value)) __x;
bool __neg = (__first != __last && *__first == '-');
auto __r = __f(__neg ? __first + 1 : __first, __last, __x, __args...);
if (__neg)
{
- if (__x <= __complement(__to_unsigned(__tl::min())))
+ if (__x <= __complement(__to_unsigned_like(__tl::min())))
{
__x = __complement(__x);
- memcpy(&__value, &__x, sizeof(__x));
+ _VSTD::memcpy(&__value, &__x, sizeof(__x));
return __r;
}
}
else
{
- if (__x <= (__tl::max)())
+ if (__x <= __tl::max())
{
__value = __x;
return __r;
auto __p = __tx::__read(__first, __last, __a, __b);
if (__p == __last || !__in_pattern(*__p))
{
- __output_type __m = (numeric_limits<_Tp>::max)();
+ __output_type __m = numeric_limits<_Tp>::max();
if (__m >= __a && __m - __a >= __b)
{
__value = __a + __b;
inline _LIBCPP_INLINE_VISIBILITY from_chars_result
__from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
{
- using __t = decltype(__to_unsigned(__value));
+ using __t = decltype(__to_unsigned_like(__value));
return __sign_combinator(__first, __last, __value, __from_chars_atoi<__t>);
}
return __subject_seq_combinator(
__first, __last, __value,
- [](const char* __p, const char* __last, _Tp& __value,
+ [](const char* __p, const char* __lastx, _Tp& __value,
int __base) -> from_chars_result {
using __tl = numeric_limits<_Tp>;
auto __digits = __tl::digits / log2f(float(__base));
_Tp __a = __in_pattern(*__p++, __base).__val, __b = 0;
- for (int __i = 1; __p != __last; ++__i, ++__p)
+ for (int __i = 1; __p != __lastx; ++__i, ++__p)
{
if (auto __c = __in_pattern(*__p, __base))
{
break;
}
- if (__p == __last || !__in_pattern(*__p, __base))
+ if (__p == __lastx || !__in_pattern(*__p, __base))
{
- if ((__tl::max)() - __a >= __b)
+ if (__tl::max() - __a >= __b)
{
__value = __a + __b;
return {__p, {}};
__from_chars_integral(const char* __first, const char* __last, _Tp& __value,
int __base)
{
- using __t = decltype(__to_unsigned(__value));
+ using __t = decltype(__to_unsigned_like(__value));
return __sign_combinator(__first, __last, __value,
__from_chars_integral<__t>, __base);
}
return __from_chars_integral(__first, __last, __value, __base);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_CHARCONV
+#endif // _LIBCPP_CHARCONV
} // std
*/
+#include <__availability>
#include <__config>
+#include <compare>
#include <ctime>
-#include <type_traits>
-#include <ratio>
#include <limits>
+#include <ratio>
+#include <type_traits>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
is_convertible<_Rep2, rep>::value &&
(treat_as_floating_point<rep>::value ||
!treat_as_floating_point<_Rep2>::value)
- >::type* = 0)
+ >::type* = nullptr)
: __rep_(__r) {}
// conversions
treat_as_floating_point<rep>::value ||
(__no_overflow<_Period2, period>::type::den == 1 &&
!treat_as_floating_point<_Rep2>::value))
- >::type* = 0)
- : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
+ >::type* = nullptr)
+ : __rep_(chrono::duration_cast<duration>(__d).count()) {}
// observer
typename enable_if
<
is_convertible<_Duration2, duration>::value
- >::type* = 0)
+ >::type* = nullptr)
: __d_(t.time_since_epoch()) {}
// observer
time_point<_Clock, _ToDuration>
time_point_cast(const time_point<_Clock, _Duration>& __t)
{
- return time_point<_Clock, _ToDuration>(_VSTD::chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
+ return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
}
#if _LIBCPP_STD_VER > 14
class weekday_indexed {
private:
- _VSTD::chrono::weekday __wd;
+ chrono::weekday __wd;
unsigned char __idx;
public:
weekday_indexed() = default;
- inline constexpr weekday_indexed(const _VSTD::chrono::weekday& __wdval, unsigned __idxval) noexcept
+ inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept
: __wd{__wdval}, __idx(__idxval) {}
- inline constexpr _VSTD::chrono::weekday weekday() const noexcept { return __wd; }
+ inline constexpr chrono::weekday weekday() const noexcept { return __wd; }
inline constexpr unsigned index() const noexcept { return __idx; }
inline constexpr bool ok() const noexcept { return __wd.ok() && __idx >= 1 && __idx <= 5; }
};
class weekday_last {
private:
- _VSTD::chrono::weekday __wd;
+ chrono::weekday __wd;
public:
- explicit constexpr weekday_last(const _VSTD::chrono::weekday& __val) noexcept
+ explicit constexpr weekday_last(const chrono::weekday& __val) noexcept
: __wd{__val} {}
- constexpr _VSTD::chrono::weekday weekday() const noexcept { return __wd; }
+ constexpr chrono::weekday weekday() const noexcept { return __wd; }
constexpr bool ok() const noexcept { return __wd.ok(); }
};
year_month_day
year_month_day::__from_days(days __d) noexcept
{
- static_assert(std::numeric_limits<unsigned>::digits >= 18, "");
- static_assert(std::numeric_limits<int>::digits >= 20 , "");
+ static_assert(numeric_limits<unsigned>::digits >= 18, "");
+ static_assert(numeric_limits<int>::digits >= 20 , "");
const int __z = __d.count() + 719468;
const int __era = (__z >= 0 ? __z : __z - 146096) / 146097;
const unsigned __doe = static_cast<unsigned>(__z - __era * 146097); // [0, 146096]
// https://howardhinnant.github.io/date_algorithms.html#days_from_civil
inline constexpr days year_month_day::__to_days() const noexcept
{
- static_assert(std::numeric_limits<unsigned>::digits >= 18, "");
- static_assert(std::numeric_limits<int>::digits >= 20 , "");
+ static_assert(numeric_limits<unsigned>::digits >= 18, "");
+ static_assert(numeric_limits<int>::digits >= 20 , "");
const int __yr = static_cast<int>(__y) - (__m <= February);
const unsigned __mth = static_cast<unsigned>(__m);
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_CHRONO
+#endif // _LIBCPP_CHRONO
_LIBCPP_BEGIN_NAMESPACE_STD
-using::imaxdiv_t;
-using::imaxabs;
-using::imaxdiv;
-using::strtoimax;
-using::strtoumax;
-using::wcstoimax;
-using::wcstoumax;
+using ::imaxdiv_t _LIBCPP_USING_IF_EXISTS;
+using ::imaxabs _LIBCPP_USING_IF_EXISTS;
+using ::imaxdiv _LIBCPP_USING_IF_EXISTS;
+using ::strtoimax _LIBCPP_USING_IF_EXISTS;
+using ::strtoumax _LIBCPP_USING_IF_EXISTS;
+using ::wcstoimax _LIBCPP_USING_IF_EXISTS;
+using ::wcstoumax _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CINTTYPES
+#endif // _LIBCPP_CINTTYPES
#pragma GCC system_header
#endif
-#endif // _LIBCPP_CISO646
+#endif // _LIBCPP_CISO646
#pragma GCC system_header
#endif
-#endif // _LIBCPP_CLIMITS
+#endif // _LIBCPP_CLIMITS
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::lconv;
+using ::lconv _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
-using ::setlocale;
+using ::setlocale _LIBCPP_USING_IF_EXISTS;
#endif
-using ::localeconv;
+using ::localeconv _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CLOCALE
+#endif // _LIBCPP_CLOCALE
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::signbit;
-using ::fpclassify;
-using ::isfinite;
-using ::isinf;
-using ::isnan;
-using ::isnormal;
-using ::isgreater;
-using ::isgreaterequal;
-using ::isless;
-using ::islessequal;
-using ::islessgreater;
-using ::isunordered;
-using ::isunordered;
-
-using ::float_t;
-using ::double_t;
-
-#ifndef _AIX
-using ::abs;
-#endif
-
-using ::acos;
-using ::acosf;
-using ::asin;
-using ::asinf;
-using ::atan;
-using ::atanf;
-using ::atan2;
-using ::atan2f;
-using ::ceil;
-using ::ceilf;
-using ::cos;
-using ::cosf;
-using ::cosh;
-using ::coshf;
-
-using ::exp;
-using ::expf;
-
-using ::fabs;
-using ::fabsf;
-using ::floor;
-using ::floorf;
-
-using ::fmod;
-using ::fmodf;
-
-using ::frexp;
-using ::frexpf;
-using ::ldexp;
-using ::ldexpf;
-
-using ::log;
-using ::logf;
-
-using ::log10;
-using ::log10f;
-using ::modf;
-using ::modff;
-
-using ::pow;
-using ::powf;
-
-using ::sin;
-using ::sinf;
-using ::sinh;
-using ::sinhf;
-
-using ::sqrt;
-using ::sqrtf;
-using ::tan;
-using ::tanf;
-
-using ::tanh;
-using ::tanhf;
-
-using ::acosh;
-using ::acoshf;
-using ::asinh;
-using ::asinhf;
-using ::atanh;
-using ::atanhf;
-using ::cbrt;
-using ::cbrtf;
-
-using ::copysign;
-using ::copysignf;
-
-using ::erf;
-using ::erff;
-using ::erfc;
-using ::erfcf;
-using ::exp2;
-using ::exp2f;
-using ::expm1;
-using ::expm1f;
-using ::fdim;
-using ::fdimf;
-using ::fmaf;
-using ::fma;
-using ::fmax;
-using ::fmaxf;
-using ::fmin;
-using ::fminf;
-using ::hypot;
-using ::hypotf;
-using ::ilogb;
-using ::ilogbf;
-using ::lgamma;
-using ::lgammaf;
-using ::llrint;
-using ::llrintf;
-using ::llround;
-using ::llroundf;
-using ::log1p;
-using ::log1pf;
-using ::log2;
-using ::log2f;
-using ::logb;
-using ::logbf;
-using ::lrint;
-using ::lrintf;
-using ::lround;
-using ::lroundf;
-
-using ::nan;
-using ::nanf;
-
-using ::nearbyint;
-using ::nearbyintf;
-using ::nextafter;
-using ::nextafterf;
-using ::nexttoward;
-using ::nexttowardf;
-using ::remainder;
-using ::remainderf;
-using ::remquo;
-using ::remquof;
-using ::rint;
-using ::rintf;
-using ::round;
-using ::roundf;
-using ::scalbln;
-using ::scalblnf;
-using ::scalbn;
-using ::scalbnf;
-using ::tgamma;
-using ::tgammaf;
-using ::trunc;
-using ::truncf;
-
-using ::acosl;
-using ::asinl;
-using ::atanl;
-using ::atan2l;
-using ::ceill;
-using ::cosl;
-using ::coshl;
-using ::expl;
-using ::fabsl;
-using ::floorl;
-using ::fmodl;
-using ::frexpl;
-using ::ldexpl;
-using ::logl;
-using ::log10l;
-using ::modfl;
-using ::powl;
-using ::sinl;
-using ::sinhl;
-using ::sqrtl;
-using ::tanl;
-
-using ::tanhl;
-using ::acoshl;
-using ::asinhl;
-using ::atanhl;
-using ::cbrtl;
-
-using ::copysignl;
-
-using ::erfl;
-using ::erfcl;
-using ::exp2l;
-using ::expm1l;
-using ::fdiml;
-using ::fmal;
-using ::fmaxl;
-using ::fminl;
-using ::hypotl;
-using ::ilogbl;
-using ::lgammal;
-using ::llrintl;
-using ::llroundl;
-using ::log1pl;
-using ::log2l;
-using ::logbl;
-using ::lrintl;
-using ::lroundl;
-using ::nanl;
-using ::nearbyintl;
-using ::nextafterl;
-using ::nexttowardl;
-using ::remainderl;
-using ::remquol;
-using ::rintl;
-using ::roundl;
-using ::scalblnl;
-using ::scalbnl;
-using ::tgammal;
-using ::truncl;
+using ::signbit _LIBCPP_USING_IF_EXISTS;
+using ::fpclassify _LIBCPP_USING_IF_EXISTS;
+using ::isfinite _LIBCPP_USING_IF_EXISTS;
+using ::isinf _LIBCPP_USING_IF_EXISTS;
+using ::isnan _LIBCPP_USING_IF_EXISTS;
+using ::isnormal _LIBCPP_USING_IF_EXISTS;
+using ::isgreater _LIBCPP_USING_IF_EXISTS;
+using ::isgreaterequal _LIBCPP_USING_IF_EXISTS;
+using ::isless _LIBCPP_USING_IF_EXISTS;
+using ::islessequal _LIBCPP_USING_IF_EXISTS;
+using ::islessgreater _LIBCPP_USING_IF_EXISTS;
+using ::isunordered _LIBCPP_USING_IF_EXISTS;
+using ::isunordered _LIBCPP_USING_IF_EXISTS;
+
+using ::float_t _LIBCPP_USING_IF_EXISTS;
+using ::double_t _LIBCPP_USING_IF_EXISTS;
+
+using ::abs _LIBCPP_USING_IF_EXISTS;
+
+using ::acos _LIBCPP_USING_IF_EXISTS;
+using ::acosf _LIBCPP_USING_IF_EXISTS;
+using ::asin _LIBCPP_USING_IF_EXISTS;
+using ::asinf _LIBCPP_USING_IF_EXISTS;
+using ::atan _LIBCPP_USING_IF_EXISTS;
+using ::atanf _LIBCPP_USING_IF_EXISTS;
+using ::atan2 _LIBCPP_USING_IF_EXISTS;
+using ::atan2f _LIBCPP_USING_IF_EXISTS;
+using ::ceil _LIBCPP_USING_IF_EXISTS;
+using ::ceilf _LIBCPP_USING_IF_EXISTS;
+using ::cos _LIBCPP_USING_IF_EXISTS;
+using ::cosf _LIBCPP_USING_IF_EXISTS;
+using ::cosh _LIBCPP_USING_IF_EXISTS;
+using ::coshf _LIBCPP_USING_IF_EXISTS;
+
+using ::exp _LIBCPP_USING_IF_EXISTS;
+using ::expf _LIBCPP_USING_IF_EXISTS;
+
+using ::fabs _LIBCPP_USING_IF_EXISTS;
+using ::fabsf _LIBCPP_USING_IF_EXISTS;
+using ::floor _LIBCPP_USING_IF_EXISTS;
+using ::floorf _LIBCPP_USING_IF_EXISTS;
+
+using ::fmod _LIBCPP_USING_IF_EXISTS;
+using ::fmodf _LIBCPP_USING_IF_EXISTS;
+
+using ::frexp _LIBCPP_USING_IF_EXISTS;
+using ::frexpf _LIBCPP_USING_IF_EXISTS;
+using ::ldexp _LIBCPP_USING_IF_EXISTS;
+using ::ldexpf _LIBCPP_USING_IF_EXISTS;
+
+using ::log _LIBCPP_USING_IF_EXISTS;
+using ::logf _LIBCPP_USING_IF_EXISTS;
+
+using ::log10 _LIBCPP_USING_IF_EXISTS;
+using ::log10f _LIBCPP_USING_IF_EXISTS;
+using ::modf _LIBCPP_USING_IF_EXISTS;
+using ::modff _LIBCPP_USING_IF_EXISTS;
+
+using ::pow _LIBCPP_USING_IF_EXISTS;
+using ::powf _LIBCPP_USING_IF_EXISTS;
+
+using ::sin _LIBCPP_USING_IF_EXISTS;
+using ::sinf _LIBCPP_USING_IF_EXISTS;
+using ::sinh _LIBCPP_USING_IF_EXISTS;
+using ::sinhf _LIBCPP_USING_IF_EXISTS;
+
+using ::sqrt _LIBCPP_USING_IF_EXISTS;
+using ::sqrtf _LIBCPP_USING_IF_EXISTS;
+using ::tan _LIBCPP_USING_IF_EXISTS;
+using ::tanf _LIBCPP_USING_IF_EXISTS;
+
+using ::tanh _LIBCPP_USING_IF_EXISTS;
+using ::tanhf _LIBCPP_USING_IF_EXISTS;
+
+using ::acosh _LIBCPP_USING_IF_EXISTS;
+using ::acoshf _LIBCPP_USING_IF_EXISTS;
+using ::asinh _LIBCPP_USING_IF_EXISTS;
+using ::asinhf _LIBCPP_USING_IF_EXISTS;
+using ::atanh _LIBCPP_USING_IF_EXISTS;
+using ::atanhf _LIBCPP_USING_IF_EXISTS;
+using ::cbrt _LIBCPP_USING_IF_EXISTS;
+using ::cbrtf _LIBCPP_USING_IF_EXISTS;
+
+using ::copysign _LIBCPP_USING_IF_EXISTS;
+using ::copysignf _LIBCPP_USING_IF_EXISTS;
+
+using ::erf _LIBCPP_USING_IF_EXISTS;
+using ::erff _LIBCPP_USING_IF_EXISTS;
+using ::erfc _LIBCPP_USING_IF_EXISTS;
+using ::erfcf _LIBCPP_USING_IF_EXISTS;
+using ::exp2 _LIBCPP_USING_IF_EXISTS;
+using ::exp2f _LIBCPP_USING_IF_EXISTS;
+using ::expm1 _LIBCPP_USING_IF_EXISTS;
+using ::expm1f _LIBCPP_USING_IF_EXISTS;
+using ::fdim _LIBCPP_USING_IF_EXISTS;
+using ::fdimf _LIBCPP_USING_IF_EXISTS;
+using ::fmaf _LIBCPP_USING_IF_EXISTS;
+using ::fma _LIBCPP_USING_IF_EXISTS;
+using ::fmax _LIBCPP_USING_IF_EXISTS;
+using ::fmaxf _LIBCPP_USING_IF_EXISTS;
+using ::fmin _LIBCPP_USING_IF_EXISTS;
+using ::fminf _LIBCPP_USING_IF_EXISTS;
+using ::hypot _LIBCPP_USING_IF_EXISTS;
+using ::hypotf _LIBCPP_USING_IF_EXISTS;
+using ::ilogb _LIBCPP_USING_IF_EXISTS;
+using ::ilogbf _LIBCPP_USING_IF_EXISTS;
+using ::lgamma _LIBCPP_USING_IF_EXISTS;
+using ::lgammaf _LIBCPP_USING_IF_EXISTS;
+using ::llrint _LIBCPP_USING_IF_EXISTS;
+using ::llrintf _LIBCPP_USING_IF_EXISTS;
+using ::llround _LIBCPP_USING_IF_EXISTS;
+using ::llroundf _LIBCPP_USING_IF_EXISTS;
+using ::log1p _LIBCPP_USING_IF_EXISTS;
+using ::log1pf _LIBCPP_USING_IF_EXISTS;
+using ::log2 _LIBCPP_USING_IF_EXISTS;
+using ::log2f _LIBCPP_USING_IF_EXISTS;
+using ::logb _LIBCPP_USING_IF_EXISTS;
+using ::logbf _LIBCPP_USING_IF_EXISTS;
+using ::lrint _LIBCPP_USING_IF_EXISTS;
+using ::lrintf _LIBCPP_USING_IF_EXISTS;
+using ::lround _LIBCPP_USING_IF_EXISTS;
+using ::lroundf _LIBCPP_USING_IF_EXISTS;
+
+using ::nan _LIBCPP_USING_IF_EXISTS;
+using ::nanf _LIBCPP_USING_IF_EXISTS;
+
+using ::nearbyint _LIBCPP_USING_IF_EXISTS;
+using ::nearbyintf _LIBCPP_USING_IF_EXISTS;
+using ::nextafter _LIBCPP_USING_IF_EXISTS;
+using ::nextafterf _LIBCPP_USING_IF_EXISTS;
+using ::nexttoward _LIBCPP_USING_IF_EXISTS;
+using ::nexttowardf _LIBCPP_USING_IF_EXISTS;
+using ::remainder _LIBCPP_USING_IF_EXISTS;
+using ::remainderf _LIBCPP_USING_IF_EXISTS;
+using ::remquo _LIBCPP_USING_IF_EXISTS;
+using ::remquof _LIBCPP_USING_IF_EXISTS;
+using ::rint _LIBCPP_USING_IF_EXISTS;
+using ::rintf _LIBCPP_USING_IF_EXISTS;
+using ::round _LIBCPP_USING_IF_EXISTS;
+using ::roundf _LIBCPP_USING_IF_EXISTS;
+using ::scalbln _LIBCPP_USING_IF_EXISTS;
+using ::scalblnf _LIBCPP_USING_IF_EXISTS;
+using ::scalbn _LIBCPP_USING_IF_EXISTS;
+using ::scalbnf _LIBCPP_USING_IF_EXISTS;
+using ::tgamma _LIBCPP_USING_IF_EXISTS;
+using ::tgammaf _LIBCPP_USING_IF_EXISTS;
+using ::trunc _LIBCPP_USING_IF_EXISTS;
+using ::truncf _LIBCPP_USING_IF_EXISTS;
+
+using ::acosl _LIBCPP_USING_IF_EXISTS;
+using ::asinl _LIBCPP_USING_IF_EXISTS;
+using ::atanl _LIBCPP_USING_IF_EXISTS;
+using ::atan2l _LIBCPP_USING_IF_EXISTS;
+using ::ceill _LIBCPP_USING_IF_EXISTS;
+using ::cosl _LIBCPP_USING_IF_EXISTS;
+using ::coshl _LIBCPP_USING_IF_EXISTS;
+using ::expl _LIBCPP_USING_IF_EXISTS;
+using ::fabsl _LIBCPP_USING_IF_EXISTS;
+using ::floorl _LIBCPP_USING_IF_EXISTS;
+using ::fmodl _LIBCPP_USING_IF_EXISTS;
+using ::frexpl _LIBCPP_USING_IF_EXISTS;
+using ::ldexpl _LIBCPP_USING_IF_EXISTS;
+using ::logl _LIBCPP_USING_IF_EXISTS;
+using ::log10l _LIBCPP_USING_IF_EXISTS;
+using ::modfl _LIBCPP_USING_IF_EXISTS;
+using ::powl _LIBCPP_USING_IF_EXISTS;
+using ::sinl _LIBCPP_USING_IF_EXISTS;
+using ::sinhl _LIBCPP_USING_IF_EXISTS;
+using ::sqrtl _LIBCPP_USING_IF_EXISTS;
+using ::tanl _LIBCPP_USING_IF_EXISTS;
+
+using ::tanhl _LIBCPP_USING_IF_EXISTS;
+using ::acoshl _LIBCPP_USING_IF_EXISTS;
+using ::asinhl _LIBCPP_USING_IF_EXISTS;
+using ::atanhl _LIBCPP_USING_IF_EXISTS;
+using ::cbrtl _LIBCPP_USING_IF_EXISTS;
+
+using ::copysignl _LIBCPP_USING_IF_EXISTS;
+
+using ::erfl _LIBCPP_USING_IF_EXISTS;
+using ::erfcl _LIBCPP_USING_IF_EXISTS;
+using ::exp2l _LIBCPP_USING_IF_EXISTS;
+using ::expm1l _LIBCPP_USING_IF_EXISTS;
+using ::fdiml _LIBCPP_USING_IF_EXISTS;
+using ::fmal _LIBCPP_USING_IF_EXISTS;
+using ::fmaxl _LIBCPP_USING_IF_EXISTS;
+using ::fminl _LIBCPP_USING_IF_EXISTS;
+using ::hypotl _LIBCPP_USING_IF_EXISTS;
+using ::ilogbl _LIBCPP_USING_IF_EXISTS;
+using ::lgammal _LIBCPP_USING_IF_EXISTS;
+using ::llrintl _LIBCPP_USING_IF_EXISTS;
+using ::llroundl _LIBCPP_USING_IF_EXISTS;
+using ::log1pl _LIBCPP_USING_IF_EXISTS;
+using ::log2l _LIBCPP_USING_IF_EXISTS;
+using ::logbl _LIBCPP_USING_IF_EXISTS;
+using ::lrintl _LIBCPP_USING_IF_EXISTS;
+using ::lroundl _LIBCPP_USING_IF_EXISTS;
+using ::nanl _LIBCPP_USING_IF_EXISTS;
+using ::nearbyintl _LIBCPP_USING_IF_EXISTS;
+using ::nextafterl _LIBCPP_USING_IF_EXISTS;
+using ::nexttowardl _LIBCPP_USING_IF_EXISTS;
+using ::remainderl _LIBCPP_USING_IF_EXISTS;
+using ::remquol _LIBCPP_USING_IF_EXISTS;
+using ::rintl _LIBCPP_USING_IF_EXISTS;
+using ::roundl _LIBCPP_USING_IF_EXISTS;
+using ::scalblnl _LIBCPP_USING_IF_EXISTS;
+using ::scalbnl _LIBCPP_USING_IF_EXISTS;
+using ::tgammal _LIBCPP_USING_IF_EXISTS;
+using ::truncl _LIBCPP_USING_IF_EXISTS;
#if _LIBCPP_STD_VER > 14
inline _LIBCPP_INLINE_VISIBILITY float hypot( float x, float y, float z ) { return sqrt(x*x + y*y + z*z); }
if (__t == 1) return __b;
const _Fp __x = __a + __t * (__b - __a);
- if (__t > 1 == __b > __a)
- return __b < __x ? __x : __b;
+ if ((__t > 1) == (__b > __a))
+ return __b < __x ? __x : __b;
else
- return __x < __b ? __x : __b;
+ return __x < __b ? __x : __b;
}
constexpr float
template <class _IntT, class _RealT>
_LIBCPP_INLINE_VISIBILITY
_IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {
- using _Lim = std::numeric_limits<_IntT>;
- const _IntT _MaxVal = std::__max_representable_int_for_float<_IntT, _RealT>();
+ using _Lim = numeric_limits<_IntT>;
+ const _IntT _MaxVal = __max_representable_int_for_float<_IntT, _RealT>();
if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), INFINITY)) {
return _Lim::max();
} else if (__r <= _Lim::lowest()) {
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_CMATH
+#endif // _LIBCPP_CMATH
virtual int do_max_length() const _NOEXCEPT;
};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
class _LIBCPP_TYPE_VIS __codecvt_utf8<char16_t>
: public codecvt<char16_t, char, mbstate_t>
codecvt_mode _Mode)
: codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
_Mode_(_Mode) {}
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
protected:
virtual result
do_out(state_type& __st,
virtual int do_max_length() const _NOEXCEPT;
};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
class _LIBCPP_TYPE_VIS __codecvt_utf8<char32_t>
: public codecvt<char32_t, char, mbstate_t>
codecvt_mode _Mode)
: codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
_Mode_(_Mode) {}
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
protected:
virtual result
do_out(state_type& __st,
virtual int do_max_length() const _NOEXCEPT;
};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, false>
: public codecvt<char16_t, char, mbstate_t>
codecvt_mode _Mode)
: codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
_Mode_(_Mode) {}
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
protected:
virtual result
do_out(state_type& __st,
virtual int do_max_length() const _NOEXCEPT;
};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, true>
: public codecvt<char16_t, char, mbstate_t>
codecvt_mode _Mode)
: codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
_Mode_(_Mode) {}
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
protected:
virtual result
do_out(state_type& __st,
virtual int do_max_length() const _NOEXCEPT;
};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, false>
: public codecvt<char32_t, char, mbstate_t>
codecvt_mode _Mode)
: codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
_Mode_(_Mode) {}
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
protected:
virtual result
do_out(state_type& __st,
virtual int do_max_length() const _NOEXCEPT;
};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, true>
: public codecvt<char32_t, char, mbstate_t>
codecvt_mode _Mode)
: codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
_Mode_(_Mode) {}
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
protected:
virtual result
do_out(state_type& __st,
virtual int do_max_length() const _NOEXCEPT;
};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char32_t>
: public codecvt<char32_t, char, mbstate_t>
codecvt_mode _Mode)
: codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
_Mode_(_Mode) {}
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
protected:
virtual result
do_out(state_type& __st,
virtual int do_max_length() const _NOEXCEPT;
};
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char16_t>
: public codecvt<char16_t, char, mbstate_t>
codecvt_mode _Mode)
: codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
_Mode_(_Mode) {}
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+
protected:
virtual result
do_out(state_type& __st,
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CODECVT
+#endif // _LIBCPP_CODECVT
namespace std {
// [cmp.categories], comparison category types
- class weak_equality;
- class strong_equality;
class partial_ordering;
class weak_ordering;
class strong_ordering;
// named comparison functions
- constexpr bool is_eq (weak_equality cmp) noexcept { return cmp == 0; }
- constexpr bool is_neq (weak_equality cmp) noexcept { return cmp != 0; }
+ constexpr bool is_eq (partial_ordering cmp) noexcept { return cmp == 0; }
+ constexpr bool is_neq (partial_ordering cmp) noexcept { return cmp != 0; }
constexpr bool is_lt (partial_ordering cmp) noexcept { return cmp < 0; }
constexpr bool is_lteq(partial_ordering cmp) noexcept { return cmp <= 0; }
constexpr bool is_gt (partial_ordering cmp) noexcept { return cmp > 0; }
template<class T> constexpr strong_ordering strong_order(const T& a, const T& b);
template<class T> constexpr weak_ordering weak_order(const T& a, const T& b);
template<class T> constexpr partial_ordering partial_order(const T& a, const T& b);
- template<class T> constexpr strong_equality strong_equal(const T& a, const T& b);
- template<class T> constexpr weak_equality weak_equal(const T& a, const T& b);
// [cmp.partialord], Class partial_ordering
class partial_ordering {
#include <__config>
#include <type_traits>
-#include <array>
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#pragma GCC system_header
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
-
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
// exposition only
enum class _LIBCPP_ENUM_VIS _EqResult : unsigned char {
__zero = 0,
__unordered = -127
};
-struct _CmpUnspecifiedType;
-using _CmpUnspecifiedParam = void (_CmpUnspecifiedType::*)();
-
-class weak_equality {
- _LIBCPP_INLINE_VISIBILITY
- constexpr explicit weak_equality(_EqResult __val) noexcept : __value_(__val) {}
-
-public:
- static const weak_equality equivalent;
- static const weak_equality nonequivalent;
-
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept;
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
- _LIBCPP_INLINE_VISIBILITY friend constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept;
-#endif
-
-private:
- _EqResult __value_;
-};
-
-_LIBCPP_INLINE_VAR constexpr weak_equality weak_equality::equivalent(_EqResult::__equiv);
-_LIBCPP_INLINE_VAR constexpr weak_equality weak_equality::nonequivalent(_EqResult::__nonequiv);
-
-_LIBCPP_INLINE_VISIBILITY
-inline constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-inline constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-inline constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-inline constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-_LIBCPP_INLINE_VISIBILITY
-inline constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-inline constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v;
-}
-#endif
-
-class strong_equality {
- _LIBCPP_INLINE_VISIBILITY
- explicit constexpr strong_equality(_EqResult __val) noexcept : __value_(__val) {}
+class partial_ordering;
+class weak_ordering;
+class strong_ordering;
-public:
- static const strong_equality equal;
- static const strong_equality nonequal;
- static const strong_equality equivalent;
- static const strong_equality nonequivalent;
+template<class _Tp, class... _Args>
+inline constexpr bool __one_of_v = (is_same_v<_Tp, _Args> || ...);
- // conversion
- _LIBCPP_INLINE_VISIBILITY constexpr operator weak_equality() const noexcept {
- return __value_ == _EqResult::__zero ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
+struct _CmpUnspecifiedParam {
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEVAL
+ _CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {}
- // comparisons
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept;
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
- _LIBCPP_INLINE_VISIBILITY friend constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept;
-#endif
-private:
- _EqResult __value_;
+ template<class _Tp, class = enable_if_t<!__one_of_v<_Tp, int, partial_ordering, weak_ordering, strong_ordering>>>
+ _CmpUnspecifiedParam(_Tp) = delete;
};
-_LIBCPP_INLINE_VAR constexpr strong_equality strong_equality::equal(_EqResult::__equal);
-_LIBCPP_INLINE_VAR constexpr strong_equality strong_equality::nonequal(_EqResult::__nonequal);
-_LIBCPP_INLINE_VAR constexpr strong_equality strong_equality::equivalent(_EqResult::__equiv);
-_LIBCPP_INLINE_VAR constexpr strong_equality strong_equality::nonequivalent(_EqResult::__nonequiv);
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-_LIBCPP_INLINE_VISIBILITY
-constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v;
-}
-#endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-
class partial_ordering {
using _ValueT = signed char;
static const partial_ordering greater;
static const partial_ordering unordered;
- // conversion
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent : weak_equality::nonequivalent;
- }
-
// comparisons
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, partial_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(partial_ordering, partial_ordering) noexcept = default;
- _LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
-#endif
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__is_ordered() && __v.__value_ == 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__is_ordered() && __v.__value_ < 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__is_ordered() && __v.__value_ <= 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__is_ordered() && __v.__value_ > 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__is_ordered() && __v.__value_ >= 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept {
+ return __v.__is_ordered() && 0 < __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
+ return __v.__is_ordered() && 0 <= __v.__value_;
+ }
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, partial_ordering __v) noexcept {
+ return __v.__is_ordered() && 0 > __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
+ return __v.__is_ordered() && 0 >= __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
+ return __v < 0 ? partial_ordering::greater : (__v > 0 ? partial_ordering::less : __v);
+ }
private:
_ValueT __value_;
};
_LIBCPP_INLINE_VAR constexpr partial_ordering partial_ordering::greater(_OrdResult::__greater);
_LIBCPP_INLINE_VAR constexpr partial_ordering partial_ordering::unordered(_NCmpResult ::__unordered);
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__is_ordered() && __v.__value_ == 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__is_ordered() && __v.__value_ < 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__is_ordered() && __v.__value_ <= 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__is_ordered() && __v.__value_ > 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__is_ordered() && __v.__value_ >= 0;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
- return __v.__is_ordered() && 0 == __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept {
- return __v.__is_ordered() && 0 < __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
- return __v.__is_ordered() && 0 <= __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator> (_CmpUnspecifiedParam, partial_ordering __v) noexcept {
- return __v.__is_ordered() && 0 > __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
- return __v.__is_ordered() && 0 >= __v.__value_;
-}
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
- return !__v.__is_ordered() || __v.__value_ != 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
- return !__v.__is_ordered() || __v.__value_ != 0;
-}
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-_LIBCPP_INLINE_VISIBILITY
-constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
- return __v < 0 ? partial_ordering::greater : (__v > 0 ? partial_ordering::less : __v);
-}
-#endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-
class weak_ordering {
using _ValueT = signed char;
static const weak_ordering equivalent;
static const weak_ordering greater;
- // conversions
- _LIBCPP_INLINE_VISIBILITY
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
-
_LIBCPP_INLINE_VISIBILITY
constexpr operator partial_ordering() const noexcept {
return __value_ == 0 ? partial_ordering::equivalent
}
// comparisons
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (weak_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, weak_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default;
- _LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
-#endif
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ == 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ < 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ <= 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (weak_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ > 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ >= 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept {
+ return 0 < __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
+ return 0 <= __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, weak_ordering __v) noexcept {
+ return 0 > __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
+ return 0 >= __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
+ return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v);
+ }
private:
_ValueT __value_;
_LIBCPP_INLINE_VAR constexpr weak_ordering weak_ordering::less(_OrdResult::__less);
_LIBCPP_INLINE_VAR constexpr weak_ordering weak_ordering::equivalent(_EqResult::__equiv);
_LIBCPP_INLINE_VAR constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater);
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ < 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ <= 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator> (weak_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ > 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ >= 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
- return 0 == __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
- return 0 != __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept {
- return 0 < __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
- return 0 <= __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator> (_CmpUnspecifiedParam, weak_ordering __v) noexcept {
- return 0 > __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
- return 0 >= __v.__value_;
-}
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-_LIBCPP_INLINE_VISIBILITY
-constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
- return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v);
-}
-#endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-
class strong_ordering {
using _ValueT = signed char;
static const strong_ordering greater;
// conversions
- _LIBCPP_INLINE_VISIBILITY
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- constexpr operator strong_equality() const noexcept {
- return __value_ == 0 ? strong_equality::equal
- : strong_equality::nonequal;
- }
-
_LIBCPP_INLINE_VISIBILITY
constexpr operator partial_ordering() const noexcept {
return __value_ == 0 ? partial_ordering::equivalent
}
// comparisons
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (strong_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, strong_ordering __v) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_ordering, strong_ordering) noexcept = default;
- _LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
- _LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
-#endif
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ == 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ < 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ <= 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (strong_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ > 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v.__value_ >= 0;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept {
+ return 0 < __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
+ return 0 <= __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, strong_ordering __v) noexcept {
+ return 0 > __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
+ return 0 >= __v.__value_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
+ return __v;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
+ return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v);
+ }
private:
_ValueT __value_;
_LIBCPP_INLINE_VAR constexpr strong_ordering strong_ordering::equivalent(_EqResult::__equiv);
_LIBCPP_INLINE_VAR constexpr strong_ordering strong_ordering::greater(_OrdResult::__greater);
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ < 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ <= 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator> (strong_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ > 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ >= 0;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
- return 0 == __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
- return 0 != __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept {
- return 0 < __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
- return 0 <= __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator> (_CmpUnspecifiedParam, strong_ordering __v) noexcept {
- return 0 > __v.__value_;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
- return 0 >= __v.__value_;
-}
-
-#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-_LIBCPP_INLINE_VISIBILITY
-constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-_LIBCPP_INLINE_VISIBILITY
-constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
- return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v);
-}
-#endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-
// named comparison functions
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool is_eq(weak_equality __cmp) noexcept { return __cmp == 0; }
-
-_LIBCPP_INLINE_VISIBILITY
-constexpr bool is_neq(weak_equality __cmp) noexcept { return __cmp != 0; }
-
_LIBCPP_INLINE_VISIBILITY
constexpr bool is_lt(partial_ordering __cmp) noexcept { return __cmp < 0; }
enum _ClassifyCompCategory : unsigned{
_None,
- _WeakEq,
- _StrongEq,
_PartialOrd,
_WeakOrd,
_StrongOrd,
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
constexpr _ClassifyCompCategory __type_to_enum() noexcept {
- if (is_same_v<_Tp, weak_equality>)
- return _WeakEq;
- if (is_same_v<_Tp, strong_equality>)
- return _StrongEq;
if (is_same_v<_Tp, partial_ordering>)
return _PartialOrd;
if (is_same_v<_Tp, weak_ordering>)
template <size_t _Size>
constexpr _ClassifyCompCategory
-__compute_comp_type(std::array<_ClassifyCompCategory, _Size> __types) {
- std::array<int, _CCC_Size> __seen = {};
+__compute_comp_type(const _ClassifyCompCategory (&__types)[_Size]) {
+ int __seen[_CCC_Size] = {};
for (auto __type : __types)
++__seen[__type];
if (__seen[_None])
return _None;
- if (__seen[_WeakEq])
- return _WeakEq;
- if (__seen[_StrongEq] && (__seen[_PartialOrd] || __seen[_WeakOrd]))
- return _WeakEq;
- if (__seen[_StrongEq])
- return _StrongEq;
if (__seen[_PartialOrd])
return _PartialOrd;
if (__seen[_WeakOrd])
return _StrongOrd;
}
-template <class ..._Ts>
+template <class ..._Ts, bool _False = false>
constexpr auto __get_comp_type() {
using _CCC = _ClassifyCompCategory;
- constexpr array<_CCC, sizeof...(_Ts)> __type_kinds{{__comp_detail::__type_to_enum<_Ts>()...}};
- constexpr _CCC _Cat = sizeof...(_Ts) == 0 ? _StrongOrd
- : __compute_comp_type(__type_kinds);
+ constexpr _CCC __type_kinds[] = {_StrongOrd, __type_to_enum<_Ts>()...};
+ constexpr _CCC _Cat = __compute_comp_type(__type_kinds);
if constexpr (_Cat == _None)
return void();
- else if constexpr (_Cat == _WeakEq)
- return weak_equality::equivalent;
- else if constexpr (_Cat == _StrongEq)
- return strong_equality::equivalent;
else if constexpr (_Cat == _PartialOrd)
return partial_ordering::equivalent;
else if constexpr (_Cat == _WeakOrd)
else if constexpr (_Cat == _StrongOrd)
return strong_ordering::equivalent;
else
- static_assert(_Cat != _Cat, "unhandled case");
+ static_assert(_False, "unhandled case");
}
} // namespace __comp_detail
template<class _Tp> constexpr strong_ordering strong_order(const _Tp& __lhs, const _Tp& __rhs);
template<class _Tp> constexpr weak_ordering weak_order(const _Tp& __lhs, const _Tp& __rhs);
template<class _Tp> constexpr partial_ordering partial_order(const _Tp& __lhs, const _Tp& __rhs);
-template<class _Tp> constexpr strong_equality strong_equal(const _Tp& __lhs, const _Tp& __rhs);
-template<class _Tp> constexpr weak_equality weak_equal(const _Tp& __lhs, const _Tp& __rhs);
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
_LIBCPP_END_NAMESPACE_STD
template<class T> complex<T> tan (const complex<T>&);
template<class T> complex<T> tanh (const complex<T>&);
-template<class T, class charT, class traits>
- basic_istream<charT, traits>&
- operator>>(basic_istream<charT, traits>& is, complex<T>& x);
-
-template<class T, class charT, class traits>
- basic_ostream<charT, traits>&
- operator<<(basic_ostream<charT, traits>& o, const complex<T>& x);
-
} // std
*/
#include <__config>
-#include <type_traits>
-#include <stdexcept>
#include <cmath>
#include <iosfwd>
-#include <sstream>
+#include <stdexcept>
+#include <type_traits>
#include <version>
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+# include <sstream> // for std::basic_ostringstream
+#endif
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
complex<_Tp>
proj(const complex<_Tp>& __c)
{
- std::complex<_Tp> __r = __c;
+ complex<_Tp> __r = __c;
if (__libcpp_isinf_or_builtin(__c.real()) || __libcpp_isinf_or_builtin(__c.imag()))
__r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
return __r;
return __is;
}
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
template<class _Tp, class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
__s << '(' << __x.real() << ',' << __x.imag() << ')';
return __os << __s.str();
}
+#endif // !_LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_STD_VER > 11
// Literal suffix for complex number literals [complex.literals]
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_COMPLEX
+#endif // _LIBCPP_COMPLEX
#include_next <complex.h>
-#endif // __cplusplus
+#endif // __cplusplus
-#endif // _LIBCPP_COMPLEX_H
+#endif // _LIBCPP_COMPLEX_H
template<class T, class... Args>
concept constructible_from = see below;
- // [concept.defaultconstructible], concept default_constructible
+ // [concept.default.init], concept default_initializable
template<class T>
- concept default_constructible = see below;
+ concept default_initializable = see below;
// [concept.moveconstructible], concept move_constructible
template<class T>
template<class T>
concept copy_constructible = see below;
- // [concepts.compare], comparison concepts
- // [concept.boolean], concept boolean
- template<class B>
- concept boolean = see below;
-
// [concept.equalitycomparable], concept equality_comparable
template<class T>
concept equality_comparable = see below;
*/
#include <__config>
+#include <__functional/invoke.h>
+#include <__functional_base>
#include <type_traits>
+#include <utility>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
// [concept.same]
template<class _Tp, class _Up>
concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;
-#endif //_LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
+// [concept.derived]
+template<class _Dp, class _Bp>
+concept derived_from =
+ is_base_of_v<_Bp, _Dp> &&
+ is_convertible_v<const volatile _Dp*, const volatile _Bp*>;
+
+// [concept.convertible]
+template<class _From, class _To>
+concept convertible_to =
+ is_convertible_v<_From, _To> &&
+ requires(add_rvalue_reference_t<_From> (&__f)()) {
+ static_cast<_To>(__f());
+ };
+
+// [concept.commonref]
+template<class _Tp, class _Up>
+concept common_reference_with =
+ same_as<common_reference_t<_Tp, _Up>, common_reference_t<_Up, _Tp>> &&
+ convertible_to<_Tp, common_reference_t<_Tp, _Up>> &&
+ convertible_to<_Up, common_reference_t<_Tp, _Up>>;
+
+// [concept.common]
+template<class _Tp, class _Up>
+concept common_with =
+ same_as<common_type_t<_Tp, _Up>, common_type_t<_Up, _Tp>> &&
+ requires {
+ static_cast<common_type_t<_Tp, _Up>>(declval<_Tp>());
+ static_cast<common_type_t<_Tp, _Up>>(declval<_Up>());
+ } &&
+ common_reference_with<
+ add_lvalue_reference_t<const _Tp>,
+ add_lvalue_reference_t<const _Up>> &&
+ common_reference_with<
+ add_lvalue_reference_t<common_type_t<_Tp, _Up>>,
+ common_reference_t<
+ add_lvalue_reference_t<const _Tp>,
+ add_lvalue_reference_t<const _Up>>>;
+
+// [concepts.arithmetic], arithmetic concepts
+template<class _Tp>
+concept integral = is_integral_v<_Tp>;
+
+template<class _Tp>
+concept signed_integral = integral<_Tp> && is_signed_v<_Tp>;
+
+template<class _Tp>
+concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;
+
+template<class _Tp>
+concept floating_point = is_floating_point_v<_Tp>;
+
+// [concept.assignable]
+template<class _Lhs, class _Rhs>
+concept assignable_from =
+ is_lvalue_reference_v<_Lhs> &&
+ common_reference_with<__make_const_lvalue_ref<_Lhs>, __make_const_lvalue_ref<_Rhs>> &&
+ requires (_Lhs __lhs, _Rhs&& __rhs) {
+ { __lhs = _VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
+ };
+
+// [concept.destructible]
+
+template<class _Tp>
+concept destructible = is_nothrow_destructible_v<_Tp>;
+
+// [concept.constructible]
+template<class _Tp, class... _Args>
+concept constructible_from =
+ destructible<_Tp> && is_constructible_v<_Tp, _Args...>;
+
+// [concept.default.init]
+
+template<class _Tp>
+concept __default_initializable = requires { ::new _Tp; };
+
+template<class _Tp>
+concept default_initializable = constructible_from<_Tp> &&
+ requires { _Tp{}; } && __default_initializable<_Tp>;
+
+// [concept.moveconstructible]
+template<class _Tp>
+concept move_constructible =
+ constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>;
+
+// [concept.copyconstructible]
+template<class _Tp>
+concept copy_constructible =
+ move_constructible<_Tp> &&
+ constructible_from<_Tp, _Tp&> && convertible_to<_Tp&, _Tp> &&
+ constructible_from<_Tp, const _Tp&> && convertible_to<const _Tp&, _Tp> &&
+ constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>;
+
+// Whether a type is a class type or enumeration type according to the Core wording.
+template<class _Tp>
+concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;
+
+// [concept.swappable]
+namespace ranges::__swap {
+ // Deleted to inhibit ADL
+ template<class _Tp>
+ void swap(_Tp&, _Tp&) = delete;
+
+
+ // [1]
+ template<class _Tp, class _Up>
+ concept __unqualified_swappable_with =
+ (__class_or_enum<remove_cvref_t<_Tp>> || __class_or_enum<remove_cvref_t<_Up>>) &&
+ requires(_Tp&& __t, _Up&& __u) {
+ swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
+ };
+
+ struct __fn;
+
+ template<class _Tp, class _Up, size_t _Size>
+ concept __swappable_arrays =
+ !__unqualified_swappable_with<_Tp(&)[_Size], _Up(&)[_Size]> &&
+ extent_v<_Tp> == extent_v<_Up> &&
+ requires(_Tp(& __t)[_Size], _Up(& __u)[_Size], const __fn& __swap) {
+ __swap(__t[0], __u[0]);
+ };
+
+ template<class _Tp>
+ concept __exchangeable =
+ !__unqualified_swappable_with<_Tp&, _Tp&> &&
+ move_constructible<_Tp> &&
+ assignable_from<_Tp&, _Tp>;
+
+ struct __fn {
+ // 2.1 `S` is `(void)swap(E1, E2)`* if `E1` or `E2` has class or enumeration type and...
+ // *The name `swap` is used here unqualified.
+ template<class _Tp, class _Up>
+ requires __unqualified_swappable_with<_Tp, _Up>
+ constexpr void operator()(_Tp&& __t, _Up&& __u) const
+ noexcept(noexcept(swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
+ {
+ swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
+ }
+
+ // 2.2 Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and...
+ template<class _Tp, class _Up, size_t _Size>
+ requires __swappable_arrays<_Tp, _Up, _Size>
+ constexpr void operator()(_Tp(& __t)[_Size], _Up(& __u)[_Size]) const
+ noexcept(noexcept((*this)(*__t, *__u)))
+ {
+ // TODO(cjdb): replace with `ranges::swap_ranges`.
+ for (size_t __i = 0; __i < _Size; ++__i) {
+ (*this)(__t[__i], __u[__i]);
+ }
+ }
+
+ // 2.3 Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models...
+ template<__exchangeable _Tp>
+ constexpr void operator()(_Tp& __x, _Tp& __y) const
+ noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_move_assignable_v<_Tp>)
+ {
+ __y = _VSTD::exchange(__x, _VSTD::move(__y));
+ }
+ };
+} // namespace ranges::__swap
+
+namespace ranges::inline __cpo {
+ inline constexpr auto swap = __swap::__fn{};
+} // namespace ranges::__cpo
+
+template<class _Tp>
+concept swappable = requires(_Tp& __a, _Tp& __b) { ranges::swap(__a, __b); };
+
+template<class _Tp, class _Up>
+concept swappable_with =
+ common_reference_with<_Tp, _Up> &&
+ requires(_Tp&& __t, _Up&& __u) {
+ ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Tp>(__t));
+ ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Up>(__u));
+ ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
+ ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Tp>(__t));
+ };
+
+// [concept.booleantestable]
+template<class _Tp>
+concept __boolean_testable_impl = convertible_to<_Tp, bool>;
+
+template<class _Tp>
+concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t) {
+ { !std::forward<_Tp>(__t) } -> __boolean_testable_impl;
+};
+
+// [concept.equalitycomparable]
+template<class _Tp, class _Up>
+concept __weakly_equality_comparable_with =
+ requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {
+ { __t == __u } -> __boolean_testable;
+ { __t != __u } -> __boolean_testable;
+ { __u == __t } -> __boolean_testable;
+ { __u != __t } -> __boolean_testable;
+ };
+
+template<class _Tp>
+concept equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>;
+
+template<class _Tp, class _Up>
+concept equality_comparable_with =
+ equality_comparable<_Tp> && equality_comparable<_Up> &&
+ common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> &&
+ equality_comparable<
+ common_reference_t<
+ __make_const_lvalue_ref<_Tp>,
+ __make_const_lvalue_ref<_Up>>> &&
+ __weakly_equality_comparable_with<_Tp, _Up>;
+
+// [concept.totallyordered]
+
+template<class _Tp, class _Up>
+concept __partially_ordered_with =
+ requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_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<class _Tp>
+concept totally_ordered = equality_comparable<_Tp> && __partially_ordered_with<_Tp, _Tp>;
+
+template<class _Tp, class _Up>
+concept totally_ordered_with =
+ totally_ordered<_Tp> && totally_ordered<_Up> &&
+ equality_comparable_with<_Tp, _Up> &&
+ totally_ordered<
+ common_reference_t<
+ __make_const_lvalue_ref<_Tp>,
+ __make_const_lvalue_ref<_Up>>> &&
+ __partially_ordered_with<_Tp, _Up>;
+
+// [concepts.object]
+template<class _Tp>
+concept movable =
+ is_object_v<_Tp> &&
+ move_constructible<_Tp> &&
+ assignable_from<_Tp&, _Tp> &&
+ swappable<_Tp>;
+
+template<class _Tp>
+concept copyable =
+ copy_constructible<_Tp> &&
+ movable<_Tp> &&
+ assignable_from<_Tp&, _Tp&> &&
+ assignable_from<_Tp&, const _Tp&> &&
+ assignable_from<_Tp&, const _Tp>;
+
+template<class _Tp>
+concept semiregular = copyable<_Tp> && default_initializable<_Tp>;
+
+template<class _Tp>
+concept regular = semiregular<_Tp> && equality_comparable<_Tp>;
+
+// [concept.invocable]
+template<class _Fn, class... _Args>
+concept invocable = requires(_Fn&& __fn, _Args&&... __args) {
+ _VSTD::invoke(_VSTD::forward<_Fn>(__fn), _VSTD::forward<_Args>(__args)...); // not required to be equality preserving
+};
+
+// [concept.regular.invocable]
+template<class _Fn, class... _Args>
+concept regular_invocable = invocable<_Fn, _Args...>;
+
+// [concept.predicate]
+template<class _Fn, class... _Args>
+concept predicate =
+ regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;
+
+// [concept.relation]
+template<class _Rp, class _Tp, class _Up>
+concept relation =
+ predicate<_Rp, _Tp, _Tp> && predicate<_Rp, _Up, _Up> &&
+ predicate<_Rp, _Tp, _Up> && predicate<_Rp, _Up, _Tp>;
+
+// [concept.equiv]
+template<class _Rp, class _Tp, class _Up>
+concept equivalence_relation = relation<_Rp, _Tp, _Up>;
+
+// [concept.strictweakorder]
+template<class _Rp, class _Tp, class _Up>
+concept strict_weak_order = relation<_Rp, _Tp, _Up>;
+
+template<class _Tp, class _Up>
+concept __different_from = !same_as<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
_LIBCPP_END_NAMESPACE_STD
#endif // !_LIBCPP_HAS_NO_THREADS
-#endif // _LIBCPP_CONDITION_VARIABLE
+#endif // _LIBCPP_CONDITION_VARIABLE
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::jmp_buf;
-using ::longjmp;
+using ::jmp_buf _LIBCPP_USING_IF_EXISTS;
+using ::longjmp _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CSETJMP
+#endif // _LIBCPP_CSETJMP
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::sig_atomic_t;
-using ::signal;
-using ::raise;
+using ::sig_atomic_t _LIBCPP_USING_IF_EXISTS;
+using ::signal _LIBCPP_USING_IF_EXISTS;
+using ::raise _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CSIGNAL
+#endif // _LIBCPP_CSIGNAL
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::va_list;
+using ::va_list _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CSTDARG
+#endif // _LIBCPP_CSTDARG
#undef __bool_true_false_are_defined
#define __bool_true_false_are_defined 1
-#endif // _LIBCPP_CSTDBOOL
+#endif // _LIBCPP_CSTDBOOL
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::ptrdiff_t;
-using ::size_t;
+using ::ptrdiff_t _LIBCPP_USING_IF_EXISTS;
+using ::size_t _LIBCPP_USING_IF_EXISTS;
#if !defined(_LIBCPP_CXX03_LANG)
-using ::max_align_t;
+using ::max_align_t _LIBCPP_USING_IF_EXISTS;
#endif
template <class _Tp> struct __libcpp_is_integral { enum { value = 0 }; };
template <> struct __libcpp_is_integral<signed char> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<unsigned char> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<wchar_t> { enum { value = 1 }; };
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
template <> struct __libcpp_is_integral<char8_t> { enum { value = 1 }; };
#endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
template <> struct __libcpp_is_integral<char16_t> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<char32_t> { enum { value = 1 }; };
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
template <> struct __libcpp_is_integral<short> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<unsigned short> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<int> { enum { value = 1 }; };
{ return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift)); }
template <class _Integer, class = _EnableByteOverload<_Integer> >
- constexpr _Integer
+ _LIBCPP_NODISCARD_EXT constexpr _Integer
to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); }
}
#endif
-#endif // _LIBCPP_CSTDDEF
+#endif // _LIBCPP_CSTDDEF
_LIBCPP_BEGIN_NAMESPACE_STD
-using::int8_t;
-using::int16_t;
-using::int32_t;
-using::int64_t;
-
-using::uint8_t;
-using::uint16_t;
-using::uint32_t;
-using::uint64_t;
-
-using::int_least8_t;
-using::int_least16_t;
-using::int_least32_t;
-using::int_least64_t;
-
-using::uint_least8_t;
-using::uint_least16_t;
-using::uint_least32_t;
-using::uint_least64_t;
-
-using::int_fast8_t;
-using::int_fast16_t;
-using::int_fast32_t;
-using::int_fast64_t;
-
-using::uint_fast8_t;
-using::uint_fast16_t;
-using::uint_fast32_t;
-using::uint_fast64_t;
-
-using::intptr_t;
-using::uintptr_t;
-
-using::intmax_t;
-using::uintmax_t;
+using ::int8_t _LIBCPP_USING_IF_EXISTS;
+using ::int16_t _LIBCPP_USING_IF_EXISTS;
+using ::int32_t _LIBCPP_USING_IF_EXISTS;
+using ::int64_t _LIBCPP_USING_IF_EXISTS;
+
+using ::uint8_t _LIBCPP_USING_IF_EXISTS;
+using ::uint16_t _LIBCPP_USING_IF_EXISTS;
+using ::uint32_t _LIBCPP_USING_IF_EXISTS;
+using ::uint64_t _LIBCPP_USING_IF_EXISTS;
+
+using ::int_least8_t _LIBCPP_USING_IF_EXISTS;
+using ::int_least16_t _LIBCPP_USING_IF_EXISTS;
+using ::int_least32_t _LIBCPP_USING_IF_EXISTS;
+using ::int_least64_t _LIBCPP_USING_IF_EXISTS;
+
+using ::uint_least8_t _LIBCPP_USING_IF_EXISTS;
+using ::uint_least16_t _LIBCPP_USING_IF_EXISTS;
+using ::uint_least32_t _LIBCPP_USING_IF_EXISTS;
+using ::uint_least64_t _LIBCPP_USING_IF_EXISTS;
+
+using ::int_fast8_t _LIBCPP_USING_IF_EXISTS;
+using ::int_fast16_t _LIBCPP_USING_IF_EXISTS;
+using ::int_fast32_t _LIBCPP_USING_IF_EXISTS;
+using ::int_fast64_t _LIBCPP_USING_IF_EXISTS;
+
+using ::uint_fast8_t _LIBCPP_USING_IF_EXISTS;
+using ::uint_fast16_t _LIBCPP_USING_IF_EXISTS;
+using ::uint_fast32_t _LIBCPP_USING_IF_EXISTS;
+using ::uint_fast64_t _LIBCPP_USING_IF_EXISTS;
+
+using ::intptr_t _LIBCPP_USING_IF_EXISTS;
+using ::uintptr_t _LIBCPP_USING_IF_EXISTS;
+
+using ::intmax_t _LIBCPP_USING_IF_EXISTS;
+using ::uintmax_t _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CSTDINT
+#endif // _LIBCPP_CSTDINT
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::FILE;
-using ::fpos_t;
-using ::size_t;
-
-using ::fclose;
-using ::fflush;
-using ::setbuf;
-using ::setvbuf;
-using ::fprintf;
-using ::fscanf;
-using ::snprintf;
-using ::sprintf;
-using ::sscanf;
-using ::vfprintf;
-using ::vfscanf;
-using ::vsscanf;
-using ::vsnprintf;
-using ::vsprintf;
-using ::fgetc;
-using ::fgets;
-using ::fputc;
-using ::fputs;
-using ::getc;
-using ::putc;
-using ::ungetc;
-using ::fread;
-using ::fwrite;
+using ::FILE _LIBCPP_USING_IF_EXISTS;
+using ::fpos_t _LIBCPP_USING_IF_EXISTS;
+using ::size_t _LIBCPP_USING_IF_EXISTS;
+
+using ::fclose _LIBCPP_USING_IF_EXISTS;
+using ::fflush _LIBCPP_USING_IF_EXISTS;
+using ::setbuf _LIBCPP_USING_IF_EXISTS;
+using ::setvbuf _LIBCPP_USING_IF_EXISTS;
+using ::fprintf _LIBCPP_USING_IF_EXISTS;
+using ::fscanf _LIBCPP_USING_IF_EXISTS;
+using ::snprintf _LIBCPP_USING_IF_EXISTS;
+using ::sprintf _LIBCPP_USING_IF_EXISTS;
+using ::sscanf _LIBCPP_USING_IF_EXISTS;
+using ::vfprintf _LIBCPP_USING_IF_EXISTS;
+using ::vfscanf _LIBCPP_USING_IF_EXISTS;
+using ::vsscanf _LIBCPP_USING_IF_EXISTS;
+using ::vsnprintf _LIBCPP_USING_IF_EXISTS;
+using ::vsprintf _LIBCPP_USING_IF_EXISTS;
+using ::fgetc _LIBCPP_USING_IF_EXISTS;
+using ::fgets _LIBCPP_USING_IF_EXISTS;
+using ::fputc _LIBCPP_USING_IF_EXISTS;
+using ::fputs _LIBCPP_USING_IF_EXISTS;
+using ::getc _LIBCPP_USING_IF_EXISTS;
+using ::putc _LIBCPP_USING_IF_EXISTS;
+using ::ungetc _LIBCPP_USING_IF_EXISTS;
+using ::fread _LIBCPP_USING_IF_EXISTS;
+using ::fwrite _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
-using ::fgetpos;
+using ::fgetpos _LIBCPP_USING_IF_EXISTS;
#endif
-using ::fseek;
+using ::fseek _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
-using ::fsetpos;
+using ::fsetpos _LIBCPP_USING_IF_EXISTS;
#endif
-using ::ftell;
-using ::rewind;
-using ::clearerr;
-using ::feof;
-using ::ferror;
-using ::perror;
+using ::ftell _LIBCPP_USING_IF_EXISTS;
+using ::rewind _LIBCPP_USING_IF_EXISTS;
+using ::clearerr _LIBCPP_USING_IF_EXISTS;
+using ::feof _LIBCPP_USING_IF_EXISTS;
+using ::ferror _LIBCPP_USING_IF_EXISTS;
+using ::perror _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
-using ::fopen;
-using ::freopen;
-using ::remove;
-using ::rename;
-using ::tmpfile;
-using ::tmpnam;
+using ::fopen _LIBCPP_USING_IF_EXISTS;
+using ::freopen _LIBCPP_USING_IF_EXISTS;
+using ::remove _LIBCPP_USING_IF_EXISTS;
+using ::rename _LIBCPP_USING_IF_EXISTS;
+using ::tmpfile _LIBCPP_USING_IF_EXISTS;
+using ::tmpnam _LIBCPP_USING_IF_EXISTS;
#endif
#ifndef _LIBCPP_HAS_NO_STDIN
-using ::getchar;
+using ::getchar _LIBCPP_USING_IF_EXISTS;
#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS)
-using ::gets;
+using ::gets _LIBCPP_USING_IF_EXISTS;
#endif
-using ::scanf;
-using ::vscanf;
+using ::scanf _LIBCPP_USING_IF_EXISTS;
+using ::vscanf _LIBCPP_USING_IF_EXISTS;
#endif
#ifndef _LIBCPP_HAS_NO_STDOUT
-using ::printf;
-using ::putchar;
-using ::puts;
-using ::vprintf;
+using ::printf _LIBCPP_USING_IF_EXISTS;
+using ::putchar _LIBCPP_USING_IF_EXISTS;
+using ::puts _LIBCPP_USING_IF_EXISTS;
+using ::vprintf _LIBCPP_USING_IF_EXISTS;
#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CSTDIO
+#endif // _LIBCPP_CSTDIO
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::size_t;
-using ::div_t;
-using ::ldiv_t;
+using ::size_t _LIBCPP_USING_IF_EXISTS;
+using ::div_t _LIBCPP_USING_IF_EXISTS;
+using ::ldiv_t _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-using ::lldiv_t;
+using ::lldiv_t _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-using ::atof;
-using ::atoi;
-using ::atol;
+using ::atof _LIBCPP_USING_IF_EXISTS;
+using ::atoi _LIBCPP_USING_IF_EXISTS;
+using ::atol _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-using ::atoll;
+using ::atoll _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-using ::strtod;
-using ::strtof;
-using ::strtold;
-using ::strtol;
+using ::strtod _LIBCPP_USING_IF_EXISTS;
+using ::strtof _LIBCPP_USING_IF_EXISTS;
+using ::strtold _LIBCPP_USING_IF_EXISTS;
+using ::strtol _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-using ::strtoll;
+using ::strtoll _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-using ::strtoul;
+using ::strtoul _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-using ::strtoull;
+using ::strtoull _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-using ::rand;
-using ::srand;
-using ::calloc;
-using ::free;
-using ::malloc;
-using ::realloc;
-using ::abort;
-using ::atexit;
-using ::exit;
-using ::_Exit;
+using ::rand _LIBCPP_USING_IF_EXISTS;
+using ::srand _LIBCPP_USING_IF_EXISTS;
+using ::calloc _LIBCPP_USING_IF_EXISTS;
+using ::free _LIBCPP_USING_IF_EXISTS;
+using ::malloc _LIBCPP_USING_IF_EXISTS;
+using ::realloc _LIBCPP_USING_IF_EXISTS;
+using ::abort _LIBCPP_USING_IF_EXISTS;
+using ::atexit _LIBCPP_USING_IF_EXISTS;
+using ::exit _LIBCPP_USING_IF_EXISTS;
+using ::_Exit _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_WINDOWS_STORE_APP
-using ::getenv;
-using ::system;
+using ::getenv _LIBCPP_USING_IF_EXISTS;
+using ::system _LIBCPP_USING_IF_EXISTS;
#endif
-using ::bsearch;
-using ::qsort;
-using ::abs;
-using ::labs;
+using ::bsearch _LIBCPP_USING_IF_EXISTS;
+using ::qsort _LIBCPP_USING_IF_EXISTS;
+using ::abs _LIBCPP_USING_IF_EXISTS;
+using ::labs _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-using ::llabs;
+using ::llabs _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-using ::div;
-using ::ldiv;
+using ::div _LIBCPP_USING_IF_EXISTS;
+using ::ldiv _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-using ::lldiv;
+using ::lldiv _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-using ::mblen;
-using ::mbtowc;
-using ::wctomb;
-using ::mbstowcs;
-using ::wcstombs;
+using ::mblen _LIBCPP_USING_IF_EXISTS;
+using ::mbtowc _LIBCPP_USING_IF_EXISTS;
+using ::wctomb _LIBCPP_USING_IF_EXISTS;
+using ::mbstowcs _LIBCPP_USING_IF_EXISTS;
+using ::wcstombs _LIBCPP_USING_IF_EXISTS;
#if !defined(_LIBCPP_CXX03_LANG) && defined(_LIBCPP_HAS_QUICK_EXIT)
-using ::at_quick_exit;
-using ::quick_exit;
+using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
+using ::quick_exit _LIBCPP_USING_IF_EXISTS;
#endif
#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_ALIGNED_ALLOC)
-using ::aligned_alloc;
+using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CSTDLIB
+#endif // _LIBCPP_CSTDLIB
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::size_t;
-using ::memcpy;
-using ::memmove;
-using ::strcpy;
-using ::strncpy;
-using ::strcat;
-using ::strncat;
-using ::memcmp;
-using ::strcmp;
-using ::strncmp;
-using ::strcoll;
-using ::strxfrm;
-using ::memchr;
-using ::strchr;
-using ::strcspn;
-using ::strpbrk;
-using ::strrchr;
-using ::strspn;
-using ::strstr;
+using ::size_t _LIBCPP_USING_IF_EXISTS;
+using ::memcpy _LIBCPP_USING_IF_EXISTS;
+using ::memmove _LIBCPP_USING_IF_EXISTS;
+using ::strcpy _LIBCPP_USING_IF_EXISTS;
+using ::strncpy _LIBCPP_USING_IF_EXISTS;
+using ::strcat _LIBCPP_USING_IF_EXISTS;
+using ::strncat _LIBCPP_USING_IF_EXISTS;
+using ::memcmp _LIBCPP_USING_IF_EXISTS;
+using ::strcmp _LIBCPP_USING_IF_EXISTS;
+using ::strncmp _LIBCPP_USING_IF_EXISTS;
+using ::strcoll _LIBCPP_USING_IF_EXISTS;
+using ::strxfrm _LIBCPP_USING_IF_EXISTS;
+using ::memchr _LIBCPP_USING_IF_EXISTS;
+using ::strchr _LIBCPP_USING_IF_EXISTS;
+using ::strcspn _LIBCPP_USING_IF_EXISTS;
+using ::strpbrk _LIBCPP_USING_IF_EXISTS;
+using ::strrchr _LIBCPP_USING_IF_EXISTS;
+using ::strspn _LIBCPP_USING_IF_EXISTS;
+using ::strstr _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
-using ::strtok;
+using ::strtok _LIBCPP_USING_IF_EXISTS;
#endif
-using ::memset;
-using ::strerror;
-using ::strlen;
+using ::memset _LIBCPP_USING_IF_EXISTS;
+using ::strerror _LIBCPP_USING_IF_EXISTS;
+using ::strlen _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CSTRING
+#endif // _LIBCPP_CSTRING
#pragma GCC system_header
#endif
-#endif // _LIBCPP_CTGMATH
+#endif // _LIBCPP_CTGMATH
#pragma GCC system_header
#endif
+// FIXME:
+// Apple SDKs don't define ::timespec_get unconditionally in C++ mode. This
+// should be fixed in future SDKs, but for the time being we need to avoid
+// trying to use that declaration when the SDK doesn't provide it. Note that
+// we're detecting this here instead of in <__config> because we can't include
+// system headers from <__config>, since it leads to circular module dependencies.
+// This is also meant to be a very temporary workaround until the SDKs are fixed.
+#if defined(__APPLE__) && !__has_attribute(using_if_exists)
+# include <sys/cdefs.h>
+# if defined(_LIBCPP_HAS_TIMESPEC_GET) && (__DARWIN_C_LEVEL < __DARWIN_C_FULL)
+# define _LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED
+# endif
+#endif
+
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::clock_t;
-using ::size_t;
-using ::time_t;
-using ::tm;
+using ::clock_t _LIBCPP_USING_IF_EXISTS;
+using ::size_t _LIBCPP_USING_IF_EXISTS;
+using ::time_t _LIBCPP_USING_IF_EXISTS;
+using ::tm _LIBCPP_USING_IF_EXISTS;
#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)
-using ::timespec;
+using ::timespec _LIBCPP_USING_IF_EXISTS;
#endif
-using ::clock;
-using ::difftime;
-using ::mktime;
-using ::time;
+using ::clock _LIBCPP_USING_IF_EXISTS;
+using ::difftime _LIBCPP_USING_IF_EXISTS;
+using ::mktime _LIBCPP_USING_IF_EXISTS;
+using ::time _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
-using ::asctime;
-using ::ctime;
-using ::gmtime;
-using ::localtime;
+using ::asctime _LIBCPP_USING_IF_EXISTS;
+using ::ctime _LIBCPP_USING_IF_EXISTS;
+using ::gmtime _LIBCPP_USING_IF_EXISTS;
+using ::localtime _LIBCPP_USING_IF_EXISTS;
#endif
-using ::strftime;
-#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)
-using ::timespec_get;
+using ::strftime _LIBCPP_USING_IF_EXISTS;
+#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) && !defined(_LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED)
+using ::timespec_get _LIBCPP_USING_IF_EXISTS;
#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CTIME
+#endif // _LIBCPP_CTIME
#endif
-#endif // _LIBCPP_CTYPE_H
+#endif // _LIBCPP_CTYPE_H
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::mbstate_t;
-using ::size_t;
-using ::tm;
-using ::wint_t;
-using ::FILE;
-using ::fwprintf;
-using ::fwscanf;
-using ::swprintf;
-using ::vfwprintf;
-using ::vswprintf;
-using ::swscanf;
-using ::vfwscanf;
-using ::vswscanf;
-using ::fgetwc;
-using ::fgetws;
-using ::fputwc;
-using ::fputws;
-using ::fwide;
-using ::getwc;
-using ::putwc;
-using ::ungetwc;
-using ::wcstod;
-using ::wcstof;
-using ::wcstold;
-using ::wcstol;
+using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
+using ::size_t _LIBCPP_USING_IF_EXISTS;
+using ::tm _LIBCPP_USING_IF_EXISTS;
+using ::wint_t _LIBCPP_USING_IF_EXISTS;
+using ::FILE _LIBCPP_USING_IF_EXISTS;
+using ::fwprintf _LIBCPP_USING_IF_EXISTS;
+using ::fwscanf _LIBCPP_USING_IF_EXISTS;
+using ::swprintf _LIBCPP_USING_IF_EXISTS;
+using ::vfwprintf _LIBCPP_USING_IF_EXISTS;
+using ::vswprintf _LIBCPP_USING_IF_EXISTS;
+using ::swscanf _LIBCPP_USING_IF_EXISTS;
+using ::vfwscanf _LIBCPP_USING_IF_EXISTS;
+using ::vswscanf _LIBCPP_USING_IF_EXISTS;
+using ::fgetwc _LIBCPP_USING_IF_EXISTS;
+using ::fgetws _LIBCPP_USING_IF_EXISTS;
+using ::fputwc _LIBCPP_USING_IF_EXISTS;
+using ::fputws _LIBCPP_USING_IF_EXISTS;
+using ::fwide _LIBCPP_USING_IF_EXISTS;
+using ::getwc _LIBCPP_USING_IF_EXISTS;
+using ::putwc _LIBCPP_USING_IF_EXISTS;
+using ::ungetwc _LIBCPP_USING_IF_EXISTS;
+using ::wcstod _LIBCPP_USING_IF_EXISTS;
+using ::wcstof _LIBCPP_USING_IF_EXISTS;
+using ::wcstold _LIBCPP_USING_IF_EXISTS;
+using ::wcstol _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-using ::wcstoll;
+using ::wcstoll _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-using ::wcstoul;
+using ::wcstoul _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-using ::wcstoull;
+using ::wcstoull _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-using ::wcscpy;
-using ::wcsncpy;
-using ::wcscat;
-using ::wcsncat;
-using ::wcscmp;
-using ::wcscoll;
-using ::wcsncmp;
-using ::wcsxfrm;
-using ::wcschr;
-using ::wcspbrk;
-using ::wcsrchr;
-using ::wcsstr;
-using ::wmemchr;
-using ::wcscspn;
-using ::wcslen;
-using ::wcsspn;
-using ::wcstok;
-using ::wmemcmp;
-using ::wmemcpy;
-using ::wmemmove;
-using ::wmemset;
-using ::wcsftime;
-using ::btowc;
-using ::wctob;
-using ::mbsinit;
-using ::mbrlen;
-using ::mbrtowc;
-using ::wcrtomb;
-using ::mbsrtowcs;
-using ::wcsrtombs;
+using ::wcscpy _LIBCPP_USING_IF_EXISTS;
+using ::wcsncpy _LIBCPP_USING_IF_EXISTS;
+using ::wcscat _LIBCPP_USING_IF_EXISTS;
+using ::wcsncat _LIBCPP_USING_IF_EXISTS;
+using ::wcscmp _LIBCPP_USING_IF_EXISTS;
+using ::wcscoll _LIBCPP_USING_IF_EXISTS;
+using ::wcsncmp _LIBCPP_USING_IF_EXISTS;
+using ::wcsxfrm _LIBCPP_USING_IF_EXISTS;
+using ::wcschr _LIBCPP_USING_IF_EXISTS;
+using ::wcspbrk _LIBCPP_USING_IF_EXISTS;
+using ::wcsrchr _LIBCPP_USING_IF_EXISTS;
+using ::wcsstr _LIBCPP_USING_IF_EXISTS;
+using ::wmemchr _LIBCPP_USING_IF_EXISTS;
+using ::wcscspn _LIBCPP_USING_IF_EXISTS;
+using ::wcslen _LIBCPP_USING_IF_EXISTS;
+using ::wcsspn _LIBCPP_USING_IF_EXISTS;
+using ::wcstok _LIBCPP_USING_IF_EXISTS;
+using ::wmemcmp _LIBCPP_USING_IF_EXISTS;
+using ::wmemcpy _LIBCPP_USING_IF_EXISTS;
+using ::wmemmove _LIBCPP_USING_IF_EXISTS;
+using ::wmemset _LIBCPP_USING_IF_EXISTS;
+using ::wcsftime _LIBCPP_USING_IF_EXISTS;
+using ::btowc _LIBCPP_USING_IF_EXISTS;
+using ::wctob _LIBCPP_USING_IF_EXISTS;
+using ::mbsinit _LIBCPP_USING_IF_EXISTS;
+using ::mbrlen _LIBCPP_USING_IF_EXISTS;
+using ::mbrtowc _LIBCPP_USING_IF_EXISTS;
+using ::wcrtomb _LIBCPP_USING_IF_EXISTS;
+using ::mbsrtowcs _LIBCPP_USING_IF_EXISTS;
+using ::wcsrtombs _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_STDIN
-using ::getwchar;
-using ::vwscanf;
-using ::wscanf;
+using ::getwchar _LIBCPP_USING_IF_EXISTS;
+using ::vwscanf _LIBCPP_USING_IF_EXISTS;
+using ::wscanf _LIBCPP_USING_IF_EXISTS;
#endif
#ifndef _LIBCPP_HAS_NO_STDOUT
-using ::putwchar;
-using ::vwprintf;
-using ::wprintf;
+using ::putwchar _LIBCPP_USING_IF_EXISTS;
+using ::vwprintf _LIBCPP_USING_IF_EXISTS;
+using ::wprintf _LIBCPP_USING_IF_EXISTS;
#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CWCHAR
+#endif // _LIBCPP_CWCHAR
_LIBCPP_BEGIN_NAMESPACE_STD
-using ::wint_t;
-using ::wctrans_t;
-using ::wctype_t;
-using ::iswalnum;
-using ::iswalpha;
-using ::iswblank;
-using ::iswcntrl;
-using ::iswdigit;
-using ::iswgraph;
-using ::iswlower;
-using ::iswprint;
-using ::iswpunct;
-using ::iswspace;
-using ::iswupper;
-using ::iswxdigit;
-using ::iswctype;
-using ::wctype;
-using ::towlower;
-using ::towupper;
-using ::towctrans;
-using ::wctrans;
+#if defined(_LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H)
+using ::wint_t _LIBCPP_USING_IF_EXISTS;
+using ::wctrans_t _LIBCPP_USING_IF_EXISTS;
+using ::wctype_t _LIBCPP_USING_IF_EXISTS;
+using ::iswalnum _LIBCPP_USING_IF_EXISTS;
+using ::iswalpha _LIBCPP_USING_IF_EXISTS;
+using ::iswblank _LIBCPP_USING_IF_EXISTS;
+using ::iswcntrl _LIBCPP_USING_IF_EXISTS;
+using ::iswdigit _LIBCPP_USING_IF_EXISTS;
+using ::iswgraph _LIBCPP_USING_IF_EXISTS;
+using ::iswlower _LIBCPP_USING_IF_EXISTS;
+using ::iswprint _LIBCPP_USING_IF_EXISTS;
+using ::iswpunct _LIBCPP_USING_IF_EXISTS;
+using ::iswspace _LIBCPP_USING_IF_EXISTS;
+using ::iswupper _LIBCPP_USING_IF_EXISTS;
+using ::iswxdigit _LIBCPP_USING_IF_EXISTS;
+using ::iswctype _LIBCPP_USING_IF_EXISTS;
+using ::wctype _LIBCPP_USING_IF_EXISTS;
+using ::towlower _LIBCPP_USING_IF_EXISTS;
+using ::towupper _LIBCPP_USING_IF_EXISTS;
+using ::towctrans _LIBCPP_USING_IF_EXISTS;
+using ::wctrans _LIBCPP_USING_IF_EXISTS;
+#endif // _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_CWCTYPE
+#endif // _LIBCPP_CWCTYPE
*/
#include <__config>
+#include <__debug>
#include <__split_buffer>
-#include <type_traits>
+#include <__utility/forward.h>
+#include <algorithm>
+#include <compare>
#include <initializer_list>
#include <iterator>
-#include <algorithm>
+#include <limits>
#include <stdexcept>
+#include <type_traits>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
__deque_base(__deque_base&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
__deque_base(__deque_base&& __c, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
void swap(__deque_base& __c)
#if _LIBCPP_STD_VER >= 14
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
void
__map_.swap(__c.__map_);
_VSTD::swap(__start_, __c.__start_);
_VSTD::swap(size(), __c.size());
- __swap_allocator(__alloc(), __c.__alloc());
+ _VSTD::__swap_allocator(__alloc(), __c.__alloc());
}
template <class _Tp, class _Allocator>
deque(_InputIter __f, _InputIter __l, const allocator_type& __a,
typename enable_if<__is_cpp17_input_iterator<_InputIter>::value>::type* = 0);
deque(const deque& __c);
- deque(const deque& __c, const allocator_type& __a);
+ deque(const deque& __c, const __identity_t<allocator_type>& __a);
deque& operator=(const deque& __c);
_LIBCPP_INLINE_VISIBILITY
deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
_LIBCPP_INLINE_VISIBILITY
- deque(deque&& __c, const allocator_type& __a);
+ deque(deque&& __c, const __identity_t<allocator_type>& __a);
_LIBCPP_INLINE_VISIBILITY
deque& operator=(deque&& __c)
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
_LIBCPP_INLINE_VISIBILITY
void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _InputIter>
void assign(_InputIter __f, _InputIter __l,
size_type size() const _NOEXCEPT {return __base::size();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
- {return std::min<size_type>(
+ {return _VSTD::min<size_type>(
__alloc_traits::max_size(__base::__alloc()),
numeric_limits<difference_type>::max());}
void resize(size_type __n);
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, initializer_list<value_type> __il)
{return insert(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
iterator insert(const_iterator __p, const value_type& __v);
iterator insert(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIter>
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _InputIterator,
- class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,
- class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
+ class _Alloc = allocator<__iter_value_type<_InputIterator>>,
+ class = _EnableIf<__is_allocator<_Alloc>::value>
>
deque(_InputIterator, _InputIterator)
- -> deque<typename iterator_traits<_InputIterator>::value_type, _Alloc>;
+ -> deque<__iter_value_type<_InputIterator>, _Alloc>;
template<class _InputIterator,
class _Alloc,
- class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
+ class = _EnableIf<__is_allocator<_Alloc>::value>
>
deque(_InputIterator, _InputIterator, _Alloc)
- -> deque<typename iterator_traits<_InputIterator>::value_type, _Alloc>;
+ -> deque<__iter_value_type<_InputIterator>, _Alloc>;
#endif
}
template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(const deque& __c, const allocator_type& __a)
+deque<_Tp, _Allocator>::deque(const deque& __c, const __identity_t<allocator_type>& __a)
: __base(__a)
{
__append(__c.begin(), __c.end());
template <class _Tp, class _Allocator>
inline
-deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
+deque<_Tp, _Allocator>::deque(deque&& __c, const __identity_t<allocator_type>& __a)
: __base(_VSTD::move(__c), __a)
{
if (__a != __c.__alloc())
__base::__move_assign(__c);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
template <class _InputIter>
return __base::begin() + __pos;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void)++__f) {
- __alloc_traits::construct(__a, std::__to_address(__tx.__pos_), *__f);
+ __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_), *__f);
}
}
}
for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
- __alloc_traits::construct(__a, std::__to_address(__tx.__pos_));
+ __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_));
}
}
}
for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
- __alloc_traits::construct(__a, std::__to_address(__tx.__pos_), __v);
+ __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_), __v);
}
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __nb > 0; --__nb)
__buf.push_back(__alloc_traits::allocate(__a, __base::__block_size));
#ifndef _LIBCPP_NO_EXCEPTIONS
__alloc_traits::deallocate(__a, *__i, __base::__block_size);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __back_capacity > 0; --__back_capacity)
{
__buf.push_back(__base::__map_.back());
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __nb > 0; --__nb)
__buf.push_back(__alloc_traits::allocate(__a, __base::__block_size));
#ifndef _LIBCPP_NO_EXCEPTIONS
__alloc_traits::deallocate(__a, *__i, __base::__block_size);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __front_capacity > 0; --__front_capacity)
{
__buf.push_back(__base::__map_.front());
deque<_Tp, _Allocator>::pop_front()
{
allocator_type& __a = __base::__alloc();
- __alloc_traits::destroy(__a, __to_address(*(__base::__map_.begin() +
+ __alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
__base::__start_ / __base::__block_size) +
__base::__start_ % __base::__block_size));
--__base::size();
void
deque<_Tp, _Allocator>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "deque::pop_back called for empty deque");
+ _LIBCPP_ASSERT(!empty(), "deque::pop_back called on an empty deque");
allocator_type& __a = __base::__alloc();
size_type __p = __base::size() + __base::__start_ - 1;
- __alloc_traits::destroy(__a, __to_address(*(__base::__map_.begin() +
+ __alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
__p / __base::__block_size) +
__p % __base::__block_size));
--__base::size();
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_DEQUE
+#endif // _LIBCPP_DEQUE
#define ELAST ENOTRECOVERABLE
#endif
-#endif // defined(EOWNERDEAD)
+#endif // defined(EOWNERDEAD)
-#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
+#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
// supply errno values likely to be missing, particularly on Windows
#endif // __cplusplus
-#endif // _LIBCPP_ERRNO_H
+#endif // _LIBCPP_ERRNO_H
*/
+#include <__availability>
#include <__config>
+#include <__memory/addressof.h>
#include <cstddef>
#include <cstdlib>
#include <type_traits>
exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
~exception_ptr() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY explicit operator bool() const _NOEXCEPT
{return __ptr_ != nullptr;}
friend _LIBCPP_INLINE_VISIBILITY
exception_ptr& operator=(const exception_ptr& __other) _NOEXCEPT;
exception_ptr& operator=(nullptr_t) _NOEXCEPT;
~exception_ptr() _NOEXCEPT;
- _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT;
+ explicit operator bool() const _NOEXCEPT;
};
_LIBCPP_FUNC_VIS
_LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void
__do_throw(_Tp&& __t)
{
- throw __nested<_Up>(_VSTD::forward<_Tp>(__t));
+ throw __nested<_Up>(static_cast<_Tp&&>(__t));
}
};
__do_throw(_Tp&& __t)
#else
__do_throw (_Tp& __t)
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
{
- throw _VSTD::forward<_Tp>(__t);
+ throw static_cast<_Tp&&>(__t);
}
};
#endif
is_class<_Up>::value &&
!is_base_of<nested_exception, _Up>::value &&
!__libcpp_is_final<_Up>::value>::
- __do_throw(_VSTD::forward<_Tp>(__t));
+ __do_throw(static_cast<_Tp&&>(__t));
#else
((void)__t);
// FIXME: Make this abort
} // std
-#endif // _LIBCPP_EXCEPTION
+#endif // _LIBCPP_EXCEPTION
#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
#define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
-#define _LIBCPP_BEGIN_NAMESPACE_CHRONO_LFTS _LIBCPP_BEGIN_NAMESPACE_STD \
- namespace chrono { namespace experimental { inline namespace fundamentals_v1 {
-#define _LIBCPP_END_NAMESPACE_CHRONO_LFTS _LIBCPP_END_NAMESPACE_STD } } }
-
#if defined(_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM)
# define _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM /* nothing */
#else
#ifndef _LIBCPP_EXPERIMENTAL___MEMORY
#define _LIBCPP_EXPERIMENTAL___MEMORY
+#include <__memory/allocator_arg_t.h>
+#include <__memory/uses_allocator.h>
#include <experimental/__config>
#include <experimental/utility> // for erased_type
#include <__functional_base>
>
{};
+template <class _Tp, class _Allocator, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args )
+{
+ new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
+}
+
+// FIXME: This should have a version which takes a non-const alloc.
+template <class _Tp, class _Allocator, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
+{
+ new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
+}
+
+// FIXME: This should have a version which takes a non-const alloc.
+template <class _Tp, class _Allocator, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
+{
+ new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
+}
+
template <class _Tp, class _Alloc, class ..._Args>
inline _LIBCPP_INLINE_VISIBILITY
void __lfts_user_alloc_construct(
_Tp * __store, const _Alloc & __a, _Args &&... __args)
{
- _VSTD::__user_alloc_construct_impl(
+ ::std::experimental::fundamentals_v1::__user_alloc_construct_impl(
typename __lfts_uses_alloc_ctor<_Tp, _Alloc, _Args...>::type()
, __store, __a, _VSTD::forward<_Args>(__args)...
);
*/
+#include <__memory/uses_allocator.h>
#include <experimental/__config>
#include <functional>
#include <algorithm>
#if _LIBCPP_STD_VER > 11
// default searcher
template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-class _LIBCPP_TYPE_VIS default_searcher {
+class _LIBCPP_TEMPLATE_VIS default_searcher {
public:
_LIBCPP_INLINE_VISIBILITY
default_searcher(_ForwardIterator __f, _ForwardIterator __l,
operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
{
return _VSTD::__search(__f, __l, __first_, __last_, __pred_,
- typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category(),
- typename _VSTD::iterator_traits<_ForwardIterator2>::iterator_category());
+ typename iterator_traits<_ForwardIterator>::iterator_category(),
+ typename iterator_traits<_ForwardIterator2>::iterator_category());
}
private:
public:
_LIBCPP_INLINE_VISIBILITY
- _BMSkipTable(std::size_t __sz, _Value __default, _Hash __hf, _BinaryPredicate __pred)
+ _BMSkipTable(size_t __sz, _Value __default, _Hash __hf, _BinaryPredicate __pred)
: __default_value_(__default), __table(__sz, __hf, __pred) {}
_LIBCPP_INLINE_VISIBILITY
typedef _Value value_type;
typedef _Key key_type;
- typedef typename std::make_unsigned<key_type>::type unsigned_key_type;
- typedef std::array<value_type, _VSTD::numeric_limits<unsigned_key_type>::max()> skip_map;
+ typedef typename make_unsigned<key_type>::type unsigned_key_type;
+ typedef std::array<value_type, numeric_limits<unsigned_key_type>::max()> skip_map;
skip_map __table;
public:
_LIBCPP_INLINE_VISIBILITY
- _BMSkipTable(std::size_t /*__sz*/, _Value __default, _Hash /*__hf*/, _BinaryPredicate /*__pred*/)
+ _BMSkipTable(size_t /*__sz*/, _Value __default, _Hash /*__hf*/, _BinaryPredicate /*__pred*/)
{
std::fill_n(__table.begin(), __table.size(), __default);
}
template <class _RandomAccessIterator1,
class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
class _BinaryPredicate = equal_to<>>
-class _LIBCPP_TYPE_VIS boyer_moore_searcher {
+class _LIBCPP_TEMPLATE_VIS boyer_moore_searcher {
private:
typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type;
typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type;
typedef _BMSkipTable<value_type, difference_type, _Hash, _BinaryPredicate,
- _VSTD::is_integral<value_type>::value && // what about enums?
+ is_integral<value_type>::value && // what about enums?
sizeof(value_type) == 1 &&
is_same<_Hash, hash<value_type>>::value &&
is_same<_BinaryPredicate, equal_to<>>::value
if (__first_ == __last_) return make_pair(__f, __f); // empty pattern
// If the pattern is larger than the corpus, we can't find it!
- if ( __pattern_length_ > _VSTD::distance (__f, __l))
+ if ( __pattern_length_ > _VSTD::distance(__f, __l))
return make_pair(__l, __l);
// Do the search
template<typename _Iterator, typename _Container>
void __compute_bm_prefix ( _Iterator __f, _Iterator __l, _BinaryPredicate __pred, _Container &__prefix )
{
- const std::size_t __count = _VSTD::distance(__f, __l);
+ const size_t __count = _VSTD::distance(__f, __l);
__prefix[0] = 0;
- std::size_t __k = 0;
- for ( std::size_t __i = 1; __i < __count; ++__i )
+ size_t __k = 0;
+ for ( size_t __i = 1; __i < __count; ++__i )
{
while ( __k > 0 && !__pred ( __f[__k], __f[__i] ))
__k = __prefix [ __k - 1 ];
void __build_suffix_table(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
_BinaryPredicate __pred)
{
- const std::size_t __count = _VSTD::distance(__f, __l);
+ const size_t __count = _VSTD::distance(__f, __l);
vector<difference_type> & __suffix = *__suffix_.get();
if (__count > 0)
{
- _VSTD::vector<value_type> __scratch(__count);
+ vector<value_type> __scratch(__count);
__compute_bm_prefix(__f, __l, __pred, __scratch);
- for ( std::size_t __i = 0; __i <= __count; __i++ )
+ for ( size_t __i = 0; __i <= __count; __i++ )
__suffix[__i] = __count - __scratch[__count-1];
- typedef _VSTD::reverse_iterator<_RandomAccessIterator1> _RevIter;
+ typedef reverse_iterator<_RandomAccessIterator1> _RevIter;
__compute_bm_prefix(_RevIter(__l), _RevIter(__f), __pred, __scratch);
- for ( std::size_t __i = 0; __i < __count; __i++ )
+ for ( size_t __i = 0; __i < __count; __i++ )
{
- const std::size_t __j = __count - __scratch[__i];
+ const size_t __j = __count - __scratch[__i];
const difference_type __k = __i - __scratch[__i] + 1;
if (__suffix[__j] > __k)
template <class _RandomAccessIterator1,
class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
class _BinaryPredicate = equal_to<>>
-class _LIBCPP_TYPE_VIS boyer_moore_horspool_searcher {
+class _LIBCPP_TEMPLATE_VIS boyer_moore_horspool_searcher {
private:
typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type;
typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type;
typedef _BMSkipTable<value_type, difference_type, _Hash, _BinaryPredicate,
- _VSTD::is_integral<value_type>::value && // what about enums?
+ is_integral<value_type>::value && // what about enums?
sizeof(value_type) == 1 &&
is_same<_Hash, hash<value_type>>::value &&
is_same<_BinaryPredicate, equal_to<>>::value
if (__first_ == __last_) return make_pair(__f, __f); // empty pattern
// If the pattern is larger than the corpus, we can't find it!
- if ( __pattern_length_ > _VSTD::distance (__f, __l))
+ if ( __pattern_length_ > _VSTD::distance(__f, __l))
return make_pair(__l, __l);
// Do the search
#if _LIBCPP_STD_VER > 11
+#include <__memory/addressof.h>
+#include <__utility/move.h>
+#include <__utility/forward.h>
#include <iterator>
_LIBCPP_BEGIN_NAMESPACE_LFTS
{ return do_is_equal(__other); }
// 8.5.3, memory.resource.priv
-protected:
+private:
virtual void* do_allocate(size_t, size_t) = 0;
virtual void do_deallocate(void*, size_t, size_t) = 0;
virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0;
{ return __alloc_; }
// 8.7.3, memory.resource.adaptor.mem
-protected:
+private:
virtual void * do_allocate(size_t __bytes, size_t)
{
if (__bytes > __max_size()) {
return __p ? __alloc_ == __p->__alloc_ : false;
}
-private:
_LIBCPP_INLINE_VISIBILITY
size_t __max_size() const _NOEXCEPT {
return numeric_limits<size_t>::max() - _MaxAlign;
class propagate_const
{
public:
- typedef remove_reference_t<decltype(*_VSTD::declval<_Tp&>())> element_type;
+ typedef remove_reference_t<decltype(*declval<_Tp&>())> element_type;
static_assert(!is_array<_Tp>::value,
"Instantiation of propagate_const with an array type is ill-formed.");
#pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
#if _LIBCPP_STD_VER >= 17
template <class _Tp, size_t __bytes>
struct __vec_ext_traits {
-#if !defined(_LIBCPP_COMPILER_CLANG)
+#if !defined(_LIBCPP_COMPILER_CLANG_BASED)
typedef _Tp type __attribute__((vector_size(__ceil_pow_of_2(__bytes))));
#endif
};
-#if defined(_LIBCPP_COMPILER_CLANG)
+#if defined(_LIBCPP_COMPILER_CLANG_BASED)
#define _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, _NUM_ELEMENT) \
template <> \
struct __vec_ext_traits<_TYPE, sizeof(_TYPE) * _NUM_ELEMENT> { \
_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
+_LIBCPP_POP_MACROS
+
#endif /* _LIBCPP_EXPERIMENTAL_SIMD */
// 3.3.4, Detection idiom
template <class...> using void_t = void;
-struct nonesuch : private _VSTD::__nat { // make nonesuch "not an aggregate"
+struct nonesuch : private __nat { // make nonesuch "not an aggregate"
~nonesuch() = delete;
nonesuch (nonesuch const&) = delete;
void operator=(nonesuch const&) = delete;
#pragma GCC system_header
+#include <__string>
#include <string>
#include <cstring>
};
}
-#endif // _LIBCPP_EXT_HASH
+#endif // _LIBCPP_EXT_HASH
#include <type_traits>
#include <ext/__hash>
-#if __DEPRECATED
+#if defined(__DEPRECATED) && __DEPRECATED
#if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>")
#else
{
const_cast<bool&>(__x.__value_constructed) = false;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void operator()(pointer __p)
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
__h.get_deleter().__second_constructed = true;
- return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
+ return __h;
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
} // __gnu_cxx
-#endif // _LIBCPP_HASH_MAP
+#endif // _LIBCPP_HASH_MAP
#include <functional>
#include <ext/__hash>
-#if __DEPRECATED
+#if defined(__DEPRECATED) && __DEPRECATED
#if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>")
#else
} // __gnu_cxx
-#endif // _LIBCPP_HASH_SET
+#endif // _LIBCPP_HASH_SET
*/
+#include <__availability>
#include <__config>
+#include <__debug>
+#include <__utility/forward.h>
+#include <chrono>
+#include <compare>
#include <cstddef>
#include <cstdlib>
-#include <chrono>
-#include <iterator>
#include <iosfwd>
-#include <locale>
+#include <iterator>
#include <memory>
#include <stack>
#include <string>
+#include <string_view>
#include <system_error>
#include <utility>
-#include <iomanip> // for quoted
-#include <string_view>
#include <version>
-#include <__debug>
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+# include <locale>
+# include <iomanip> // for quoted
+#endif
+
+#if defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
+# error "The Filesystem library is not supported by this configuration of libc++"
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
uintmax_t available;
};
+// On Windows, the library never identifies files as block, character, fifo
+// or socket.
enum class _LIBCPP_ENUM_VIS file_type : signed char {
none = 0,
not_found = -1,
unknown = 8
};
+// On Windows, these permission bits map to one single readonly flag per
+// file, and the executable bit is always returned as set. When setting
+// permissions, as long as the write bit is set for either owner, group or
+// others, the readonly flag is cleared.
enum class _LIBCPP_ENUM_VIS perms : unsigned {
none = 0,
static const bool value = true;
using __char_type = wchar_t;
};
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+template <>
+struct __can_convert_char<char8_t> {
+ static const bool value = true;
+ using __char_type = char8_t;
+};
+#endif
template <>
struct __can_convert_char<char16_t> {
static const bool value = true;
template <class _ECharT>
typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
__is_separator(_ECharT __e) {
+#if defined(_LIBCPP_WIN32API)
+ return __e == _ECharT('/') || __e == _ECharT('\\');
+#else
return __e == _ECharT('/');
+#endif
}
-struct _NullSentinal {};
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+typedef u8string __u8_string;
+#else
+typedef string __u8_string;
+#endif
+
+struct _NullSentinel {};
template <class _Tp>
using _Void = void;
static _ECharT const* __range_begin(const _ECharT* __b) { return __b; }
static _ECharT const* __range_end(const _ECharT* __b) {
using _Iter = const _ECharT*;
- const _ECharT __sentinal = _ECharT{};
+ const _ECharT __sentinel = _ECharT{};
_Iter __e = __b;
- for (; *__e != __sentinal; ++__e)
+ for (; *__e != __sentinel; ++__e)
;
return __e;
}
using _Base = __can_convert_char<_ECharT>;
static _Iter __range_begin(_Iter __b) { return __b; }
- static _NullSentinal __range_end(_Iter) { return _NullSentinal{}; }
+ static _NullSentinel __range_end(_Iter) { return _NullSentinel{}; }
static _ECharT __first_or_null(_Iter __b) { return *__b; }
};
template <class _Tp>
struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp> {};
+#if defined(_LIBCPP_WIN32API)
+typedef wstring __path_string;
+typedef wchar_t __path_value;
+#else
+typedef string __path_string;
+typedef char __path_value;
+#endif
+
+#if defined(_LIBCPP_WIN32API)
+_LIBCPP_FUNC_VIS
+size_t __wide_to_char(const wstring&, char*, size_t);
+_LIBCPP_FUNC_VIS
+size_t __char_to_wide(const string&, wchar_t*, size_t);
+#endif
+
+template <class _ECharT>
+struct _PathCVT;
+
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
template <class _ECharT>
struct _PathCVT {
static_assert(__can_convert_char<_ECharT>::value,
"Char type not convertible");
typedef __narrow_to_utf8<sizeof(_ECharT) * __CHAR_BIT__> _Narrower;
+#if defined(_LIBCPP_WIN32API)
+ typedef __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Widener;
+#endif
- static void __append_range(string& __dest, _ECharT const* __b,
+ static void __append_range(__path_string& __dest, _ECharT const* __b,
_ECharT const* __e) {
+#if defined(_LIBCPP_WIN32API)
+ string __utf8;
+ _Narrower()(back_inserter(__utf8), __b, __e);
+ _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
+#else
_Narrower()(back_inserter(__dest), __b, __e);
+#endif
}
template <class _Iter>
- static void __append_range(string& __dest, _Iter __b, _Iter __e) {
+ static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
if (__b == __e)
return;
basic_string<_ECharT> __tmp(__b, __e);
+#if defined(_LIBCPP_WIN32API)
+ string __utf8;
+ _Narrower()(back_inserter(__utf8), __tmp.data(),
+ __tmp.data() + __tmp.length());
+ _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
+#else
_Narrower()(back_inserter(__dest), __tmp.data(),
__tmp.data() + __tmp.length());
+#endif
}
template <class _Iter>
- static void __append_range(string& __dest, _Iter __b, _NullSentinal) {
+ static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
- const _ECharT __sentinal = _ECharT{};
- if (*__b == __sentinal)
+ const _ECharT __sentinel = _ECharT{};
+ if (*__b == __sentinel)
return;
basic_string<_ECharT> __tmp;
- for (; *__b != __sentinal; ++__b)
+ for (; *__b != __sentinel; ++__b)
__tmp.push_back(*__b);
+#if defined(_LIBCPP_WIN32API)
+ string __utf8;
+ _Narrower()(back_inserter(__utf8), __tmp.data(),
+ __tmp.data() + __tmp.length());
+ _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
+#else
_Narrower()(back_inserter(__dest), __tmp.data(),
__tmp.data() + __tmp.length());
+#endif
}
template <class _Source>
- static void __append_source(string& __dest, _Source const& __s) {
+ static void __append_source(__path_string& __dest, _Source const& __s) {
using _Traits = __is_pathable<_Source>;
__append_range(__dest, _Traits::__range_begin(__s),
_Traits::__range_end(__s));
}
};
+#endif // !_LIBCPP_HAS_NO_LOCALIZATION
template <>
-struct _PathCVT<char> {
+struct _PathCVT<__path_value> {
template <class _Iter>
static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
- __append_range(string& __dest, _Iter __b, _Iter __e) {
+ __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
for (; __b != __e; ++__b)
__dest.push_back(*__b);
}
template <class _Iter>
static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
- __append_range(string& __dest, _Iter __b, _Iter __e) {
- __dest.__append_forward_unsafe(__b, __e);
+ __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
+ __dest.append(__b, __e);
}
template <class _Iter>
- static void __append_range(string& __dest, _Iter __b, _NullSentinal) {
- const char __sentinal = char{};
- for (; *__b != __sentinal; ++__b)
+ static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
+ const char __sentinel = char{};
+ for (; *__b != __sentinel; ++__b)
__dest.push_back(*__b);
}
template <class _Source>
- static void __append_source(string& __dest, _Source const& __s) {
+ static void __append_source(__path_string& __dest, _Source const& __s) {
+ using _Traits = __is_pathable<_Source>;
+ __append_range(__dest, _Traits::__range_begin(__s),
+ _Traits::__range_end(__s));
+ }
+};
+
+#if defined(_LIBCPP_WIN32API)
+template <>
+struct _PathCVT<char> {
+
+ static void
+ __append_string(__path_string& __dest, const basic_string<char> &__str) {
+ size_t __size = __char_to_wide(__str, nullptr, 0);
+ size_t __pos = __dest.size();
+ __dest.resize(__pos + __size);
+ __char_to_wide(__str, const_cast<__path_value*>(__dest.data()) + __pos, __size);
+ }
+
+ template <class _Iter>
+ static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
+ __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
+ basic_string<char> __tmp(__b, __e);
+ __append_string(__dest, __tmp);
+ }
+
+ template <class _Iter>
+ static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
+ __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
+ basic_string<char> __tmp(__b, __e);
+ __append_string(__dest, __tmp);
+ }
+
+ template <class _Iter>
+ static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
+ const char __sentinel = char{};
+ basic_string<char> __tmp;
+ for (; *__b != __sentinel; ++__b)
+ __tmp.push_back(*__b);
+ __append_string(__dest, __tmp);
+ }
+
+ template <class _Source>
+ static void __append_source(__path_string& __dest, _Source const& __s) {
using _Traits = __is_pathable<_Source>;
__append_range(__dest, _Traits::__range_begin(__s),
_Traits::__range_end(__s));
}
};
+template <class _ECharT>
+struct _PathExport {
+ typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;
+ typedef __widen_from_utf8<sizeof(_ECharT) * __CHAR_BIT__> _Widener;
+
+ template <class _Str>
+ static void __append(_Str& __dest, const __path_string& __src) {
+ string __utf8;
+ _Narrower()(back_inserter(__utf8), __src.data(), __src.data() + __src.size());
+ _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
+ }
+};
+
+template <>
+struct _PathExport<char> {
+ template <class _Str>
+ static void __append(_Str& __dest, const __path_string& __src) {
+ size_t __size = __wide_to_char(__src, nullptr, 0);
+ size_t __pos = __dest.size();
+ __dest.resize(__size);
+ __wide_to_char(__src, const_cast<char*>(__dest.data()) + __pos, __size);
+ }
+};
+
+template <>
+struct _PathExport<wchar_t> {
+ template <class _Str>
+ static void __append(_Str& __dest, const __path_string& __src) {
+ __dest.append(__src.begin(), __src.end());
+ }
+};
+
+template <>
+struct _PathExport<char16_t> {
+ template <class _Str>
+ static void __append(_Str& __dest, const __path_string& __src) {
+ __dest.append(__src.begin(), __src.end());
+ }
+};
+
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+template <>
+struct _PathExport<char8_t> {
+ typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;
+
+ template <class _Str>
+ static void __append(_Str& __dest, const __path_string& __src) {
+ _Narrower()(back_inserter(__dest), __src.data(), __src.data() + __src.size());
+ }
+};
+#endif /* !_LIBCPP_HAS_NO_CHAR8_T */
+#endif /* _LIBCPP_WIN32API */
+
class _LIBCPP_TYPE_VIS path {
template <class _SourceOrIter, class _Tp = path&>
using _EnableIfPathable =
using _SourceCVT = _PathCVT<_SourceChar<_Tp> >;
public:
+#if defined(_LIBCPP_WIN32API)
+ typedef wchar_t value_type;
+ static constexpr value_type preferred_separator = L'\\';
+#else
typedef char value_type;
- typedef basic_string<value_type> string_type;
- typedef _VSTD::string_view __string_view;
static constexpr value_type preferred_separator = '/';
+#endif
+ typedef basic_string<value_type> string_type;
+ typedef basic_string_view<value_type> __string_view;
- enum class _LIBCPP_ENUM_VIS format : unsigned char {
+ enum _LIBCPP_ENUM_VIS format : unsigned char {
auto_format,
native_format,
generic_format
_PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
}
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
// TODO Implement locale conversions.
template <class _Source, class = _EnableIfPathable<_Source, void> >
path(const _Source& __src, const locale& __loc, format = format::auto_format);
template <class _InputIt>
path(_InputIt __first, _InputIt _last, const locale& __loc,
format = format::auto_format);
+#endif
_LIBCPP_INLINE_VISIBILITY
~path() = default;
return *this;
}
- template <class = void>
- _LIBCPP_INLINE_VISIBILITY path& operator=(string_type&& __s) noexcept {
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator=(string_type&& __s) noexcept {
__pn_ = _VSTD::move(__s);
return *this;
}
return *this;
}
-private:
- template <class _ECharT>
- static bool __source_is_absolute(_ECharT __first_or_null) {
- return __is_separator(__first_or_null);
- }
-
public:
// appends
+#if defined(_LIBCPP_WIN32API)
+ path& operator/=(const path& __p) {
+ auto __p_root_name = __p.__root_name();
+ auto __p_root_name_size = __p_root_name.size();
+ if (__p.is_absolute() ||
+ (!__p_root_name.empty() && __p_root_name != root_name())) {
+ __pn_ = __p.__pn_;
+ return *this;
+ }
+ if (__p.has_root_directory()) {
+ path __root_name_str = root_name();
+ __pn_ = __root_name_str.native();
+ __pn_ += __string_view(__p.__pn_).substr(__p_root_name_size);
+ return *this;
+ }
+ if (has_filename() || (!has_root_directory() && is_absolute()))
+ __pn_ += preferred_separator;
+ __pn_ += __string_view(__p.__pn_).substr(__p_root_name_size);
+ return *this;
+ }
+ template <class _Source>
+ _LIBCPP_INLINE_VISIBILITY _EnableIfPathable<_Source>
+ operator/=(const _Source& __src) {
+ return operator/=(path(__src));
+ }
+
+ template <class _Source>
+ _EnableIfPathable<_Source> append(const _Source& __src) {
+ return operator/=(path(__src));
+ }
+
+ template <class _InputIt>
+ path& append(_InputIt __first, _InputIt __last) {
+ return operator/=(path(__first, __last));
+ }
+#else
path& operator/=(const path& __p) {
if (__p.is_absolute()) {
__pn_ = __p.__pn_;
_EnableIfPathable<_Source> append(const _Source& __src) {
using _Traits = __is_pathable<_Source>;
using _CVT = _PathCVT<_SourceChar<_Source> >;
- if (__source_is_absolute(_Traits::__first_or_null(__src)))
+ bool __source_is_absolute = __is_separator(_Traits::__first_or_null(__src));
+ if (__source_is_absolute)
__pn_.clear();
else if (has_filename())
__pn_ += preferred_separator;
typedef typename iterator_traits<_InputIt>::value_type _ItVal;
static_assert(__can_convert_char<_ItVal>::value, "Must convertible");
using _CVT = _PathCVT<_ItVal>;
- if (__first != __last && __source_is_absolute(*__first))
+ if (__first != __last && __is_separator(*__first))
__pn_.clear();
else if (has_filename())
__pn_ += preferred_separator;
_CVT::__append_range(__pn_, __first, __last);
return *this;
}
+#endif
// concatenation
_LIBCPP_INLINE_VISIBILITY
template <class _ECharT>
typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
operator+=(_ECharT __x) {
- basic_string<_ECharT> __tmp;
- __tmp += __x;
- _PathCVT<_ECharT>::__append_source(__pn_, __tmp);
+ _PathCVT<_ECharT>::__append_source(__pn_,
+ basic_string_view<_ECharT>(&__x, 1));
return *this;
}
_LIBCPP_INLINE_VISIBILITY
void clear() noexcept { __pn_.clear(); }
- path& make_preferred() { return *this; }
+ path& make_preferred() {
+#if defined(_LIBCPP_WIN32API)
+ _VSTD::replace(__pn_.begin(), __pn_.end(), L'/', L'\\');
+#endif
+ return *this;
+ }
_LIBCPP_INLINE_VISIBILITY
path& remove_filename() {
_LIBCPP_INLINE_VISIBILITY operator string_type() const { return __pn_; }
+#if defined(_LIBCPP_WIN32API)
+ _LIBCPP_INLINE_VISIBILITY _VSTD::wstring wstring() const { return __pn_; }
+
+ _VSTD::wstring generic_wstring() const {
+ _VSTD::wstring __s;
+ __s.resize(__pn_.size());
+ _VSTD::replace_copy(__pn_.begin(), __pn_.end(), __s.begin(), '\\', '/');
+ return __s;
+ }
+
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+ template <class _ECharT, class _Traits = char_traits<_ECharT>,
+ class _Allocator = allocator<_ECharT> >
+ basic_string<_ECharT, _Traits, _Allocator>
+ string(const _Allocator& __a = _Allocator()) const {
+ using _Str = basic_string<_ECharT, _Traits, _Allocator>;
+ _Str __s(__a);
+ __s.reserve(__pn_.size());
+ _PathExport<_ECharT>::__append(__s, __pn_);
+ return __s;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _VSTD::string string() const {
+ return string<char>();
+ }
+ _LIBCPP_INLINE_VISIBILITY __u8_string u8string() const {
+ using _CVT = __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
+ __u8_string __s;
+ __s.reserve(__pn_.size());
+ _CVT()(back_inserter(__s), __pn_.data(), __pn_.data() + __pn_.size());
+ return __s;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const {
+ return string<char16_t>();
+ }
+ _LIBCPP_INLINE_VISIBILITY _VSTD::u32string u32string() const {
+ return string<char32_t>();
+ }
+
+ // generic format observers
+ template <class _ECharT, class _Traits = char_traits<_ECharT>,
+ class _Allocator = allocator<_ECharT> >
+ basic_string<_ECharT, _Traits, _Allocator>
+ generic_string(const _Allocator& __a = _Allocator()) const {
+ using _Str = basic_string<_ECharT, _Traits, _Allocator>;
+ _Str __s = string<_ECharT, _Traits, _Allocator>(__a);
+ // Note: This (and generic_u8string below) is slightly suboptimal as
+ // it iterates twice over the string; once to convert it to the right
+ // character type, and once to replace path delimiters.
+ _VSTD::replace(__s.begin(), __s.end(),
+ static_cast<_ECharT>('\\'), static_cast<_ECharT>('/'));
+ return __s;
+ }
+
+ _VSTD::string generic_string() const { return generic_string<char>(); }
+ _VSTD::u16string generic_u16string() const { return generic_string<char16_t>(); }
+ _VSTD::u32string generic_u32string() const { return generic_string<char32_t>(); }
+ __u8_string generic_u8string() const {
+ __u8_string __s = u8string();
+ _VSTD::replace(__s.begin(), __s.end(), '\\', '/');
+ return __s;
+ }
+#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
+#else /* _LIBCPP_WIN32API */
+
+ _LIBCPP_INLINE_VISIBILITY _VSTD::string string() const { return __pn_; }
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ _LIBCPP_INLINE_VISIBILITY _VSTD::u8string u8string() const { return _VSTD::u8string(__pn_.begin(), __pn_.end()); }
+#else
+ _LIBCPP_INLINE_VISIBILITY _VSTD::string u8string() const { return __pn_; }
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
template <class _ECharT, class _Traits = char_traits<_ECharT>,
class _Allocator = allocator<_ECharT> >
basic_string<_ECharT, _Traits, _Allocator>
return __s;
}
- _LIBCPP_INLINE_VISIBILITY std::string string() const { return __pn_; }
- _LIBCPP_INLINE_VISIBILITY std::wstring wstring() const {
+ _LIBCPP_INLINE_VISIBILITY _VSTD::wstring wstring() const {
return string<wchar_t>();
}
- _LIBCPP_INLINE_VISIBILITY std::string u8string() const { return __pn_; }
- _LIBCPP_INLINE_VISIBILITY std::u16string u16string() const {
+ _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const {
return string<char16_t>();
}
- _LIBCPP_INLINE_VISIBILITY std::u32string u32string() const {
+ _LIBCPP_INLINE_VISIBILITY _VSTD::u32string u32string() const {
return string<char32_t>();
}
+#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
// generic format observers
+ _VSTD::string generic_string() const { return __pn_; }
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ _VSTD::u8string generic_u8string() const { return _VSTD::u8string(__pn_.begin(), __pn_.end()); }
+#else
+ _VSTD::string generic_u8string() const { return __pn_; }
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
template <class _ECharT, class _Traits = char_traits<_ECharT>,
class _Allocator = allocator<_ECharT> >
basic_string<_ECharT, _Traits, _Allocator>
return string<_ECharT, _Traits, _Allocator>(__a);
}
- std::string generic_string() const { return __pn_; }
- std::wstring generic_wstring() const { return string<wchar_t>(); }
- std::string generic_u8string() const { return __pn_; }
- std::u16string generic_u16string() const { return string<char16_t>(); }
- std::u32string generic_u32string() const { return string<char32_t>(); }
+ _VSTD::wstring generic_wstring() const { return string<wchar_t>(); }
+ _VSTD::u16string generic_u16string() const { return string<char16_t>(); }
+ _VSTD::u32string generic_u32string() const { return string<char32_t>(); }
+#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
+#endif /* !_LIBCPP_WIN32API */
private:
int __compare(__string_view) const;
return string_type(__root_directory());
}
_LIBCPP_INLINE_VISIBILITY path root_path() const {
+#if defined(_LIBCPP_WIN32API)
+ return string_type(__root_path_raw());
+#else
return root_name().append(string_type(__root_directory()));
+#endif
}
_LIBCPP_INLINE_VISIBILITY path relative_path() const {
return string_type(__relative_path());
}
_LIBCPP_INLINE_VISIBILITY bool is_absolute() const {
+#if defined(_LIBCPP_WIN32API)
+ __string_view __root_name_str = __root_name();
+ __string_view __root_dir = __root_directory();
+ if (__root_name_str.size() == 2 && __root_name_str[1] == ':') {
+ // A drive letter with no root directory is relative, e.g. x:example.
+ return !__root_dir.empty();
+ }
+ // If no root name, it's relative, e.g. \example is relative to the current drive
+ if (__root_name_str.empty())
+ return false;
+ if (__root_name_str.size() < 3)
+ return false;
+ // A server root name, like \\server, is always absolute
+ if (__root_name_str[0] != '/' && __root_name_str[0] != '\\')
+ return false;
+ if (__root_name_str[1] != '/' && __root_name_str[1] != '\\')
+ return false;
+ // Seems to be a server root name
+ return true;
+#else
return has_root_directory();
+#endif
}
_LIBCPP_INLINE_VISIBILITY bool is_relative() const { return !is_absolute(); }
iterator begin() const;
iterator end() const;
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
template <class _CharT, class _Traits>
_LIBCPP_INLINE_VISIBILITY friend
- typename enable_if<is_same<_CharT, char>::value &&
- is_same<_Traits, char_traits<char> >::value,
+ typename enable_if<is_same<_CharT, value_type>::value &&
+ is_same<_Traits, char_traits<value_type> >::value,
basic_ostream<_CharT, _Traits>&>::type
operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
- __os << std::__quoted(__p.native());
+ __os << _VSTD::__quoted(__p.native());
return __os;
}
template <class _CharT, class _Traits>
_LIBCPP_INLINE_VISIBILITY friend
- typename enable_if<!is_same<_CharT, char>::value ||
- !is_same<_Traits, char_traits<char> >::value,
+ typename enable_if<!is_same<_CharT, value_type>::value ||
+ !is_same<_Traits, char_traits<value_type> >::value,
basic_ostream<_CharT, _Traits>&>::type
operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
- __os << std::__quoted(__p.string<_CharT, _Traits>());
+ __os << _VSTD::__quoted(__p.string<_CharT, _Traits>());
return __os;
}
__p = __tmp;
return __is;
}
+#endif // !_LIBCPP_HAS_NO_LOCALIZATION
friend _LIBCPP_INLINE_VISIBILITY bool operator==(const path& __lhs, const path& __rhs) noexcept {
return __lhs.compare(__rhs) == 0;
_LIBCPP_FUNC_VIS
size_t hash_value(const path& __p) noexcept;
-template <class _Source>
-_LIBCPP_INLINE_VISIBILITY
- typename enable_if<__is_pathable<_Source>::value, path>::type
- u8path(const _Source& __s) {
+template <class _InputIt>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
+ typename enable_if<__is_pathable<_InputIt>::value, path>::type
+ u8path(_InputIt __f, _InputIt __l) {
static_assert(
- is_same<typename __is_pathable<_Source>::__char_type, char>::value,
- "u8path(Source const&) requires Source have a character type of type "
- "'char'");
- return path(__s);
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
+#endif
+ is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
+ "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
+ " or 'char8_t'");
+#if defined(_LIBCPP_WIN32API)
+ string __tmp(__f, __l);
+ using _CVT = __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
+ _VSTD::wstring __w;
+ __w.reserve(__tmp.size());
+ _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
+ return path(__w);
+#else
+ return path(__f, __l);
+#endif /* !_LIBCPP_WIN32API */
}
+#if defined(_LIBCPP_WIN32API)
template <class _InputIt>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
typename enable_if<__is_pathable<_InputIt>::value, path>::type
- u8path(_InputIt __f, _InputIt __l) {
+ u8path(_InputIt __f, _NullSentinel) {
static_assert(
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
+#endif
is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
- "u8path(Iter, Iter) requires Iter have a value_type of type 'char'");
- return path(__f, __l);
+ "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
+ " or 'char8_t'");
+ string __tmp;
+ const char __sentinel = char{};
+ for (; *__f != __sentinel; ++__f)
+ __tmp.push_back(*__f);
+ using _CVT = __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
+ _VSTD::wstring __w;
+ __w.reserve(__tmp.size());
+ _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
+ return path(__w);
+}
+#endif /* _LIBCPP_WIN32API */
+
+template <class _Source>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
+ typename enable_if<__is_pathable<_Source>::value, path>::type
+ u8path(const _Source& __s) {
+ static_assert(
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ is_same<typename __is_pathable<_Source>::__char_type, char8_t>::value ||
+#endif
+ is_same<typename __is_pathable<_Source>::__char_type, char>::value,
+ "u8path(Source const&) requires Source have a character type of type "
+ "'char' or 'char8_t'");
+#if defined(_LIBCPP_WIN32API)
+ using _Traits = __is_pathable<_Source>;
+ return u8path(_VSTD::__unwrap_iter(_Traits::__range_begin(__s)), _VSTD::__unwrap_iter(_Traits::__range_end(__s)));
+#else
+ return path(__s);
+#endif
}
class _LIBCPP_TYPE_VIS path::iterator {
typedef bidirectional_iterator_tag iterator_category;
typedef path value_type;
- typedef std::ptrdiff_t difference_type;
+ typedef ptrdiff_t difference_type;
typedef const path* pointer;
typedef const path& reference;
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_NO_EXCEPTIONS
void __throw_filesystem_error(_Args&&... __args) {
- throw filesystem_error(std::forward<_Args>(__args)...);
+ throw filesystem_error(_VSTD::forward<_Args>(__args)...);
}
#else
void __throw_filesystem_error(_Args&&...) {
_LIBCPP_INLINE_VISIBILITY
void __assign_iter_entry(_Path&& __p, __cached_data __dt) {
- __p_ = std::move(__p);
+ __p_ = _VSTD::move(__p);
__data_ = __dt;
}
class recursive_directory_iterator {
public:
using value_type = directory_entry;
- using difference_type = std::ptrdiff_t;
+ using difference_type = ptrdiff_t;
using pointer = directory_entry const*;
using reference = directory_entry const&;
- using iterator_category = std::input_iterator_tag;
+ using iterator_category = input_iterator_tag;
public:
// constructors and destructor
#endif // __cplusplus
-#endif // _LIBCPP_FLOAT_H
+#endif // _LIBCPP_FLOAT_H
--- /dev/null
+// -*- C++ -*-
+//===--------------------------- format -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_FORMAT
+#define _LIBCPP_FORMAT
+
+/*
+
+namespace std {
+ // [format.error], class format_error
+ class format_error : public runtime_error {
+ public:
+ explicit format_error(const string& what_arg);
+ explicit format_error(const char* what_arg);
+ };
+
+ // [format.parse.ctx], class template basic_format_parse_context
+ template<class charT>
+ class basic_format_parse_context {
+ public:
+ using char_type = charT;
+ using const_iterator = typename basic_string_view<charT>::const_iterator;
+ using iterator = const_iterator;
+
+ private:
+ iterator begin_; // exposition only
+ iterator end_; // exposition only
+ enum indexing { unknown, manual, automatic }; // exposition only
+ indexing indexing_; // exposition only
+ size_t next_arg_id_; // exposition only
+ size_t num_args_; // exposition only
+
+ public:
+ constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt,
+ size_t num_args = 0) noexcept;
+ basic_format_parse_context(const basic_format_parse_context&) = delete;
+ basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;
+
+ constexpr const_iterator begin() const noexcept;
+ constexpr const_iterator end() const noexcept;
+ constexpr void advance_to(const_iterator it);
+
+ constexpr size_t next_arg_id();
+ constexpr void check_arg_id(size_t id);
+ };
+ using format_parse_context = basic_format_parse_context<char>;
+ using wformat_parse_context = basic_format_parse_context<wchar_t>;
+}
+
+*/
+
+// Make sure all feature tests macros are always available.
+#include <version>
+// Only enable the contents of the header when libc++ was build with LIBCXX_ENABLE_INCOMPLETE_FEATURES enabled
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+
+#include <__config>
+#include <__format/format_error.h>
+#include <__format/format_parse_context.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17
+
+#endif //_LIBCPP_STD_VER > 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+
+#endif // _LIBCPP_FORMAT
*/
#include <__config>
+#include <__utility/forward.h>
+#include <algorithm>
#include <initializer_list>
-#include <memory>
-#include <limits>
#include <iterator>
-#include <algorithm>
+#include <limits>
+#include <memory>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
};
template <class _Tp, class _VoidPtr>
-struct __forward_list_node
+struct _LIBCPP_STANDALONE_DEBUG __forward_list_node
: public __begin_node_of<_Tp, _VoidPtr>::type
{
typedef _Tp value_type;
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
_LIBCPP_INLINE_VISIBILITY
__forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
private:
__forward_list_base(const __forward_list_base&);
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
#else
- _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
+ _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value);
#endif
protected:
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
__forward_list_base<_Tp, _Alloc>::~__forward_list_base()
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
#else
- _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
+ _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
#endif
{
- __swap_allocator(__alloc(), __x.__alloc(),
+ _VSTD::__swap_allocator(__alloc(), __x.__alloc(),
integral_constant<bool, __node_traits::propagate_on_container_swap::value>());
using _VSTD::swap;
swap(__before_begin()->__next_, __x.__before_begin()->__next_);
__is_cpp17_input_iterator<_InputIterator>::value
>::type* = nullptr);
forward_list(const forward_list& __x);
- forward_list(const forward_list& __x, const allocator_type& __a);
+ forward_list(const forward_list& __x, const __identity_t<allocator_type>& __a);
forward_list& operator=(const forward_list& __x);
forward_list(forward_list&& __x)
_NOEXCEPT_(is_nothrow_move_constructible<base>::value)
: base(_VSTD::move(__x)) {}
- forward_list(forward_list&& __x, const allocator_type& __a);
+ forward_list(forward_list&& __x, const __identity_t<allocator_type>& __a);
forward_list(initializer_list<value_type> __il);
forward_list(initializer_list<value_type> __il, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
void assign(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
// ~forward_list() = default;
{return base::__before_begin()->__next_ == nullptr;}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT {
- return std::min<size_type>(
+ return _VSTD::min<size_type>(
__node_traits::max_size(base::__alloc()),
numeric_limits<difference_type>::max());
}
template <class... _Args> void emplace_front(_Args&&... __args);
#endif
void push_front(value_type&& __v);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
void push_front(const value_type& __v);
void pop_front();
iterator insert_after(const_iterator __p, value_type&& __v);
iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
{return insert_after(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
iterator insert_after(const_iterator __p, const value_type& __v);
iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
void merge(forward_list&& __x, _Compare __comp)
{merge(__x, _VSTD::move(__comp));}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void merge(forward_list& __x) {merge(__x, __less<value_type>());}
template <class _Compare> void merge(forward_list& __x, _Compare __comp);
void __move_assign(forward_list& __x, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
void __move_assign(forward_list& __x, false_type);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Compare>
static
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _InputIterator,
- class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,
- class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
+ class _Alloc = allocator<__iter_value_type<_InputIterator>>,
+ class = _EnableIf<__is_allocator<_Alloc>::value>
>
forward_list(_InputIterator, _InputIterator)
- -> forward_list<typename iterator_traits<_InputIterator>::value_type, _Alloc>;
+ -> forward_list<__iter_value_type<_InputIterator>, _Alloc>;
template<class _InputIterator,
class _Alloc,
- class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
+ class = _EnableIf<__is_allocator<_Alloc>::value>
>
forward_list(_InputIterator, _InputIterator, _Alloc)
- -> forward_list<typename iterator_traits<_InputIterator>::value_type, _Alloc>;
+ -> forward_list<__iter_value_type<_InputIterator>, _Alloc>;
#endif
template <class _Tp, class _Alloc>
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(const forward_list& __x,
- const allocator_type& __a)
+ const __identity_t<allocator_type>& __a)
: base(__a)
{
insert_after(cbefore_begin(), __x.begin(), __x.end());
#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
- const allocator_type& __a)
+ const __identity_t<allocator_type>& __a)
: base(_VSTD::move(__x), __a)
{
if (base::__alloc() != __x.__alloc())
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
template <class _InputIterator>
base::__before_begin()->__next_ = __h.release();
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
void
return iterator(__r->__next_);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
typename forward_list<_Tp, _Alloc>::iterator
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, __last = __last->__next_)
{
__h.reset(__node_traits::allocate(__a, 1));
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
__r = static_cast<__begin_node_pointer>(__last);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_)))
{
__h.reset(__node_traits::allocate(__a, 1));
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
__r = static_cast<__begin_node_pointer>(__last);
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_FORWARD_LIST
+#endif // _LIBCPP_FORWARD_LIST
*/
+#include <__availability>
#include <__config>
-#include <ostream>
-#include <istream>
+#include <__debug>
#include <__locale>
#include <cstdio>
#include <cstdlib>
-#include <filesystem>
+#include <istream>
+#include <ostream>
+
+#if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
+# include <filesystem>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
+#if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION)
+# define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
// 27.9.1.2 Constructors/destructor:
basic_filebuf();
-#ifndef _LIBCPP_CXX03_LANG
basic_filebuf(basic_filebuf&& __rhs);
-#endif
virtual ~basic_filebuf();
// 27.9.1.3 Assign/swap:
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_filebuf& operator=(basic_filebuf&& __rhs);
-#endif
void swap(basic_filebuf& __rhs);
// 27.9.1.4 Members:
_LIBCPP_INLINE_VISIBILITY
basic_filebuf* open(const string& __s, ios_base::openmode __mode);
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
return open(__p.c_str(), __mode);
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>::basic_filebuf()
- : __extbuf_(0),
- __extbufnext_(0),
- __extbufend_(0),
+ : __extbuf_(nullptr),
+ __extbufnext_(nullptr),
+ __extbufend_(nullptr),
__ebs_(0),
- __intbuf_(0),
+ __intbuf_(nullptr),
__ibs_(0),
- __file_(0),
+ __file_(nullptr),
__cv_(nullptr),
__st_(),
__st_last_(),
__cv_ = &use_facet<codecvt<char_type, char, state_type> >(this->getloc());
__always_noconv_ = __cv_->always_noconv();
}
- setbuf(0, 4096);
+ setbuf(nullptr, 4096);
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
: basic_streambuf<_CharT, _Traits>(__rhs)
(char_type*)__extbuf_ + (__rhs.gptr() - __rhs.eback()),
(char_type*)__extbuf_ + (__rhs.egptr() - __rhs.eback()));
}
- __rhs.__extbuf_ = 0;
- __rhs.__extbufnext_ = 0;
- __rhs.__extbufend_ = 0;
+ __rhs.__extbuf_ = nullptr;
+ __rhs.__extbufnext_ = nullptr;
+ __rhs.__extbufend_ = nullptr;
__rhs.__ebs_ = 0;
__rhs.__intbuf_ = 0;
__rhs.__ibs_ = 0;
- __rhs.__file_ = 0;
+ __rhs.__file_ = nullptr;
__rhs.__st_ = state_type();
__rhs.__st_last_ = state_type();
__rhs.__om_ = 0;
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>::~basic_filebuf()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
close();
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (__owns_eb_)
delete [] __extbuf_;
if (__owns_ib_)
bool
basic_filebuf<_CharT, _Traits>::is_open() const
{
- return __file_ != 0;
+ return __file_ != nullptr;
}
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>*
basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
{
- basic_filebuf<_CharT, _Traits>* __rt = 0;
- if (__file_ == 0)
+ basic_filebuf<_CharT, _Traits>* __rt = nullptr;
+ if (__file_ == nullptr)
{
if (const char* __mdstr = __make_mdstring(__mode)) {
__rt = this;
if (__mode & ios_base::ate) {
if (fseek(__file_, 0, SEEK_END)) {
fclose(__file_);
- __file_ = 0;
- __rt = 0;
+ __file_ = nullptr;
+ __rt = nullptr;
}
}
} else
- __rt = 0;
+ __rt = nullptr;
}
}
return __rt;
}
template <class _CharT, class _Traits>
-_LIBCPP_INLINE_VISIBILITY basic_filebuf<_CharT, _Traits>*
+inline
+basic_filebuf<_CharT, _Traits>*
basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {
- basic_filebuf<_CharT, _Traits>* __rt = 0;
- if (__file_ == 0) {
+ basic_filebuf<_CharT, _Traits>* __rt = nullptr;
+ if (__file_ == nullptr) {
if (const char* __mdstr = __make_mdstring(__mode)) {
__rt = this;
__file_ = fdopen(__fd, __mdstr);
if (__mode & ios_base::ate) {
if (fseek(__file_, 0, SEEK_END)) {
fclose(__file_);
- __file_ = 0;
- __rt = 0;
+ __file_ = nullptr;
+ __rt = nullptr;
}
}
} else
- __rt = 0;
+ __rt = nullptr;
}
}
return __rt;
basic_filebuf<_CharT, _Traits>*
basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode)
{
- basic_filebuf<_CharT, _Traits>* __rt = 0;
- if (__file_ == 0)
+ basic_filebuf<_CharT, _Traits>* __rt = nullptr;
+ if (__file_ == nullptr)
{
__rt = this;
const wchar_t* __mdstr;
__mdstr = L"a+b";
break;
default:
- __rt = 0;
+ __rt = nullptr;
break;
}
if (__rt)
if (fseek(__file_, 0, SEEK_END))
{
fclose(__file_);
- __file_ = 0;
- __rt = 0;
+ __file_ = nullptr;
+ __rt = nullptr;
}
}
}
else
- __rt = 0;
+ __rt = nullptr;
}
}
return __rt;
basic_filebuf<_CharT, _Traits>*
basic_filebuf<_CharT, _Traits>::close()
{
- basic_filebuf<_CharT, _Traits>* __rt = 0;
+ basic_filebuf<_CharT, _Traits>* __rt = nullptr;
if (__file_)
{
__rt = this;
unique_ptr<FILE, int(*)(FILE*)> __h(__file_, fclose);
if (sync())
- __rt = 0;
+ __rt = nullptr;
if (fclose(__h.release()))
- __rt = 0;
- __file_ = 0;
+ __rt = nullptr;
+ __file_ = nullptr;
setbuf(0, 0);
}
return __rt;
typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::underflow()
{
- if (__file_ == 0)
+ if (__file_ == nullptr)
return traits_type::eof();
bool __initial = __read_mode();
char_type __1buf;
- if (this->gptr() == 0)
+ if (this->gptr() == nullptr)
this->setg(&__1buf, &__1buf+1, &__1buf+1);
const size_t __unget_sz = __initial ? 0 : min<size_t>((this->egptr() - this->eback()) / 2, 4);
int_type __c = traits_type::eof();
if (this->gptr() == this->egptr())
{
- memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
+ _VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
if (__always_noconv_)
{
size_t __nmemb = static_cast<size_t>(this->egptr() - this->eback() - __unget_sz);
{
_LIBCPP_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
if (__extbufend_ != __extbufnext_)
- memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
+ _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
size_t __nmemb = _VSTD::min(static_cast<size_t>(__ibs_ - __unget_sz),
else
__c = traits_type::to_int_type(*this->gptr());
if (this->eback() == &__1buf)
- this->setg(0, 0, 0);
+ this->setg(nullptr, nullptr, nullptr);
return __c;
}
typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
{
- if (__file_ == 0)
+ if (__file_ == nullptr)
return traits_type::eof();
__write_mode();
char_type __1buf;
char_type* __epb_save = this->epptr();
if (!traits_type::eq_int_type(__c, traits_type::eof()))
{
- if (this->pptr() == 0)
+ if (this->pptr() == nullptr)
this->setp(&__1buf, &__1buf+1);
*this->pptr() = traits_type::to_char_type(__c);
this->pbump(1);
basic_streambuf<_CharT, _Traits>*
basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n)
{
- this->setg(0, 0, 0);
- this->setp(0, 0);
+ this->setg(nullptr, nullptr, nullptr);
+ this->setp(nullptr, nullptr);
if (__owns_eb_)
delete [] __extbuf_;
if (__owns_ib_)
else
{
__ibs_ = 0;
- __intbuf_ = 0;
+ __intbuf_ = nullptr;
__owns_ib_ = false;
}
return this;
__throw_bad_cast();
int __width = __cv_->encoding();
- if (__file_ == 0 || (__width <= 0 && __off != 0) || sync())
+ if (__file_ == nullptr || (__width <= 0 && __off != 0) || sync())
return pos_type(off_type(-1));
// __width > 0 || __off == 0
int __whence;
typename basic_filebuf<_CharT, _Traits>::pos_type
basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
{
- if (__file_ == 0 || sync())
+ if (__file_ == nullptr || sync())
return pos_type(off_type(-1));
#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, __sp, SEEK_SET))
int
basic_filebuf<_CharT, _Traits>::sync()
{
- if (__file_ == 0)
+ if (__file_ == nullptr)
return 0;
if (!__cv_)
__throw_bad_cast();
if (__update_st)
__st_ = __state;
__extbufnext_ = __extbufend_ = __extbuf_;
- this->setg(0, 0, 0);
+ this->setg(nullptr, nullptr, nullptr);
__cm_ = 0;
}
return 0;
__always_noconv_ = __cv_->always_noconv();
if (__old_anc != __always_noconv_)
{
- this->setg(0, 0, 0);
- this->setp(0, 0);
+ this->setg(nullptr, nullptr, nullptr);
+ this->setp(nullptr, nullptr);
// invariant, char_type is char, else we couldn't get here
if (__always_noconv_) // need to dump __intbuf_
{
__ebs_ = __ibs_;
__extbuf_ = (char*)__intbuf_;
__ibs_ = 0;
- __intbuf_ = 0;
+ __intbuf_ = nullptr;
__owns_ib_ = false;
}
else // need to obtain an __intbuf_.
{
if (!(__cm_ & ios_base::in))
{
- this->setp(0, 0);
+ this->setp(nullptr, nullptr);
if (__always_noconv_)
this->setg((char_type*)__extbuf_,
(char_type*)__extbuf_ + __ebs_,
{
if (!(__cm_ & ios_base::out))
{
- this->setg(0, 0, 0);
+ this->setg(nullptr, nullptr, nullptr);
if (__ebs_ > sizeof(__extbuf_min_))
{
if (__always_noconv_)
this->setp(__intbuf_, __intbuf_ + (__ibs_ - 1));
}
else
- this->setp(0, 0);
+ this->setp(nullptr, nullptr);
__cm_ = ios_base::out;
}
}
#endif
_LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
: basic_ifstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
#endif
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_ifstream(basic_ifstream&& __rhs);
-
_LIBCPP_INLINE_VISIBILITY
basic_ifstream& operator=(basic_ifstream&& __rhs);
-#endif
_LIBCPP_INLINE_VISIBILITY
void swap(basic_ifstream& __rhs);
void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::in);
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p,
ios_base::openmode __mode = ios_base::in) {
basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openmode __mode)
: basic_istream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode | ios_base::in) == 0)
+ if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
this->setstate(ios_base::failbit);
}
basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t* __s, ios_base::openmode __mode)
: basic_istream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode | ios_base::in) == 0)
+ if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
this->setstate(ios_base::failbit);
}
#endif
basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::openmode __mode)
: basic_istream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode | ios_base::in) == 0)
+ if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
this->setstate(ios_base::failbit);
}
#endif
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
inline
basic_ifstream<_CharT, _Traits>::basic_ifstream(basic_ifstream&& __rhs)
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
inline
void
}
template <class _CharT, class _Traits>
+inline
void basic_ifstream<_CharT, _Traits>::__open(int __fd,
ios_base::openmode __mode) {
if (__sb_.__open(__fd, __mode | ios_base::in))
_LIBCPP_INLINE_VISIBILITY
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
: basic_ofstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_ofstream(basic_ofstream&& __rhs);
-
_LIBCPP_INLINE_VISIBILITY
basic_ofstream& operator=(basic_ofstream&& __rhs);
-#endif
_LIBCPP_INLINE_VISIBILITY
void swap(basic_ofstream& __rhs);
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::out);
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
{ return open(__p.c_str(), __mode); }
basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openmode __mode)
: basic_ostream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode | ios_base::out) == 0)
+ if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
this->setstate(ios_base::failbit);
}
basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t* __s, ios_base::openmode __mode)
: basic_ostream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode | ios_base::out) == 0)
+ if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
this->setstate(ios_base::failbit);
}
#endif
basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::openmode __mode)
: basic_ostream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode | ios_base::out) == 0)
+ if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
this->setstate(ios_base::failbit);
}
#endif
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
inline
basic_ofstream<_CharT, _Traits>::basic_ofstream(basic_ofstream&& __rhs)
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
inline
void
}
template <class _CharT, class _Traits>
+inline
void basic_ofstream<_CharT, _Traits>::__open(int __fd,
ios_base::openmode __mode) {
if (__sb_.__open(__fd, __mode | ios_base::out))
void
basic_ofstream<_CharT, _Traits>::close()
{
- if (__sb_.close() == 0)
+ if (__sb_.close() == nullptr)
this->setstate(ios_base::failbit);
}
_LIBCPP_INLINE_VISIBILITY
explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
: basic_fstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
#endif
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_fstream(basic_fstream&& __rhs);
_LIBCPP_INLINE_VISIBILITY
basic_fstream& operator=(basic_fstream&& __rhs);
-#endif
+
_LIBCPP_INLINE_VISIBILITY
void swap(basic_fstream& __rhs);
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
{ return open(__p.c_str(), __mode); }
basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmode __mode)
: basic_iostream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode) == 0)
+ if (__sb_.open(__s, __mode) == nullptr)
this->setstate(ios_base::failbit);
}
basic_fstream<_CharT, _Traits>::basic_fstream(const wchar_t* __s, ios_base::openmode __mode)
: basic_iostream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode) == 0)
+ if (__sb_.open(__s, __mode) == nullptr)
this->setstate(ios_base::failbit);
}
#endif
basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openmode __mode)
: basic_iostream<char_type, traits_type>(&__sb_)
{
- if (__sb_.open(__s, __mode) == 0)
+ if (__sb_.open(__s, __mode) == nullptr)
this->setstate(ios_base::failbit);
}
#endif
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
inline
basic_fstream<_CharT, _Traits>::basic_fstream(basic_fstream&& __rhs)
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
inline
void
void
basic_fstream<_CharT, _Traits>::close()
{
- if (__sb_.close() == 0)
+ if (__sb_.close() == nullptr)
this->setstate(ios_base::failbit);
}
+#if defined(_LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ifstream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ofstream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>)
+#endif
+
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_FSTREAM
+#endif // _LIBCPP_FSTREAM
// -*- C++ -*-
-//===------------------------ functional ----------------------------------===//
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
typedef see below result_type; // Not always defined
// construct/copy/destroy
- reference_wrapper(T&) noexcept;
- reference_wrapper(T&&) = delete; // do not bind to temps
+ template<class U>
+ reference_wrapper(U&&);
reference_wrapper(const reference_wrapper<T>& x) noexcept;
// assignment
operator() (ArgTypes&&...) const;
};
+template <class T>
+ reference_wrapper(T&) -> reference_wrapper<T>;
+
template <class T> reference_wrapper<T> ref(T& t) noexcept;
template <class T> void ref(const T&& t) = delete;
template <class T> reference_wrapper<T> ref(reference_wrapper<T>t) noexcept;
template <class T> using unwrap_ref_decay_t = typename unwrap_ref_decay<T>::type; // since C++20
template <class T> // <class T=void> in C++14
-struct plus : binary_function<T, T, T>
-{
+struct plus {
T operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct minus : binary_function<T, T, T>
-{
+struct minus {
T operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct multiplies : binary_function<T, T, T>
-{
+struct multiplies {
T operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct divides : binary_function<T, T, T>
-{
+struct divides {
T operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct modulus : binary_function<T, T, T>
-{
+struct modulus {
T operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct negate : unary_function<T, T>
-{
+struct negate {
T operator()(const T& x) const;
};
template <class T> // <class T=void> in C++14
-struct equal_to : binary_function<T, T, bool>
-{
+struct equal_to {
bool operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct not_equal_to : binary_function<T, T, bool>
-{
+struct not_equal_to {
bool operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct greater : binary_function<T, T, bool>
-{
+struct greater {
bool operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct less : binary_function<T, T, bool>
-{
+struct less {
bool operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct greater_equal : binary_function<T, T, bool>
-{
+struct greater_equal {
bool operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct less_equal : binary_function<T, T, bool>
-{
+struct less_equal {
bool operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct logical_and : binary_function<T, T, bool>
-{
+struct logical_and {
bool operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct logical_or : binary_function<T, T, bool>
-{
+struct logical_or {
bool operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct logical_not : unary_function<T, bool>
-{
+struct logical_not {
bool operator()(const T& x) const;
};
template <class T> // <class T=void> in C++14
-struct bit_and : unary_function<T, bool>
-{
- bool operator()(const T& x, const T& y) const;
+struct bit_and {
+ T operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct bit_or : unary_function<T, bool>
-{
- bool operator()(const T& x, const T& y) const;
+struct bit_or {
+ T operator()(const T& x, const T& y) const;
};
template <class T> // <class T=void> in C++14
-struct bit_xor : unary_function<T, bool>
-{
- bool operator()(const T& x, const T& y) const;
+struct bit_xor {
+ T operator()(const T& x, const T& y) const;
};
template <class T=void> // C++14
-struct bit_xor : unary_function<T, bool>
-{
- bool operator()(const T& x) const;
+struct bit_not {
+ T operator()(const T& x) const;
};
+struct identity; // C++20
+
template <class Predicate>
-class unary_negate // deprecated in C++17
+class unary_negate // deprecated in C++17, removed in C++20
: public unary_function<typename Predicate::argument_type, bool>
{
public:
bool operator()(const typename Predicate::argument_type& x) const;
};
-template <class Predicate> // deprecated in C++17
+template <class Predicate> // deprecated in C++17, removed in C++20
unary_negate<Predicate> not1(const Predicate& pred);
template <class Predicate>
-class binary_negate // deprecated in C++17
+class binary_negate // deprecated in C++17, removed in C++20
: public binary_function<typename Predicate::first_argument_type,
typename Predicate::second_argument_type,
bool>
const typename Predicate::second_argument_type& y) const;
};
-template <class Predicate> // deprecated in C++17
+template <class Predicate> // deprecated in C++17, removed in C++20
binary_negate<Predicate> not2(const Predicate& pred);
-template <class F> unspecified not_fn(F&& f); // C++17
+template <class F>
+constexpr unspecified not_fn(F&& f); // C++17, constexpr in C++20
template<class T> struct is_bind_expression;
template<class T> struct is_placeholder;
template<class Fn, class... BoundArgs>
- unspecified bind(Fn&&, BoundArgs&&...);
+ constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
template<class R, class Fn, class... BoundArgs>
- unspecified bind(Fn&&, BoundArgs&&...);
+ constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
template<class F, class... Args>
+ constexpr // constexpr in C++20
invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17
noexcept(is_nothrow_invocable_v<F, Args...>);
template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17
template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
-template<class R, class T> unspecified mem_fn(R T::*);
+template<class R, class T>
+constexpr unspecified mem_fn(R T::*); // constexpr in C++20
class bad_function_call
: public exception
template <> struct hash<char>;
template <> struct hash<signed char>;
template <> struct hash<unsigned char>;
+template <> struct hash<char8_t>; // since C++20
template <> struct hash<char16_t>;
template <> struct hash<char32_t>;
template <> struct hash<wchar_t>;
*/
+#include <__algorithm/search.h>
#include <__config>
-#include <type_traits>
-#include <typeinfo>
+#include <__debug>
+#include <__functional/binary_function.h> // TODO: deprecate
+#include <__functional/binary_negate.h>
+#include <__functional/bind_front.h>
+#include <__functional/bind.h>
+#include <__functional/binder1st.h>
+#include <__functional/binder2nd.h>
+#include <__functional/default_searcher.h>
+#include <__functional/function.h>
+#include <__functional/hash.h>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__functional/mem_fn.h> // TODO: deprecate
+#include <__functional/mem_fun_ref.h>
+#include <__functional/not_fn.h>
+#include <__functional/operations.h>
+#include <__functional/pointer_to_binary_function.h>
+#include <__functional/pointer_to_unary_function.h>
+#include <__functional/ranges_operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/unary_function.h> // TODO: deprecate
+#include <__functional/unary_negate.h>
+#include <__functional/unwrap_ref.h>
+#include <__utility/forward.h>
+#include <concepts>
#include <exception>
#include <memory>
#include <tuple>
+#include <type_traits>
+#include <typeinfo>
#include <utility>
#include <version>
-#include <__functional_base>
-
-#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
-#include <Block.h>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS plus : binary_function<_Tp, _Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x, const _Tp& __y) const
- {return __x + __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS plus<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS minus : binary_function<_Tp, _Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x, const _Tp& __y) const
- {return __x - __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS minus<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS multiplies : binary_function<_Tp, _Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x, const _Tp& __y) const
- {return __x * __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS multiplies<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS divides : binary_function<_Tp, _Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x, const _Tp& __y) const
- {return __x / __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS divides<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS modulus : binary_function<_Tp, _Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x, const _Tp& __y) const
- {return __x % __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS modulus<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS negate : unary_function<_Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x) const
- {return -__x;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS negate<void>
-{
- template <class _Tp>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_Tp&& __x) const
- _NOEXCEPT_(noexcept(- _VSTD::forward<_Tp>(__x)))
- -> decltype (- _VSTD::forward<_Tp>(__x))
- { return - _VSTD::forward<_Tp>(__x); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS equal_to : binary_function<_Tp, _Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x, const _Tp& __y) const
- {return __x == __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS equal_to<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS not_equal_to : binary_function<_Tp, _Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x, const _Tp& __y) const
- {return __x != __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS not_equal_to<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x, const _Tp& __y) const
- {return __x > __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS greater<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-// less in <__functional_base>
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x, const _Tp& __y) const
- {return __x >= __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS greater_equal<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS less_equal : binary_function<_Tp, _Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x, const _Tp& __y) const
- {return __x <= __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS less_equal<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS logical_and : binary_function<_Tp, _Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x, const _Tp& __y) const
- {return __x && __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS logical_and<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS logical_or : binary_function<_Tp, _Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x, const _Tp& __y) const
- {return __x || __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS logical_or<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS logical_not : unary_function<_Tp, bool>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Tp& __x) const
- {return !__x;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS logical_not<void>
-{
- template <class _Tp>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_Tp&& __x) const
- _NOEXCEPT_(noexcept(!_VSTD::forward<_Tp>(__x)))
- -> decltype (!_VSTD::forward<_Tp>(__x))
- { return !_VSTD::forward<_Tp>(__x); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS bit_and : binary_function<_Tp, _Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x, const _Tp& __y) const
- {return __x & __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS bit_and<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS bit_or : binary_function<_Tp, _Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x, const _Tp& __y) const
- {return __x | __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS bit_or<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-#else
-template <class _Tp>
-#endif
-struct _LIBCPP_TEMPLATE_VIS bit_xor : binary_function<_Tp, _Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x, const _Tp& __y) const
- {return __x ^ __y;}
-};
-
-#if _LIBCPP_STD_VER > 11
-template <>
-struct _LIBCPP_TEMPLATE_VIS bit_xor<void>
-{
- template <class _T1, class _T2>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_T1&& __t, _T2&& __u) const
- _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u)))
- -> decltype (_VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u))
- { return _VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u); }
- typedef void is_transparent;
-};
-#endif
-
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp = void>
-struct _LIBCPP_TEMPLATE_VIS bit_not : unary_function<_Tp, _Tp>
-{
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- _Tp operator()(const _Tp& __x) const
- {return ~__x;}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS bit_not<void>
-{
- template <class _Tp>
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- auto operator()(_Tp&& __x) const
- _NOEXCEPT_(noexcept(~_VSTD::forward<_Tp>(__x)))
- -> decltype (~_VSTD::forward<_Tp>(__x))
- { return ~_VSTD::forward<_Tp>(__x); }
- typedef void is_transparent;
-};
-#endif
-
-template <class _Predicate>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 unary_negate
- : public unary_function<typename _Predicate::argument_type, bool>
-{
- _Predicate __pred_;
-public:
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- explicit unary_negate(const _Predicate& __pred)
- : __pred_(__pred) {}
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const typename _Predicate::argument_type& __x) const
- {return !__pred_(__x);}
-};
-
-template <class _Predicate>
-_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-unary_negate<_Predicate>
-not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);}
-
-template <class _Predicate>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 binary_negate
- : public binary_function<typename _Predicate::first_argument_type,
- typename _Predicate::second_argument_type,
- bool>
-{
- _Predicate __pred_;
-public:
- _LIBCPP_INLINE_VISIBILITY explicit _LIBCPP_CONSTEXPR_AFTER_CXX11
- binary_negate(const _Predicate& __pred) : __pred_(__pred) {}
-
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- bool operator()(const typename _Predicate::first_argument_type& __x,
- const typename _Predicate::second_argument_type& __y) const
- {return !__pred_(__x, __y);}
-};
-
-template <class _Predicate>
-_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-binary_negate<_Predicate>
-not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
-template <class __Operation>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder1st
- : public unary_function<typename __Operation::second_argument_type,
- typename __Operation::result_type>
-{
-protected:
- __Operation op;
- typename __Operation::first_argument_type value;
-public:
- _LIBCPP_INLINE_VISIBILITY binder1st(const __Operation& __x,
- const typename __Operation::first_argument_type __y)
- : op(__x), value(__y) {}
- _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
- (typename __Operation::second_argument_type& __x) const
- {return op(value, __x);}
- _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
- (const typename __Operation::second_argument_type& __x) const
- {return op(value, __x);}
-};
-
-template <class __Operation, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-binder1st<__Operation>
-bind1st(const __Operation& __op, const _Tp& __x)
- {return binder1st<__Operation>(__op, __x);}
-
-template <class __Operation>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder2nd
- : public unary_function<typename __Operation::first_argument_type,
- typename __Operation::result_type>
-{
-protected:
- __Operation op;
- typename __Operation::second_argument_type value;
-public:
- _LIBCPP_INLINE_VISIBILITY
- binder2nd(const __Operation& __x, const typename __Operation::second_argument_type __y)
- : op(__x), value(__y) {}
- _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
- ( typename __Operation::first_argument_type& __x) const
- {return op(__x, value);}
- _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
- (const typename __Operation::first_argument_type& __x) const
- {return op(__x, value);}
-};
-
-template <class __Operation, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-binder2nd<__Operation>
-bind2nd(const __Operation& __op, const _Tp& __x)
- {return binder2nd<__Operation>(__op, __x);}
-
-template <class _Arg, class _Result>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function
- : public unary_function<_Arg, _Result>
-{
- _Result (*__f_)(_Arg);
-public:
- _LIBCPP_INLINE_VISIBILITY explicit pointer_to_unary_function(_Result (*__f)(_Arg))
- : __f_(__f) {}
- _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg __x) const
- {return __f_(__x);}
-};
-
-template <class _Arg, class _Result>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-pointer_to_unary_function<_Arg,_Result>
-ptr_fun(_Result (*__f)(_Arg))
- {return pointer_to_unary_function<_Arg,_Result>(__f);}
-
-template <class _Arg1, class _Arg2, class _Result>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function
- : public binary_function<_Arg1, _Arg2, _Result>
-{
- _Result (*__f_)(_Arg1, _Arg2);
-public:
- _LIBCPP_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2))
- : __f_(__f) {}
- _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg1 __x, _Arg2 __y) const
- {return __f_(__x, __y);}
-};
-
-template <class _Arg1, class _Arg2, class _Result>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-pointer_to_binary_function<_Arg1,_Arg2,_Result>
-ptr_fun(_Result (*__f)(_Arg1,_Arg2))
- {return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
-
-template<class _Sp, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_t
- : public unary_function<_Tp*, _Sp>
-{
- _Sp (_Tp::*__p_)();
-public:
- _LIBCPP_INLINE_VISIBILITY explicit mem_fun_t(_Sp (_Tp::*__p)())
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p) const
- {return (__p->*__p_)();}
-};
-
-template<class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_t
- : public binary_function<_Tp*, _Ap, _Sp>
-{
- _Sp (_Tp::*__p_)(_Ap);
-public:
- _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_t(_Sp (_Tp::*__p)(_Ap))
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p, _Ap __x) const
- {return (__p->*__p_)(__x);}
-};
-
-template<class _Sp, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-mem_fun_t<_Sp,_Tp>
-mem_fun(_Sp (_Tp::*__f)())
- {return mem_fun_t<_Sp,_Tp>(__f);}
-
-template<class _Sp, class _Tp, class _Ap>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-mem_fun1_t<_Sp,_Tp,_Ap>
-mem_fun(_Sp (_Tp::*__f)(_Ap))
- {return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
-
-template<class _Sp, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_ref_t
- : public unary_function<_Tp, _Sp>
-{
- _Sp (_Tp::*__p_)();
-public:
- _LIBCPP_INLINE_VISIBILITY explicit mem_fun_ref_t(_Sp (_Tp::*__p)())
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p) const
- {return (__p.*__p_)();}
-};
-
-template<class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_ref_t
- : public binary_function<_Tp, _Ap, _Sp>
-{
- _Sp (_Tp::*__p_)(_Ap);
-public:
- _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap))
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p, _Ap __x) const
- {return (__p.*__p_)(__x);}
-};
-
-template<class _Sp, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-mem_fun_ref_t<_Sp,_Tp>
-mem_fun_ref(_Sp (_Tp::*__f)())
- {return mem_fun_ref_t<_Sp,_Tp>(__f);}
-
-template<class _Sp, class _Tp, class _Ap>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-mem_fun1_ref_t<_Sp,_Tp,_Ap>
-mem_fun_ref(_Sp (_Tp::*__f)(_Ap))
- {return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
-
-template <class _Sp, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_t
- : public unary_function<const _Tp*, _Sp>
-{
- _Sp (_Tp::*__p_)() const;
-public:
- _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_t(_Sp (_Tp::*__p)() const)
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p) const
- {return (__p->*__p_)();}
-};
-
-template <class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_t
- : public binary_function<const _Tp*, _Ap, _Sp>
-{
- _Sp (_Tp::*__p_)(_Ap) const;
-public:
- _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_t(_Sp (_Tp::*__p)(_Ap) const)
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p, _Ap __x) const
- {return (__p->*__p_)(__x);}
-};
-
-template <class _Sp, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-const_mem_fun_t<_Sp,_Tp>
-mem_fun(_Sp (_Tp::*__f)() const)
- {return const_mem_fun_t<_Sp,_Tp>(__f);}
-
-template <class _Sp, class _Tp, class _Ap>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-const_mem_fun1_t<_Sp,_Tp,_Ap>
-mem_fun(_Sp (_Tp::*__f)(_Ap) const)
- {return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
-
-template <class _Sp, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_ref_t
- : public unary_function<_Tp, _Sp>
-{
- _Sp (_Tp::*__p_)() const;
-public:
- _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_ref_t(_Sp (_Tp::*__p)() const)
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p) const
- {return (__p.*__p_)();}
-};
-
-template <class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_ref_t
- : public binary_function<_Tp, _Ap, _Sp>
-{
- _Sp (_Tp::*__p_)(_Ap) const;
-public:
- _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap) const)
- : __p_(__p) {}
- _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p, _Ap __x) const
- {return (__p.*__p_)(__x);}
-};
-
-template <class _Sp, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-const_mem_fun_ref_t<_Sp,_Tp>
-mem_fun_ref(_Sp (_Tp::*__f)() const)
- {return const_mem_fun_ref_t<_Sp,_Tp>(__f);}
-
-template <class _Sp, class _Tp, class _Ap>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
-const_mem_fun1_ref_t<_Sp,_Tp,_Ap>
-mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const)
- {return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// MEMFUN
-//==============================================================================
-
-template <class _Tp>
-class __mem_fn
- : public __weak_result_type<_Tp>
-{
-public:
- // types
- typedef _Tp type;
-private:
- type __f_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}
-
-#ifndef _LIBCPP_CXX03_LANG
- // invoke
- template <class... _ArgTypes>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return<type, _ArgTypes...>::type
- operator() (_ArgTypes&&... __args) const {
- return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
- }
-#else
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return0<type, _A0>::type
- operator() (_A0& __a0) const {
- return __invoke(__f_, __a0);
- }
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return0<type, _A0 const>::type
- operator() (_A0 const& __a0) const {
- return __invoke(__f_, __a0);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type, _A0, _A1>::type
- operator() (_A0& __a0, _A1& __a1) const {
- return __invoke(__f_, __a0, __a1);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type, _A0 const, _A1>::type
- operator() (_A0 const& __a0, _A1& __a1) const {
- return __invoke(__f_, __a0, __a1);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type, _A0, _A1 const>::type
- operator() (_A0& __a0, _A1 const& __a1) const {
- return __invoke(__f_, __a0, __a1);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type, _A0 const, _A1 const>::type
- operator() (_A0 const& __a0, _A1 const& __a1) const {
- return __invoke(__f_, __a0, __a1);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0, _A1, _A2>::type
- operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0 const, _A1, _A2>::type
- operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0, _A1 const, _A2>::type
- operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0, _A1, _A2 const>::type
- operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
- operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
- operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
- operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
- operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-#endif
-};
-
-template<class _Rp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp _Tp::*>
-mem_fn(_Rp _Tp::* __pm) _NOEXCEPT
-{
- return __mem_fn<_Rp _Tp::*>(__pm);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// FUNCTION
-//==============================================================================
-
-// bad_function_call
-
-class _LIBCPP_EXCEPTION_ABI bad_function_call
- : public exception
-{
-#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
-public:
- virtual ~bad_function_call() _NOEXCEPT;
-
- virtual const char* what() const _NOEXCEPT;
-#endif
-};
-
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-void __throw_bad_function_call()
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_function_call();
-#else
- _VSTD::abort();
-#endif
-}
-
-#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) && __has_attribute(deprecated)
-# define _LIBCPP_DEPRECATED_CXX03_FUNCTION \
- __attribute__((deprecated("Using std::function in C++03 is not supported anymore. Please upgrade to C++11 or later, or use a different type")))
-#else
-# define _LIBCPP_DEPRECATED_CXX03_FUNCTION /* nothing */
-#endif
-
-template<class _Fp> class _LIBCPP_DEPRECATED_CXX03_FUNCTION _LIBCPP_TEMPLATE_VIS function; // undefined
-
-namespace __function
-{
-
-template<class _Rp>
-struct __maybe_derive_from_unary_function
-{
-};
-
-template<class _Rp, class _A1>
-struct __maybe_derive_from_unary_function<_Rp(_A1)>
- : public unary_function<_A1, _Rp>
-{
-};
-
-template<class _Rp>
-struct __maybe_derive_from_binary_function
-{
-};
-
-template<class _Rp, class _A1, class _A2>
-struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)>
- : public binary_function<_A1, _A2, _Rp>
-{
-};
-
-template <class _Fp>
-_LIBCPP_INLINE_VISIBILITY
-bool __not_null(_Fp const&) { return true; }
-
-template <class _Fp>
-_LIBCPP_INLINE_VISIBILITY
-bool __not_null(_Fp* __ptr) { return __ptr; }
-
-template <class _Ret, class _Class>
-_LIBCPP_INLINE_VISIBILITY
-bool __not_null(_Ret _Class::*__ptr) { return __ptr; }
-
-template <class _Fp>
-_LIBCPP_INLINE_VISIBILITY
-bool __not_null(function<_Fp> const& __f) { return !!__f; }
-
-#ifdef _LIBCPP_HAS_EXTENSION_BLOCKS
-template <class _Rp, class ..._Args>
-_LIBCPP_INLINE_VISIBILITY
-bool __not_null(_Rp (^__p)(_Args...)) { return __p; }
-#endif
-
-} // namespace __function
-
-#ifndef _LIBCPP_CXX03_LANG
-
-namespace __function {
-
-// __alloc_func holds a functor and an allocator.
-
-template <class _Fp, class _Ap, class _FB> class __alloc_func;
-template <class _Fp, class _FB>
-class __default_alloc_func;
-
-template <class _Fp, class _Ap, class _Rp, class... _ArgTypes>
-class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)>
-{
- __compressed_pair<_Fp, _Ap> __f_;
-
- public:
- typedef _LIBCPP_NODEBUG_TYPE _Fp _Target;
- typedef _LIBCPP_NODEBUG_TYPE _Ap _Alloc;
-
- _LIBCPP_INLINE_VISIBILITY
- const _Target& __target() const { return __f_.first(); }
-
- // WIN32 APIs may define __allocator, so use __get_allocator instead.
- _LIBCPP_INLINE_VISIBILITY
- const _Alloc& __get_allocator() const { return __f_.second(); }
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __alloc_func(_Target&& __f)
- : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
- _VSTD::forward_as_tuple())
- {
- }
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __alloc_func(const _Target& __f, const _Alloc& __a)
- : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
- _VSTD::forward_as_tuple(__a))
- {
- }
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __alloc_func(const _Target& __f, _Alloc&& __a)
- : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
- _VSTD::forward_as_tuple(_VSTD::move(__a)))
- {
- }
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __alloc_func(_Target&& __f, _Alloc&& __a)
- : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
- _VSTD::forward_as_tuple(_VSTD::move(__a)))
- {
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Rp operator()(_ArgTypes&&... __arg)
- {
- typedef __invoke_void_return_wrapper<_Rp> _Invoker;
- return _Invoker::__call(__f_.first(),
- _VSTD::forward<_ArgTypes>(__arg)...);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __alloc_func* __clone() const
- {
- typedef allocator_traits<_Alloc> __alloc_traits;
- typedef
- typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type
- _AA;
- _AA __a(__f_.second());
- typedef __allocator_destructor<_AA> _Dp;
- unique_ptr<__alloc_func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
- ::new ((void*)__hold.get()) __alloc_func(__f_.first(), _Alloc(__a));
- return __hold.release();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void destroy() _NOEXCEPT { __f_.~__compressed_pair<_Target, _Alloc>(); }
-
- static void __destroy_and_delete(__alloc_func* __f) {
- typedef allocator_traits<_Alloc> __alloc_traits;
- typedef typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type
- _FunAlloc;
- _FunAlloc __a(__f->__get_allocator());
- __f->destroy();
- __a.deallocate(__f, 1);
- }
-};
-
-template <class _Fp, class _Rp, class... _ArgTypes>
-class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> {
- _Fp __f_;
-
-public:
- typedef _LIBCPP_NODEBUG_TYPE _Fp _Target;
-
- _LIBCPP_INLINE_VISIBILITY
- const _Target& __target() const { return __f_; }
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __default_alloc_func(_Target&& __f) : __f_(std::move(__f)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __default_alloc_func(const _Target& __f) : __f_(__f) {}
-
- _LIBCPP_INLINE_VISIBILITY
- _Rp operator()(_ArgTypes&&... __arg) {
- typedef __invoke_void_return_wrapper<_Rp> _Invoker;
- return _Invoker::__call(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __default_alloc_func* __clone() const {
- __builtin_new_allocator::__holder_t __hold =
- __builtin_new_allocator::__allocate_type<__default_alloc_func>(1);
- __default_alloc_func* __res =
- ::new (__hold.get()) __default_alloc_func(__f_);
- (void)__hold.release();
- return __res;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void destroy() _NOEXCEPT { __f_.~_Target(); }
-
- static void __destroy_and_delete(__default_alloc_func* __f) {
- __f->destroy();
- __builtin_new_allocator::__deallocate_type<__default_alloc_func>(__f, 1);
- }
-};
-
-// __base provides an abstract interface for copyable functors.
-
-template<class _Fp> class _LIBCPP_TEMPLATE_VIS __base;
-
-template<class _Rp, class ..._ArgTypes>
-class __base<_Rp(_ArgTypes...)>
-{
- __base(const __base&);
- __base& operator=(const __base&);
-public:
- _LIBCPP_INLINE_VISIBILITY __base() {}
- _LIBCPP_INLINE_VISIBILITY virtual ~__base() {}
- virtual __base* __clone() const = 0;
- virtual void __clone(__base*) const = 0;
- virtual void destroy() _NOEXCEPT = 0;
- virtual void destroy_deallocate() _NOEXCEPT = 0;
- virtual _Rp operator()(_ArgTypes&& ...) = 0;
-#ifndef _LIBCPP_NO_RTTI
- virtual const void* target(const type_info&) const _NOEXCEPT = 0;
- virtual const std::type_info& target_type() const _NOEXCEPT = 0;
-#endif // _LIBCPP_NO_RTTI
-};
-
-// __func implements __base for a given functor type.
-
-template<class _FD, class _Alloc, class _FB> class __func;
-
-template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-class __func<_Fp, _Alloc, _Rp(_ArgTypes...)>
- : public __base<_Rp(_ArgTypes...)>
-{
- __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> __f_;
-public:
- _LIBCPP_INLINE_VISIBILITY
- explicit __func(_Fp&& __f)
- : __f_(_VSTD::move(__f)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __func(const _Fp& __f, const _Alloc& __a)
- : __f_(__f, __a) {}
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __func(const _Fp& __f, _Alloc&& __a)
- : __f_(__f, _VSTD::move(__a)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __func(_Fp&& __f, _Alloc&& __a)
- : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
-
- virtual __base<_Rp(_ArgTypes...)>* __clone() const;
- virtual void __clone(__base<_Rp(_ArgTypes...)>*) const;
- virtual void destroy() _NOEXCEPT;
- virtual void destroy_deallocate() _NOEXCEPT;
- virtual _Rp operator()(_ArgTypes&&... __arg);
-#ifndef _LIBCPP_NO_RTTI
- virtual const void* target(const type_info&) const _NOEXCEPT;
- virtual const std::type_info& target_type() const _NOEXCEPT;
-#endif // _LIBCPP_NO_RTTI
-};
-
-template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-__base<_Rp(_ArgTypes...)>*
-__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone() const
-{
- typedef allocator_traits<_Alloc> __alloc_traits;
- typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
- _Ap __a(__f_.__get_allocator());
- typedef __allocator_destructor<_Ap> _Dp;
- unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
- ::new ((void*)__hold.get()) __func(__f_.__target(), _Alloc(__a));
- return __hold.release();
-}
-
-template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-void
-__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const
-{
- ::new (__p) __func(__f_.__target(), __f_.__get_allocator());
-}
-
-template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-void
-__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy() _NOEXCEPT
-{
- __f_.destroy();
-}
-
-template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-void
-__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate() _NOEXCEPT
-{
- typedef allocator_traits<_Alloc> __alloc_traits;
- typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap;
- _Ap __a(__f_.__get_allocator());
- __f_.destroy();
- __a.deallocate(this, 1);
-}
-
-template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-_Rp
-__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
-{
- return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
-}
-
-#ifndef _LIBCPP_NO_RTTI
-
-template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-const void*
-__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT
-{
- if (__ti == typeid(_Fp))
- return &__f_.__target();
- return (const void*)0;
-}
-
-template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-const std::type_info&
-__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
-{
- return typeid(_Fp);
-}
-
-#endif // _LIBCPP_NO_RTTI
-
-// __value_func creates a value-type from a __func.
-
-template <class _Fp> class __value_func;
-
-template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
-{
- typename aligned_storage<3 * sizeof(void*)>::type __buf_;
-
- typedef __base<_Rp(_ArgTypes...)> __func;
- __func* __f_;
-
- _LIBCPP_NO_CFI static __func* __as_base(void* p)
- {
- return reinterpret_cast<__func*>(p);
- }
-
- public:
- _LIBCPP_INLINE_VISIBILITY
- __value_func() _NOEXCEPT : __f_(0) {}
-
- template <class _Fp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a)
- : __f_(0)
- {
- typedef allocator_traits<_Alloc> __alloc_traits;
- typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun;
- typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type
- _FunAlloc;
-
- if (__function::__not_null(__f))
- {
- _FunAlloc __af(__a);
- if (sizeof(_Fun) <= sizeof(__buf_) &&
- is_nothrow_copy_constructible<_Fp>::value &&
- is_nothrow_copy_constructible<_FunAlloc>::value)
- {
- __f_ =
- ::new ((void*)&__buf_) _Fun(_VSTD::move(__f), _Alloc(__af));
- }
- else
- {
- typedef __allocator_destructor<_FunAlloc> _Dp;
- unique_ptr<__func, _Dp> __hold(__af.allocate(1), _Dp(__af, 1));
- ::new ((void*)__hold.get()) _Fun(_VSTD::move(__f), _Alloc(__a));
- __f_ = __hold.release();
- }
- }
- }
-
- template <class _Fp,
- class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type>
- _LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f)
- : __value_func(std::forward<_Fp>(__f), allocator<_Fp>()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __value_func(const __value_func& __f)
- {
- if (__f.__f_ == 0)
- __f_ = 0;
- else if ((void*)__f.__f_ == &__f.__buf_)
- {
- __f_ = __as_base(&__buf_);
- __f.__f_->__clone(__f_);
- }
- else
- __f_ = __f.__f_->__clone();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __value_func(__value_func&& __f) _NOEXCEPT
- {
- if (__f.__f_ == 0)
- __f_ = 0;
- else if ((void*)__f.__f_ == &__f.__buf_)
- {
- __f_ = __as_base(&__buf_);
- __f.__f_->__clone(__f_);
- }
- else
- {
- __f_ = __f.__f_;
- __f.__f_ = 0;
- }
- }
-
- _LIBCPP_INLINE_VISIBILITY
- ~__value_func()
- {
- if ((void*)__f_ == &__buf_)
- __f_->destroy();
- else if (__f_)
- __f_->destroy_deallocate();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __value_func& operator=(__value_func&& __f)
- {
- *this = nullptr;
- if (__f.__f_ == 0)
- __f_ = 0;
- else if ((void*)__f.__f_ == &__f.__buf_)
- {
- __f_ = __as_base(&__buf_);
- __f.__f_->__clone(__f_);
- }
- else
- {
- __f_ = __f.__f_;
- __f.__f_ = 0;
- }
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __value_func& operator=(nullptr_t)
- {
- __func* __f = __f_;
- __f_ = 0;
- if ((void*)__f == &__buf_)
- __f->destroy();
- else if (__f)
- __f->destroy_deallocate();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Rp operator()(_ArgTypes&&... __args) const
- {
- if (__f_ == 0)
- __throw_bad_function_call();
- return (*__f_)(_VSTD::forward<_ArgTypes>(__args)...);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(__value_func& __f) _NOEXCEPT
- {
- if (&__f == this)
- return;
- if ((void*)__f_ == &__buf_ && (void*)__f.__f_ == &__f.__buf_)
- {
- typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
- __func* __t = __as_base(&__tempbuf);
- __f_->__clone(__t);
- __f_->destroy();
- __f_ = 0;
- __f.__f_->__clone(__as_base(&__buf_));
- __f.__f_->destroy();
- __f.__f_ = 0;
- __f_ = __as_base(&__buf_);
- __t->__clone(__as_base(&__f.__buf_));
- __t->destroy();
- __f.__f_ = __as_base(&__f.__buf_);
- }
- else if ((void*)__f_ == &__buf_)
- {
- __f_->__clone(__as_base(&__f.__buf_));
- __f_->destroy();
- __f_ = __f.__f_;
- __f.__f_ = __as_base(&__f.__buf_);
- }
- else if ((void*)__f.__f_ == &__f.__buf_)
- {
- __f.__f_->__clone(__as_base(&__buf_));
- __f.__f_->destroy();
- __f.__f_ = __f_;
- __f_ = __as_base(&__buf_);
- }
- else
- _VSTD::swap(__f_, __f.__f_);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT { return __f_ != 0; }
-
-#ifndef _LIBCPP_NO_RTTI
- _LIBCPP_INLINE_VISIBILITY
- const std::type_info& target_type() const _NOEXCEPT
- {
- if (__f_ == 0)
- return typeid(void);
- return __f_->target_type();
- }
-
- template <typename _Tp>
- _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
- {
- if (__f_ == 0)
- return 0;
- return (const _Tp*)__f_->target(typeid(_Tp));
- }
-#endif // _LIBCPP_NO_RTTI
-};
-
-// Storage for a functor object, to be used with __policy to manage copy and
-// destruction.
-union __policy_storage
-{
- mutable char __small[sizeof(void*) * 2];
- void* __large;
-};
-
-// True if _Fun can safely be held in __policy_storage.__small.
-template <typename _Fun>
-struct __use_small_storage
- : public _VSTD::integral_constant<
- bool, sizeof(_Fun) <= sizeof(__policy_storage) &&
- _LIBCPP_ALIGNOF(_Fun) <= _LIBCPP_ALIGNOF(__policy_storage) &&
- _VSTD::is_trivially_copy_constructible<_Fun>::value &&
- _VSTD::is_trivially_destructible<_Fun>::value> {};
-
-// Policy contains information about how to copy, destroy, and move the
-// underlying functor. You can think of it as a vtable of sorts.
-struct __policy
-{
- // Used to copy or destroy __large values. null for trivial objects.
- void* (*const __clone)(const void*);
- void (*const __destroy)(void*);
-
- // True if this is the null policy (no value).
- const bool __is_null;
-
- // The target type. May be null if RTTI is disabled.
- const std::type_info* const __type_info;
-
- // Returns a pointer to a static policy object suitable for the functor
- // type.
- template <typename _Fun>
- _LIBCPP_INLINE_VISIBILITY static const __policy* __create()
- {
- return __choose_policy<_Fun>(__use_small_storage<_Fun>());
- }
-
- _LIBCPP_INLINE_VISIBILITY
- static const __policy* __create_empty()
- {
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {nullptr, nullptr,
- true,
-#ifndef _LIBCPP_NO_RTTI
- &typeid(void)
-#else
- nullptr
-#endif
- };
- return &__policy_;
- }
-
- private:
- template <typename _Fun> static void* __large_clone(const void* __s)
- {
- const _Fun* __f = static_cast<const _Fun*>(__s);
- return __f->__clone();
- }
-
- template <typename _Fun>
- static void __large_destroy(void* __s) {
- _Fun::__destroy_and_delete(static_cast<_Fun*>(__s));
- }
-
- template <typename _Fun>
- _LIBCPP_INLINE_VISIBILITY static const __policy*
- __choose_policy(/* is_small = */ false_type) {
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {
- &__large_clone<_Fun>, &__large_destroy<_Fun>, false,
-#ifndef _LIBCPP_NO_RTTI
- &typeid(typename _Fun::_Target)
-#else
- nullptr
-#endif
- };
- return &__policy_;
- }
-
- template <typename _Fun>
- _LIBCPP_INLINE_VISIBILITY static const __policy*
- __choose_policy(/* is_small = */ true_type)
- {
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {
- nullptr, nullptr, false,
-#ifndef _LIBCPP_NO_RTTI
- &typeid(typename _Fun::_Target)
-#else
- nullptr
-#endif
- };
- return &__policy_;
- }
-};
-
-// Used to choose between perfect forwarding or pass-by-value. Pass-by-value is
-// faster for types that can be passed in registers.
-template <typename _Tp>
-using __fast_forward =
- typename _VSTD::conditional<_VSTD::is_scalar<_Tp>::value, _Tp, _Tp&&>::type;
-
-// __policy_invoker calls an instance of __alloc_func held in __policy_storage.
-
-template <class _Fp> struct __policy_invoker;
-
-template <class _Rp, class... _ArgTypes>
-struct __policy_invoker<_Rp(_ArgTypes...)>
-{
- typedef _Rp (*__Call)(const __policy_storage*,
- __fast_forward<_ArgTypes>...);
-
- __Call __call_;
-
- // Creates an invoker that throws bad_function_call.
- _LIBCPP_INLINE_VISIBILITY
- __policy_invoker() : __call_(&__call_empty) {}
-
- // Creates an invoker that calls the given instance of __func.
- template <typename _Fun>
- _LIBCPP_INLINE_VISIBILITY static __policy_invoker __create()
- {
- return __policy_invoker(&__call_impl<_Fun>);
- }
-
- private:
- _LIBCPP_INLINE_VISIBILITY
- explicit __policy_invoker(__Call __c) : __call_(__c) {}
-
- static _Rp __call_empty(const __policy_storage*,
- __fast_forward<_ArgTypes>...)
- {
- __throw_bad_function_call();
- }
-
- template <typename _Fun>
- static _Rp __call_impl(const __policy_storage* __buf,
- __fast_forward<_ArgTypes>... __args)
- {
- _Fun* __f = reinterpret_cast<_Fun*>(__use_small_storage<_Fun>::value
- ? &__buf->__small
- : __buf->__large);
- return (*__f)(_VSTD::forward<_ArgTypes>(__args)...);
- }
-};
-
-// __policy_func uses a __policy and __policy_invoker to create a type-erased,
-// copyable functor.
-
-template <class _Fp> class __policy_func;
-
-template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
-{
- // Inline storage for small objects.
- __policy_storage __buf_;
-
- // Calls the value stored in __buf_. This could technically be part of
- // policy, but storing it here eliminates a level of indirection inside
- // operator().
- typedef __function::__policy_invoker<_Rp(_ArgTypes...)> __invoker;
- __invoker __invoker_;
-
- // The policy that describes how to move / copy / destroy __buf_. Never
- // null, even if the function is empty.
- const __policy* __policy_;
-
- public:
- _LIBCPP_INLINE_VISIBILITY
- __policy_func() : __policy_(__policy::__create_empty()) {}
-
- template <class _Fp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY __policy_func(_Fp&& __f, const _Alloc& __a)
- : __policy_(__policy::__create_empty())
- {
- typedef __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun;
- typedef allocator_traits<_Alloc> __alloc_traits;
- typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type
- _FunAlloc;
-
- if (__function::__not_null(__f))
- {
- __invoker_ = __invoker::template __create<_Fun>();
- __policy_ = __policy::__create<_Fun>();
-
- _FunAlloc __af(__a);
- if (__use_small_storage<_Fun>())
- {
- ::new ((void*)&__buf_.__small)
- _Fun(_VSTD::move(__f), _Alloc(__af));
- }
- else
- {
- typedef __allocator_destructor<_FunAlloc> _Dp;
- unique_ptr<_Fun, _Dp> __hold(__af.allocate(1), _Dp(__af, 1));
- ::new ((void*)__hold.get())
- _Fun(_VSTD::move(__f), _Alloc(__af));
- __buf_.__large = __hold.release();
- }
- }
- }
-
- template <class _Fp, class = typename enable_if<!is_same<typename decay<_Fp>::type, __policy_func>::value>::type>
- _LIBCPP_INLINE_VISIBILITY explicit __policy_func(_Fp&& __f)
- : __policy_(__policy::__create_empty()) {
- typedef __default_alloc_func<_Fp, _Rp(_ArgTypes...)> _Fun;
-
- if (__function::__not_null(__f)) {
- __invoker_ = __invoker::template __create<_Fun>();
- __policy_ = __policy::__create<_Fun>();
- if (__use_small_storage<_Fun>()) {
- ::new ((void*)&__buf_.__small) _Fun(_VSTD::move(__f));
- } else {
- __builtin_new_allocator::__holder_t __hold =
- __builtin_new_allocator::__allocate_type<_Fun>(1);
- __buf_.__large = ::new (__hold.get()) _Fun(_VSTD::move(__f));
- (void)__hold.release();
- }
- }
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __policy_func(const __policy_func& __f)
- : __buf_(__f.__buf_), __invoker_(__f.__invoker_),
- __policy_(__f.__policy_)
- {
- if (__policy_->__clone)
- __buf_.__large = __policy_->__clone(__f.__buf_.__large);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __policy_func(__policy_func&& __f)
- : __buf_(__f.__buf_), __invoker_(__f.__invoker_),
- __policy_(__f.__policy_)
- {
- if (__policy_->__destroy)
- {
- __f.__policy_ = __policy::__create_empty();
- __f.__invoker_ = __invoker();
- }
- }
-
- _LIBCPP_INLINE_VISIBILITY
- ~__policy_func()
- {
- if (__policy_->__destroy)
- __policy_->__destroy(__buf_.__large);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __policy_func& operator=(__policy_func&& __f)
- {
- *this = nullptr;
- __buf_ = __f.__buf_;
- __invoker_ = __f.__invoker_;
- __policy_ = __f.__policy_;
- __f.__policy_ = __policy::__create_empty();
- __f.__invoker_ = __invoker();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __policy_func& operator=(nullptr_t)
- {
- const __policy* __p = __policy_;
- __policy_ = __policy::__create_empty();
- __invoker_ = __invoker();
- if (__p->__destroy)
- __p->__destroy(__buf_.__large);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Rp operator()(_ArgTypes&&... __args) const
- {
- return __invoker_.__call_(_VSTD::addressof(__buf_),
- _VSTD::forward<_ArgTypes>(__args)...);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(__policy_func& __f)
- {
- _VSTD::swap(__invoker_, __f.__invoker_);
- _VSTD::swap(__policy_, __f.__policy_);
- _VSTD::swap(__buf_, __f.__buf_);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- explicit operator bool() const _NOEXCEPT
- {
- return !__policy_->__is_null;
- }
-
-#ifndef _LIBCPP_NO_RTTI
- _LIBCPP_INLINE_VISIBILITY
- const std::type_info& target_type() const _NOEXCEPT
- {
- return *__policy_->__type_info;
- }
-
- template <typename _Tp>
- _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
- {
- if (__policy_->__is_null || typeid(_Tp) != *__policy_->__type_info)
- return nullptr;
- if (__policy_->__clone) // Out of line storage.
- return reinterpret_cast<const _Tp*>(__buf_.__large);
- else
- return reinterpret_cast<const _Tp*>(&__buf_.__small);
- }
-#endif // _LIBCPP_NO_RTTI
-};
-
-#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
-
-template<class _Rp1, class ..._ArgTypes1, class _Alloc, class _Rp, class ..._ArgTypes>
-class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
- : public __base<_Rp(_ArgTypes...)>
-{
- typedef _Rp1(^__block_type)(_ArgTypes1...);
- __block_type __f_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- explicit __func(__block_type const& __f)
- : __f_(__f ? Block_copy(__f) : (__block_type)0)
- { }
-
- // [TODO] add && to save on a retain
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __func(__block_type __f, const _Alloc& /* unused */)
- : __f_(__f ? Block_copy(__f) : (__block_type)0)
- { }
-
- virtual __base<_Rp(_ArgTypes...)>* __clone() const {
- _LIBCPP_ASSERT(false,
- "Block pointers are just pointers, so they should always fit into "
- "std::function's small buffer optimization. This function should "
- "never be invoked.");
- return nullptr;
- }
-
- virtual void __clone(__base<_Rp(_ArgTypes...)>* __p) const {
- ::new (__p) __func(__f_);
- }
-
- virtual void destroy() _NOEXCEPT {
- if (__f_)
- Block_release(__f_);
- __f_ = 0;
- }
-
- virtual void destroy_deallocate() _NOEXCEPT {
- _LIBCPP_ASSERT(false,
- "Block pointers are just pointers, so they should always fit into "
- "std::function's small buffer optimization. This function should "
- "never be invoked.");
- }
-
- virtual _Rp operator()(_ArgTypes&& ... __arg) {
- return __invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
- }
-
-#ifndef _LIBCPP_NO_RTTI
- virtual const void* target(type_info const& __ti) const _NOEXCEPT {
- if (__ti == typeid(__func::__block_type))
- return &__f_;
- return (const void*)nullptr;
- }
-
- virtual const std::type_info& target_type() const _NOEXCEPT {
- return typeid(__func::__block_type);
- }
-#endif // _LIBCPP_NO_RTTI
-};
-
-#endif // _LIBCPP_HAS_EXTENSION_BLOCKS && !_LIBCPP_HAS_OBJC_ARC
-
-} // __function
-
-template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
- : public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
- public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
-{
-#ifndef _LIBCPP_ABI_OPTIMIZED_FUNCTION
- typedef __function::__value_func<_Rp(_ArgTypes...)> __func;
-#else
- typedef __function::__policy_func<_Rp(_ArgTypes...)> __func;
-#endif
-
- __func __f_;
-
- template <class _Fp, bool = _And<
- _IsNotSame<__uncvref_t<_Fp>, function>,
- __invokable<_Fp, _ArgTypes...>
- >::value>
- struct __callable;
- template <class _Fp>
- struct __callable<_Fp, true>
- {
- static const bool value = is_same<void, _Rp>::value ||
- is_convertible<typename __invoke_of<_Fp, _ArgTypes...>::type,
- _Rp>::value;
- };
- template <class _Fp>
- struct __callable<_Fp, false>
- {
- static const bool value = false;
- };
-
- template <class _Fp>
- using _EnableIfLValueCallable = typename enable_if<__callable<_Fp&>::value>::type;
-public:
- typedef _Rp result_type;
-
- // construct/copy/destroy:
- _LIBCPP_INLINE_VISIBILITY
- function() _NOEXCEPT { }
- _LIBCPP_INLINE_VISIBILITY
- function(nullptr_t) _NOEXCEPT {}
- function(const function&);
- function(function&&) _NOEXCEPT;
- template<class _Fp, class = _EnableIfLValueCallable<_Fp>>
- function(_Fp);
-
-#if _LIBCPP_STD_VER <= 14
- template<class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
- function(allocator_arg_t, const _Alloc&) _NOEXCEPT {}
- template<class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
- function(allocator_arg_t, const _Alloc&, nullptr_t) _NOEXCEPT {}
- template<class _Alloc>
- function(allocator_arg_t, const _Alloc&, const function&);
- template<class _Alloc>
- function(allocator_arg_t, const _Alloc&, function&&);
- template<class _Fp, class _Alloc, class = _EnableIfLValueCallable<_Fp>>
- function(allocator_arg_t, const _Alloc& __a, _Fp __f);
-#endif
-
- function& operator=(const function&);
- function& operator=(function&&) _NOEXCEPT;
- function& operator=(nullptr_t) _NOEXCEPT;
- template<class _Fp, class = _EnableIfLValueCallable<typename decay<_Fp>::type>>
- function& operator=(_Fp&&);
-
- ~function();
-
- // function modifiers:
- void swap(function&) _NOEXCEPT;
-
-#if _LIBCPP_STD_VER <= 14
- template<class _Fp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
- void assign(_Fp&& __f, const _Alloc& __a)
- {function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);}
-#endif
-
- // function capacity:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {
- return static_cast<bool>(__f_);
- }
-
- // deleted overloads close possible hole in the type system
- template<class _R2, class... _ArgTypes2>
- bool operator==(const function<_R2(_ArgTypes2...)>&) const = delete;
- template<class _R2, class... _ArgTypes2>
- bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete;
-public:
- // function invocation:
- _Rp operator()(_ArgTypes...) const;
-
-#ifndef _LIBCPP_NO_RTTI
- // function target access:
- const std::type_info& target_type() const _NOEXCEPT;
- template <typename _Tp> _Tp* target() _NOEXCEPT;
- template <typename _Tp> const _Tp* target() const _NOEXCEPT;
-#endif // _LIBCPP_NO_RTTI
-};
-
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-template<class _Rp, class ..._Ap>
-function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
-
-template<class _Fp>
-struct __strip_signature;
-
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile> { using type = _Rp(_Ap...); };
-
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) &> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const &> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile &> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile &> { using type = _Rp(_Ap...); };
-
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile noexcept> { using type = _Rp(_Ap...); };
-
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) & noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const & noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile & noexcept> { using type = _Rp(_Ap...); };
-template<class _Rp, class _Gp, class ..._Ap>
-struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type = _Rp(_Ap...); };
-
-template<class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
-function(_Fp) -> function<_Stripped>;
-#endif // !_LIBCPP_HAS_NO_DEDUCTION_GUIDES
-
-template<class _Rp, class ..._ArgTypes>
-function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {}
-
-#if _LIBCPP_STD_VER <= 14
-template<class _Rp, class ..._ArgTypes>
-template <class _Alloc>
-function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
- const function& __f) : __f_(__f.__f_) {}
-#endif
-
-template <class _Rp, class... _ArgTypes>
-function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
- : __f_(_VSTD::move(__f.__f_)) {}
-
-#if _LIBCPP_STD_VER <= 14
-template<class _Rp, class ..._ArgTypes>
-template <class _Alloc>
-function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
- function&& __f)
- : __f_(_VSTD::move(__f.__f_)) {}
-#endif
-
-template <class _Rp, class... _ArgTypes>
-template <class _Fp, class>
-function<_Rp(_ArgTypes...)>::function(_Fp __f) : __f_(_VSTD::move(__f)) {}
-
-#if _LIBCPP_STD_VER <= 14
-template <class _Rp, class... _ArgTypes>
-template <class _Fp, class _Alloc, class>
-function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a,
- _Fp __f)
- : __f_(_VSTD::move(__f), __a) {}
-#endif
-
-template<class _Rp, class ..._ArgTypes>
-function<_Rp(_ArgTypes...)>&
-function<_Rp(_ArgTypes...)>::operator=(const function& __f)
-{
- function(__f).swap(*this);
- return *this;
-}
-
-template<class _Rp, class ..._ArgTypes>
-function<_Rp(_ArgTypes...)>&
-function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
-{
- __f_ = std::move(__f.__f_);
- return *this;
-}
-
-template<class _Rp, class ..._ArgTypes>
-function<_Rp(_ArgTypes...)>&
-function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
-{
- __f_ = nullptr;
- return *this;
-}
-
-template<class _Rp, class ..._ArgTypes>
-template <class _Fp, class>
-function<_Rp(_ArgTypes...)>&
-function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f)
-{
- function(_VSTD::forward<_Fp>(__f)).swap(*this);
- return *this;
-}
-
-template<class _Rp, class ..._ArgTypes>
-function<_Rp(_ArgTypes...)>::~function() {}
-
-template<class _Rp, class ..._ArgTypes>
-void
-function<_Rp(_ArgTypes...)>::swap(function& __f) _NOEXCEPT
-{
- __f_.swap(__f.__f_);
-}
-
-template<class _Rp, class ..._ArgTypes>
-_Rp
-function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
-{
- return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
-}
-
-#ifndef _LIBCPP_NO_RTTI
-
-template<class _Rp, class ..._ArgTypes>
-const std::type_info&
-function<_Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
-{
- return __f_.target_type();
-}
-
-template<class _Rp, class ..._ArgTypes>
-template <typename _Tp>
-_Tp*
-function<_Rp(_ArgTypes...)>::target() _NOEXCEPT
-{
- return (_Tp*)(__f_.template target<_Tp>());
-}
-
-template<class _Rp, class ..._ArgTypes>
-template <typename _Tp>
-const _Tp*
-function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT
-{
- return __f_.template target<_Tp>();
-}
-
-#endif // _LIBCPP_NO_RTTI
-
-template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;}
-
-template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return !__f;}
-
-template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;}
-
-template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;}
-
-template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
-{return __x.swap(__y);}
-
-#else // _LIBCPP_CXX03_LANG
-
-#include <__functional_03>
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// BIND
-//==============================================================================
-
-template<class _Tp> struct __is_bind_expression : public false_type {};
-template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_bind_expression
- : public __is_bind_expression<typename remove_cv<_Tp>::type> {};
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp>
-_LIBCPP_INLINE_VAR constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
-#endif
-
-template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
-template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_placeholder
- : public __is_placeholder<typename remove_cv<_Tp>::type> {};
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp>
-_LIBCPP_INLINE_VAR constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
-#endif
-
-namespace placeholders
-{
-
-template <int _Np> struct __ph {};
-
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-_LIBCPP_FUNC_VIS extern const __ph<1> _1;
-_LIBCPP_FUNC_VIS extern const __ph<2> _2;
-_LIBCPP_FUNC_VIS extern const __ph<3> _3;
-_LIBCPP_FUNC_VIS extern const __ph<4> _4;
-_LIBCPP_FUNC_VIS extern const __ph<5> _5;
-_LIBCPP_FUNC_VIS extern const __ph<6> _6;
-_LIBCPP_FUNC_VIS extern const __ph<7> _7;
-_LIBCPP_FUNC_VIS extern const __ph<8> _8;
-_LIBCPP_FUNC_VIS extern const __ph<9> _9;
-_LIBCPP_FUNC_VIS extern const __ph<10> _10;
-#else
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<1> _1{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<2> _2{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<3> _3{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<4> _4{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<5> _5{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<6> _6{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<7> _7{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<8> _8{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<9> _9{};
-/* _LIBCPP_INLINE_VAR */ constexpr __ph<10> _10{};
-#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-
-} // placeholders
-
-template<int _Np>
-struct __is_placeholder<placeholders::__ph<_Np> >
- : public integral_constant<int, _Np> {};
-
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
-_Tp&
-__mu(reference_wrapper<_Tp> __t, _Uj&)
-{
- return __t.get();
-}
-
-template <class _Ti, class ..._Uj, size_t ..._Indx>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __invoke_of<_Ti&, _Uj...>::type
-__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
-{
- return __ti(_VSTD::forward<_Uj>(_VSTD::get<_Indx>(__uj))...);
-}
-
-template <class _Ti, class ..._Uj>
-inline _LIBCPP_INLINE_VISIBILITY
-typename _EnableIf
-<
- is_bind_expression<_Ti>::value,
- __invoke_of<_Ti&, _Uj...>
->::type
-__mu(_Ti& __ti, tuple<_Uj...>& __uj)
-{
- typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;
- return __mu_expand(__ti, __uj, __indices());
-}
-
-template <bool IsPh, class _Ti, class _Uj>
-struct __mu_return2 {};
-
-template <class _Ti, class _Uj>
-struct __mu_return2<true, _Ti, _Uj>
-{
- typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type;
-};
-
-template <class _Ti, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- 0 < is_placeholder<_Ti>::value,
- typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
->::type
-__mu(_Ti&, _Uj& __uj)
-{
- const size_t _Indx = is_placeholder<_Ti>::value - 1;
- return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_VSTD::get<_Indx>(__uj));
-}
-
-template <class _Ti, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_bind_expression<_Ti>::value &&
- is_placeholder<_Ti>::value == 0 &&
- !__is_reference_wrapper<_Ti>::value,
- _Ti&
->::type
-__mu(_Ti& __ti, _Uj&)
-{
- return __ti;
-}
-
-template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh,
- class _TupleUj>
-struct __mu_return_impl;
-
-template <bool _Invokable, class _Ti, class ..._Uj>
-struct __mu_return_invokable // false
-{
- typedef __nat type;
-};
-
-template <class _Ti, class ..._Uj>
-struct __mu_return_invokable<true, _Ti, _Uj...>
-{
- typedef typename __invoke_of<_Ti&, _Uj...>::type type;
-};
-
-template <class _Ti, class ..._Uj>
-struct __mu_return_impl<_Ti, false, true, false, tuple<_Uj...> >
- : public __mu_return_invokable<__invokable<_Ti&, _Uj...>::value, _Ti, _Uj...>
-{
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return_impl<_Ti, false, false, true, _TupleUj>
-{
- typedef typename tuple_element<is_placeholder<_Ti>::value - 1,
- _TupleUj>::type&& type;
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return_impl<_Ti, true, false, false, _TupleUj>
-{
- typedef typename _Ti::type& type;
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return_impl<_Ti, false, false, false, _TupleUj>
-{
- typedef _Ti& type;
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return
- : public __mu_return_impl<_Ti,
- __is_reference_wrapper<_Ti>::value,
- is_bind_expression<_Ti>::value,
- 0 < is_placeholder<_Ti>::value &&
- is_placeholder<_Ti>::value <= tuple_size<_TupleUj>::value,
- _TupleUj>
-{
-};
-
-template <class _Fp, class _BoundArgs, class _TupleUj>
-struct __is_valid_bind_return
-{
- static const bool value = false;
-};
-
-template <class _Fp, class ..._BoundArgs, class _TupleUj>
-struct __is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>
-{
- static const bool value = __invokable<_Fp,
- typename __mu_return<_BoundArgs, _TupleUj>::type...>::value;
-};
-
-template <class _Fp, class ..._BoundArgs, class _TupleUj>
-struct __is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj>
-{
- static const bool value = __invokable<_Fp,
- typename __mu_return<const _BoundArgs, _TupleUj>::type...>::value;
-};
-
-template <class _Fp, class _BoundArgs, class _TupleUj,
- bool = __is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value>
-struct __bind_return;
-
-template <class _Fp, class ..._BoundArgs, class _TupleUj>
-struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj, true>
-{
- typedef typename __invoke_of
- <
- _Fp&,
- typename __mu_return
- <
- _BoundArgs,
- _TupleUj
- >::type...
- >::type type;
-};
-
-template <class _Fp, class ..._BoundArgs, class _TupleUj>
-struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true>
-{
- typedef typename __invoke_of
- <
- _Fp&,
- typename __mu_return
- <
- const _BoundArgs,
- _TupleUj
- >::type...
- >::type type;
-};
-
-template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __bind_return<_Fp, _BoundArgs, _Args>::type
-__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
- _Args&& __args)
-{
- return _VSTD::__invoke(__f, _VSTD::__mu(_VSTD::get<_Indx>(__bound_args), __args)...);
-}
-
-template<class _Fp, class ..._BoundArgs>
-class __bind
- : public __weak_result_type<typename decay<_Fp>::type>
-{
-protected:
- typedef typename decay<_Fp>::type _Fd;
- typedef tuple<typename decay<_BoundArgs>::type...> _Td;
-private:
- _Fd __f_;
- _Td __bound_args_;
-
- typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
-public:
- template <class _Gp, class ..._BA,
- class = typename enable_if
- <
- is_constructible<_Fd, _Gp>::value &&
- !is_same<typename remove_reference<_Gp>::type,
- __bind>::value
- >::type>
- _LIBCPP_INLINE_VISIBILITY
- explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
- : __f_(_VSTD::forward<_Gp>(__f)),
- __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
-
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
- operator()(_Args&& ...__args)
- {
- return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
- tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
- }
-
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
- operator()(_Args&& ...__args) const
- {
- return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
- tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
- }
-};
-
-template<class _Fp, class ..._BoundArgs>
-struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {};
-
-template<class _Rp, class _Fp, class ..._BoundArgs>
-class __bind_r
- : public __bind<_Fp, _BoundArgs...>
-{
- typedef __bind<_Fp, _BoundArgs...> base;
- typedef typename base::_Fd _Fd;
- typedef typename base::_Td _Td;
-public:
- typedef _Rp result_type;
-
-
- template <class _Gp, class ..._BA,
- class = typename enable_if
- <
- is_constructible<_Fd, _Gp>::value &&
- !is_same<typename remove_reference<_Gp>::type,
- __bind_r>::value
- >::type>
- _LIBCPP_INLINE_VISIBILITY
- explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)
- : base(_VSTD::forward<_Gp>(__f),
- _VSTD::forward<_BA>(__bound_args)...) {}
-
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
- result_type>::value || is_void<_Rp>::value,
- result_type
- >::type
- operator()(_Args&& ...__args)
- {
- typedef __invoke_void_return_wrapper<_Rp> _Invoker;
- return _Invoker::__call(static_cast<base&>(*this), _VSTD::forward<_Args>(__args)...);
- }
-
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
- result_type>::value || is_void<_Rp>::value,
- result_type
- >::type
- operator()(_Args&& ...__args) const
- {
- typedef __invoke_void_return_wrapper<_Rp> _Invoker;
- return _Invoker::__call(static_cast<base const&>(*this), _VSTD::forward<_Args>(__args)...);
- }
-};
-
-template<class _Rp, class _Fp, class ..._BoundArgs>
-struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
-
-template<class _Fp, class ..._BoundArgs>
-inline _LIBCPP_INLINE_VISIBILITY
-__bind<_Fp, _BoundArgs...>
-bind(_Fp&& __f, _BoundArgs&&... __bound_args)
-{
- typedef __bind<_Fp, _BoundArgs...> type;
- return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
-}
-
-template<class _Rp, class _Fp, class ..._BoundArgs>
-inline _LIBCPP_INLINE_VISIBILITY
-__bind_r<_Rp, _Fp, _BoundArgs...>
-bind(_Fp&& __f, _BoundArgs&&... __bound_args)
-{
- typedef __bind_r<_Rp, _Fp, _BoundArgs...> type;
- return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-#if _LIBCPP_STD_VER > 14
-
-template <class _Fn, class ..._Args>
-invoke_result_t<_Fn, _Args...>
-invoke(_Fn&& __f, _Args&&... __args)
- noexcept(is_nothrow_invocable_v<_Fn, _Args...>)
-{
- return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
-}
-
-template <class _DecayFunc>
-class _LIBCPP_TEMPLATE_VIS __not_fn_imp {
- _DecayFunc __fd;
-
-public:
- __not_fn_imp() = delete;
-
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- auto operator()(_Args&& ...__args) &
- noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
- -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
- { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
-
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- auto operator()(_Args&& ...__args) &&
- noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
- -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
- { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
-
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- auto operator()(_Args&& ...__args) const&
- noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
- -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
- { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
-
-
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- auto operator()(_Args&& ...__args) const&&
- noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
- -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
- { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
-
-private:
- template <class _RawFunc,
- class = enable_if_t<!is_same<decay_t<_RawFunc>, __not_fn_imp>::value>>
- _LIBCPP_INLINE_VISIBILITY
- explicit __not_fn_imp(_RawFunc&& __rf)
- : __fd(_VSTD::forward<_RawFunc>(__rf)) {}
-
- template <class _RawFunc>
- friend inline _LIBCPP_INLINE_VISIBILITY
- __not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&&);
-};
-
-template <class _RawFunc>
-inline _LIBCPP_INLINE_VISIBILITY
-__not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&& __fn) {
- return __not_fn_imp<decay_t<_RawFunc>>(_VSTD::forward<_RawFunc>(__fn));
-}
-
-#endif
-
-// struct hash<T*> in <memory>
-
-template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
-pair<_ForwardIterator1, _ForwardIterator1> _LIBCPP_CONSTEXPR_AFTER_CXX11
-__search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
- forward_iterator_tag, forward_iterator_tag)
-{
- if (__first2 == __last2)
- return _VSTD::make_pair(__first1, __first1); // Everything matches an empty sequence
- while (true)
- {
- // Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks
- while (true)
- {
- if (__first1 == __last1) // return __last1 if no element matches *__first2
- return _VSTD::make_pair(__last1, __last1);
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- }
- // *__first1 matches *__first2, now match elements after here
- _ForwardIterator1 __m1 = __first1;
- _ForwardIterator2 __m2 = __first2;
- while (true)
- {
- if (++__m2 == __last2) // If pattern exhausted, __first1 is the answer (works for 1 element pattern)
- return _VSTD::make_pair(__first1, __m1);
- if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found
- return _VSTD::make_pair(__last1, __last1);
- if (!__pred(*__m1, *__m2)) // if there is a mismatch, restart with a new __first1
- {
- ++__first1;
- break;
- } // else there is a match, check next elements
- }
- }
-}
-
-template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX11
-pair<_RandomAccessIterator1, _RandomAccessIterator1>
-__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
- random_access_iterator_tag, random_access_iterator_tag)
-{
- typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1;
- typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2;
- // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern
- const _D2 __len2 = __last2 - __first2;
- if (__len2 == 0)
- return _VSTD::make_pair(__first1, __first1);
- const _D1 __len1 = __last1 - __first1;
- if (__len1 < __len2)
- return _VSTD::make_pair(__last1, __last1);
- const _RandomAccessIterator1 __s = __last1 - (__len2 - 1); // Start of pattern match can't go beyond here
-
- while (true)
- {
- while (true)
- {
- if (__first1 == __s)
- return _VSTD::make_pair(__last1, __last1);
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- }
-
- _RandomAccessIterator1 __m1 = __first1;
- _RandomAccessIterator2 __m2 = __first2;
- while (true)
- {
- if (++__m2 == __last2)
- return _VSTD::make_pair(__first1, __first1 + __len2);
- ++__m1; // no need to check range on __m1 because __s guarantees we have enough source
- if (!__pred(*__m1, *__m2))
- {
- ++__first1;
- break;
- }
- }
- }
-}
-
-#if _LIBCPP_STD_VER > 14
-
-// default searcher
-template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-class _LIBCPP_TYPE_VIS default_searcher {
-public:
- _LIBCPP_INLINE_VISIBILITY
- default_searcher(_ForwardIterator __f, _ForwardIterator __l,
- _BinaryPredicate __p = _BinaryPredicate())
- : __first_(__f), __last_(__l), __pred_(__p) {}
-
- template <typename _ForwardIterator2>
- _LIBCPP_INLINE_VISIBILITY
- pair<_ForwardIterator2, _ForwardIterator2>
- operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
- {
- return _VSTD::__search(__f, __l, __first_, __last_, __pred_,
- typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category(),
- typename _VSTD::iterator_traits<_ForwardIterator2>::iterator_category());
- }
-
-private:
- _ForwardIterator __first_;
- _ForwardIterator __last_;
- _BinaryPredicate __pred_;
- };
-
-#endif // _LIBCPP_STD_VER > 14
-
-#if _LIBCPP_STD_VER > 17
-template <class _Tp>
-using unwrap_reference_t = typename unwrap_reference<_Tp>::type;
-
-template <class _Tp>
-using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
-#endif // > C++17
-
-template <class _Container, class _Predicate>
-inline typename _Container::size_type
-__libcpp_erase_if_container(_Container& __c, _Predicate __pred) {
- typename _Container::size_type __old_size = __c.size();
-
- const typename _Container::iterator __last = __c.end();
- for (typename _Container::iterator __iter = __c.begin(); __iter != __last;) {
- if (__pred(*__iter))
- __iter = __c.erase(__iter);
- else
- ++__iter;
- }
-
- return __old_size - __c.size();
-}
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_FUNCTIONAL
+#endif // _LIBCPP_FUNCTIONAL
*/
+#include <__availability>
#include <__config>
-#include <system_error>
-#include <memory>
+#include <__debug>
+#include <__memory/allocator_arg_t.h>
+#include <__memory/uses_allocator.h>
+#include <__utility/__decay_copy.h>
+#include <__utility/forward.h>
#include <chrono>
#include <exception>
+#include <memory>
#include <mutex>
+#include <system_error>
#include <thread>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
__x = __x ^ __y; return __x;
}
-#endif // !_LIBCPP_HAS_NO_STRONG_ENUMS
+#endif // !_LIBCPP_HAS_NO_STRONG_ENUMS
//enum class future_status
_LIBCPP_DECLARE_STRONG_ENUM(future_status)
error_code __ec_;
public:
future_error(error_code __ec);
-#if _LIBCPP_STD_VERS > 14
- explicit future_error(future_errc _Ev) : logic_error(), __ec_(make_error_code(_Ev)) {}
-#endif
+
_LIBCPP_INLINE_VISIBILITY
const error_code& code() const _NOEXCEPT {return __ec_;}
public:
template <class _Arg>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- void set_value(_Arg&& __arg);
-#else
- void set_value(_Arg& __arg);
-#endif
+ void set_value(_Arg&& __arg);
template <class _Arg>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- void set_value_at_thread_exit(_Arg&& __arg);
-#else
- void set_value_at_thread_exit(_Arg& __arg);
-#endif
+ void set_value_at_thread_exit(_Arg&& __arg);
_Rp move();
typename add_lvalue_reference<_Rp>::type copy();
template <class _Arg>
_LIBCPP_AVAILABILITY_FUTURE
void
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__assoc_state<_Rp>::set_value(_Arg&& __arg)
-#else
-__assoc_state<_Rp>::set_value(_Arg& __arg)
-#endif
{
unique_lock<mutex> __lk(this->__mut_);
if (this->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
- ::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
+ ::new ((void*)&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
this->__state_ |= base::__constructed | base::ready;
__cv_.notify_all();
}
template <class _Rp>
template <class _Arg>
void
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__assoc_state<_Rp>::set_value_at_thread_exit(_Arg&& __arg)
-#else
-__assoc_state<_Rp>::set_value_at_thread_exit(_Arg& __arg)
-#endif
{
unique_lock<mutex> __lk(this->__mut_);
if (this->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
- ::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
+ ::new ((void*)&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
this->__state_ |= base::__constructed;
__thread_local_data()->__make_ready_at_thread_exit(this);
}
_Fp __func_;
public:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
explicit __deferred_assoc_state(_Fp&& __f);
-#endif
virtual void __execute();
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp, class _Fp>
inline
__deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
this->__set_deferred();
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp, class _Fp>
void
__deferred_assoc_state<_Rp, _Fp>::__execute()
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
this->set_value(__func_());
#ifndef _LIBCPP_NO_EXCEPTIONS
}
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template <class _Fp>
_Fp __func_;
public:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
explicit __deferred_assoc_state(_Fp&& __f);
-#endif
virtual void __execute();
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Fp>
inline
__deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
this->__set_deferred();
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Fp>
void
__deferred_assoc_state<void, _Fp>::__execute()
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__func_();
this->set_value();
#ifndef _LIBCPP_NO_EXCEPTIONS
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template <class _Rp, class _Fp>
virtual void __on_zero_shared() _NOEXCEPT;
public:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
explicit __async_assoc_state(_Fp&& __f);
-#endif
virtual void __execute();
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp, class _Fp>
inline
__async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
{
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp, class _Fp>
void
__async_assoc_state<_Rp, _Fp>::__execute()
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
this->set_value(__func_());
#ifndef _LIBCPP_NO_EXCEPTIONS
}
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template <class _Rp, class _Fp>
virtual void __on_zero_shared() _NOEXCEPT;
public:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
explicit __async_assoc_state(_Fp&& __f);
-#endif
virtual void __execute();
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Fp>
inline
__async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
{
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Fp>
void
__async_assoc_state<void, _Fp>::__execute()
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__func_();
this->set_value();
#ifndef _LIBCPP_NO_EXCEPTIONS
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template <class _Fp>
template <class _Rp, class _Fp>
_LIBCPP_INLINE_VISIBILITY future<_Rp>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__make_deferred_assoc_state(_Fp&& __f);
-#else
-__make_deferred_assoc_state(_Fp __f);
-#endif
template <class _Rp, class _Fp>
_LIBCPP_INLINE_VISIBILITY future<_Rp>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__make_async_assoc_state(_Fp&& __f);
-#else
-__make_async_assoc_state(_Fp __f);
-#endif
template <class _Rp>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
template <class> friend class promise;
template <class> friend class shared_future;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _R1, class _Fp>
friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
template <class _R1, class _Fp>
friend future<_R1> __make_async_assoc_state(_Fp&& __f);
-#else
- template <class _R1, class _Fp>
- friend future<_R1> __make_deferred_assoc_state(_Fp __f);
- template <class _R1, class _Fp>
- friend future<_R1> __make_async_assoc_state(_Fp __f);
-#endif
public:
_LIBCPP_INLINE_VISIBILITY
future() _NOEXCEPT : __state_(nullptr) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
future(future&& __rhs) _NOEXCEPT
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
_LIBCPP_INLINE_VISIBILITY
future& operator=(future&& __rhs) _NOEXCEPT
{
- future(std::move(__rhs)).swap(*this);
+ future(_VSTD::move(__rhs)).swap(*this);
return *this;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- future(const future&);
- future& operator=(const future&);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
~future();
_LIBCPP_INLINE_VISIBILITY
shared_future<_Rp> share() _NOEXCEPT;
template <class> friend class promise;
template <class> friend class shared_future;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _R1, class _Fp>
friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
template <class _R1, class _Fp>
friend future<_R1> __make_async_assoc_state(_Fp&& __f);
-#else
- template <class _R1, class _Fp>
- friend future<_R1> __make_deferred_assoc_state(_Fp __f);
- template <class _R1, class _Fp>
- friend future<_R1> __make_async_assoc_state(_Fp __f);
-#endif
public:
_LIBCPP_INLINE_VISIBILITY
future() _NOEXCEPT : __state_(nullptr) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
future(future&& __rhs) _NOEXCEPT
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
_LIBCPP_INLINE_VISIBILITY
future& operator=(future&& __rhs) _NOEXCEPT
{
- future(std::move(__rhs)).swap(*this);
+ future(_VSTD::move(__rhs)).swap(*this);
return *this;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- future(const future&);
- future& operator=(const future&);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
~future();
_LIBCPP_INLINE_VISIBILITY
shared_future<_Rp&> share() _NOEXCEPT;
template <class> friend class promise;
template <class> friend class shared_future;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _R1, class _Fp>
friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
template <class _R1, class _Fp>
friend future<_R1> __make_async_assoc_state(_Fp&& __f);
-#else
- template <class _R1, class _Fp>
- friend future<_R1> __make_deferred_assoc_state(_Fp __f);
- template <class _R1, class _Fp>
- friend future<_R1> __make_async_assoc_state(_Fp __f);
-#endif
public:
_LIBCPP_INLINE_VISIBILITY
future() _NOEXCEPT : __state_(nullptr) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
future(future&& __rhs) _NOEXCEPT
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
_LIBCPP_INLINE_VISIBILITY
future& operator=(future&& __rhs) _NOEXCEPT
{
- future(std::move(__rhs)).swap(*this);
+ future(_VSTD::move(__rhs)).swap(*this);
return *this;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- future(const future&);
- future& operator=(const future&);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
~future();
_LIBCPP_INLINE_VISIBILITY
shared_future<void> share() _NOEXCEPT;
promise();
template <class _Alloc>
promise(allocator_arg_t, const _Alloc& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
promise(promise&& __rhs) _NOEXCEPT
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
promise(const promise& __rhs) = delete;
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- promise(const promise& __rhs);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~promise();
// assignment
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
promise& operator=(promise&& __rhs) _NOEXCEPT
{
- promise(std::move(__rhs)).swap(*this);
+ promise(_VSTD::move(__rhs)).swap(*this);
return *this;
}
promise& operator=(const promise& __rhs) = delete;
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- promise& operator=(const promise& __rhs);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
_LIBCPP_INLINE_VISIBILITY
void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
// setting the result
void set_value(const _Rp& __r);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
void set_value(_Rp&& __r);
-#endif
void set_exception(exception_ptr __p);
// setting the result with deferred notification
void set_value_at_thread_exit(const _Rp& __r);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
void set_value_at_thread_exit(_Rp&& __r);
-#endif
void set_exception_at_thread_exit(exception_ptr __p);
};
typedef __allocator_destructor<_A2> _D2;
_A2 __a(__a0);
unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
- ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);
+ ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
__state_ = _VSTD::addressof(*__hold.release());
}
__state_->set_value(__r);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp>
void
promise<_Rp>::set_value(_Rp&& __r)
__state_->set_value(_VSTD::move(__r));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp>
void
promise<_Rp>::set_exception(exception_ptr __p)
__state_->set_value_at_thread_exit(__r);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp>
void
promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
__state_->set_value_at_thread_exit(_VSTD::move(__r));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp>
void
promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
promise();
template <class _Allocator>
promise(allocator_arg_t, const _Allocator& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
promise(promise&& __rhs) _NOEXCEPT
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
promise(const promise& __rhs) = delete;
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- promise(const promise& __rhs);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~promise();
// assignment
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
promise& operator=(promise&& __rhs) _NOEXCEPT
{
- promise(std::move(__rhs)).swap(*this);
+ promise(_VSTD::move(__rhs)).swap(*this);
return *this;
}
promise& operator=(const promise& __rhs) = delete;
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- promise& operator=(const promise& __rhs);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
_LIBCPP_INLINE_VISIBILITY
void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
typedef __allocator_destructor<_A2> _D2;
_A2 __a(__a0);
unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
- ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);
+ ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
__state_ = _VSTD::addressof(*__hold.release());
}
template <class _Allocator>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
promise(allocator_arg_t, const _Allocator& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
promise(promise&& __rhs) _NOEXCEPT
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
promise(const promise& __rhs) = delete;
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- promise(const promise& __rhs);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~promise();
// assignment
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
promise& operator=(promise&& __rhs) _NOEXCEPT
{
- promise(std::move(__rhs)).swap(*this);
+ promise(_VSTD::move(__rhs)).swap(*this);
return *this;
}
promise& operator=(const promise& __rhs) = delete;
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-private:
- promise& operator=(const promise& __rhs);
-public:
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
_LIBCPP_INLINE_VISIBILITY
void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
typedef __allocator_destructor<_A2> _D2;
_A2 __a(__a0);
unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
- ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);
+ ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
__state_ = _VSTD::addressof(*__hold.release());
}
struct _LIBCPP_TEMPLATE_VIS uses_allocator<promise<_Rp>, _Alloc>
: public true_type {};
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
// packaged_task
template<class _Fp> class __packaged_task_base;
__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(
__packaged_task_base<_Rp(_ArgTypes...)>* __p) _NOEXCEPT
{
- ::new (__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));
+ ::new ((void*)__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));
}
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
_Rp
__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
{
- return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
+ return _VSTD::__invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
}
template <class _Callable> class __packaged_task_function;
class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
{
typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_NO_CFI
+ __base* __get_buf() { return (__base*)&__buf_; }
+
typename aligned_storage<3*sizeof(void*)>::type __buf_;
__base* __f_;
{
if (__f.__f_ == nullptr)
__f_ = nullptr;
- else if (__f.__f_ == (__base*)&__f.__buf_)
+ else if (__f.__f_ == __f.__get_buf())
{
+ __f.__f_->__move_to(__get_buf());
__f_ = (__base*)&__buf_;
- __f.__f_->__move_to(__f_);
}
else
{
typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
{
+ ::new ((void*)&__buf_) _FF(_VSTD::forward<_Fp>(__f));
__f_ = (__base*)&__buf_;
- ::new (__f_) _FF(_VSTD::forward<_Fp>(__f));
}
else
{
_Ap __a;
typedef __allocator_destructor<_Ap> _Dp;
unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
- ::new (__hold.get()) _FF(_VSTD::forward<_Fp>(__f), allocator<_FR>(__a));
+ ::new ((void*)__hold.get()) _FF(_VSTD::forward<_Fp>(__f), allocator<_FR>(__a));
__f_ = __hold.release();
}
}
if (sizeof(_FF) <= sizeof(__buf_))
{
__f_ = (__base*)&__buf_;
- ::new (__f_) _FF(_VSTD::forward<_Fp>(__f));
+ ::new ((void*)__f_) _FF(_VSTD::forward<_Fp>(__f));
}
else
{
_Ap __a(__a0);
typedef __allocator_destructor<_Ap> _Dp;
unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
- ::new (static_cast<void*>(_VSTD::addressof(*__hold.get())))
+ ::new ((void*)_VSTD::addressof(*__hold.get()))
_FF(_VSTD::forward<_Fp>(__f), _Alloc(__a));
__f_ = _VSTD::addressof(*__hold.release());
}
__packaged_task_function<_Rp(_ArgTypes...)>&
__packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&& __f) _NOEXCEPT
{
- if (__f_ == (__base*)&__buf_)
+ if (__f_ == __get_buf())
__f_->destroy();
else if (__f_)
__f_->destroy_deallocate();
__f_ = nullptr;
if (__f.__f_ == nullptr)
__f_ = nullptr;
- else if (__f.__f_ == (__base*)&__f.__buf_)
+ else if (__f.__f_ == __f.__get_buf())
{
- __f_ = (__base*)&__buf_;
- __f.__f_->__move_to(__f_);
+ __f.__f_->__move_to(__get_buf());
+ __f_ = __get_buf();
}
else
{
template<class _Rp, class ..._ArgTypes>
__packaged_task_function<_Rp(_ArgTypes...)>::~__packaged_task_function()
{
- if (__f_ == (__base*)&__buf_)
+ if (__f_ == __get_buf())
__f_->destroy();
else if (__f_)
__f_->destroy_deallocate();
}
template<class _Rp, class ..._ArgTypes>
+_LIBCPP_NO_CFI
void
__packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f) _NOEXCEPT
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__p_.set_value(__f_(_VSTD::forward<_ArgTypes>(__args)...));
#ifndef _LIBCPP_NO_EXCEPTIONS
}
{
__p_.set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template<class _Rp, class ..._ArgTypes>
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__p_.set_value_at_thread_exit(__f_(_VSTD::forward<_ArgTypes>(__args)...));
#ifndef _LIBCPP_NO_EXCEPTIONS
}
{
__p_.set_exception_at_thread_exit(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template<class _Rp, class ..._ArgTypes>
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__f_(_VSTD::forward<_ArgTypes>(__args)...);
__p_.set_value();
#ifndef _LIBCPP_NO_EXCEPTIONS
{
__p_.set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template<class ..._ArgTypes>
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__f_(_VSTD::forward<_ArgTypes>(__args)...);
__p_.set_value_at_thread_exit();
#ifndef _LIBCPP_NO_EXCEPTIONS
{
__p_.set_exception_at_thread_exit(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template<class ..._ArgTypes>
__p_ = promise<result_type>();
}
-template <class _Callable>
+template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
void
-swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y) _NOEXCEPT
+swap(packaged_task<_Rp(_ArgTypes...)>& __x, packaged_task<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
{
__x.swap(__y);
}
template <class _Rp, class _Fp>
_LIBCPP_INLINE_VISIBILITY future<_Rp>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__make_deferred_assoc_state(_Fp&& __f)
-#else
-__make_deferred_assoc_state(_Fp __f)
-#endif
{
unique_ptr<__deferred_assoc_state<_Rp, _Fp>, __release_shared_count>
__h(new __deferred_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));
template <class _Rp, class _Fp>
_LIBCPP_INLINE_VISIBILITY future<_Rp>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__make_async_assoc_state(_Fp&& __f)
-#else
-__make_async_assoc_state(_Fp __f)
-#endif
{
unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count>
__h(new __async_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));
return future<_Rp>(__h.get());
}
+#ifndef _LIBCPP_CXX03_LANG
+
template <class _Fp, class... _Args>
class _LIBCPP_HIDDEN __async_func
{
_Rp
__execute(__tuple_indices<_Indices...>)
{
- return __invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
+ return _VSTD::__invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
}
};
{
#endif
if (__does_policy_contain(__policy, launch::async))
- return _VSTD::__make_async_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)),
- __decay_copy(_VSTD::forward<_Args>(__args))...));
+ return _VSTD::__make_async_assoc_state<_Rp>(_BF(_VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
+ _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch ( ... ) { if (__policy == launch::async) throw ; }
#endif
if (__does_policy_contain(__policy, launch::deferred))
- return _VSTD::__make_deferred_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)),
- __decay_copy(_VSTD::forward<_Args>(__args))...));
+ return _VSTD::__make_deferred_assoc_state<_Rp>(_BF(_VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
+ _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
return future<_Rp>{};
}
_VSTD::forward<_Args>(__args)...);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // C++03
// shared_future
_LIBCPP_INLINE_VISIBILITY
shared_future(const shared_future& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{if (__state_) __state_->__add_shared();}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future(future<_Rp>&& __f) _NOEXCEPT : __state_(__f.__state_)
{__f.__state_ = nullptr;}
_LIBCPP_INLINE_VISIBILITY
shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{__rhs.__state_ = nullptr;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~shared_future();
shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
{
- shared_future(std::move(__rhs)).swap(*this);
+ shared_future(_VSTD::move(__rhs)).swap(*this);
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
// retrieving the value
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
{if (__state_) __state_->__add_shared();}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future(future<_Rp&>&& __f) _NOEXCEPT : __state_(__f.__state_)
{__f.__state_ = nullptr;}
_LIBCPP_INLINE_VISIBILITY
shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{__rhs.__state_ = nullptr;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~shared_future();
shared_future& operator=(const shared_future& __rhs);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
{
- shared_future(std::move(__rhs)).swap(*this);
+ shared_future(_VSTD::move(__rhs)).swap(*this);
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
// retrieving the value
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
{if (__state_) __state_->__add_shared();}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future(future<void>&& __f) _NOEXCEPT : __state_(__f.__state_)
{__f.__state_ = nullptr;}
_LIBCPP_INLINE_VISIBILITY
shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{__rhs.__state_ = nullptr;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~shared_future();
shared_future& operator=(const shared_future& __rhs);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
{
- shared_future(std::move(__rhs)).swap(*this);
+ shared_future(_VSTD::move(__rhs)).swap(*this);
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
// retrieving the value
_LIBCPP_INLINE_VISIBILITY
return shared_future<_Rp&>(_VSTD::move(*this));
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
inline
shared_future<void>
future<void>::share() _NOEXCEPT
return shared_future<void>(_VSTD::move(*this));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
_LIBCPP_END_NAMESPACE_STD
#endif // !_LIBCPP_HAS_NO_THREADS
-#endif // _LIBCPP_FUTURE
+#endif // _LIBCPP_FUTURE
return __il.end();
}
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif // !defined(_LIBCPP_CXX03_LANG)
} // std
-#endif // _LIBCPP_INITIALIZER_LIST
+#endif // _LIBCPP_INITIALIZER_LIST
#endif // __cplusplus
-#endif // _LIBCPP_INTTYPES_H
+#endif // _LIBCPP_INTTYPES_H
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
{
__is.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return __is;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return __os;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
{
__is.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return __is;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return __os;
}
}
template <class _CharT, class _Traits, class _ForwardIterator>
-std::basic_ostream<_CharT, _Traits> &
+basic_ostream<_CharT, _Traits> &
__quoted_output ( basic_ostream<_CharT, _Traits> &__os,
_ForwardIterator __first, _ForwardIterator __last, _CharT __delim, _CharT __escape )
{
- _VSTD::basic_string<_CharT, _Traits> __str;
+ basic_string<_CharT, _Traits> __str;
__str.push_back(__delim);
for ( ; __first != __last; ++ __first )
{
__str.push_back(*__first);
}
__str.push_back(__delim);
- return __put_character_sequence(__os, __str.data(), __str.size());
+ return _VSTD::__put_character_sequence(__os, __str.data(), __str.size());
}
template <class _CharT, class _Traits, class _String>
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_IOMANIP
+#endif // _LIBCPP_IOMANIP
*/
#include <__config>
-#include <iosfwd>
#include <__locale>
+#include <iosfwd>
#include <system_error>
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
clear(__rdstate_);
}
-#if defined(_LIBCPP_CXX03_LANG)
-struct _LIBCPP_TYPE_VIS __cxx03_bool {
- typedef void (__cxx03_bool::*__bool_type)();
- void __true_value() {}
-};
-#endif
-
template <class _CharT, class _Traits>
class _LIBCPP_TEMPLATE_VIS basic_ios
: public ios_base
static_assert((is_same<_CharT, typename traits_type::char_type>::value),
"traits_type::char_type must be the same type as CharT");
- // __true_value will generate undefined references when linking unless
- // we give it internal linkage.
-
-#if defined(_LIBCPP_CXX03_LANG)
+#ifdef _LIBCPP_CXX03_LANG
+ // Preserve the ability to compare with literal 0,
+ // and implicitly convert to bool, but not implicitly convert to int.
_LIBCPP_INLINE_VISIBILITY
- operator __cxx03_bool::__bool_type() const {
- return !fail() ? &__cxx03_bool::__true_value : nullptr;
- }
+ operator void*() const {return fail() ? nullptr : (void*)this;}
#else
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT operator bool() const {return !fail();}
+ explicit operator bool() const {return !fail();}
#endif
_LIBCPP_INLINE_VISIBILITY bool operator!() const {return fail();}
_LIBCPP_INLINE_VISIBILITY
void move(basic_ios& __rhs);
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void move(basic_ios&& __rhs) {move(__rhs);}
-#endif
_LIBCPP_INLINE_VISIBILITY
void swap(basic_ios& __rhs) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
{
ios_base::init(__sb);
- __tie_ = 0;
+ __tie_ = nullptr;
__fill_ = traits_type::eof();
}
{
ios_base::move(__rhs);
__tie_ = __rhs.__tie_;
- __rhs.__tie_ = 0;
+ __rhs.__tie_ = nullptr;
__fill_ = __rhs.__fill_;
}
return __str;
}
-template <class _CharT, class _Traits>
-class __save_flags
-{
- typedef basic_ios<_CharT, _Traits> __stream_type;
- typedef typename __stream_type::fmtflags fmtflags;
-
- __stream_type& __stream_;
- fmtflags __fmtflags_;
- _CharT __fill_;
-
- __save_flags(const __save_flags&);
- __save_flags& operator=(const __save_flags&);
-public:
- _LIBCPP_INLINE_VISIBILITY
- explicit __save_flags(__stream_type& __stream)
- : __stream_(__stream),
- __fmtflags_(__stream.flags()),
- __fill_(__stream.fill())
- {}
- _LIBCPP_INLINE_VISIBILITY
- ~__save_flags()
- {
- __stream_.flags(__fmtflags_);
- __stream_.fill(__fill_);
- }
-};
-
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_IOS
+#endif // _LIBCPP_IOS
typedef basic_fstream<wchar_t> wfstream;
template <class state> class fpos;
-typedef fpos<char_traits<char>::state_type> streampos;
-typedef fpos<char_traits<wchar_t>::state_type> wstreampos;
+using streampos = fpos<char_traits<char>::state_type>;
+using wstreampos = fpos<char_traits<wchar_t>::state_type>;
+using u8streampos = fpos<char_traits<char8_t>::state_type>; // C++20
+using u16streampos = fpos<char_traits<char16_t>::state_type>;
+using u32streampos = fpos<char_traits<char32_t>::state_type>;
} // std
template<class _CharT> struct _LIBCPP_TEMPLATE_VIS char_traits;
template<> struct char_traits<char>;
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
template<> struct char_traits<char8_t>;
#endif
template<> struct char_traits<char16_t>;
typedef basic_ofstream<wchar_t> wofstream;
typedef basic_fstream<wchar_t> wfstream;
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_PREFERRED_NAME(wios) basic_ios;
+
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_PREFERRED_NAME(wstreambuf) basic_streambuf;
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_PREFERRED_NAME(wistream) basic_istream;
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_PREFERRED_NAME(wostream) basic_ostream;
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_PREFERRED_NAME(wiostream) basic_iostream;
+
+template <class _CharT, class _Traits, class _Allocator>
+ class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_PREFERRED_NAME(wstringbuf) basic_stringbuf;
+template <class _CharT, class _Traits, class _Allocator>
+ class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_PREFERRED_NAME(wistringstream) basic_istringstream;
+template <class _CharT, class _Traits, class _Allocator>
+ class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_PREFERRED_NAME(wostringstream) basic_ostringstream;
+template <class _CharT, class _Traits, class _Allocator>
+ class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_PREFERRED_NAME(wstringstream) basic_stringstream;
+
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_PREFERRED_NAME(wfilebuf) basic_filebuf;
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_PREFERRED_NAME(wifstream) basic_ifstream;
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_PREFERRED_NAME(wofstream) basic_ofstream;
+template <class _CharT, class _Traits>
+ class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_PREFERRED_NAME(wfstream) basic_fstream;
+
template <class _State> class _LIBCPP_TEMPLATE_VIS fpos;
typedef fpos<mbstate_t> streampos;
typedef fpos<mbstate_t> wstreampos;
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
typedef fpos<mbstate_t> u8streampos;
#endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef fpos<mbstate_t> u16streampos;
typedef fpos<mbstate_t> u32streampos;
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
#if defined(_NEWLIB_VERSION)
// On newlib, off_t is 'long int'
typedef basic_string<char, char_traits<char>, allocator<char> > string;
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
+template <class _CharT, class _Traits, class _Allocator>
+ class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_PREFERRED_NAME(wstring) basic_string;
// Include other forward declarations here
template <class _Tp, class _Alloc = allocator<_Tp> >
class _LIBCPP_TEMPLATE_VIS vector;
+template <class _CharT, class _Traits>
+class __save_flags
+{
+ typedef basic_ios<_CharT, _Traits> __stream_type;
+ typedef typename __stream_type::fmtflags fmtflags;
+
+ __stream_type& __stream_;
+ fmtflags __fmtflags_;
+ _CharT __fill_;
+
+ __save_flags(const __save_flags&);
+ __save_flags& operator=(const __save_flags&);
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __save_flags(__stream_type& __stream)
+ : __stream_(__stream),
+ __fmtflags_(__stream.flags()),
+ __fill_(__stream.fill())
+ {}
+ _LIBCPP_INLINE_VISIBILITY
+ ~__save_flags()
+ {
+ __stream_.flags(__fmtflags_);
+ __stream_.fill(__fill_);
+ }
+};
+
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_IOSFWD
+#endif // _LIBCPP_IOSFWD
iostream synopsis
#include <ios>
-#include <streambuf>
#include <istream>
#include <ostream>
+#include <streambuf>
namespace std {
#include <__config>
#include <ios>
-#include <streambuf>
#include <istream>
#include <ostream>
+#include <streambuf>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_IOSTREAM
+#endif // _LIBCPP_IOSTREAM
basic_istream<charT,traits>&
ws(basic_istream<charT,traits>& is);
-template <class charT, class traits, class T>
- basic_istream<charT, traits>&
- operator>>(basic_istream<charT, traits>&& is, T& x);
+// rvalue stream extraction
+template <class Stream, class T>
+ Stream&& operator>>(Stream&& is, T&& x);
} // std
*/
#include <__config>
-#include <version>
+#include <__utility/forward.h>
#include <ostream>
+#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
{ this->init(__sb); }
virtual ~basic_istream();
protected:
-#ifndef _LIBCPP_CXX03_LANG
inline _LIBCPP_INLINE_VISIBILITY
basic_istream(basic_istream&& __rhs);
// 27.7.1.1.2 Assign/swap:
inline _LIBCPP_INLINE_VISIBILITY
basic_istream& operator=(basic_istream&& __rhs);
-#endif
inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
void swap(basic_istream& __rhs) {
basic_ios<char_type, traits_type>::swap(__rhs);
}
-#ifndef _LIBCPP_CXX03_LANG
basic_istream (const basic_istream& __rhs) = delete;
basic_istream& operator=(const basic_istream& __rhs) = delete;
-#endif
public:
// 27.7.1.1.3 Prefix/suffix:
// ~sentry() = default;
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT
- operator bool() const {return __ok_;}
+ explicit operator bool() const {return __ok_;}
};
template <class _CharT, class _Traits>
__is.setstate(ios_base::failbit);
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
: __gc_(__rhs.__gc_)
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
basic_istream<_CharT, _Traits>::~basic_istream()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef num_get<_CharT, _Ip> _Fp;
use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef num_get<_CharT, _Ip> _Fp;
long __temp;
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__is.setstate(__state);
}
return __is;
return __is >> (char*)__s;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER > 17
template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
else
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
__state |= ios_base::badbit;
// according to the spec, exceptions here are caught but not rethrown
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (__gc_ == 0)
__state |= ios_base::failbit;
this->setstate(__state);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
if (__n > 0)
*__s = char_type();
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (__n == numeric_limits<streamsize>::max())
{
while (true)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__r = this->rdbuf()->sgetc();
if (traits_type::eq_int_type(__r, traits_type::eof()))
__state |= ios_base::eofbit;
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__gc_ = this->rdbuf()->sgetn(__s, __n);
if (__gc_ != __n)
__state |= ios_base::failbit | ios_base::eofbit;
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
else
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
streamsize __c = this->rdbuf()->in_avail();
switch (__c)
{
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
else
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
- if (this->rdbuf() == 0 || this->rdbuf()->sputbackc(__c) == traits_type::eof())
+#endif // _LIBCPP_NO_EXCEPTIONS
+ if (this->rdbuf() == nullptr || this->rdbuf()->sputbackc(__c) == traits_type::eof())
__state |= ios_base::badbit;
#ifndef _LIBCPP_NO_EXCEPTIONS
}
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
else
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
- if (this->rdbuf() == 0 || this->rdbuf()->sungetc() == traits_type::eof())
+#endif // _LIBCPP_NO_EXCEPTIONS
+ if (this->rdbuf() == nullptr || this->rdbuf()->sungetc() == traits_type::eof())
__state |= ios_base::badbit;
#ifndef _LIBCPP_NO_EXCEPTIONS
}
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
else
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
- if (this->rdbuf() == 0)
+#endif // _LIBCPP_NO_EXCEPTIONS
+ if (this->rdbuf() == nullptr)
return -1;
if (this->rdbuf()->pubsync() == -1)
{
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
__state |= ios_base::failbit;
#ifndef _LIBCPP_NO_EXCEPTIONS
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))
__state |= ios_base::failbit;
#ifndef _LIBCPP_NO_EXCEPTIONS
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
while (true)
{
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__is.setstate(__state);
}
return __is;
}
-#ifndef _LIBCPP_CXX03_LANG
+template <class _Stream, class _Tp, class = void>
+struct __is_istreamable : false_type { };
-template <class _CharT, class _Traits, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp&& __x)
+template <class _Stream, class _Tp>
+struct __is_istreamable<_Stream, _Tp, decltype(
+ declval<_Stream>() >> declval<_Tp>(), void()
+)> : true_type { };
+
+template <class _Stream, class _Tp, class = typename enable_if<
+ _And<is_base_of<ios_base, _Stream>,
+ __is_istreamable<_Stream&, _Tp&&> >::value
+>::type>
+_LIBCPP_INLINE_VISIBILITY
+_Stream&& operator>>(_Stream&& __is, _Tp&& __x)
{
__is >> _VSTD::forward<_Tp>(__x);
- return __is;
+ return _VSTD::move(__is);
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
class _LIBCPP_TEMPLATE_VIS basic_iostream
: public basic_istream<_CharT, _Traits>,
virtual ~basic_iostream();
protected:
-#ifndef _LIBCPP_CXX03_LANG
inline _LIBCPP_INLINE_VISIBILITY
basic_iostream(basic_iostream&& __rhs);
// assign/swap
inline _LIBCPP_INLINE_VISIBILITY
basic_iostream& operator=(basic_iostream&& __rhs);
-#endif
+
inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
void swap(basic_iostream& __rhs)
{ basic_istream<char_type, traits_type>::swap(__rhs); }
};
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
basic_iostream<_CharT, _Traits>::~basic_iostream()
{
return getline(__is, __str, __is.widen('\n'));
}
-#ifndef _LIBCPP_CXX03_LANG
-
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
return getline(__is, __str, __is.widen('\n'));
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits, size_t _Size>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
return __is;
}
-#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
-#endif
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_ISTREAM
+#endif // _LIBCPP_ISTREAM
/*
iterator synopsis
+#include <concepts>
+
namespace std
{
+template<class> struct incrementable_traits; // since C++20
+template<class T>
+ using iter_difference_t = see below; // since C++20
+
+template<class> struct indirectly_readable_traits; // since C++20
+template<class T>
+ using iter_value_t = see below; // since C++20
template<class Iterator>
-struct iterator_traits
-{
- typedef typename Iterator::difference_type difference_type;
- typedef typename Iterator::value_type value_type;
- typedef typename Iterator::pointer pointer;
- typedef typename Iterator::reference reference;
- typedef typename Iterator::iterator_category iterator_category;
-};
+struct iterator_traits;
template<class T>
-struct iterator_traits<T*>
-{
- typedef ptrdiff_t difference_type;
- typedef T value_type;
- typedef T* pointer;
- typedef T& reference;
- typedef random_access_iterator_tag iterator_category;
-};
+ requires is_object_v<T> // since C++20
+struct iterator_traits<T*>;
+
+template<dereferenceable T>
+ using iter_reference_t = decltype(*declval<T&>());
+
+namespace ranges::inline unspecified {
+ inline constexpr unspecified iter_move = unspecified; // since C++20, nodiscard as an extension
+}}
+
+template<dereferenceable T>
+ requires ...
+using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<T&>())); // since C++20
+
+// [iterator.concepts], iterator concepts
+// [iterator.concept.readable], concept indirectly_readable
+template<class In>
+ concept indirectly_readable = see below; // since C++20
+
+template<indirectly_readable T>
+ using iter_common_reference_t =
+ common_reference_t<iter_reference_t<T>, iter_value_t<T>&>; // since C++20
+
+// [iterator.concept.writable], concept indirectly_writable
+template<class Out, class T>
+ concept indirectly_writable = see below; // since C++20
+
+// [iterator.concept.winc], concept weakly_incrementable
+template<class I>
+ concept weakly_incrementable = see below; // since C++20
+
+// [iterator.concept.inc], concept incrementable
+template<class I>
+ concept incrementable = see below; // since C++20
+
+// [iterator.concept.iterator], concept input_or_output_iterator
+ template<class I>
+ concept input_or_output_iterator = see below; // since C++20
+
+// [iterator.concept.sentinel], concept sentinel_for
+template<class S, class I>
+ concept sentinel_for = see below; // since C++20
+
+// [iterator.concept.sizedsentinel], concept sized_sentinel_for
+template<class S, class I>
+ inline constexpr bool disable_sized_sentinel_for = false;
+
+template<class S, class I>
+ concept sized_sentinel_for = see below;
+
+// [iterator.concept.input], concept input_iterator
+template<class I>
+ concept input_iterator = see below; // since C++20
+
+// [iterator.concept.output], concept output_iterator
+template<class I, class T>
+ concept output_iterator = see below; // since C++20
+
+// [iterator.concept.forward], concept forward_iterator
+template<class I>
+ concept forward_iterator = see below; // since C++20
+
+// [iterator.concept.bidir], concept bidirectional_iterator
+template<class I>
+ concept bidirectional_iterator = see below; // since C++20
+
+// [iterator.concept.random.access], concept random_access_iterator
+template<class I>
+ concept random_access_iterator = see below; // since C++20
+
+// [indirectcallable]
+// [indirectcallable.indirectinvocable]
+template<class F, class I>
+ concept indirectly_unary_invocable = see below; // since C++20
+
+template<class F, class I>
+ concept indirectly_regular_unary_invocable = see below; // since C++20
+
+template<class F, class I>
+ concept indirect_unary_predicate = see below; // since C++20
+
+template<class F, class I1, class I2>
+ concept indirect_binary_predicate = see below; // since C++20
+
+template<class F, class I1, class I2 = I1>
+ concept indirect_equivalence_relation = see below; // since C++20
+
+template<class F, class I1, class I2 = I1>
+ concept indirect_strict_weak_order = see below; // since C++20
+
+template<class F, class... Is>
+ using indirect_result_t = see below; // since C++20
+
+// [projected], projected
+template<indirectly_readable I, indirectly_regular_unary_invocable<I> Proj>
+ struct projected; // since C++20
+
+template<weakly_incrementable I, indirectly_regular_unary_invocable<I> Proj>
+ struct incrementable_traits<projected<I, Proj>>; // since C++20
+
+// [alg.req.ind.move], concept indirectly_movable
+template<class In, class Out>
+ concept indirectly_movable = see below; // since C++20
+
+template<class In, class Out>
+ concept indirectly_movable_storable = see below; // since C++20
+
+// [alg.req.ind.swap], concept indirectly_swappable
+template<class I1, class I2 = I1>
+ concept indirectly_swappable = see below; // since C++20
+
+template<input_or_output_iterator I, sentinel_for<I> S>
+ requires (!same_as<I, S> && copyable<I>)
+class common_iterator; // since C++20
template<class Category, class T, class Distance = ptrdiff_t,
class Pointer = T*, class Reference = T&>
-struct iterator
+struct iterator // deprecated in C++17
{
typedef T value_type;
typedef Distance difference_type;
constexpr BidirectionalIterator prev(BidirectionalIterator x,
typename iterator_traits<BidirectionalIterator>::difference_type n = 1);
+// [range.iter.ops], range iterator operations
+namespace ranges {
+ // [range.iter.op.advance], ranges::advance
+ template<input_or_output_iterator I>
+ constexpr void advance(I& i, iter_difference_t<I> n); // since C++20
+ template<input_or_output_iterator I, sentinel_for<I> S>
+ constexpr void advance(I& i, S bound); // since C++20
+ template<input_or_output_iterator I, sentinel_for<I> S>
+ constexpr iter_difference_t<I> advance(I& i, iter_difference_t<I> n, S bound); // since C++20
+}
+
template <class Iterator>
class reverse_iterator
- : public iterator<typename iterator_traits<Iterator>::iterator_category,
+ : public iterator<typename iterator_traits<Iterator>::iterator_category, // until C++17
typename iterator_traits<Iterator>::value_type,
typename iterator_traits<Iterator>::difference_type,
typename iterator_traits<Iterator>::pointer,
template <class Container>
class back_insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void> // until C++17
{
protected:
Container* container;
public:
typedef Container container_type;
typedef void value_type;
- typedef void difference_type;
+ typedef void difference_type; // until C++20
+ typedef ptrdiff_t difference_type; // since C++20
typedef void reference;
typedef void pointer;
- explicit back_insert_iterator(Container& x);
- back_insert_iterator& operator=(const typename Container::value_type& value);
- back_insert_iterator& operator*();
- back_insert_iterator& operator++();
- back_insert_iterator operator++(int);
+ explicit back_insert_iterator(Container& x); // constexpr in C++20
+ back_insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20
+ back_insert_iterator& operator*(); // constexpr in C++20
+ back_insert_iterator& operator++(); // constexpr in C++20
+ back_insert_iterator operator++(int); // constexpr in C++20
};
-template <class Container> back_insert_iterator<Container> back_inserter(Container& x);
+template <class Container> back_insert_iterator<Container> back_inserter(Container& x); // constexpr in C++20
template <class Container>
class front_insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void> // until C++17
{
protected:
Container* container;
public:
typedef Container container_type;
typedef void value_type;
- typedef void difference_type;
+ typedef void difference_type; // until C++20
+ typedef ptrdiff_t difference_type; // since C++20
typedef void reference;
typedef void pointer;
- explicit front_insert_iterator(Container& x);
- front_insert_iterator& operator=(const typename Container::value_type& value);
- front_insert_iterator& operator*();
- front_insert_iterator& operator++();
- front_insert_iterator operator++(int);
+ explicit front_insert_iterator(Container& x); // constexpr in C++20
+ front_insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20
+ front_insert_iterator& operator*(); // constexpr in C++20
+ front_insert_iterator& operator++(); // constexpr in C++20
+ front_insert_iterator operator++(int); // constexpr in C++20
};
-template <class Container> front_insert_iterator<Container> front_inserter(Container& x);
+template <class Container> front_insert_iterator<Container> front_inserter(Container& x); // constexpr in C++20
template <class Container>
class insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void> // until C++17
{
protected:
Container* container;
public:
typedef Container container_type;
typedef void value_type;
- typedef void difference_type;
+ typedef void difference_type; // until C++20
+ typedef ptrdiff_t difference_type; // since C++20
typedef void reference;
typedef void pointer;
- insert_iterator(Container& x, typename Container::iterator i);
- insert_iterator& operator=(const typename Container::value_type& value);
- insert_iterator& operator*();
- insert_iterator& operator++();
- insert_iterator& operator++(int);
+ insert_iterator(Container& x, typename Container::iterator i); // constexpr in C++20
+ insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20
+ insert_iterator& operator*(); // constexpr in C++20
+ insert_iterator& operator++(); // constexpr in C++20
+ insert_iterator& operator++(int); // constexpr in C++20
};
template <class Container, class Iterator>
-insert_iterator<Container> inserter(Container& x, Iterator i);
+insert_iterator<Container> inserter(Container& x, Iterator i); // constexpr in C++20
template <class Iterator>
class move_iterator {
template <class Iterator> // constexpr in C++17
constexpr move_iterator<Iterator> make_move_iterator(const Iterator& i);
+// [default.sentinel], default sentinel
+struct default_sentinel_t;
+inline constexpr default_sentinel_t default_sentinel{};
+
+// [iterators.counted], counted iterators
+template<input_or_output_iterator I> class counted_iterator;
+
+template<input_iterator I>
+ requires see below
+ struct iterator_traits<counted_iterator<I>>;
template <class T, class charT = char, class traits = char_traits<charT>, class Distance = ptrdiff_t>
class istream_iterator
- : public iterator<input_iterator_tag, T, Distance, const T*, const T&>
+ : public iterator<input_iterator_tag, T, Distance, const T*, const T&> // until C++17
{
public:
- typedef charT char_type;
- typedef traits traits_type;
- typedef basic_istream<charT,traits> istream_type;
+ typedef input_iterator_tag iterator_category;
+ typedef T value_type;
+ typedef Distance difference_type;
+ typedef const T* pointer;
+ typedef const T& reference;
+
+ typedef charT char_type;
+ typedef traits traits_type;
+ typedef basic_istream<charT, traits> istream_type;
constexpr istream_iterator();
istream_iterator(istream_type& s);
template <class T, class charT = char, class traits = char_traits<charT> >
class ostream_iterator
- : public iterator<output_iterator_tag, void, void, void ,void>
+ : public iterator<output_iterator_tag, void, void, void, void> // until C++17
{
public:
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type; // until C++20
+ typedef ptrdiff_t difference_type; // since C++20
+ typedef void pointer;
+ typedef void reference;
+
typedef charT char_type;
typedef traits traits_type;
typedef basic_ostream<charT,traits> ostream_type;
template<class charT, class traits = char_traits<charT> >
class istreambuf_iterator
- : public iterator<input_iterator_tag, charT,
- typename traits::off_type, unspecified,
- charT>
+ : public iterator<input_iterator_tag, charT, traits::off_type, unspecified, charT> // until C++17
{
public:
- typedef charT char_type;
- typedef traits traits_type;
- typedef typename traits::int_type int_type;
- typedef basic_streambuf<charT,traits> streambuf_type;
- typedef basic_istream<charT,traits> istream_type;
+ typedef input_iterator_tag iterator_category;
+ typedef charT value_type;
+ typedef traits::off_type difference_type;
+ typedef unspecified pointer;
+ typedef charT reference;
+
+ typedef charT char_type;
+ typedef traits traits_type;
+ typedef traits::int_type int_type;
+ typedef basic_streambuf<charT, traits> streambuf_type;
+ typedef basic_istream<charT, traits> istream_type;
istreambuf_iterator() noexcept;
istreambuf_iterator(istream_type& s) noexcept;
template <class charT, class traits = char_traits<charT> >
class ostreambuf_iterator
- : public iterator<output_iterator_tag, void, void, void, void>
+ : public iterator<output_iterator_tag, void, void, void, void> // until C++17
{
public:
- typedef charT char_type;
- typedef traits traits_type;
- typedef basic_streambuf<charT,traits> streambuf_type;
- typedef basic_ostream<charT,traits> ostream_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type; // until C++20
+ typedef ptrdiff_t difference_type; // since C++20
+ typedef void pointer;
+ typedef void reference;
+
+ typedef charT char_type;
+ typedef traits traits_type;
+ typedef basic_streambuf<charT, traits> streambuf_type;
+ typedef basic_ostream<charT, traits> ostream_type;
ostreambuf_iterator(ostream_type& s) noexcept;
ostreambuf_iterator(streambuf_type* s) noexcept;
template <class T, size_t N> constexpr size_t size(const T (&array)[N]) noexcept; // C++17
template <class C> constexpr auto ssize(const C& c)
- -> common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>; // C++20
+ -> common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>; // C++20
template <class T, ptrdiff_t> constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; // C++20
template <class C> constexpr auto empty(const C& c) -> decltype(c.empty()); // C++17
*/
#include <__config>
-#include <iosfwd> // for forward declarations of vector and string.
+#include <__debug>
#include <__functional_base>
-#include <type_traits>
+#include <__iterator/access.h>
+#include <__iterator/advance.h>
+#include <__iterator/back_insert_iterator.h>
+#include <__iterator/common_iterator.h>
+#include <__iterator/concepts.h>
+#include <__iterator/counted_iterator.h>
+#include <__iterator/data.h>
+#include <__iterator/default_sentinel.h>
+#include <__iterator/distance.h>
+#include <__iterator/empty.h>
+#include <__iterator/erase_if_container.h>
+#include <__iterator/front_insert_iterator.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/insert_iterator.h>
+#include <__iterator/istreambuf_iterator.h>
+#include <__iterator/istream_iterator.h>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/move_iterator.h>
+#include <__iterator/next.h>
+#include <__iterator/ostreambuf_iterator.h>
+#include <__iterator/ostream_iterator.h>
+#include <__iterator/prev.h>
+#include <__iterator/projected.h>
+#include <__iterator/readable_traits.h>
+#include <__iterator/reverse_access.h>
+#include <__iterator/reverse_iterator.h>
+#include <__iterator/size.h>
+#include <__iterator/wrap_iter.h>
+#include <__memory/addressof.h>
+#include <__memory/pointer_traits.h>
+#include <__utility/forward.h>
+#include <compare>
+#include <concepts> // Mandated by the Standard.
#include <cstddef>
#include <initializer_list>
+#include <type_traits>
#include <version>
-#ifdef __APPLE__
-#include <Availability.h>
-#endif
-
-#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
-_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Iter>
-struct _LIBCPP_TEMPLATE_VIS iterator_traits;
-
-struct _LIBCPP_TEMPLATE_VIS input_iterator_tag {};
-struct _LIBCPP_TEMPLATE_VIS output_iterator_tag {};
-struct _LIBCPP_TEMPLATE_VIS forward_iterator_tag : public input_iterator_tag {};
-struct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
-struct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
-#if _LIBCPP_STD_VER > 17
-// TODO(EricWF) contiguous_iterator_tag is provided as an extension prior to
-// C++20 to allow optimizations for users providing wrapped iterator types.
-struct _LIBCPP_TEMPLATE_VIS contiguous_iterator_tag: public random_access_iterator_tag { };
-#endif
-
-template <class _Iter>
-struct __iter_traits_cache {
- using type = _If<
- __is_primary_template<iterator_traits<_Iter> >::value,
- _Iter,
- iterator_traits<_Iter>
- >;
-};
-template <class _Iter>
-using _ITER_TRAITS = typename __iter_traits_cache<_Iter>::type;
-
-struct __iter_concept_concept_test {
- template <class _Iter>
- using _Apply = typename _ITER_TRAITS<_Iter>::iterator_concept;
-};
-struct __iter_concept_category_test {
- template <class _Iter>
- using _Apply = typename _ITER_TRAITS<_Iter>::iterator_category;
-};
-struct __iter_concept_random_fallback {
- template <class _Iter>
- using _Apply = _EnableIf<
- __is_primary_template<iterator_traits<_Iter> >::value,
- random_access_iterator_tag
- >;
-};
-
-template <class _Iter, class _Tester> struct __test_iter_concept
- : _IsValidExpansion<_Tester::template _Apply, _Iter>,
- _Tester
-{
-};
-
-template <class _Iter>
-struct __iter_concept_cache {
- using type = _Or<
- __test_iter_concept<_Iter, __iter_concept_concept_test>,
- __test_iter_concept<_Iter, __iter_concept_category_test>,
- __test_iter_concept<_Iter, __iter_concept_random_fallback>
- >;
-};
-
-template <class _Iter>
-using _ITER_CONCEPT = typename __iter_concept_cache<_Iter>::type::template _Apply<_Iter>;
-
-
-template <class _Tp>
-struct __has_iterator_typedefs
-{
-private:
- struct __two {char __lx; char __lxx;};
- template <class _Up> static __two __test(...);
- template <class _Up> static char __test(typename std::__void_t<typename _Up::iterator_category>::type* = 0,
- typename std::__void_t<typename _Up::difference_type>::type* = 0,
- typename std::__void_t<typename _Up::value_type>::type* = 0,
- typename std::__void_t<typename _Up::reference>::type* = 0,
- typename std::__void_t<typename _Up::pointer>::type* = 0
- );
-public:
- static const bool value = sizeof(__test<_Tp>(0,0,0,0,0)) == 1;
-};
-
-
-template <class _Tp>
-struct __has_iterator_category
-{
-private:
- struct __two {char __lx; char __lxx;};
- template <class _Up> static __two __test(...);
- template <class _Up> static char __test(typename _Up::iterator_category* = 0);
-public:
- static const bool value = sizeof(__test<_Tp>(0)) == 1;
-};
-
-template <class _Iter, bool> struct __iterator_traits_impl {};
-
-template <class _Iter>
-struct __iterator_traits_impl<_Iter, true>
-{
- typedef typename _Iter::difference_type difference_type;
- typedef typename _Iter::value_type value_type;
- typedef typename _Iter::pointer pointer;
- typedef typename _Iter::reference reference;
- typedef typename _Iter::iterator_category iterator_category;
-};
-
-template <class _Iter, bool> struct __iterator_traits {};
-
-template <class _Iter>
-struct __iterator_traits<_Iter, true>
- : __iterator_traits_impl
- <
- _Iter,
- is_convertible<typename _Iter::iterator_category, input_iterator_tag>::value ||
- is_convertible<typename _Iter::iterator_category, output_iterator_tag>::value
- >
-{};
-
-// iterator_traits<Iterator> will only have the nested types if Iterator::iterator_category
-// exists. Else iterator_traits<Iterator> will be an empty class. This is a
-// conforming extension which allows some programs to compile and behave as
-// the client expects instead of failing at compile time.
-
-template <class _Iter>
-struct _LIBCPP_TEMPLATE_VIS iterator_traits
- : __iterator_traits<_Iter, __has_iterator_typedefs<_Iter>::value> {
-
- using __primary_template = iterator_traits;
-};
-
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
-{
- typedef ptrdiff_t difference_type;
- typedef typename remove_cv<_Tp>::type value_type;
- typedef _Tp* pointer;
- typedef _Tp& reference;
- typedef random_access_iterator_tag iterator_category;
-#if _LIBCPP_STD_VER > 17
- typedef contiguous_iterator_tag iterator_concept;
-#endif
-};
-
-template <class _Tp, class _Up, bool = __has_iterator_category<iterator_traits<_Tp> >::value>
-struct __has_iterator_category_convertible_to
- : public integral_constant<bool, is_convertible<typename iterator_traits<_Tp>::iterator_category, _Up>::value>
-{};
-
-template <class _Tp, class _Up>
-struct __has_iterator_category_convertible_to<_Tp, _Up, false> : public false_type {};
-
-template <class _Tp>
-struct __is_cpp17_input_iterator : public __has_iterator_category_convertible_to<_Tp, input_iterator_tag> {};
-
-template <class _Tp>
-struct __is_cpp17_forward_iterator : public __has_iterator_category_convertible_to<_Tp, forward_iterator_tag> {};
-
-template <class _Tp>
-struct __is_cpp17_bidirectional_iterator : public __has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag> {};
-
-template <class _Tp>
-struct __is_cpp17_random_access_iterator : public __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag> {};
-
-#if _LIBCPP_STD_VER > 17
-template <class _Tp>
-struct __is_cpp17_contiguous_iterator : public __has_iterator_category_convertible_to<_Tp, contiguous_iterator_tag> {};
-#else
-template <class _Tp>
-struct __is_cpp17_contiguous_iterator : public false_type {};
-#endif
-
-
-template <class _Tp>
-struct __is_exactly_cpp17_input_iterator
- : public integral_constant<bool,
- __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
- !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
-
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-template<class _InputIterator>
-using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
-
-template<class _InputIterator>
-using __iter_key_type = remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>;
-
-template<class _InputIterator>
-using __iter_mapped_type = typename iterator_traits<_InputIterator>::value_type::second_type;
-
-template<class _InputIterator>
-using __iter_to_alloc_type = pair<
- add_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>,
- typename iterator_traits<_InputIterator>::value_type::second_type>;
-#endif
-
-template<class _Category, class _Tp, class _Distance = ptrdiff_t,
- class _Pointer = _Tp*, class _Reference = _Tp&>
-struct _LIBCPP_TEMPLATE_VIS iterator
-{
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Pointer pointer;
- typedef _Reference reference;
- typedef _Category iterator_category;
-};
-
-template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-void __advance(_InputIter& __i,
- typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag)
-{
- for (; __n > 0; --__n)
- ++__i;
-}
-
-template <class _BiDirIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-void __advance(_BiDirIter& __i,
- typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag)
-{
- if (__n >= 0)
- for (; __n > 0; --__n)
- ++__i;
- else
- for (; __n < 0; ++__n)
- --__i;
-}
-
-template <class _RandIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-void __advance(_RandIter& __i,
- typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag)
-{
- __i += __n;
-}
-
-template <class _InputIter, class _Distance>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-void advance(_InputIter& __i, _Distance __orig_n)
-{
- _LIBCPP_ASSERT(__orig_n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
- "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
- typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
- _IntegralSize __n = __orig_n;
- __advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
-}
-
-template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-typename iterator_traits<_InputIter>::difference_type
-__distance(_InputIter __first, _InputIter __last, input_iterator_tag)
-{
- typename iterator_traits<_InputIter>::difference_type __r(0);
- for (; __first != __last; ++__first)
- ++__r;
- return __r;
-}
-
-template <class _RandIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-typename iterator_traits<_RandIter>::difference_type
-__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
-{
- return __last - __first;
-}
-
-template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-typename iterator_traits<_InputIter>::difference_type
-distance(_InputIter __first, _InputIter __last)
-{
- return __distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
-}
-
-template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-typename enable_if
-<
- __is_cpp17_input_iterator<_InputIter>::value,
- _InputIter
->::type
-next(_InputIter __x,
- typename iterator_traits<_InputIter>::difference_type __n = 1)
-{
- _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
- "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
-
- _VSTD::advance(__x, __n);
- return __x;
-}
-
-template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-typename enable_if
-<
- __is_cpp17_input_iterator<_InputIter>::value,
- _InputIter
->::type
-prev(_InputIter __x,
- typename iterator_traits<_InputIter>::difference_type __n = 1)
-{
- _LIBCPP_ASSERT(__n <= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
- "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
- _VSTD::advance(__x, -__n);
- return __x;
-}
-
-
-template <class _Tp, class = void>
-struct __is_stashing_iterator : false_type {};
-
-template <class _Tp>
-struct __is_stashing_iterator<_Tp, typename __void_t<typename _Tp::__stashing_iterator_tag>::type>
- : true_type {};
-
-template <class _Iter>
-class _LIBCPP_TEMPLATE_VIS reverse_iterator
- : public iterator<typename iterator_traits<_Iter>::iterator_category,
- typename iterator_traits<_Iter>::value_type,
- typename iterator_traits<_Iter>::difference_type,
- typename iterator_traits<_Iter>::pointer,
- typename iterator_traits<_Iter>::reference>
-{
-private:
- /*mutable*/ _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break
-
- static_assert(!__is_stashing_iterator<_Iter>::value,
- "The specified iterator type cannot be used with reverse_iterator; "
- "Using stashing iterators with reverse_iterator causes undefined behavior");
-
-protected:
- _Iter current;
-public:
- typedef _Iter iterator_type;
- typedef typename iterator_traits<_Iter>::difference_type difference_type;
- typedef typename iterator_traits<_Iter>::reference reference;
- typedef typename iterator_traits<_Iter>::pointer pointer;
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator() : __t(), current() {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator(const reverse_iterator<_Up>& __u) : __t(__u.base()), current(__u.base()) {}
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator& operator=(const reverse_iterator<_Up>& __u)
- { __t = current = __u.base(); return *this; }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- _Iter base() const {return current;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reference operator*() const {_Iter __tmp = current; return *--__tmp;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- pointer operator->() const {return _VSTD::addressof(operator*());}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator& operator++() {--current; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator operator++(int) {reverse_iterator __tmp(*this); --current; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator& operator--() {++current; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator operator--(int) {reverse_iterator __tmp(*this); ++current; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator operator+ (difference_type __n) const {return reverse_iterator(current - __n);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator& operator+=(difference_type __n) {current -= __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator operator- (difference_type __n) const {return reverse_iterator(current + __n);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reference operator[](difference_type __n) const {return *(*this + __n);}
-};
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-{
- return __x.base() == __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-{
- return __x.base() > __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-{
- return __x.base() != __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-{
- return __x.base() < __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-{
- return __x.base() <= __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-{
- return __x.base() >= __y.base();
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto
-operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
--> decltype(__y.base() - __x.base())
-{
- return __y.base() - __x.base();
-}
-#else
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename reverse_iterator<_Iter1>::difference_type
-operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-{
- return __y.base() - __x.base();
-}
-#endif
-
-template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-reverse_iterator<_Iter>
-operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x)
-{
- return reverse_iterator<_Iter>(__x.base() - __n);
-}
-
-#if _LIBCPP_STD_VER > 11
-template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-reverse_iterator<_Iter> make_reverse_iterator(_Iter __i)
-{
- return reverse_iterator<_Iter>(__i);
-}
-#endif
-
-template <class _Container>
-class _LIBCPP_TEMPLATE_VIS back_insert_iterator
- : public iterator<output_iterator_tag,
- void,
- void,
- void,
- void>
-{
-protected:
- _Container* container;
-public:
- typedef _Container container_type;
-
- _LIBCPP_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
- _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value_)
- {container->push_back(__value_); return *this;}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value_)
- {container->push_back(_VSTD::move(__value_)); return *this;}
-#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*() {return *this;}
- _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++() {return *this;}
- _LIBCPP_INLINE_VISIBILITY back_insert_iterator operator++(int) {return *this;}
-};
-
-template <class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
-back_insert_iterator<_Container>
-back_inserter(_Container& __x)
-{
- return back_insert_iterator<_Container>(__x);
-}
-
-template <class _Container>
-class _LIBCPP_TEMPLATE_VIS front_insert_iterator
- : public iterator<output_iterator_tag,
- void,
- void,
- void,
- void>
-{
-protected:
- _Container* container;
-public:
- typedef _Container container_type;
-
- _LIBCPP_INLINE_VISIBILITY explicit front_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
- _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(const typename _Container::value_type& __value_)
- {container->push_front(__value_); return *this;}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value_)
- {container->push_front(_VSTD::move(__value_)); return *this;}
-#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*() {return *this;}
- _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++() {return *this;}
- _LIBCPP_INLINE_VISIBILITY front_insert_iterator operator++(int) {return *this;}
-};
-
-template <class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
-front_insert_iterator<_Container>
-front_inserter(_Container& __x)
-{
- return front_insert_iterator<_Container>(__x);
-}
-
-template <class _Container>
-class _LIBCPP_TEMPLATE_VIS insert_iterator
- : public iterator<output_iterator_tag,
- void,
- void,
- void,
- void>
-{
-protected:
- _Container* container;
- typename _Container::iterator iter;
-public:
- typedef _Container container_type;
-
- _LIBCPP_INLINE_VISIBILITY insert_iterator(_Container& __x, typename _Container::iterator __i)
- : container(_VSTD::addressof(__x)), iter(__i) {}
- _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(const typename _Container::value_type& __value_)
- {iter = container->insert(iter, __value_); ++iter; return *this;}
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value_)
- {iter = container->insert(iter, _VSTD::move(__value_)); ++iter; return *this;}
-#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY insert_iterator& operator*() {return *this;}
- _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++() {return *this;}
- _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++(int) {return *this;}
-};
-
-template <class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
-insert_iterator<_Container>
-inserter(_Container& __x, typename _Container::iterator __i)
-{
- return insert_iterator<_Container>(__x, __i);
-}
-
-template <class _Tp, class _CharT = char,
- class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
-class _LIBCPP_TEMPLATE_VIS istream_iterator
- : public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
-{
-public:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef basic_istream<_CharT,_Traits> istream_type;
-private:
- istream_type* __in_stream_;
- _Tp __value_;
-public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {}
- _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))
- {
- if (!(*__in_stream_ >> __value_))
- __in_stream_ = 0;
- }
-
- _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}
- _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return _VSTD::addressof((operator*()));}
- _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()
- {
- if (!(*__in_stream_ >> __value_))
- __in_stream_ = 0;
- return *this;
- }
- _LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int)
- {istream_iterator __t(*this); ++(*this); return __t;}
-
- template <class _Up, class _CharU, class _TraitsU, class _DistanceU>
- friend _LIBCPP_INLINE_VISIBILITY
- bool
- operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
- const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
-
- template <class _Up, class _CharU, class _TraitsU, class _DistanceU>
- friend _LIBCPP_INLINE_VISIBILITY
- bool
- operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
- const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
-};
-
-template <class _Tp, class _CharT, class _Traits, class _Distance>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
- const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y)
-{
- return __x.__in_stream_ == __y.__in_stream_;
-}
-
-template <class _Tp, class _CharT, class _Traits, class _Distance>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
- const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y)
-{
- return !(__x == __y);
-}
-
-template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
-class _LIBCPP_TEMPLATE_VIS ostream_iterator
- : public iterator<output_iterator_tag, void, void, void, void>
-{
-public:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef basic_ostream<_CharT,_Traits> ostream_type;
-private:
- ostream_type* __out_stream_;
- const char_type* __delim_;
-public:
- _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT
- : __out_stream_(_VSTD::addressof(__s)), __delim_(0) {}
- _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT
- : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}
- _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)
- {
- *__out_stream_ << __value_;
- if (__delim_)
- *__out_stream_ << __delim_;
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator*() {return *this;}
- _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++() {return *this;}
- _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++(int) {return *this;}
-};
-
-template<class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS istreambuf_iterator
- : public iterator<input_iterator_tag, _CharT,
- typename _Traits::off_type, _CharT*,
- _CharT>
-{
-public:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef typename _Traits::int_type int_type;
- typedef basic_streambuf<_CharT,_Traits> streambuf_type;
- typedef basic_istream<_CharT,_Traits> istream_type;
-private:
- mutable streambuf_type* __sbuf_;
-
- class __proxy
- {
- char_type __keep_;
- streambuf_type* __sbuf_;
- _LIBCPP_INLINE_VISIBILITY __proxy(char_type __c, streambuf_type* __s)
- : __keep_(__c), __sbuf_(__s) {}
- friend class istreambuf_iterator;
- public:
- _LIBCPP_INLINE_VISIBILITY char_type operator*() const {return __keep_;}
- };
-
- _LIBCPP_INLINE_VISIBILITY
- bool __test_for_eof() const
- {
- if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
- __sbuf_ = 0;
- return __sbuf_ == 0;
- }
-public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {}
- _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
- : __sbuf_(__s.rdbuf()) {}
- _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
- : __sbuf_(__s) {}
- _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT
- : __sbuf_(__p.__sbuf_) {}
-
- _LIBCPP_INLINE_VISIBILITY char_type operator*() const
- {return static_cast<char_type>(__sbuf_->sgetc());}
- _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
- {
- __sbuf_->sbumpc();
- return *this;
- }
- _LIBCPP_INLINE_VISIBILITY __proxy operator++(int)
- {
- return __proxy(__sbuf_->sbumpc(), __sbuf_);
- }
-
- _LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
- {return __test_for_eof() == __b.__test_for_eof();}
-};
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator==(const istreambuf_iterator<_CharT,_Traits>& __a,
- const istreambuf_iterator<_CharT,_Traits>& __b)
- {return __a.equal(__b);}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
- const istreambuf_iterator<_CharT,_Traits>& __b)
- {return !__a.equal(__b);}
-
-template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator
- : public iterator<output_iterator_tag, void, void, void, void>
-{
-public:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef basic_streambuf<_CharT,_Traits> streambuf_type;
- typedef basic_ostream<_CharT,_Traits> ostream_type;
-private:
- streambuf_type* __sbuf_;
-public:
- _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) _NOEXCEPT
- : __sbuf_(__s.rdbuf()) {}
- _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) _NOEXCEPT
- : __sbuf_(__s) {}
- _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
- {
- if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof()))
- __sbuf_ = 0;
- return *this;
- }
- _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}
- _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}
- _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
- _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;}
-
- template <class _Ch, class _Tr>
- friend
- _LIBCPP_HIDDEN
- ostreambuf_iterator<_Ch, _Tr>
- __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
- const _Ch* __ob, const _Ch* __op, const _Ch* __oe,
- ios_base& __iob, _Ch __fl);
-};
-
-template <class _Iter>
-class _LIBCPP_TEMPLATE_VIS move_iterator
-{
-private:
- _Iter __i;
-public:
- typedef _Iter iterator_type;
- typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
- typedef typename iterator_traits<iterator_type>::value_type value_type;
- typedef typename iterator_traits<iterator_type>::difference_type difference_type;
- typedef iterator_type pointer;
-#ifndef _LIBCPP_CXX03_LANG
- typedef typename iterator_traits<iterator_type>::reference __reference;
- typedef typename conditional<
- is_reference<__reference>::value,
- typename remove_reference<__reference>::type&&,
- __reference
- >::type reference;
-#else
- typedef typename iterator_traits<iterator_type>::reference reference;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator() : __i() {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- explicit move_iterator(_Iter __x) : __i(__x) {}
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _Iter base() const {return __i;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reference operator*() const { return static_cast<reference>(*__i); }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- pointer operator->() const { return __i;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator& operator++() {++__i; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator operator++(int) {move_iterator __tmp(*this); ++__i; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator& operator--() {--__i; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator operator--(int) {move_iterator __tmp(*this); --__i; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator operator+ (difference_type __n) const {return move_iterator(__i + __n);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator& operator+=(difference_type __n) {__i += __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator operator- (difference_type __n) const {return move_iterator(__i - __n);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- move_iterator& operator-=(difference_type __n) {__i -= __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- reference operator[](difference_type __n) const { return static_cast<reference>(__i[__n]); }
-};
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
-{
- return __x.base() == __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
-{
- return __x.base() < __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
-{
- return __x.base() != __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
-{
- return __x.base() > __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
-{
- return __x.base() >= __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-bool
-operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
-{
- return __x.base() <= __y.base();
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto
-operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
--> decltype(__x.base() - __y.base())
-{
- return __x.base() - __y.base();
-}
-#else
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename move_iterator<_Iter1>::difference_type
-operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
-{
- return __x.base() - __y.base();
-}
-#endif
-
-template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-move_iterator<_Iter>
-operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x)
-{
- return move_iterator<_Iter>(__x.base() + __n);
-}
-
-template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-move_iterator<_Iter>
-make_move_iterator(_Iter __i)
-{
- return move_iterator<_Iter>(__i);
-}
-
-// __wrap_iter
-
-template <class _Iter> class __wrap_iter;
-
-template <class _Iter1, class _Iter2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
-template <class _Iter1, class _Iter2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
-template <class _Iter1, class _Iter2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
-template <class _Iter1, class _Iter2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
-template <class _Iter1, class _Iter2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
-template <class _Iter1, class _Iter2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Iter1, class _Iter2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-auto
-operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
--> decltype(__x.base() - __y.base());
-#else
-template <class _Iter1, class _Iter2>
-_LIBCPP_INLINE_VISIBILITY
-typename __wrap_iter<_Iter1>::difference_type
-operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-#endif
-
-template <class _Iter>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-__wrap_iter<_Iter>
-operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
-
-template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy(_Ip, _Ip, _Op);
-template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy_backward(_B1, _B1, _B2);
-template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op);
-template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);
-
-#if _LIBCPP_DEBUG_LEVEL < 2
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-typename enable_if
-<
- is_trivially_copy_assignable<_Tp>::value,
- _Tp*
->::type
-__unwrap_iter(__wrap_iter<_Tp*>);
-
-#else
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-typename enable_if
-<
- is_trivially_copy_assignable<_Tp>::value,
- __wrap_iter<_Tp*>
->::type
-__unwrap_iter(__wrap_iter<_Tp*> __i);
-
-#endif
-
-template <class _Iter>
-class __wrap_iter
-{
-public:
- typedef _Iter iterator_type;
- typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
- typedef typename iterator_traits<iterator_type>::value_type value_type;
- typedef typename iterator_traits<iterator_type>::difference_type difference_type;
- typedef typename iterator_traits<iterator_type>::pointer pointer;
- typedef typename iterator_traits<iterator_type>::reference reference;
-private:
- iterator_type __i;
-public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
- : __i{}
-#endif
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
- }
- template <class _Up> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
- __wrap_iter(const __wrap_iter<_Up>& __u,
- typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
- : __i(__u.base())
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__iterator_copy(this, &__u);
-#endif
- }
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
- __wrap_iter(const __wrap_iter& __x)
- : __i(__x.base())
- {
- __get_db()->__iterator_copy(this, &__x);
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
- __wrap_iter& operator=(const __wrap_iter& __x)
- {
- if (this != &__x)
- {
- __get_db()->__iterator_copy(this, &__x);
- __i = __x.__i;
- }
- return *this;
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
- ~__wrap_iter()
- {
- __get_db()->__erase_i(this);
- }
-#endif
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable iterator");
-#endif
- return *__i;
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable iterator");
-#endif
- return (pointer)_VSTD::addressof(*__i);
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable iterator");
-#endif
- ++__i;
- return *this;
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator++(int) _NOEXCEPT
- {__wrap_iter __tmp(*this); ++(*this); return __tmp;}
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
- "Attempted to decrement non-decrementable iterator");
-#endif
- --__i;
- return *this;
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator--(int) _NOEXCEPT
- {__wrap_iter __tmp(*this); --(*this); return __tmp;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator+ (difference_type __n) const _NOEXCEPT
- {__wrap_iter __w(*this); __w += __n; return __w;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
- "Attempted to add/subtract iterator outside of valid range");
-#endif
- __i += __n;
- return *this;
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator- (difference_type __n) const _NOEXCEPT
- {return *this + (-__n);}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator-=(difference_type __n) _NOEXCEPT
- {*this += -__n; return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
- "Attempted to subscript iterator outside of valid range");
-#endif
- return __i[__n];
- }
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT {return __i;}
-
-private:
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
- {
- __get_db()->__insert_ic(this, __p);
- }
-#else
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
-#endif
-
- template <class _Up> friend class __wrap_iter;
- template <class _CharT, class _Traits, class _Alloc> friend class basic_string;
- template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;
- template <class _Tp, size_t> friend class _LIBCPP_TEMPLATE_VIS span;
-
- template <class _Iter1, class _Iter2>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- bool
- operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
- template <class _Iter1, class _Iter2>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- bool
- operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
- template <class _Iter1, class _Iter2>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- bool
- operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
- template <class _Iter1, class _Iter2>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- bool
- operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
- template <class _Iter1, class _Iter2>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- bool
- operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
- template <class _Iter1, class _Iter2>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- bool
- operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Iter1, class _Iter2>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- auto
- operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
- -> decltype(__x.base() - __y.base());
-#else
- template <class _Iter1, class _Iter2>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- typename __wrap_iter<_Iter1>::difference_type
- operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
-#endif
-
- template <class _Iter1>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- __wrap_iter<_Iter1>
- operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT;
-
- template <class _Ip, class _Op> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _Op copy(_Ip, _Ip, _Op);
- template <class _B1, class _B2> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _B2 copy_backward(_B1, _B1, _B2);
- template <class _Ip, class _Op> friend _Op move(_Ip, _Ip, _Op);
- template <class _B1, class _B2> friend _B2 move_backward(_B1, _B1, _B2);
-
-#if _LIBCPP_DEBUG_LEVEL < 2
- template <class _Tp>
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
- typename enable_if
- <
- is_trivially_copy_assignable<_Tp>::value,
- _Tp*
- >::type
- __unwrap_iter(__wrap_iter<_Tp*>);
-#else
- template <class _Tp>
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
- typename enable_if
- <
- is_trivially_copy_assignable<_Tp>::value,
- __wrap_iter<_Tp*>
- >::type
- __unwrap_iter(__wrap_iter<_Tp*> __i);
-#endif
-};
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
-{
- return __x.base() == __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
-{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
- "Attempted to compare incomparable iterators");
-#endif
- return __x.base() < __y.base();
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
-{
- return !(__x == __y);
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
-{
- return __y < __x;
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
-{
- return !(__x < __y);
-}
-
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
-{
- return !(__y < __x);
-}
-
-template <class _Iter1>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
-{
- return !(__x == __y);
-}
-
-template <class _Iter1>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
-{
- return __y < __x;
-}
-
-template <class _Iter1>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
-{
- return !(__x < __y);
-}
-
-template <class _Iter1>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-bool
-operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
-{
- return !(__y < __x);
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-auto
-operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
--> decltype(__x.base() - __y.base())
-{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
- "Attempted to subtract incompatible iterators");
-#endif
- return __x.base() - __y.base();
-}
-#else
-template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-typename __wrap_iter<_Iter1>::difference_type
-operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
-{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
- "Attempted to subtract incompatible iterators");
-#endif
- return __x.base() - __y.base();
-}
-#endif
-
-template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
-__wrap_iter<_Iter>
-operator+(typename __wrap_iter<_Iter>::difference_type __n,
- __wrap_iter<_Iter> __x) _NOEXCEPT
-{
- __x += __n;
- return __x;
-}
-
-template <class _Iter>
-struct __libcpp_is_trivial_iterator
- : public _LIBCPP_BOOL_CONSTANT(is_pointer<_Iter>::value) {};
-
-template <class _Iter>
-struct __libcpp_is_trivial_iterator<move_iterator<_Iter> >
- : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
-
-template <class _Iter>
-struct __libcpp_is_trivial_iterator<reverse_iterator<_Iter> >
- : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
-
-template <class _Iter>
-struct __libcpp_is_trivial_iterator<__wrap_iter<_Iter> >
- : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
-
-
-template <class _Tp, size_t _Np>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_Tp*
-begin(_Tp (&__array)[_Np])
-{
- return __array;
-}
-
-template <class _Tp, size_t _Np>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_Tp*
-end(_Tp (&__array)[_Np])
-{
- return __array + _Np;
-}
-
-#if !defined(_LIBCPP_CXX03_LANG)
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto
-begin(_Cp& __c) -> decltype(__c.begin())
-{
- return __c.begin();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto
-begin(const _Cp& __c) -> decltype(__c.begin())
-{
- return __c.begin();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto
-end(_Cp& __c) -> decltype(__c.end())
-{
- return __c.end();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto
-end(const _Cp& __c) -> decltype(__c.end())
-{
- return __c.end();
-}
-
-#if _LIBCPP_STD_VER > 11
-
-template <class _Tp, size_t _Np>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np])
-{
- return reverse_iterator<_Tp*>(__array + _Np);
-}
-
-template <class _Tp, size_t _Np>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np])
-{
- return reverse_iterator<_Tp*>(__array);
-}
-
-template <class _Ep>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il)
-{
- return reverse_iterator<const _Ep*>(__il.end());
-}
-
-template <class _Ep>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il)
-{
- return reverse_iterator<const _Ep*>(__il.begin());
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-auto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c))
-{
- return _VSTD::begin(__c);
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c))
-{
- return _VSTD::end(__c);
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto rbegin(_Cp& __c) -> decltype(__c.rbegin())
-{
- return __c.rbegin();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto rbegin(const _Cp& __c) -> decltype(__c.rbegin())
-{
- return __c.rbegin();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto rend(_Cp& __c) -> decltype(__c.rend())
-{
- return __c.rend();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto rend(const _Cp& __c) -> decltype(__c.rend())
-{
- return __c.rend();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c))
-{
- return _VSTD::rbegin(__c);
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
-{
- return _VSTD::rend(__c);
-}
-
-#endif
-
-
-#else // defined(_LIBCPP_CXX03_LANG)
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY
-typename _Cp::iterator
-begin(_Cp& __c)
-{
- return __c.begin();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY
-typename _Cp::const_iterator
-begin(const _Cp& __c)
-{
- return __c.begin();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY
-typename _Cp::iterator
-end(_Cp& __c)
-{
- return __c.end();
-}
-
-template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY
-typename _Cp::const_iterator
-end(const _Cp& __c)
-{
- return __c.end();
-}
-
-#endif // !defined(_LIBCPP_CXX03_LANG)
-
-#if _LIBCPP_STD_VER > 14
-
-// #if _LIBCPP_STD_VER > 11
-// template <>
-// struct _LIBCPP_TEMPLATE_VIS plus<void>
-// {
-// template <class _T1, class _T2>
-// _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-// auto operator()(_T1&& __t, _T2&& __u) const
-// _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u)))
-// -> decltype (_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u))
-// { return _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u); }
-// typedef void is_transparent;
-// };
-// #endif
-
-template <class _Cont>
-_LIBCPP_INLINE_VISIBILITY
-constexpr auto size(const _Cont& __c)
-_NOEXCEPT_(noexcept(__c.size()))
--> decltype (__c.size())
-{ return __c.size(); }
-
-template <class _Tp, size_t _Sz>
-_LIBCPP_INLINE_VISIBILITY
-constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
-
-#if _LIBCPP_STD_VER > 17
-template <class _Cont>
-_LIBCPP_INLINE_VISIBILITY
-constexpr auto ssize(const _Cont& __c)
-_NOEXCEPT_(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size())))
--> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>
-{ return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size()); }
-
-template <class _Tp, ptrdiff_t _Sz>
-_LIBCPP_INLINE_VISIBILITY
-constexpr ptrdiff_t ssize(const _Tp (&)[_Sz]) noexcept { return _Sz; }
-#endif
-
-template <class _Cont>
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
-constexpr auto empty(const _Cont& __c)
-_NOEXCEPT_(noexcept(__c.empty()))
--> decltype (__c.empty())
-{ return __c.empty(); }
-
-template <class _Tp, size_t _Sz>
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
-constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }
-
-template <class _Ep>
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
-constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
-
-template <class _Cont> constexpr
-_LIBCPP_INLINE_VISIBILITY
-auto data(_Cont& __c)
-_NOEXCEPT_(noexcept(__c.data()))
--> decltype (__c.data())
-{ return __c.data(); }
-
-template <class _Cont> constexpr
-_LIBCPP_INLINE_VISIBILITY
-auto data(const _Cont& __c)
-_NOEXCEPT_(noexcept(__c.data()))
--> decltype (__c.data())
-{ return __c.data(); }
-
-template <class _Tp, size_t _Sz>
-_LIBCPP_INLINE_VISIBILITY
-constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept { return __array; }
-
-template <class _Ep>
-_LIBCPP_INLINE_VISIBILITY
-constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); }
-#endif
-
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_ITERATOR
+#endif // _LIBCPP_ITERATOR
class latch
{
public:
+ static constexpr ptrdiff_t max() noexcept;
+
constexpr explicit latch(ptrdiff_t __expected);
~latch();
*/
+#include <__availability>
#include <__config>
#include <atomic>
# error <latch> is not supported on this single threaded system
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
#if _LIBCPP_STD_VER >= 14
_LIBCPP_BEGIN_NAMESPACE_STD
#endif // _LIBCPP_STD_VER >= 14
+_LIBCPP_POP_MACROS
+
#endif //_LIBCPP_LATCH
#include <type_traits>
#if defined(_LIBCPP_COMPILER_MSVC)
-#include "support/win32/limits_msvc_win32.h"
+#include "__support/win32/limits_msvc_win32.h"
#endif // _LIBCPP_MSVCRT
#if defined(__IBMCPP__)
-#include "support/ibm/limits.h"
+#include "__support/ibm/limits.h"
#endif // __IBMCPP__
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_LIMITS
+#endif // _LIBCPP_LIMITS
#include_next <limits.h>
#endif // __GNUC__
-#endif // _LIBCPP_LIMITS_H
+#endif // _LIBCPP_LIMITS_H
*/
#include <__config>
-
-#include <memory>
-#include <limits>
+#include <__debug>
+#include <__utility/forward.h>
+#include <algorithm>
#include <initializer_list>
#include <iterator>
-#include <algorithm>
+#include <limits>
+#include <memory>
#include <type_traits>
#include <version>
-#include <__debug>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
};
template <class _Tp, class _VoidPtr>
-struct __list_node
+struct _LIBCPP_STANDALONE_DEBUG __list_node
: public __list_node_base<_Tp, _VoidPtr>
{
_Tp __value_;
__link_pointer __ptr_;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
: __ptr_(__p)
_LIBCPP_INLINE_VISIBILITY
__list_iterator() _NOEXCEPT : __ptr_(nullptr)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_i(this);
#endif
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__list_iterator(const __list_iterator& __p)
return *this;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
reference operator*() const
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable list::iterator");
#endif
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable list::iterator");
#endif
_LIBCPP_INLINE_VISIBILITY
__list_iterator& operator++()
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable list::iterator");
+ "Attempted to increment a non-incrementable list::iterator");
#endif
__ptr_ = __ptr_->__next_;
return *this;
_LIBCPP_INLINE_VISIBILITY
__list_iterator& operator--()
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
- "Attempted to decrement non-decrementable list::iterator");
+ "Attempted to decrement a non-decrementable list::iterator");
#endif
__ptr_ = __ptr_->__prev_;
return *this;
__link_pointer __ptr_;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
: __ptr_(__p)
_LIBCPP_INLINE_VISIBILITY
__list_const_iterator() _NOEXCEPT : __ptr_(nullptr)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_i(this);
#endif
}
__list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT
: __ptr_(__p.__ptr_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__iterator_copy(this, &__p);
#endif
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
__list_const_iterator(const __list_const_iterator& __p)
return *this;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
reference operator*() const
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable list::const_iterator");
#endif
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable list::const_iterator");
#endif
_LIBCPP_INLINE_VISIBILITY
__list_const_iterator& operator++()
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable list::const_iterator");
+ "Attempted to increment a non-incrementable list::const_iterator");
#endif
__ptr_ = __ptr_->__next_;
return *this;
_LIBCPP_INLINE_VISIBILITY
__list_const_iterator& operator--()
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
- "Attempted to decrement non-decrementable list::const_iterator");
+ "Attempted to decrement a non-decrementable list::const_iterator");
#endif
__ptr_ = __ptr_->__prev_;
return *this;
_LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__end_.__next_, this);
#else
return iterator(__end_.__next_);
_LIBCPP_INLINE_VISIBILITY
const_iterator begin() const _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return const_iterator(__end_.__next_, this);
#else
return const_iterator(__end_.__next_);
_LIBCPP_INLINE_VISIBILITY
iterator end() _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__end_as_link(), this);
#else
return iterator(__end_as_link());
_LIBCPP_INLINE_VISIBILITY
const_iterator end() const _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return const_iterator(__end_as_link(), this);
#else
return const_iterator(__end_as_link());
_LIBCPP_INLINE_VISIBILITY
void __invalidate_all_iterators() {
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__invalidate_all(this);
#endif
}
#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
inline __list_imp<_Tp, _Alloc>::__list_imp(__node_allocator&& __a) _NOEXCEPT
- : __size_alloc_(0, std::move(__a)) {}
+ : __size_alloc_(0, _VSTD::move(__a)) {}
#endif
template <class _Tp, class _Alloc>
__list_imp<_Tp, _Alloc>::~__list_imp() {
clear();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__erase_c(this);
#endif
}
"list::swap: Either propagate_on_container_swap must be true"
" or the allocators must compare equal");
using _VSTD::swap;
- __swap_allocator(__node_alloc(), __c.__node_alloc());
+ _VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc());
swap(__sz(), __c.__sz());
swap(__end_, __c.__end_);
if (__sz() == 0)
else
__c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__c_node* __cn2 = __db->__find_c(&__c);
- std::swap(__cn1->beg_, __cn2->beg_);
- std::swap(__cn1->end_, __cn2->end_);
- std::swap(__cn1->cap_, __cn2->cap_);
+ _VSTD::swap(__cn1->beg_, __cn2->beg_);
+ _VSTD::swap(__cn1->end_, __cn2->end_);
+ _VSTD::swap(__cn1->cap_, __cn2->cap_);
for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;)
{
--__p;
{
__cn2->__add(*__p);
if (--__cn1->end_ != __p)
- memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*));
}
else
(*__p)->__c_ = __cn1;
{
__cn1->__add(*__p);
if (--__cn2->end_ != __p)
- memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
}
else
(*__p)->__c_ = __cn2;
list()
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
_LIBCPP_INLINE_VISIBILITY
explicit list(const allocator_type& __a) : base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type* = 0);
list(const list& __c);
- list(const list& __c, const allocator_type& __a);
+ list(const list& __c, const __identity_t<allocator_type>& __a);
_LIBCPP_INLINE_VISIBILITY
list& operator=(const list& __c);
#ifndef _LIBCPP_CXX03_LANG
list(list&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
_LIBCPP_INLINE_VISIBILITY
- list(list&& __c, const allocator_type& __a);
+ list(list&& __c, const __identity_t<allocator_type>& __a);
_LIBCPP_INLINE_VISIBILITY
list& operator=(list&& __c)
_NOEXCEPT_(
_LIBCPP_INLINE_VISIBILITY
void assign(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _InpIter>
void assign(_InpIter __f, _InpIter __l,
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
{
- return std::min<size_type>(
+ return _VSTD::min<size_type>(
base::__node_alloc_max_size(),
numeric_limits<difference_type >::max());
}
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, initializer_list<value_type> __il)
{return insert(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
void push_front(const value_type& __x);
void push_back(const value_type& __x);
return __hold_pointer(__p, __node_destructor(__na, 1));
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
bool __dereferenceable(const const_iterator* __i) const;
bool __decrementable(const const_iterator* __i) const;
bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
private:
_LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _InputIterator,
- class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,
- class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
+ class _Alloc = allocator<__iter_value_type<_InputIterator>>,
+ class = _EnableIf<__is_allocator<_Alloc>::value>
>
list(_InputIterator, _InputIterator)
- -> list<typename iterator_traits<_InputIterator>::value_type, _Alloc>;
+ -> list<__iter_value_type<_InputIterator>, _Alloc>;
template<class _InputIterator,
class _Alloc,
- class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
+ class = _EnableIf<__is_allocator<_Alloc>::value>
>
list(_InputIterator, _InputIterator, _Alloc)
- -> list<typename iterator_traits<_InputIterator>::value_type, _Alloc>;
+ -> list<__iter_value_type<_InputIterator>, _Alloc>;
#endif
// Link in nodes [__f, __l] just prior to __p
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (; __n > 0; --__n)
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (; __n > 0; --__n)
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (; __n > 0; --__n)
list<_Tp, _Alloc>::list(size_type __n, const value_type& __x, const allocator_type& __a)
: base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (; __n > 0; --__n)
list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,
typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (; __f != __l; ++__f)
typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
: base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (; __f != __l; ++__f)
list<_Tp, _Alloc>::list(const list& __c)
: base(__node_alloc_traits::select_on_container_copy_construction(
__c.__node_alloc())) {
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
}
template <class _Tp, class _Alloc>
-list<_Tp, _Alloc>::list(const list& __c, const allocator_type& __a)
+list<_Tp, _Alloc>::list(const list& __c, const __identity_t<allocator_type>& __a)
: base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
: base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
inline list<_Tp, _Alloc>::list(list&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
: base(_VSTD::move(__c.__node_alloc())) {
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
splice(end(), __c);
template <class _Tp, class _Alloc>
inline
-list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
+list<_Tp, _Alloc>::list(list&& __c, const __identity_t<allocator_type>& __a)
: base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__a == __c.get_allocator())
splice(end(), __c);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
inline
insert(__e, __f, __l);
else
erase(__i, __e);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__invalidate_all(this);
#endif
}
insert(__e, __n, __x);
else
erase(__i, __e);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__invalidate_all(this);
#endif
}
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::insert(iterator, x) called with an iterator not"
" referring to this list");
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
__link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link());
++base::__sz();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__hold.release()->__as_link(), this);
#else
return iterator(__hold.release()->__as_link());
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::insert(iterator, n, x) called with an iterator not"
" referring to this list");
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
++__ds;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__r = iterator(__hold->__as_link(), this);
#else
__r = iterator(__hold->__as_link());
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
__node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__e = iterator(__prev, this);
#else
__e = iterator(__prev);
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::insert(iterator, range) called with an iterator not"
" referring to this list");
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
++__ds;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__r = iterator(__hold.get()->__as_link(), this);
#else
__r = iterator(__hold.get()->__as_link());
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (++__f; __f != __l; ++__f, (void) ++__e, (void) ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
__node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__e = iterator(__prev, this);
#else
__e = iterator(__prev);
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::emplace(iterator, args...) called with an iterator not"
" referring to this list");
__link_nodes(__p.__ptr_, __nl, __nl);
++base::__sz();
__hold.release();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__nl, this);
#else
return iterator(__nl);
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::insert(iterator, x) called with an iterator not"
" referring to this list");
__link_nodes(__p.__ptr_, __nl, __nl);
++base::__sz();
__hold.release();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__nl, this);
#else
return iterator(__nl);
#endif
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
void
__link_pointer __n = base::__end_.__next_;
base::__unlink_nodes(__n, __n);
--base::__sz();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __p = __c->end_; __p != __c->beg_; )
{
{
(*__p)->__c_ = nullptr;
if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
}
}
__get_db()->unlock();
void
list<_Tp, _Alloc>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "list::pop_back() called with empty list");
+ _LIBCPP_ASSERT(!empty(), "list::pop_back() called on an empty list");
__node_allocator& __na = base::__node_alloc();
__link_pointer __n = base::__end_.__prev_;
base::__unlink_nodes(__n, __n);
--base::__sz();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __p = __c->end_; __p != __c->beg_; )
{
{
(*__p)->__c_ = nullptr;
if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
}
}
__get_db()->unlock();
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::erase(const_iterator __p)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::erase(iterator) called with an iterator not"
" referring to this list");
__link_pointer __r = __n->__next_;
base::__unlink_nodes(__n, __n);
--base::__sz();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __ip = __c->end_; __ip != __c->beg_; )
{
{
(*__ip)->__c_ = nullptr;
if (--__c->end_ != __ip)
- memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));
+ _VSTD::memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));
}
}
__get_db()->unlock();
__node_pointer __np = __n->__as_node();
__node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
__node_alloc_traits::deallocate(__na, __np, 1);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__r, this);
#else
return iterator(__r);
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this,
"list::erase(iterator, iterator) called with an iterator not"
" referring to this list");
__link_pointer __n = __f.__ptr_;
++__f;
--base::__sz();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __p = __c->end_; __p != __c->beg_; )
{
{
(*__p)->__c_ = nullptr;
if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
}
}
__get_db()->unlock();
__node_alloc_traits::deallocate(__na, __np, 1);
}
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(__l.__ptr_, this);
#else
return iterator(__l.__ptr_);
__hold_pointer __hold = __allocate_node(__na);
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
++__ds;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
iterator __r = iterator(__hold.release()->__as_link(), this);
#else
iterator __r = iterator(__hold.release()->__as_link());
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
__node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__e = iterator(__prev, this);
#else
__e = iterator(__prev);
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__link_nodes_at_back(__r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
++__ds;
__link_pointer __nl = __hold.release()->__as_link();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
iterator __r = iterator(__nl, this);
#else
iterator __r = iterator(__nl);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
__node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__e = iterator(__prev, this);
#else
__e = iterator(__prev);
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__link_nodes(base::__end_as_link(), __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
{
_LIBCPP_ASSERT(this != &__c,
"list::splice(iterator, list) called with this == &list");
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::splice(iterator, list) called with an iterator not"
" referring to this list");
__link_nodes(__p.__ptr_, __f, __l);
base::__sz() += __c.__sz();
__c.__sz() = 0;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
if (&__c != this) {
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__cn1->__add(*__ip);
(*__ip)->__c_ = __cn1;
if (--__cn2->end_ != __ip)
- memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
+ _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
__db->unlock();
void
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "list::splice(iterator, list, iterator) called with first iterator not"
- " referring to this list");
+ "list::splice(iterator, list, iterator) called with the first iterator"
+ " not referring to this list");
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__i) == &__c,
- "list::splice(iterator, list, iterator) called with second iterator not"
- " referring to list argument");
+ "list::splice(iterator, list, iterator) called with the second iterator"
+ " not referring to the list argument");
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),
- "list::splice(iterator, list, iterator) called with second iterator not"
- " derefereceable");
+ "list::splice(iterator, list, iterator) called with the second iterator"
+ " not dereferenceable");
#endif
if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
{
__link_nodes(__p.__ptr_, __f, __f);
--__c.__sz();
++base::__sz();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
if (&__c != this) {
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__cn1->__add(*__ip);
(*__ip)->__c_ = __cn1;
if (--__cn2->end_ != __ip)
- memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
+ _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
__db->unlock();
void
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::splice(iterator, list, iterator, iterator) called with first iterator not"
" referring to this list");
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == &__c,
"list::splice(iterator, list, iterator, iterator) called with second iterator not"
- " referring to list argument");
+ " referring to the list argument");
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == &__c,
+ "list::splice(iterator, list, iterator, iterator) called with third iterator not"
+ " referring to the list argument");
if (this == &__c)
{
for (const_iterator __i = __f; __i != __l; ++__i)
}
base::__unlink_nodes(__first, __last);
__link_nodes(__p.__ptr_, __first, __last);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
if (&__c != this) {
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__cn1->__add(*__ip);
(*__ip)->__c_ = __cn1;
if (--__cn2->end_ != __ip)
- memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
+ _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
}
++__f1;
}
splice(__e1, __c);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__c_node* __cn2 = __db->__find_c(&__c);
__cn1->__add(*__p);
(*__p)->__c_ = __cn1;
if (--__cn2->end_ != __p)
- memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
}
}
__db->unlock();
return size() == _VSTD::distance(begin(), end());
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
template <class _Tp, class _Alloc>
bool
return false;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_LIST
+#endif // _LIBCPP_LIST
#include <__config>
+#if defined(_LIBCPP_HAS_NO_LOCALIZATION)
+# error "Localization is not supported by this configuration of libc++"
+#endif
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
+# pragma GCC system_header
#endif
#include_next <locale.h>
-#endif // _LIBCPP_LOCALE_H
+#endif // _LIBCPP_LOCALE_H
typedef INSERT_RETURN_TYPE<iterator, node_type> insert_return_type; // C++17
class value_compare
- : public binary_function<value_type, value_type, bool>
{
friend class map;
protected:
value_compare(key_compare c);
public:
+ typedef bool result_type; // deprecated in C++17, removed in C++20
+ typedef value_type first_argument_type; // deprecated in C++17, removed in C++20
+ typedef value_type second_argument_type; // deprecated in C++17, removed in C++20
bool operator()(const value_type& x, const value_type& y) const;
};
iterator find(const K& x); // C++14
template<typename K>
const_iterator find(const K& x) const; // C++14
+
template<typename K>
size_type count(const K& x) const; // C++14
size_type count(const key_type& k) const;
- bool contains(const key_type& x) const; // C++20
+
+ bool contains(const key_type& x) const; // C++20
+ template<class K> bool contains(const K& x) const; // C++20
+
iterator lower_bound(const key_type& k);
const_iterator lower_bound(const key_type& k) const;
template<typename K>
typedef unspecified node_type; // C++17
class value_compare
- : public binary_function<value_type,value_type,bool>
{
friend class multimap;
protected:
key_compare comp;
value_compare(key_compare c);
public:
+ typedef bool result_type; // deprecated in C++17, removed in C++20
+ typedef value_type first_argument_type; // deprecated in C++17, removed in C++20
+ typedef value_type second_argument_type; // deprecated in C++17, removed in C++20
bool operator()(const value_type& x, const value_type& y) const;
};
iterator find(const K& x); // C++14
template<typename K>
const_iterator find(const K& x) const; // C++14
+
template<typename K>
size_type count(const K& x) const; // C++14
size_type count(const key_type& k) const;
- bool contains(const key_type& x) const; // C++20
+
+ bool contains(const key_type& x) const; // C++20
+ template<class K> bool contains(const K& x) const; // C++20
+
iterator lower_bound(const key_type& k);
const_iterator lower_bound(const key_type& k) const;
template<typename K>
*/
#include <__config>
-#include <__tree>
+#include <__debug>
+#include <__functional/is_transparent.h>
#include <__node_handle>
-#include <iterator>
-#include <memory>
-#include <utility>
+#include <__tree>
+#include <__utility/forward.h>
+#include <compare>
#include <functional>
#include <initializer_list>
+#include <iterator> // __libcpp_erase_if_container
+#include <memory>
#include <type_traits>
+#include <utility>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
{
__x.__value_constructed = false;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void operator()(pointer __p) _NOEXCEPT
#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp>
-struct __value_type
+struct _LIBCPP_STANDALONE_DEBUG __value_type
{
typedef _Key key_type;
typedef _Tp mapped_type;
typedef _Key key_type;
typedef _Tp mapped_type;
typedef pair<const key_type, mapped_type> value_type;
- typedef typename __identity<_Compare>::type key_compare;
- typedef typename __identity<_Allocator>::type allocator_type;
+ typedef __identity_t<_Compare> key_compare;
+ typedef __identity_t<_Allocator> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
"Allocator::value_type must be same type as value_type");
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
class _LIBCPP_TEMPLATE_VIS value_compare
+#if defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
: public binary_function<value_type, value_type, bool>
+#endif
{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
friend class map;
protected:
key_compare comp;
_LIBCPP_INLINE_VISIBILITY value_compare(key_compare c) : comp(c) {}
public:
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef value_type first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef value_type second_argument_type;
+#endif
_LIBCPP_INLINE_VISIBILITY
bool operator()(const value_type& __x, const value_type& __y) const
{return comp(__x.first, __y.first);}
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit map(const allocator_type& __a)
iterator insert(const_iterator __pos, _Pp&& __p)
{return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_Pp>(__p));}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool>
return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
_VSTD::piecewise_construct,
_VSTD::forward_as_tuple(__k),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
+ _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)).first;
}
template <class... _Args>
return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
_VSTD::piecewise_construct,
_VSTD::forward_as_tuple(_VSTD::move(__k)),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
+ _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)).first;
}
template <class _Vp>
}
template <class _Vp>
- _LIBCPP_INLINE_VISIBILITY
- iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v)
- {
- iterator __p = lower_bound(__k);
- if ( __p != end() && !key_comp()(__k, __p->first))
- {
- __p->second = _VSTD::forward<_Vp>(__v);
- return __p;
- }
- return emplace_hint(__h, __k, _VSTD::forward<_Vp>(__v));
- }
+ _LIBCPP_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
+ const key_type& __k,
+ _Vp&& __v) {
+ auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
+ __h.__i_, __k, __k, _VSTD::forward<_Vp>(__v));
+
+ if (!__inserted)
+ __r->__get_value().second = _VSTD::forward<_Vp>(__v);
+
+ return __r;
+ }
template <class _Vp>
- _LIBCPP_INLINE_VISIBILITY
- iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v)
- {
- iterator __p = lower_bound(__k);
- if ( __p != end() && !key_comp()(__k, __p->first))
- {
- __p->second = _VSTD::forward<_Vp>(__v);
- return __p;
- }
- return emplace_hint(__h, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
- }
+ _LIBCPP_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
+ key_type&& __k,
+ _Vp&& __v) {
+ auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
+ __h.__i_, __k, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
+
+ if (!__inserted)
+ __r->__get_value().second = _VSTD::forward<_Vp>(__v);
+
+ return __r;
+ }
#endif // _LIBCPP_STD_VER > 14
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
+ contains(const _K2& __k) const { return find(__k) != end(); }
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));
__h.get_deleter().__second_constructed = true;
- return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
+ return __h;
}
template <class _Key, class _Tp, class _Compare, class _Allocator>
return __r->__value_.__get_value().second;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp&
inline _LIBCPP_INLINE_VISIBILITY
typename map<_Key, _Tp, _Compare, _Allocator>::size_type
erase_if(map<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {
- return __libcpp_erase_if_container(__c, __pred);
+ return _VSTD::__libcpp_erase_if_container(__c, __pred);
}
#endif
typedef _Key key_type;
typedef _Tp mapped_type;
typedef pair<const key_type, mapped_type> value_type;
- typedef typename __identity<_Compare>::type key_compare;
- typedef typename __identity<_Allocator>::type allocator_type;
+ typedef __identity_t<_Compare> key_compare;
+ typedef __identity_t<_Allocator> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
"Allocator::value_type must be same type as value_type");
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
class _LIBCPP_TEMPLATE_VIS value_compare
+#if defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
: public binary_function<value_type, value_type, bool>
+#endif
{
+_LIBCPP_SUPPRESS_DEPRECATED_POP
friend class multimap;
protected:
key_compare comp;
_LIBCPP_INLINE_VISIBILITY
value_compare(key_compare c) : comp(c) {}
public:
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef value_type first_argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef value_type second_argument_type;
+#endif
_LIBCPP_INLINE_VISIBILITY
bool operator()(const value_type& __x, const value_type& __y) const
{return comp(__x.first, __y.first);}
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit multimap(const allocator_type& __a)
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __v) {return __tree_.__insert_multi(__v);}
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
+ contains(const _K2& __k) const { return find(__k) != end(); }
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
typename multimap<_Key, _Tp, _Compare, _Allocator>::size_type
erase_if(multimap<_Key, _Tp, _Compare, _Allocator>& __c,
_Predicate __pred) {
- return __libcpp_erase_if_container(__c, __pred);
+ return _VSTD::__libcpp_erase_if_container(__c, __pred);
}
#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_MAP
+#endif // _LIBCPP_MAP
};
template <class T> constexpr T* to_address(T* p) noexcept; // C++20
-template <class Ptr> auto to_address(const Ptr& p) noexcept; // C++20
+template <class Ptr> constexpr auto to_address(const Ptr& p) noexcept; // C++20
template <class Alloc>
struct allocator_traits
template <class T> using rebind_alloc = Alloc::rebind<T>::other | Alloc<T, Args...>;
template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;
- static pointer allocate(allocator_type& a, size_type n); // [[nodiscard]] in C++20
- static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // [[nodiscard]] in C++20
+ static pointer allocate(allocator_type& a, size_type n); // constexpr and [[nodiscard]] in C++20
+ static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // constexpr and [[nodiscard]] in C++20
- static void deallocate(allocator_type& a, pointer p, size_type n) noexcept;
+ static void deallocate(allocator_type& a, pointer p, size_type n) noexcept; // constexpr in C++20
template <class T, class... Args>
- static void construct(allocator_type& a, T* p, Args&&... args);
+ static void construct(allocator_type& a, T* p, Args&&... args); // constexpr in C++20
template <class T>
- static void destroy(allocator_type& a, T* p);
+ static void destroy(allocator_type& a, T* p); // constexpr in C++20
- static size_type max_size(const allocator_type& a); // noexcept in C++14
-
- static allocator_type
- select_on_container_copy_construction(const allocator_type& a);
+ static size_type max_size(const allocator_type& a); // noexcept in C++14, constexpr in C++20
+ static allocator_type select_on_container_copy_construction(const allocator_type& a); // constexpr in C++20
};
template <>
-class allocator<void> // deprecated in C++17, removed in C++20
+class allocator<void> // removed in C++20
{
public:
typedef void* pointer;
class allocator
{
public:
- typedef size_t size_type; // deprecated in C++17, removed in C++20
- typedef ptrdiff_t difference_type; // deprecated in C++17, removed in C++20
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
typedef T* pointer; // deprecated in C++17, removed in C++20
typedef const T* const_pointer; // deprecated in C++17, removed in C++20
typedef typename add_lvalue_reference<T>::type
constexpr allocator(const allocator&) noexcept; // constexpr in C++20
template <class U>
constexpr allocator(const allocator<U>&) noexcept; // constexpr in C++20
- ~allocator();
+ ~allocator(); // constexpr in C++20
pointer address(reference x) const noexcept; // deprecated in C++17, removed in C++20
const_pointer address(const_reference x) const noexcept; // deprecated in C++17, removed in C++20
T* allocate(size_t n, const void* hint); // deprecated in C++17, removed in C++20
- T* allocate(size_t n);
- void deallocate(T* p, size_t n) noexcept;
+ T* allocate(size_t n); // constexpr in C++20
+ void deallocate(T* p, size_t n) noexcept; // constexpr in C++20
size_type max_size() const noexcept; // deprecated in C++17, removed in C++20
template<class U, class... Args>
void construct(U* p, Args&&... args); // deprecated in C++17, removed in C++20
};
template <class T, class U>
-bool operator==(const allocator<T>&, const allocator<U>&) noexcept;
+bool operator==(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20
template <class T, class U>
-bool operator!=(const allocator<T>&, const allocator<U>&) noexcept;
+bool operator!=(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20
template <class OutputIterator, class T>
-class raw_storage_iterator
- : public iterator<output_iterator_tag,
- T, // purposefully not C++03
- ptrdiff_t, // purposefully not C++03
- T*, // purposefully not C++03
- raw_storage_iterator&> // purposefully not C++03
+class raw_storage_iterator // deprecated in C++17, removed in C++20
+ : public iterator<output_iterator_tag, void, void, void, void> // until C++17
{
public:
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type; // until C++20
+ typedef ptrdiff_t difference_type; // since C++20
+ typedef void pointer;
+ typedef void reference;
+
explicit raw_storage_iterator(OutputIterator x);
raw_storage_iterator& operator*();
raw_storage_iterator& operator=(const T& element);
ForwardIterator
uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
+template <class T, class ...Args>
+constexpr T* construct_at(T* location, Args&& ...args); // since C++20
+
template <class T>
-void destroy_at(T* location);
+void destroy_at(T* location); // constexpr in C++20
template <class ForwardIterator>
- void destroy(ForwardIterator first, ForwardIterator last);
+void destroy(ForwardIterator first, ForwardIterator last); // constexpr in C++20
template <class ForwardIterator, class Size>
- ForwardIterator destroy_n(ForwardIterator first, Size n);
+ForwardIterator destroy_n(ForwardIterator first, Size n); // constexpr in C++20
template <class InputIterator, class ForwardIterator>
ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result);
pointer release() noexcept;
void reset(pointer p = pointer()) noexcept;
void reset(nullptr_t) noexcept;
- template <class U> void reset(U) = delete;
+ template <class U> void reset(U) = delete;
void swap(unique_ptr& u) noexcept;
};
inline constexpr bool uses_allocator_v = uses_allocator<T, Alloc>::value;
// Pointer safety
-enum class pointer_safety { relaxed, preferred, strict };
-void declare_reachable(void *p);
-template <class T> T *undeclare_reachable(T *p);
-void declare_no_pointers(char *p, size_t n);
-void undeclare_no_pointers(char *p, size_t n);
-pointer_safety get_pointer_safety() noexcept;
+enum class pointer_safety { relaxed, preferred, strict }; // since C++11
+void declare_reachable(void *p); // since C++11
+template <class T> T *undeclare_reachable(T *p); // since C++11
+void declare_no_pointers(char *p, size_t n); // since C++11
+void undeclare_no_pointers(char *p, size_t n); // since C++11
+pointer_safety get_pointer_safety() noexcept; // since C++11
void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
*/
#include <__config>
-#include <type_traits>
-#include <typeinfo>
+#include <__functional_base>
+#include <__memory/addressof.h>
+#include <__memory/allocation_guard.h>
+#include <__memory/allocator.h>
+#include <__memory/allocator_arg_t.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/construct_at.h>
+#include <__memory/pointer_safety.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/raw_storage_iterator.h>
+#include <__memory/shared_ptr.h>
+#include <__memory/temporary_buffer.h>
+#include <__memory/uninitialized_algorithms.h>
+#include <__memory/unique_ptr.h>
+#include <__memory/uses_allocator.h>
+#include <compare>
#include <cstddef>
#include <cstdint>
-#include <new>
-#include <utility>
-#include <limits>
-#include <iterator>
-#include <__functional_base>
+#include <cstring>
#include <iosfwd>
-#include <tuple>
+#include <iterator>
+#include <new>
#include <stdexcept>
-#include <cstring>
-#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
-# include <atomic>
-#endif
+#include <tuple>
+#include <type_traits>
+#include <typeinfo>
+#include <utility>
#include <version>
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+# include <__memory/auto_ptr.h>
+#endif
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
-_ValueType __libcpp_relaxed_load(_ValueType const* __value) {
-#if !defined(_LIBCPP_HAS_NO_THREADS) && \
- defined(__ATOMIC_RELAXED) && \
- (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
- return __atomic_load_n(__value, __ATOMIC_RELAXED);
+template <class _Alloc, class _Ptr>
+_LIBCPP_INLINE_VISIBILITY
+void __construct_forward_with_exception_guarantees(_Alloc& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __begin2) {
+ static_assert(__is_cpp17_move_insertable<_Alloc>::value,
+ "The specified type does not meet the requirements of Cpp17MoveInsertable");
+ typedef allocator_traits<_Alloc> _Traits;
+ for (; __begin1 != __end1; ++__begin1, (void)++__begin2) {
+ _Traits::construct(__a, _VSTD::__to_address(__begin2),
+#ifdef _LIBCPP_NO_EXCEPTIONS
+ _VSTD::move(*__begin1)
#else
- return *__value;
+ _VSTD::move_if_noexcept(*__begin1)
#endif
+ );
+ }
}
-template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
-_ValueType __libcpp_acquire_load(_ValueType const* __value) {
-#if !defined(_LIBCPP_HAS_NO_THREADS) && \
- defined(__ATOMIC_ACQUIRE) && \
- (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
- return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
-#else
- return *__value;
-#endif
+template <class _Alloc, class _Tp, typename enable_if<
+ (__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Tp*, _Tp>::value) &&
+ is_trivially_move_constructible<_Tp>::value
+>::type>
+_LIBCPP_INLINE_VISIBILITY
+void __construct_forward_with_exception_guarantees(_Alloc&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2) {
+ ptrdiff_t _Np = __end1 - __begin1;
+ if (_Np > 0) {
+ _VSTD::memcpy(__begin2, __begin1, _Np * sizeof(_Tp));
+ __begin2 += _Np;
+ }
}
-// addressof moved to <type_traits>
-
-template <class _Tp> class allocator;
-
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
-template <>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<void>
-{
-public:
- typedef void* pointer;
- typedef const void* const_pointer;
- typedef void value_type;
-
- template <class _Up> struct rebind {typedef allocator<_Up> other;};
-};
+template <class _Alloc, class _Iter, class _Ptr>
+_LIBCPP_INLINE_VISIBILITY
+void __construct_range_forward(_Alloc& __a, _Iter __begin1, _Iter __end1, _Ptr& __begin2) {
+ typedef allocator_traits<_Alloc> _Traits;
+ for (; __begin1 != __end1; ++__begin1, (void) ++__begin2) {
+ _Traits::construct(__a, _VSTD::__to_address(__begin2), *__begin1);
+ }
+}
-template <>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<const void>
-{
-public:
- typedef const void* pointer;
- typedef const void* const_pointer;
- typedef const void value_type;
+template <class _Alloc, class _Source, class _Dest,
+ class _RawSource = typename remove_const<_Source>::type,
+ class _RawDest = typename remove_const<_Dest>::type,
+ class =
+ typename enable_if<
+ is_trivially_copy_constructible<_Dest>::value &&
+ is_same<_RawSource, _RawDest>::value &&
+ (__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Dest*, _Source&>::value)
+ >::type>
+_LIBCPP_INLINE_VISIBILITY
+void __construct_range_forward(_Alloc&, _Source* __begin1, _Source* __end1, _Dest*& __begin2) {
+ ptrdiff_t _Np = __end1 - __begin1;
+ if (_Np > 0) {
+ _VSTD::memcpy(const_cast<_RawDest*>(__begin2), __begin1, _Np * sizeof(_Dest));
+ __begin2 += _Np;
+ }
+}
- template <class _Up> struct rebind {typedef allocator<_Up> other;};
-};
+template <class _Alloc, class _Ptr>
+_LIBCPP_INLINE_VISIBILITY
+void __construct_backward_with_exception_guarantees(_Alloc& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2) {
+ static_assert(__is_cpp17_move_insertable<_Alloc>::value,
+ "The specified type does not meet the requirements of Cpp17MoveInsertable");
+ typedef allocator_traits<_Alloc> _Traits;
+ while (__end1 != __begin1) {
+ _Traits::construct(__a, _VSTD::__to_address(__end2 - 1),
+#ifdef _LIBCPP_NO_EXCEPTIONS
+ _VSTD::move(*--__end1)
+#else
+ _VSTD::move_if_noexcept(*--__end1)
#endif
+ );
+ --__end2;
+ }
+}
-// pointer_traits
-
-template <class _Tp, class = void>
-struct __has_element_type : false_type {};
-
-template <class _Tp>
-struct __has_element_type<_Tp,
- typename __void_t<typename _Tp::element_type>::type> : true_type {};
-
-template <class _Ptr, bool = __has_element_type<_Ptr>::value>
-struct __pointer_traits_element_type;
-
-template <class _Ptr>
-struct __pointer_traits_element_type<_Ptr, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::element_type type;
-};
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-template <template <class, class...> class _Sp, class _Tp, class ..._Args>
-struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::element_type type;
-};
-
-template <template <class, class...> class _Sp, class _Tp, class ..._Args>
-struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false>
-{
- typedef _LIBCPP_NODEBUG_TYPE _Tp type;
-};
-
-#else // _LIBCPP_HAS_NO_VARIADICS
-
-template <template <class> class _Sp, class _Tp>
-struct __pointer_traits_element_type<_Sp<_Tp>, true>
-{
- typedef typename _Sp<_Tp>::element_type type;
-};
-
-template <template <class> class _Sp, class _Tp>
-struct __pointer_traits_element_type<_Sp<_Tp>, false>
-{
- typedef _Tp type;
-};
-
-template <template <class, class> class _Sp, class _Tp, class _A0>
-struct __pointer_traits_element_type<_Sp<_Tp, _A0>, true>
-{
- typedef typename _Sp<_Tp, _A0>::element_type type;
-};
-
-template <template <class, class> class _Sp, class _Tp, class _A0>
-struct __pointer_traits_element_type<_Sp<_Tp, _A0>, false>
-{
- typedef _Tp type;
-};
-
-template <template <class, class, class> class _Sp, class _Tp, class _A0, class _A1>
-struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1>, true>
-{
- typedef typename _Sp<_Tp, _A0, _A1>::element_type type;
-};
-
-template <template <class, class, class> class _Sp, class _Tp, class _A0, class _A1>
-struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1>, false>
-{
- typedef _Tp type;
-};
-
-template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
- class _A1, class _A2>
-struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1, _A2>, true>
-{
- typedef typename _Sp<_Tp, _A0, _A1, _A2>::element_type type;
-};
+template <class _Alloc, class _Tp, class = typename enable_if<
+ (__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Tp*, _Tp>::value) &&
+ is_trivially_move_constructible<_Tp>::value
+>::type>
+_LIBCPP_INLINE_VISIBILITY
+void __construct_backward_with_exception_guarantees(_Alloc&, _Tp* __begin1, _Tp* __end1, _Tp*& __end2) {
+ ptrdiff_t _Np = __end1 - __begin1;
+ __end2 -= _Np;
+ if (_Np > 0)
+ _VSTD::memcpy(static_cast<void*>(__end2), static_cast<void const*>(__begin1), _Np * sizeof(_Tp));
+}
-template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
- class _A1, class _A2>
-struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1, _A2>, false>
+struct __destruct_n
{
- typedef _Tp type;
-};
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Tp, class = void>
-struct __has_difference_type : false_type {};
+private:
+ size_t __size_;
-template <class _Tp>
-struct __has_difference_type<_Tp,
- typename __void_t<typename _Tp::difference_type>::type> : true_type {};
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
+ {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();}
-template <class _Ptr, bool = __has_difference_type<_Ptr>::value>
-struct __pointer_traits_difference_type
-{
- typedef _LIBCPP_NODEBUG_TYPE ptrdiff_t type;
-};
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
+ {}
-template <class _Ptr>
-struct __pointer_traits_difference_type<_Ptr, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::difference_type type;
-};
+ _LIBCPP_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
+ {++__size_;}
+ _LIBCPP_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
+ {}
-template <class _Tp, class _Up>
-struct __has_rebind
-{
-private:
- struct __two {char __lx; char __lxx;};
- template <class _Xp> static __two __test(...);
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
- template <class _Xp> static char __test(typename _Xp::template rebind<_Up>* = 0);
- _LIBCPP_SUPPRESS_DEPRECATED_POP
+ _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
+ {__size_ = __s;}
+ _LIBCPP_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
+ {}
public:
- static const bool value = sizeof(__test<_Tp>(0)) == 1;
-};
-
-template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
-struct __pointer_traits_rebind
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up> type;
-#else
- typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up>::other type;
-#endif
-};
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
-#else
- typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
-#endif
-};
+ _LIBCPP_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
+ : __size_(__s) {}
-template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
-{
- typedef _Sp<_Up, _Args...> type;
-};
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY void __incr() _NOEXCEPT
+ {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
-#else // _LIBCPP_HAS_NO_VARIADICS
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT
+ {__set(__s, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
-template <template <class> class _Sp, class _Tp, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp>, _Up, true>
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef typename _Sp<_Tp>::template rebind<_Up> type;
-#else
- typedef typename _Sp<_Tp>::template rebind<_Up>::other type;
-#endif
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT
+ {__process(__p, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
};
-template <template <class> class _Sp, class _Tp, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp>, _Up, false>
-{
- typedef _Sp<_Up> type;
-};
+_LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
-template <template <class, class> class _Sp, class _Tp, class _A0, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp, _A0>, _Up, true>
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef typename _Sp<_Tp, _A0>::template rebind<_Up> type;
+// --- Helper for container swap --
+template <typename _Alloc>
+_LIBCPP_INLINE_VISIBILITY
+void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
+#if _LIBCPP_STD_VER >= 14
+ _NOEXCEPT
#else
- typedef typename _Sp<_Tp, _A0>::template rebind<_Up>::other type;
+ _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
#endif
-};
-
-template <template <class, class> class _Sp, class _Tp, class _A0, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp, _A0>, _Up, false>
-{
- typedef _Sp<_Up, _A0> type;
-};
-
-template <template <class, class, class> class _Sp, class _Tp, class _A0,
- class _A1, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1>, _Up, true>
{
-#ifndef _LIBCPP_CXX03_LANG
- typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up> type;
-#else
- typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up>::other type;
-#endif
-};
+ using _VSTD::swap;
+ swap(__a1, __a2);
+}
-template <template <class, class, class> class _Sp, class _Tp, class _A0,
- class _A1, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1>, _Up, false>
-{
- typedef _Sp<_Up, _A0, _A1> type;
-};
+template <typename _Alloc>
+inline _LIBCPP_INLINE_VISIBILITY
+void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
-template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
- class _A1, class _A2, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, true>
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up> type;
+template <typename _Alloc>
+inline _LIBCPP_INLINE_VISIBILITY
+void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
+#if _LIBCPP_STD_VER >= 14
+ _NOEXCEPT
#else
- typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up>::other type;
+ _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
#endif
-};
-
-template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
- class _A1, class _A2, class _Up>
-struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, false>
-{
- typedef _Sp<_Up, _A0, _A1, _A2> type;
-};
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Ptr>
-struct _LIBCPP_TEMPLATE_VIS pointer_traits
{
- typedef _Ptr pointer;
- typedef typename __pointer_traits_element_type<pointer>::type element_type;
- typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
-#else
- template <class _Up> struct rebind
- {typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
-#endif // _LIBCPP_CXX03_LANG
-
-private:
- struct __nat {};
-public:
- _LIBCPP_INLINE_VISIBILITY
- static pointer pointer_to(typename conditional<is_void<element_type>::value,
- __nat, element_type>::type& __r)
- {return pointer::pointer_to(__r);}
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*>
-{
- typedef _Tp* pointer;
- typedef _Tp element_type;
- typedef ptrdiff_t difference_type;
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Up> using rebind = _Up*;
-#else
- template <class _Up> struct rebind {typedef _Up* other;};
-#endif
-
-private:
- struct __nat {};
-public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
- static pointer pointer_to(typename conditional<is_void<element_type>::value,
- __nat, element_type>::type& __r) _NOEXCEPT
- {return _VSTD::addressof(__r);}
-};
+ _VSTD::__swap_allocator(__a1, __a2,
+ integral_constant<bool, allocator_traits<_Alloc>::propagate_on_container_swap::value>());
+}
-template <class _From, class _To>
-struct __rebind_pointer {
-#ifndef _LIBCPP_CXX03_LANG
- typedef typename pointer_traits<_From>::template rebind<_To> type;
+template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
+struct __noexcept_move_assign_container : public integral_constant<bool,
+ _Traits::propagate_on_container_move_assignment::value
+#if _LIBCPP_STD_VER > 14
+ || _Traits::is_always_equal::value
#else
- typedef typename pointer_traits<_From>::template rebind<_To>::other type;
+ && is_nothrow_move_assignable<_Alloc>::value
#endif
-};
-
-// allocator_traits
-
-template <class _Tp, class = void>
-struct __has_pointer_type : false_type {};
-
-template <class _Tp>
-struct __has_pointer_type<_Tp,
- typename __void_t<typename _Tp::pointer>::type> : true_type {};
-
-namespace __pointer_type_imp
-{
-
-template <class _Tp, class _Dp, bool = __has_pointer_type<_Dp>::value>
-struct __pointer_type
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Dp::pointer type;
-};
-
-template <class _Tp, class _Dp>
-struct __pointer_type<_Tp, _Dp, false>
-{
- typedef _LIBCPP_NODEBUG_TYPE _Tp* type;
-};
-
-} // __pointer_type_imp
-
-template <class _Tp, class _Dp>
-struct __pointer_type
-{
- typedef _LIBCPP_NODEBUG_TYPE typename __pointer_type_imp::__pointer_type<_Tp, typename remove_reference<_Dp>::type>::type type;
-};
-
-template <class _Tp, class = void>
-struct __has_const_pointer : false_type {};
-
-template <class _Tp>
-struct __has_const_pointer<_Tp,
- typename __void_t<typename _Tp::const_pointer>::type> : true_type {};
+ > {};
-template <class _Tp, class _Ptr, class _Alloc, bool = __has_const_pointer<_Alloc>::value>
-struct __const_pointer
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::const_pointer type;
-};
-template <class _Tp, class _Ptr, class _Alloc>
-struct __const_pointer<_Tp, _Ptr, _Alloc, false>
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const _Tp> type;
-#else
- typedef typename pointer_traits<_Ptr>::template rebind<const _Tp>::other type;
-#endif
-};
+template <class _Tp, class _Alloc>
+struct __temp_value {
+ typedef allocator_traits<_Alloc> _Traits;
-template <class _Tp, class = void>
-struct __has_void_pointer : false_type {};
+ typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;
+ _Alloc &__a;
-template <class _Tp>
-struct __has_void_pointer<_Tp,
- typename __void_t<typename _Tp::void_pointer>::type> : true_type {};
+ _Tp *__addr() { return reinterpret_cast<_Tp *>(addressof(__v)); }
+ _Tp & get() { return *__addr(); }
-template <class _Ptr, class _Alloc, bool = __has_void_pointer<_Alloc>::value>
-struct __void_pointer
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::void_pointer type;
-};
-
-template <class _Ptr, class _Alloc>
-struct __void_pointer<_Ptr, _Alloc, false>
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<void> type;
-#else
- typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<void>::other type;
-#endif
-};
-
-template <class _Tp, class = void>
-struct __has_const_void_pointer : false_type {};
-
-template <class _Tp>
-struct __has_const_void_pointer<_Tp,
- typename __void_t<typename _Tp::const_void_pointer>::type> : true_type {};
-
-template <class _Ptr, class _Alloc, bool = __has_const_void_pointer<_Alloc>::value>
-struct __const_void_pointer
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::const_void_pointer type;
-};
-
-template <class _Ptr, class _Alloc>
-struct __const_void_pointer<_Ptr, _Alloc, false>
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const void> type;
-#else
- typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const void>::other type;
-#endif
-};
-
-
-template <bool _UsePointerTraits> struct __to_address_helper;
-
-template <> struct __to_address_helper<true> {
- template <class _Pointer>
- using __return_type = decltype(pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()));
-
- template <class _Pointer>
- _LIBCPP_CONSTEXPR
- static __return_type<_Pointer>
- __do_it(const _Pointer &__p) _NOEXCEPT { return pointer_traits<_Pointer>::to_address(__p); }
-};
-
-template <class _Pointer, bool _Dummy = true>
-using __choose_to_address = __to_address_helper<_IsValidExpansion<__to_address_helper<_Dummy>::template __return_type, _Pointer>::value>;
-
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-_Tp*
-__to_address(_Tp* __p) _NOEXCEPT
-{
- static_assert(!is_function<_Tp>::value, "_Tp is a function type");
- return __p;
-}
-
-template <class _Pointer>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename __choose_to_address<_Pointer>::template __return_type<_Pointer>
-__to_address(const _Pointer& __p) _NOEXCEPT {
- return __choose_to_address<_Pointer>::__do_it(__p);
-}
-
-template <> struct __to_address_helper<false> {
- template <class _Pointer>
- using __return_type = typename pointer_traits<_Pointer>::element_type*;
-
- template <class _Pointer>
- _LIBCPP_CONSTEXPR
- static __return_type<_Pointer>
- __do_it(const _Pointer &__p) _NOEXCEPT { return std::__to_address(__p.operator->()); }
-};
-
-
-#if _LIBCPP_STD_VER > 17
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY constexpr
-_Tp*
-to_address(_Tp* __p) _NOEXCEPT
-{
- static_assert(!is_function_v<_Tp>, "_Tp is a function type");
- return __p;
-}
-
-template <class _Pointer>
-inline _LIBCPP_INLINE_VISIBILITY
-auto
-to_address(const _Pointer& __p) _NOEXCEPT
-{
- return _VSTD::__to_address(__p);
-}
-#endif
-
-template <class _Tp, class = void>
-struct __has_size_type : false_type {};
-
-template <class _Tp>
-struct __has_size_type<_Tp,
- typename __void_t<typename _Tp::size_type>::type> : true_type {};
-
-template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value>
-struct __size_type
-{
- typedef _LIBCPP_NODEBUG_TYPE typename make_unsigned<_DiffType>::type type;
-};
-
-template <class _Alloc, class _DiffType>
-struct __size_type<_Alloc, _DiffType, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::size_type type;
-};
-
-template <class _Tp, class = void>
-struct __has_propagate_on_container_copy_assignment : false_type {};
-
-template <class _Tp>
-struct __has_propagate_on_container_copy_assignment<_Tp,
- typename __void_t<typename _Tp::propagate_on_container_copy_assignment>::type>
- : true_type {};
-
-template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value>
-struct __propagate_on_container_copy_assignment
-{
- typedef _LIBCPP_NODEBUG_TYPE false_type type;
-};
-
-template <class _Alloc>
-struct __propagate_on_container_copy_assignment<_Alloc, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_copy_assignment type;
-};
-
-template <class _Tp, class = void>
-struct __has_propagate_on_container_move_assignment : false_type {};
-
-template <class _Tp>
-struct __has_propagate_on_container_move_assignment<_Tp,
- typename __void_t<typename _Tp::propagate_on_container_move_assignment>::type>
- : true_type {};
-
-template <class _Alloc, bool = __has_propagate_on_container_move_assignment<_Alloc>::value>
-struct __propagate_on_container_move_assignment
-{
- typedef false_type type;
-};
-
-template <class _Alloc>
-struct __propagate_on_container_move_assignment<_Alloc, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_move_assignment type;
-};
-
-template <class _Tp, class = void>
-struct __has_propagate_on_container_swap : false_type {};
-
-template <class _Tp>
-struct __has_propagate_on_container_swap<_Tp,
- typename __void_t<typename _Tp::propagate_on_container_swap>::type>
- : true_type {};
-
-template <class _Alloc, bool = __has_propagate_on_container_swap<_Alloc>::value>
-struct __propagate_on_container_swap
-{
- typedef false_type type;
-};
-
-template <class _Alloc>
-struct __propagate_on_container_swap<_Alloc, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_swap type;
-};
-
-template <class _Tp, class = void>
-struct __has_is_always_equal : false_type {};
-
-template <class _Tp>
-struct __has_is_always_equal<_Tp,
- typename __void_t<typename _Tp::is_always_equal>::type>
- : true_type {};
-
-template <class _Alloc, bool = __has_is_always_equal<_Alloc>::value>
-struct __is_always_equal
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _VSTD::is_empty<_Alloc>::type type;
-};
-
-template <class _Alloc>
-struct __is_always_equal<_Alloc, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::is_always_equal type;
-};
-
-template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
-struct __has_rebind_other
-{
-private:
- struct __two {char __lx; char __lxx;};
- template <class _Xp> static __two __test(...);
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
- template <class _Xp> static char __test(typename _Xp::template rebind<_Up>::other* = 0);
- _LIBCPP_SUPPRESS_DEPRECATED_POP
-public:
- static const bool value = sizeof(__test<_Tp>(0)) == 1;
-};
-
-template <class _Tp, class _Up>
-struct __has_rebind_other<_Tp, _Up, false>
-{
- static const bool value = false;
-};
-
-template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value>
-struct __allocator_traits_rebind
-{
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
- typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up>::other type;
- _LIBCPP_SUPPRESS_DEPRECATED_POP
-};
-
-template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
-struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true>
-{
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other type;
- _LIBCPP_SUPPRESS_DEPRECATED_POP
-};
-
-template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
-struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false>
-{
- typedef _LIBCPP_NODEBUG_TYPE _Alloc<_Up, _Args...> type;
-};
-
-#ifndef _LIBCPP_CXX03_LANG
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-template <class _Alloc, class _SizeType, class _ConstVoidPtr>
-auto
-__has_allocate_hint_test(_Alloc&& __a, _SizeType&& __sz, _ConstVoidPtr&& __p)
- -> decltype((void)__a.allocate(__sz, __p), true_type());
-_LIBCPP_SUPPRESS_DEPRECATED_POP
-
-template <class _Alloc, class _SizeType, class _ConstVoidPtr>
-auto
-__has_allocate_hint_test(const _Alloc& __a, _SizeType&& __sz, _ConstVoidPtr&& __p)
- -> false_type;
-
-template <class _Alloc, class _SizeType, class _ConstVoidPtr>
-struct __has_allocate_hint
- : decltype(_VSTD::__has_allocate_hint_test(declval<_Alloc>(),
- declval<_SizeType>(),
- declval<_ConstVoidPtr>()))
-{
-};
-
-#else // _LIBCPP_CXX03_LANG
-
-template <class _Alloc, class _SizeType, class _ConstVoidPtr>
-struct __has_allocate_hint
- : true_type
-{
-};
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-template <class _Alloc, class ..._Args,
- class = decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Args>()...))>
-static true_type __test_has_construct(int);
-_LIBCPP_SUPPRESS_DEPRECATED_POP
-
-template <class _Alloc, class...>
-static false_type __test_has_construct(...);
-
-template <class _Alloc, class ..._Args>
-struct __has_construct : decltype(__test_has_construct<_Alloc, _Args...>(0)) {};
-
-#if !defined(_LIBCPP_CXX03_LANG)
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-template <class _Alloc, class _Pointer>
-auto
-__has_destroy_test(_Alloc&& __a, _Pointer&& __p)
- -> decltype(__a.destroy(__p), true_type());
-_LIBCPP_SUPPRESS_DEPRECATED_POP
-
-template <class _Alloc, class _Pointer>
-auto
-__has_destroy_test(const _Alloc& __a, _Pointer&& __p)
- -> false_type;
-
-template <class _Alloc, class _Pointer>
-struct __has_destroy
- : decltype(_VSTD::__has_destroy_test(declval<_Alloc>(),
- declval<_Pointer>()))
-{
-};
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-template <class _Alloc>
-auto
-__has_max_size_test(_Alloc&& __a)
- -> decltype(__a.max_size(), true_type());
-_LIBCPP_SUPPRESS_DEPRECATED_POP
-
-template <class _Alloc>
-auto
-__has_max_size_test(const volatile _Alloc& __a)
- -> false_type;
-
-template <class _Alloc>
-struct __has_max_size
- : decltype(_VSTD::__has_max_size_test(declval<_Alloc&>()))
-{
-};
-
-template <class _Alloc>
-auto
-__has_select_on_container_copy_construction_test(_Alloc&& __a)
- -> decltype(__a.select_on_container_copy_construction(), true_type());
-
-template <class _Alloc>
-auto
-__has_select_on_container_copy_construction_test(const volatile _Alloc& __a)
- -> false_type;
-
-template <class _Alloc>
-struct __has_select_on_container_copy_construction
- : decltype(_VSTD::__has_select_on_container_copy_construction_test(declval<_Alloc&>()))
-{
-};
-
-#else // _LIBCPP_CXX03_LANG
-
-template <class _Alloc, class _Pointer, class = void>
-struct __has_destroy : false_type {};
-
-template <class _Alloc, class _Pointer>
-struct __has_destroy<_Alloc, _Pointer, typename __void_t<
- decltype(_VSTD::declval<_Alloc>().destroy(_VSTD::declval<_Pointer>()))
->::type> : std::true_type {};
-
-template <class _Alloc>
-struct __has_max_size
- : true_type
-{
-};
-
-template <class _Alloc>
-struct __has_select_on_container_copy_construction
- : false_type
-{
-};
-
-#endif // _LIBCPP_CXX03_LANG
-
-template <class _Alloc, class _Ptr, bool = __has_difference_type<_Alloc>::value>
-struct __alloc_traits_difference_type
-{
- typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::difference_type type;
-};
-
-template <class _Alloc, class _Ptr>
-struct __alloc_traits_difference_type<_Alloc, _Ptr, true>
-{
- typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::difference_type type;
-};
-
-template <class _Tp>
-struct __is_default_allocator : false_type {};
-
-template <class _Tp>
-struct __is_default_allocator<_VSTD::allocator<_Tp> > : true_type {};
-
-
-
-template <class _Alloc,
- bool = __has_construct<_Alloc, typename _Alloc::value_type*, typename _Alloc::value_type&&>::value && !__is_default_allocator<_Alloc>::value
- >
-struct __is_cpp17_move_insertable;
-template <class _Alloc>
-struct __is_cpp17_move_insertable<_Alloc, true> : std::true_type {};
-template <class _Alloc>
-struct __is_cpp17_move_insertable<_Alloc, false> : std::is_move_constructible<typename _Alloc::value_type> {};
-
-template <class _Alloc,
- bool = __has_construct<_Alloc, typename _Alloc::value_type*, const typename _Alloc::value_type&>::value && !__is_default_allocator<_Alloc>::value
- >
-struct __is_cpp17_copy_insertable;
-template <class _Alloc>
-struct __is_cpp17_copy_insertable<_Alloc, true> : __is_cpp17_move_insertable<_Alloc> {};
-template <class _Alloc>
-struct __is_cpp17_copy_insertable<_Alloc, false> : integral_constant<bool,
- std::is_copy_constructible<typename _Alloc::value_type>::value &&
- __is_cpp17_move_insertable<_Alloc>::value>
- {};
-
-
-
-template <class _Alloc>
-struct _LIBCPP_TEMPLATE_VIS allocator_traits
-{
- typedef _Alloc allocator_type;
- typedef typename allocator_type::value_type value_type;
-
- typedef typename __pointer_type<value_type, allocator_type>::type pointer;
- typedef typename __const_pointer<value_type, pointer, allocator_type>::type const_pointer;
- typedef typename __void_pointer<pointer, allocator_type>::type void_pointer;
- typedef typename __const_void_pointer<pointer, allocator_type>::type const_void_pointer;
-
- typedef typename __alloc_traits_difference_type<allocator_type, pointer>::type difference_type;
- typedef typename __size_type<allocator_type, difference_type>::type size_type;
-
- typedef typename __propagate_on_container_copy_assignment<allocator_type>::type
- propagate_on_container_copy_assignment;
- typedef typename __propagate_on_container_move_assignment<allocator_type>::type
- propagate_on_container_move_assignment;
- typedef typename __propagate_on_container_swap<allocator_type>::type
- propagate_on_container_swap;
- typedef typename __is_always_equal<allocator_type>::type
- is_always_equal;
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Tp> using rebind_alloc =
- typename __allocator_traits_rebind<allocator_type, _Tp>::type;
- template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp> >;
-#else // _LIBCPP_CXX03_LANG
- template <class _Tp> struct rebind_alloc
- {typedef typename __allocator_traits_rebind<allocator_type, _Tp>::type other;};
- template <class _Tp> struct rebind_traits
- {typedef allocator_traits<typename rebind_alloc<_Tp>::other> other;};
-#endif // _LIBCPP_CXX03_LANG
-
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
- static pointer allocate(allocator_type& __a, size_type __n)
- {return __a.allocate(__n);}
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
- static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
- {return __allocate(__a, __n, __hint,
- __has_allocate_hint<allocator_type, size_type, const_void_pointer>());}
-
- _LIBCPP_INLINE_VISIBILITY
- static void deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT
- {__a.deallocate(__p, __n);}
-
- template <class _Tp, class... _Args>
- _LIBCPP_INLINE_VISIBILITY
- static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args)
- {__construct(__has_construct<allocator_type, _Tp*, _Args...>(),
- __a, __p, _VSTD::forward<_Args>(__args)...);}
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- static void destroy(allocator_type& __a, _Tp* __p)
- {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}
-
- _LIBCPP_INLINE_VISIBILITY
- static size_type max_size(const allocator_type& __a) _NOEXCEPT
- {return __max_size(__has_max_size<const allocator_type>(), __a);}
-
- _LIBCPP_INLINE_VISIBILITY
- static allocator_type
- select_on_container_copy_construction(const allocator_type& __a)
- {return __select_on_container_copy_construction(
- __has_select_on_container_copy_construction<const allocator_type>(),
- __a);}
-
- template <class _Ptr>
- _LIBCPP_INLINE_VISIBILITY
- static
- void
- __construct_forward_with_exception_guarantees(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __begin2)
- {
- static_assert(__is_cpp17_move_insertable<allocator_type>::value,
- "The specified type does not meet the requirements of Cpp17MoveInsertible");
- for (; __begin1 != __end1; ++__begin1, (void) ++__begin2)
- construct(__a, _VSTD::__to_address(__begin2),
-#ifdef _LIBCPP_NO_EXCEPTIONS
- _VSTD::move(*__begin1)
-#else
- _VSTD::move_if_noexcept(*__begin1)
-#endif
- );
- }
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- static
- typename enable_if
- <
- (__is_default_allocator<allocator_type>::value
- || !__has_construct<allocator_type, _Tp*, _Tp>::value) &&
- is_trivially_move_constructible<_Tp>::value,
- void
- >::type
- __construct_forward_with_exception_guarantees(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
- {
- ptrdiff_t _Np = __end1 - __begin1;
- if (_Np > 0)
- {
- _VSTD::memcpy(__begin2, __begin1, _Np * sizeof(_Tp));
- __begin2 += _Np;
- }
- }
-
- template <class _Iter, class _Ptr>
- _LIBCPP_INLINE_VISIBILITY
- static
- void
- __construct_range_forward(allocator_type& __a, _Iter __begin1, _Iter __end1, _Ptr& __begin2)
- {
- for (; __begin1 != __end1; ++__begin1, (void) ++__begin2)
- construct(__a, _VSTD::__to_address(__begin2), *__begin1);
- }
-
- template <class _SourceTp, class _DestTp,
- class _RawSourceTp = typename remove_const<_SourceTp>::type,
- class _RawDestTp = typename remove_const<_DestTp>::type>
- _LIBCPP_INLINE_VISIBILITY
- static
- typename enable_if
- <
- is_trivially_copy_constructible<_DestTp>::value &&
- is_same<_RawSourceTp, _RawDestTp>::value &&
- (__is_default_allocator<allocator_type>::value ||
- !__has_construct<allocator_type, _DestTp*, _SourceTp&>::value),
- void
- >::type
- __construct_range_forward(allocator_type&, _SourceTp* __begin1, _SourceTp* __end1, _DestTp*& __begin2)
- {
- ptrdiff_t _Np = __end1 - __begin1;
- if (_Np > 0)
- {
- _VSTD::memcpy(const_cast<_RawDestTp*>(__begin2), __begin1, _Np * sizeof(_DestTp));
- __begin2 += _Np;
- }
- }
-
- template <class _Ptr>
- _LIBCPP_INLINE_VISIBILITY
- static
- void
- __construct_backward_with_exception_guarantees(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2)
- {
- static_assert(__is_cpp17_move_insertable<allocator_type>::value,
- "The specified type does not meet the requirements of Cpp17MoveInsertable");
- while (__end1 != __begin1)
- {
- construct(__a, _VSTD::__to_address(__end2 - 1),
-#ifdef _LIBCPP_NO_EXCEPTIONS
- _VSTD::move(*--__end1)
-#else
- _VSTD::move_if_noexcept(*--__end1)
-#endif
- );
- --__end2;
- }
- }
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- static
- typename enable_if
- <
- (__is_default_allocator<allocator_type>::value
- || !__has_construct<allocator_type, _Tp*, _Tp>::value) &&
- is_trivially_move_constructible<_Tp>::value,
- void
- >::type
- __construct_backward_with_exception_guarantees(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __end2)
- {
- ptrdiff_t _Np = __end1 - __begin1;
- __end2 -= _Np;
- if (_Np > 0)
- _VSTD::memcpy(__end2, __begin1, _Np * sizeof(_Tp));
- }
-
-private:
-
- _LIBCPP_INLINE_VISIBILITY
- static pointer __allocate(allocator_type& __a, size_type __n,
- const_void_pointer __hint, true_type)
- {
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
- return __a.allocate(__n, __hint);
- _LIBCPP_SUPPRESS_DEPRECATED_POP
- }
- _LIBCPP_INLINE_VISIBILITY
- static pointer __allocate(allocator_type& __a, size_type __n,
- const_void_pointer, false_type)
- {return __a.allocate(__n);}
-
- template <class _Tp, class... _Args>
- _LIBCPP_INLINE_VISIBILITY
- static void __construct(true_type, allocator_type& __a, _Tp* __p, _Args&&... __args)
- {
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
- __a.construct(__p, _VSTD::forward<_Args>(__args)...);
- _LIBCPP_SUPPRESS_DEPRECATED_POP
- }
-
- template <class _Tp, class... _Args>
- _LIBCPP_INLINE_VISIBILITY
- static void __construct(false_type, allocator_type&, _Tp* __p, _Args&&... __args)
- {
- ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
- }
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- static void __destroy(true_type, allocator_type& __a, _Tp* __p)
- {
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
- __a.destroy(__p);
- _LIBCPP_SUPPRESS_DEPRECATED_POP
- }
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- static void __destroy(false_type, allocator_type&, _Tp* __p)
- {
- __p->~_Tp();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- static size_type __max_size(true_type, const allocator_type& __a) _NOEXCEPT
- {
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
- return __a.max_size();
- _LIBCPP_SUPPRESS_DEPRECATED_POP
- }
-
- _LIBCPP_INLINE_VISIBILITY
- static size_type __max_size(false_type, const allocator_type&) _NOEXCEPT
- {return numeric_limits<size_type>::max() / sizeof(value_type);}
-
- _LIBCPP_INLINE_VISIBILITY
- static allocator_type
- __select_on_container_copy_construction(true_type, const allocator_type& __a)
- {return __a.select_on_container_copy_construction();}
- _LIBCPP_INLINE_VISIBILITY
- static allocator_type
- __select_on_container_copy_construction(false_type, const allocator_type& __a)
- {return __a;}
-};
-
-template <class _Traits, class _Tp>
-struct __rebind_alloc_helper
-{
-#ifndef _LIBCPP_CXX03_LANG
- typedef _LIBCPP_NODEBUG_TYPE typename _Traits::template rebind_alloc<_Tp> type;
-#else
- typedef typename _Traits::template rebind_alloc<_Tp>::other type;
-#endif
-};
-
-// allocator
-
-template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS allocator
-{
-public:
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t size_type;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef ptrdiff_t difference_type;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* pointer;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp& reference;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
-
- template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
-#endif
-
- typedef _Tp value_type;
-
- typedef true_type propagate_on_container_move_assignment;
- typedef true_type is_always_equal;
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
- allocator() _NOEXCEPT {}
-
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
- allocator(const allocator<_Up>&) _NOEXCEPT {}
-
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
- pointer address(reference __x) const _NOEXCEPT
- {return _VSTD::addressof(__x);}
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
- const_pointer address(const_reference __x) const _NOEXCEPT
- {return _VSTD::addressof(__x);}
-#endif
-
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _Tp* allocate(size_t __n)
- {
- // TODO(mpark): Replace with `allocator_traits<allocator>::max_size(*this)`.
- if (__n > (size_t(~0) / sizeof(_Tp)))
- __throw_length_error("allocator<T>::allocate(size_t n)"
- " 'n' exceeds maximum supported size");
- return static_cast<_Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
- }
-
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
- _Tp* allocate(size_t __n, const void*) { return allocate(__n); }
-#endif
-
- _LIBCPP_INLINE_VISIBILITY void deallocate(_Tp* __p, size_t __n) _NOEXCEPT
- {_VSTD::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));}
-
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT
- {return size_type(~0) / sizeof(_Tp);}
-
- template <class _Up, class... _Args>
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
- void
- construct(_Up* __p, _Args&&... __args)
- {
- ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
- }
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}
-#endif
-};
-
-template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
-{
-public:
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t size_type;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef ptrdiff_t difference_type;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference;
- _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
-
- template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
-#endif
-
- typedef const _Tp value_type;
-
- typedef true_type propagate_on_container_move_assignment;
- typedef true_type is_always_equal;
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
- allocator() _NOEXCEPT {}
-
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
- allocator(const allocator<_Up>&) _NOEXCEPT {}
-
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
- const_pointer address(const_reference __x) const _NOEXCEPT
- {return _VSTD::addressof(__x);}
-#endif
-
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY const _Tp* allocate(size_t __n)
- {
- // TODO(mpark): Replace with `allocator_traits<allocator>::max_size(*this)`.
- if (__n > (size_t(~0) / sizeof(_Tp)))
- __throw_length_error("allocator<const T>::allocate(size_t n)"
- " 'n' exceeds maximum supported size");
- return static_cast<const _Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
- }
-
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
- const _Tp* allocate(size_t __n, const void*) { return allocate(__n); }
-#endif
-
- _LIBCPP_INLINE_VISIBILITY void deallocate(const _Tp* __p, size_t __n)
- {_VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));}
-
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT
- {return size_type(~0) / sizeof(_Tp);}
-
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- template <class _Up, class... _Args>
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
- void
- construct(_Up* __p, _Args&&... __args)
- {
- ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
- }
-#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp();
- }
-# if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, _A0& __a0)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0);
- }
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, const _A0& __a0)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0);
- }
-# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, _A0& __a0, _A1& __a1)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
- }
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, const _A0& __a0, _A1& __a1)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
- }
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, _A0& __a0, const _A1& __a1)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
- }
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, const _A0& __a0, const _A1& __a1)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
- }
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}
-#endif
-};
-
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}
-
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
-
-template <class _OutputIterator, class _Tp>
-class _LIBCPP_TEMPLATE_VIS raw_storage_iterator
- : public iterator<output_iterator_tag,
- _Tp, // purposefully not C++03
- ptrdiff_t, // purposefully not C++03
- _Tp*, // purposefully not C++03
- raw_storage_iterator<_OutputIterator, _Tp>&> // purposefully not C++03
-{
-private:
- _OutputIterator __x_;
-public:
- _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}
- _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}
- _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element)
- {::new(_VSTD::addressof(*__x_)) _Tp(__element); return *this;}
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element)
- {::new(_VSTD::addressof(*__x_)) _Tp(_VSTD::move(__element)); return *this;}
-#endif
- _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}
- _LIBCPP_INLINE_VISIBILITY raw_storage_iterator operator++(int)
- {raw_storage_iterator __t(*this); ++__x_; return __t;}
-#if _LIBCPP_STD_VER >= 14
- _LIBCPP_INLINE_VISIBILITY _OutputIterator base() const { return __x_; }
-#endif
-};
-
-template <class _Tp>
-_LIBCPP_NODISCARD_EXT _LIBCPP_NO_CFI
-pair<_Tp*, ptrdiff_t>
-get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT
-{
- pair<_Tp*, ptrdiff_t> __r(0, 0);
- const ptrdiff_t __m = (~ptrdiff_t(0) ^
- ptrdiff_t(ptrdiff_t(1) << (sizeof(ptrdiff_t) * __CHAR_BIT__ - 1)))
- / sizeof(_Tp);
- if (__n > __m)
- __n = __m;
- while (__n > 0)
- {
-#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
- if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))
- {
- std::align_val_t __al =
- std::align_val_t(std::alignment_of<_Tp>::value);
- __r.first = static_cast<_Tp*>(::operator new(
- __n * sizeof(_Tp), __al, nothrow));
- } else {
- __r.first = static_cast<_Tp*>(::operator new(
- __n * sizeof(_Tp), nothrow));
- }
-#else
- if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))
- {
- // Since aligned operator new is unavailable, return an empty
- // buffer rather than one with invalid alignment.
- return __r;
- }
-
- __r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), nothrow));
-#endif
-
- if (__r.first)
- {
- __r.second = __n;
- break;
- }
- __n /= 2;
- }
- return __r;
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-void return_temporary_buffer(_Tp* __p) _NOEXCEPT
-{
- _VSTD::__libcpp_deallocate_unsized((void*)__p, _LIBCPP_ALIGNOF(_Tp));
-}
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-template <class _Tp>
-struct _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr_ref
-{
- _Tp* __ptr_;
-};
-
-template<class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
-{
-private:
- _Tp* __ptr_;
-public:
- typedef _Tp element_type;
-
- _LIBCPP_INLINE_VISIBILITY explicit auto_ptr(_Tp* __p = 0) _NOEXCEPT : __ptr_(__p) {}
- _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr& __p) _NOEXCEPT : __ptr_(__p.release()) {}
- template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr<_Up>& __p) _NOEXCEPT
- : __ptr_(__p.release()) {}
- _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr& __p) _NOEXCEPT
- {reset(__p.release()); return *this;}
- template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr<_Up>& __p) _NOEXCEPT
- {reset(__p.release()); return *this;}
- _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr_ref<_Tp> __p) _NOEXCEPT
- {reset(__p.__ptr_); return *this;}
- _LIBCPP_INLINE_VISIBILITY ~auto_ptr() _NOEXCEPT {delete __ptr_;}
-
- _LIBCPP_INLINE_VISIBILITY _Tp& operator*() const _NOEXCEPT
- {return *__ptr_;}
- _LIBCPP_INLINE_VISIBILITY _Tp* operator->() const _NOEXCEPT {return __ptr_;}
- _LIBCPP_INLINE_VISIBILITY _Tp* get() const _NOEXCEPT {return __ptr_;}
- _LIBCPP_INLINE_VISIBILITY _Tp* release() _NOEXCEPT
- {
- _Tp* __t = __ptr_;
- __ptr_ = 0;
- return __t;
- }
- _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT
- {
- if (__ptr_ != __p)
- delete __ptr_;
- __ptr_ = __p;
- }
-
- _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr_ref<_Tp> __p) _NOEXCEPT : __ptr_(__p.__ptr_) {}
- template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr_ref<_Up>() _NOEXCEPT
- {auto_ptr_ref<_Up> __t; __t.__ptr_ = release(); return __t;}
- template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr<_Up>() _NOEXCEPT
- {return auto_ptr<_Up>(release());}
-};
-
-template <>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr<void>
-{
-public:
- typedef void element_type;
-};
-#endif
-
-// Tag used to default initialize one or both of the pair's elements.
-struct __default_init_tag {};
-struct __value_init_tag {};
-
-template <class _Tp, int _Idx,
- bool _CanBeEmptyBase =
- is_empty<_Tp>::value && !__libcpp_is_final<_Tp>::value>
-struct __compressed_pair_elem {
- typedef _Tp _ParamT;
- typedef _Tp& reference;
- typedef const _Tp& const_reference;
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- __compressed_pair_elem(__default_init_tag) {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- __compressed_pair_elem(__value_init_tag) : __value_() {}
-
- template <class _Up, class = typename enable_if<
- !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
- >::type>
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR explicit
- __compressed_pair_elem(_Up&& __u)
- : __value_(_VSTD::forward<_Up>(__u))
- {
- }
-
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args, size_t... _Indexes>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
- __tuple_indices<_Indexes...>)
- : __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
-#endif
-
-
- _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return __value_; }
- _LIBCPP_INLINE_VISIBILITY
- const_reference __get() const _NOEXCEPT { return __value_; }
-
-private:
- _Tp __value_;
-};
-
-template <class _Tp, int _Idx>
-struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
- typedef _Tp _ParamT;
- typedef _Tp& reference;
- typedef const _Tp& const_reference;
- typedef _Tp __value_type;
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __compressed_pair_elem() = default;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- __compressed_pair_elem(__default_init_tag) {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- __compressed_pair_elem(__value_init_tag) : __value_type() {}
-
- template <class _Up, class = typename enable_if<
- !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
- >::type>
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR explicit
- __compressed_pair_elem(_Up&& __u)
- : __value_type(_VSTD::forward<_Up>(__u))
- {}
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args, size_t... _Indexes>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
- __tuple_indices<_Indexes...>)
- : __value_type(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
-#endif
-
- _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return *this; }
- _LIBCPP_INLINE_VISIBILITY
- const_reference __get() const _NOEXCEPT { return *this; }
-};
-
-template <class _T1, class _T2>
-class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
- private __compressed_pair_elem<_T2, 1> {
- typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T1, 0> _Base1;
- typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T2, 1> _Base2;
-
- // NOTE: This static assert should never fire because __compressed_pair
- // is *almost never* used in a scenario where it's possible for T1 == T2.
- // (The exception is std::function where it is possible that the function
- // object and the allocator have the same type).
- static_assert((!is_same<_T1, _T2>::value),
- "__compressed_pair cannot be instantated when T1 and T2 are the same type; "
- "The current implementation is NOT ABI-compatible with the previous "
- "implementation for this configuration");
-
-public:
- template <bool _Dummy = true,
- class = typename enable_if<
- __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
- __dependent_type<is_default_constructible<_T2>, _Dummy>::value
- >::type
- >
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR __compressed_pair() : _Base1(__value_init_tag()), _Base2(__value_init_tag()) {}
-
- template <class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- __compressed_pair(_U1&& __t1, _U2&& __t2)
- : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args1, class... _Args2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
- tuple<_Args2...> __second_args)
- : _Base1(__pc, _VSTD::move(__first_args),
- typename __make_tuple_indices<sizeof...(_Args1)>::type()),
- _Base2(__pc, _VSTD::move(__second_args),
- typename __make_tuple_indices<sizeof...(_Args2)>::type()) {}
-#endif
-
- _LIBCPP_INLINE_VISIBILITY
- typename _Base1::reference first() _NOEXCEPT {
- return static_cast<_Base1&>(*this).__get();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- typename _Base1::const_reference first() const _NOEXCEPT {
- return static_cast<_Base1 const&>(*this).__get();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- typename _Base2::reference second() _NOEXCEPT {
- return static_cast<_Base2&>(*this).__get();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- typename _Base2::const_reference second() const _NOEXCEPT {
- return static_cast<_Base2 const&>(*this).__get();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(__compressed_pair& __x)
- _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value)
- {
- using std::swap;
- swap(first(), __x.first());
- swap(second(), __x.second());
- }
-};
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
- _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value) {
- __x.swap(__y);
-}
-
-// default_delete
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS default_delete {
- static_assert(!is_function<_Tp>::value,
- "default_delete cannot be instantiated for function types");
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default;
-#else
- _LIBCPP_INLINE_VISIBILITY default_delete() {}
-#endif
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- default_delete(const default_delete<_Up>&,
- typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* =
- 0) _NOEXCEPT {}
-
- _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __ptr) const _NOEXCEPT {
- static_assert(sizeof(_Tp) > 0,
- "default_delete can not delete incomplete type");
- static_assert(!is_void<_Tp>::value,
- "default_delete can not delete incomplete type");
- delete __ptr;
- }
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS default_delete<_Tp[]> {
-private:
- template <class _Up>
- struct _EnableIfConvertible
- : enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value> {};
-
-public:
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default;
-#else
- _LIBCPP_INLINE_VISIBILITY default_delete() {}
-#endif
-
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- default_delete(const default_delete<_Up[]>&,
- typename _EnableIfConvertible<_Up>::type* = 0) _NOEXCEPT {}
-
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- typename _EnableIfConvertible<_Up>::type
- operator()(_Up* __ptr) const _NOEXCEPT {
- static_assert(sizeof(_Tp) > 0,
- "default_delete can not delete incomplete type");
- static_assert(!is_void<_Tp>::value,
- "default_delete can not delete void type");
- delete[] __ptr;
- }
-};
-
-template <class _Deleter>
-struct __unique_ptr_deleter_sfinae {
- static_assert(!is_reference<_Deleter>::value, "incorrect specialization");
- typedef const _Deleter& __lval_ref_type;
- typedef _Deleter&& __good_rval_ref_type;
- typedef true_type __enable_rval_overload;
-};
-
-template <class _Deleter>
-struct __unique_ptr_deleter_sfinae<_Deleter const&> {
- typedef const _Deleter& __lval_ref_type;
- typedef const _Deleter&& __bad_rval_ref_type;
- typedef false_type __enable_rval_overload;
-};
-
-template <class _Deleter>
-struct __unique_ptr_deleter_sfinae<_Deleter&> {
- typedef _Deleter& __lval_ref_type;
- typedef _Deleter&& __bad_rval_ref_type;
- typedef false_type __enable_rval_overload;
-};
-
-template <class _Tp, class _Dp = default_delete<_Tp> >
-class _LIBCPP_TEMPLATE_VIS unique_ptr {
-public:
- typedef _Tp element_type;
- typedef _Dp deleter_type;
- typedef _LIBCPP_NODEBUG_TYPE typename __pointer_type<_Tp, deleter_type>::type pointer;
-
- static_assert(!is_rvalue_reference<deleter_type>::value,
- "the specified deleter type cannot be an rvalue reference");
-
-private:
- __compressed_pair<pointer, deleter_type> __ptr_;
-
- struct __nat { int __for_bool_; };
-
- typedef _LIBCPP_NODEBUG_TYPE __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
-
- template <bool _Dummy>
- using _LValRefType _LIBCPP_NODEBUG_TYPE =
- typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
-
- template <bool _Dummy>
- using _GoodRValRefType _LIBCPP_NODEBUG_TYPE =
- typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
-
- template <bool _Dummy>
- using _BadRValRefType _LIBCPP_NODEBUG_TYPE =
- typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
-
- template <bool _Dummy, class _Deleter = typename __dependent_type<
- __identity<deleter_type>, _Dummy>::type>
- using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG_TYPE =
- typename enable_if<is_default_constructible<_Deleter>::value &&
- !is_pointer<_Deleter>::value>::type;
-
- template <class _ArgType>
- using _EnableIfDeleterConstructible _LIBCPP_NODEBUG_TYPE =
- typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
-
- template <class _UPtr, class _Up>
- using _EnableIfMoveConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
- is_convertible<typename _UPtr::pointer, pointer>::value &&
- !is_array<_Up>::value
- >::type;
-
- template <class _UDel>
- using _EnableIfDeleterConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
- (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
- (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
- >::type;
-
- template <class _UDel>
- using _EnableIfDeleterAssignable = typename enable_if<
- is_assignable<_Dp&, _UDel&&>::value
- >::type;
-
-public:
- template <bool _Dummy = true,
- class = _EnableIfDeleterDefaultConstructible<_Dummy> >
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(pointer(), __default_init_tag()) {}
-
- template <bool _Dummy = true,
- class = _EnableIfDeleterDefaultConstructible<_Dummy> >
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(pointer(), __default_init_tag()) {}
-
- template <bool _Dummy = true,
- class = _EnableIfDeleterDefaultConstructible<_Dummy> >
- _LIBCPP_INLINE_VISIBILITY
- explicit unique_ptr(pointer __p) _NOEXCEPT : __ptr_(__p, __default_init_tag()) {}
-
- template <bool _Dummy = true,
- class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(pointer __p, _LValRefType<_Dummy> __d) _NOEXCEPT
- : __ptr_(__p, __d) {}
-
- template <bool _Dummy = true,
- class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
- : __ptr_(__p, _VSTD::move(__d)) {
- static_assert(!is_reference<deleter_type>::value,
- "rvalue deleter bound to reference");
- }
-
- template <bool _Dummy = true,
- class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> > >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete;
-
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(unique_ptr&& __u) _NOEXCEPT
- : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
- }
-
- template <class _Up, class _Ep,
- class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
- class = _EnableIfDeleterConvertible<_Ep>
- >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
- : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(auto_ptr<_Up>&& __p,
- typename enable_if<is_convertible<_Up*, _Tp*>::value &&
- is_same<_Dp, default_delete<_Tp> >::value,
- __nat>::type = __nat()) _NOEXCEPT
- : __ptr_(__p.release(), __default_init_tag()) {}
-#endif
-
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
- return *this;
- }
-
- template <class _Up, class _Ep,
- class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
- class = _EnableIfDeleterAssignable<_Ep>
- >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr& operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
- return *this;
- }
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if<is_convertible<_Up*, _Tp*>::value &&
- is_same<_Dp, default_delete<_Tp> >::value,
- unique_ptr&>::type
- operator=(auto_ptr<_Up> __p) {
- reset(__p.release());
- return *this;
- }
-#endif
-
-#ifdef _LIBCPP_CXX03_LANG
- unique_ptr(unique_ptr const&) = delete;
- unique_ptr& operator=(unique_ptr const&) = delete;
-#endif
-
-
- _LIBCPP_INLINE_VISIBILITY
- ~unique_ptr() { reset(); }
-
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr& operator=(nullptr_t) _NOEXCEPT {
- reset();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- typename add_lvalue_reference<_Tp>::type
- operator*() const {
- return *__ptr_.first();
- }
- _LIBCPP_INLINE_VISIBILITY
- pointer operator->() const _NOEXCEPT {
- return __ptr_.first();
- }
- _LIBCPP_INLINE_VISIBILITY
- pointer get() const _NOEXCEPT {
- return __ptr_.first();
- }
- _LIBCPP_INLINE_VISIBILITY
- deleter_type& get_deleter() _NOEXCEPT {
- return __ptr_.second();
- }
- _LIBCPP_INLINE_VISIBILITY
- const deleter_type& get_deleter() const _NOEXCEPT {
- return __ptr_.second();
- }
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {
- return __ptr_.first() != nullptr;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- pointer release() _NOEXCEPT {
- pointer __t = __ptr_.first();
- __ptr_.first() = pointer();
- return __t;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void reset(pointer __p = pointer()) _NOEXCEPT {
- pointer __tmp = __ptr_.first();
- __ptr_.first() = __p;
- if (__tmp)
- __ptr_.second()(__tmp);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(unique_ptr& __u) _NOEXCEPT {
- __ptr_.swap(__u.__ptr_);
- }
-};
-
-
-template <class _Tp, class _Dp>
-class _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {
-public:
- typedef _Tp element_type;
- typedef _Dp deleter_type;
- typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
-
-private:
- __compressed_pair<pointer, deleter_type> __ptr_;
-
- template <class _From>
- struct _CheckArrayPointerConversion : is_same<_From, pointer> {};
-
- template <class _FromElem>
- struct _CheckArrayPointerConversion<_FromElem*>
- : integral_constant<bool,
- is_same<_FromElem*, pointer>::value ||
- (is_same<pointer, element_type*>::value &&
- is_convertible<_FromElem(*)[], element_type(*)[]>::value)
- >
- {};
-
- typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
-
- template <bool _Dummy>
- using _LValRefType _LIBCPP_NODEBUG_TYPE =
- typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
-
- template <bool _Dummy>
- using _GoodRValRefType _LIBCPP_NODEBUG_TYPE =
- typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
-
- template <bool _Dummy>
- using _BadRValRefType _LIBCPP_NODEBUG_TYPE =
- typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
-
- template <bool _Dummy, class _Deleter = typename __dependent_type<
- __identity<deleter_type>, _Dummy>::type>
- using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG_TYPE =
- typename enable_if<is_default_constructible<_Deleter>::value &&
- !is_pointer<_Deleter>::value>::type;
-
- template <class _ArgType>
- using _EnableIfDeleterConstructible _LIBCPP_NODEBUG_TYPE =
- typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
-
- template <class _Pp>
- using _EnableIfPointerConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
- _CheckArrayPointerConversion<_Pp>::value
- >::type;
-
- template <class _UPtr, class _Up,
- class _ElemT = typename _UPtr::element_type>
- using _EnableIfMoveConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
- is_array<_Up>::value &&
- is_same<pointer, element_type*>::value &&
- is_same<typename _UPtr::pointer, _ElemT*>::value &&
- is_convertible<_ElemT(*)[], element_type(*)[]>::value
- >::type;
-
- template <class _UDel>
- using _EnableIfDeleterConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if<
- (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
- (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
- >::type;
-
- template <class _UDel>
- using _EnableIfDeleterAssignable _LIBCPP_NODEBUG_TYPE = typename enable_if<
- is_assignable<_Dp&, _UDel&&>::value
- >::type;
-
-public:
- template <bool _Dummy = true,
- class = _EnableIfDeleterDefaultConstructible<_Dummy> >
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(pointer(), __default_init_tag()) {}
-
- template <bool _Dummy = true,
- class = _EnableIfDeleterDefaultConstructible<_Dummy> >
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(pointer(), __default_init_tag()) {}
-
- template <class _Pp, bool _Dummy = true,
- class = _EnableIfDeleterDefaultConstructible<_Dummy>,
- class = _EnableIfPointerConvertible<_Pp> >
- _LIBCPP_INLINE_VISIBILITY
- explicit unique_ptr(_Pp __p) _NOEXCEPT
- : __ptr_(__p, __default_init_tag()) {}
-
- template <class _Pp, bool _Dummy = true,
- class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> >,
- class = _EnableIfPointerConvertible<_Pp> >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) _NOEXCEPT
- : __ptr_(__p, __d) {}
-
- template <bool _Dummy = true,
- class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) _NOEXCEPT
- : __ptr_(nullptr, __d) {}
-
- template <class _Pp, bool _Dummy = true,
- class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> >,
- class = _EnableIfPointerConvertible<_Pp> >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
- : __ptr_(__p, _VSTD::move(__d)) {
- static_assert(!is_reference<deleter_type>::value,
- "rvalue deleter bound to reference");
- }
-
- template <bool _Dummy = true,
- class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
- : __ptr_(nullptr, _VSTD::move(__d)) {
- static_assert(!is_reference<deleter_type>::value,
- "rvalue deleter bound to reference");
- }
-
- template <class _Pp, bool _Dummy = true,
- class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> >,
- class = _EnableIfPointerConvertible<_Pp> >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete;
-
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(unique_ptr&& __u) _NOEXCEPT
- : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
- }
-
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
- return *this;
- }
-
- template <class _Up, class _Ep,
- class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
- class = _EnableIfDeleterConvertible<_Ep>
- >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
- : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {
- }
-
- template <class _Up, class _Ep,
- class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
- class = _EnableIfDeleterAssignable<_Ep>
- >
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr&
- operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
- return *this;
- }
-
-#ifdef _LIBCPP_CXX03_LANG
- unique_ptr(unique_ptr const&) = delete;
- unique_ptr& operator=(unique_ptr const&) = delete;
-#endif
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- ~unique_ptr() { reset(); }
-
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr& operator=(nullptr_t) _NOEXCEPT {
- reset();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- typename add_lvalue_reference<_Tp>::type
- operator[](size_t __i) const {
- return __ptr_.first()[__i];
- }
- _LIBCPP_INLINE_VISIBILITY
- pointer get() const _NOEXCEPT {
- return __ptr_.first();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- deleter_type& get_deleter() _NOEXCEPT {
- return __ptr_.second();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- const deleter_type& get_deleter() const _NOEXCEPT {
- return __ptr_.second();
- }
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {
- return __ptr_.first() != nullptr;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- pointer release() _NOEXCEPT {
- pointer __t = __ptr_.first();
- __ptr_.first() = pointer();
- return __t;
- }
-
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if<
- _CheckArrayPointerConversion<_Pp>::value
- >::type
- reset(_Pp __p) _NOEXCEPT {
- pointer __tmp = __ptr_.first();
- __ptr_.first() = __p;
- if (__tmp)
- __ptr_.second()(__tmp);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void reset(nullptr_t = nullptr) _NOEXCEPT {
- pointer __tmp = __ptr_.first();
- __ptr_.first() = nullptr;
- if (__tmp)
- __ptr_.second()(__tmp);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(unique_ptr& __u) _NOEXCEPT {
- __ptr_.swap(__u.__ptr_);
- }
-
-};
-
-template <class _Tp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<
- __is_swappable<_Dp>::value,
- void
->::type
-swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) _NOEXCEPT {__x.swap(__y);}
-
-template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __x.get() == __y.get();}
-
-template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x == __y);}
-
-template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator< (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y)
-{
- typedef typename unique_ptr<_T1, _D1>::pointer _P1;
- typedef typename unique_ptr<_T2, _D2>::pointer _P2;
- typedef typename common_type<_P1, _P2>::type _Vp;
- return less<_Vp>()(__x.get(), __y.get());
-}
-
-template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator> (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __y < __x;}
-
-template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__y < __x);}
-
-template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x < __y);}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
-{
- return !__x;
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
-{
- return !__x;
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
-{
- return static_cast<bool>(__x);
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
-{
- return static_cast<bool>(__x);
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t)
-{
- typedef typename unique_ptr<_T1, _D1>::pointer _P1;
- return less<_P1>()(__x.get(), nullptr);
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(nullptr_t, const unique_ptr<_T1, _D1>& __x)
-{
- typedef typename unique_ptr<_T1, _D1>::pointer _P1;
- return less<_P1>()(nullptr, __x.get());
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>(const unique_ptr<_T1, _D1>& __x, nullptr_t)
-{
- return nullptr < __x;
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>(nullptr_t, const unique_ptr<_T1, _D1>& __x)
-{
- return __x < nullptr;
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
-{
- return !(nullptr < __x);
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
-{
- return !(__x < nullptr);
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
-{
- return !(__x < nullptr);
-}
-
-template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
-{
- return !(nullptr < __x);
-}
-
-#if _LIBCPP_STD_VER > 11
-
-template<class _Tp>
-struct __unique_if
-{
- typedef unique_ptr<_Tp> __unique_single;
-};
-
-template<class _Tp>
-struct __unique_if<_Tp[]>
-{
- typedef unique_ptr<_Tp[]> __unique_array_unknown_bound;
-};
-
-template<class _Tp, size_t _Np>
-struct __unique_if<_Tp[_Np]>
-{
- typedef void __unique_array_known_bound;
-};
-
-template<class _Tp, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __unique_if<_Tp>::__unique_single
-make_unique(_Args&&... __args)
-{
- return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __unique_if<_Tp>::__unique_array_unknown_bound
-make_unique(size_t __n)
-{
- typedef typename remove_extent<_Tp>::type _Up;
- return unique_ptr<_Tp>(new _Up[__n]());
-}
-
-template<class _Tp, class... _Args>
- typename __unique_if<_Tp>::__unique_array_known_bound
- make_unique(_Args&&...) = delete;
-
-#endif // _LIBCPP_STD_VER > 11
-
-template <class _Tp, class _Dp>
-#ifdef _LIBCPP_CXX03_LANG
-struct _LIBCPP_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> >
-#else
-struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper<
- unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer> >
-#endif
-{
- typedef unique_ptr<_Tp, _Dp> argument_type;
- typedef size_t result_type;
- _LIBCPP_INLINE_VISIBILITY
- result_type operator()(const argument_type& __ptr) const
- {
- typedef typename argument_type::pointer pointer;
- return hash<pointer>()(__ptr.get());
- }
-};
-
-struct __destruct_n
-{
-private:
- size_t __size_;
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
- {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();}
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
- {}
-
- _LIBCPP_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
- {++__size_;}
- _LIBCPP_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
- {}
-
- _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
- {__size_ = __s;}
- _LIBCPP_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
- {}
-public:
- _LIBCPP_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
- : __size_(__s) {}
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY void __incr(_Tp*) _NOEXCEPT
- {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT
- {__set(__s, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT
- {__process(__p, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
-};
-
-template <class _Alloc>
-class __allocator_destructor
-{
- typedef _LIBCPP_NODEBUG_TYPE allocator_traits<_Alloc> __alloc_traits;
-public:
- typedef _LIBCPP_NODEBUG_TYPE typename __alloc_traits::pointer pointer;
- typedef _LIBCPP_NODEBUG_TYPE typename __alloc_traits::size_type size_type;
-private:
- _Alloc& __alloc_;
- size_type __s_;
-public:
- _LIBCPP_INLINE_VISIBILITY __allocator_destructor(_Alloc& __a, size_type __s)
- _NOEXCEPT
- : __alloc_(__a), __s_(__s) {}
- _LIBCPP_INLINE_VISIBILITY
- void operator()(pointer __p) _NOEXCEPT
- {__alloc_traits::deallocate(__alloc_, __p, __s_);}
-};
-
-template <class _InputIterator, class _ForwardIterator>
-_ForwardIterator
-uninitialized_copy(_InputIterator __f, _InputIterator __l, _ForwardIterator __r)
-{
- typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- _ForwardIterator __s = __r;
- try
- {
-#endif
- for (; __f != __l; ++__f, (void) ++__r)
- ::new (static_cast<void*>(_VSTD::addressof(*__r))) value_type(*__f);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- for (; __s != __r; ++__s)
- __s->~value_type();
- throw;
- }
-#endif
- return __r;
-}
-
-template <class _InputIterator, class _Size, class _ForwardIterator>
-_ForwardIterator
-uninitialized_copy_n(_InputIterator __f, _Size __n, _ForwardIterator __r)
-{
- typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- _ForwardIterator __s = __r;
- try
- {
-#endif
- for (; __n > 0; ++__f, (void) ++__r, (void) --__n)
- ::new (static_cast<void*>(_VSTD::addressof(*__r))) value_type(*__f);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- for (; __s != __r; ++__s)
- __s->~value_type();
- throw;
- }
-#endif
- return __r;
-}
-
-template <class _ForwardIterator, class _Tp>
-void
-uninitialized_fill(_ForwardIterator __f, _ForwardIterator __l, const _Tp& __x)
-{
- typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- _ForwardIterator __s = __f;
- try
- {
-#endif
- for (; __f != __l; ++__f)
- ::new (static_cast<void*>(_VSTD::addressof(*__f))) value_type(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- for (; __s != __f; ++__s)
- __s->~value_type();
- throw;
- }
-#endif
-}
-
-template <class _ForwardIterator, class _Size, class _Tp>
-_ForwardIterator
-uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
-{
- typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- _ForwardIterator __s = __f;
- try
- {
-#endif
- for (; __n > 0; ++__f, (void) --__n)
- ::new (static_cast<void*>(_VSTD::addressof(*__f))) value_type(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- for (; __s != __f; ++__s)
- __s->~value_type();
- throw;
- }
-#endif
- return __f;
-}
-
-#if _LIBCPP_STD_VER > 14
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-void destroy_at(_Tp* __loc) {
- _LIBCPP_ASSERT(__loc, "null pointer given to destroy_at");
- __loc->~_Tp();
-}
-
-template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void destroy(_ForwardIterator __first, _ForwardIterator __last) {
- for (; __first != __last; ++__first)
- _VSTD::destroy_at(_VSTD::addressof(*__first));
-}
-
-template <class _ForwardIterator, class _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
- for (; __n > 0; (void)++__first, --__n)
- _VSTD::destroy_at(_VSTD::addressof(*__first));
- return __first;
-}
-
-template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) {
- using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
- auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif
- for (; __idx != __last; ++__idx)
- ::new((void*)_VSTD::addressof(*__idx)) _Vt;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- _VSTD::destroy(__first, __idx);
- throw;
- }
-#endif
-}
-
-template <class _ForwardIterator, class _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
- using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
- auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif
- for (; __n > 0; (void)++__idx, --__n)
- ::new((void*)_VSTD::addressof(*__idx)) _Vt;
- return __idx;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- _VSTD::destroy(__first, __idx);
- throw;
- }
-#endif
-}
-
-
-template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) {
- using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
- auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif
- for (; __idx != __last; ++__idx)
- ::new((void*)_VSTD::addressof(*__idx)) _Vt();
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- _VSTD::destroy(__first, __idx);
- throw;
- }
-#endif
-}
-
-template <class _ForwardIterator, class _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
- using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
- auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif
- for (; __n > 0; (void)++__idx, --__n)
- ::new((void*)_VSTD::addressof(*__idx)) _Vt();
- return __idx;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- _VSTD::destroy(__first, __idx);
- throw;
- }
-#endif
-}
-
-
-template <class _InputIt, class _ForwardIt>
-inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIt uninitialized_move(_InputIt __first, _InputIt __last, _ForwardIt __first_res) {
- using _Vt = typename iterator_traits<_ForwardIt>::value_type;
- auto __idx = __first_res;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif
- for (; __first != __last; (void)++__idx, ++__first)
- ::new((void*)_VSTD::addressof(*__idx)) _Vt(std::move(*__first));
- return __idx;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- _VSTD::destroy(__first_res, __idx);
- throw;
- }
-#endif
-}
-
-template <class _InputIt, class _Size, class _ForwardIt>
-inline _LIBCPP_INLINE_VISIBILITY
-pair<_InputIt, _ForwardIt>
-uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) {
- using _Vt = typename iterator_traits<_ForwardIt>::value_type;
- auto __idx = __first_res;
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try {
-#endif
- for (; __n > 0; ++__idx, (void)++__first, --__n)
- ::new((void*)_VSTD::addressof(*__idx)) _Vt(std::move(*__first));
- return {__first, __idx};
-#ifndef _LIBCPP_NO_EXCEPTIONS
- } catch (...) {
- _VSTD::destroy(__first_res, __idx);
- throw;
- }
-#endif
-}
-
-
-#endif // _LIBCPP_STD_VER > 14
-
-// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)
-// should be sufficient for thread safety.
-// See https://bugs.llvm.org/show_bug.cgi?id=22803
-#if defined(__clang__) && __has_builtin(__atomic_add_fetch) \
- && defined(__ATOMIC_RELAXED) \
- && defined(__ATOMIC_ACQ_REL)
-# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT
-#elif defined(_LIBCPP_COMPILER_GCC)
-# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT
-#endif
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _Tp
-__libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT
-{
-#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
- return __atomic_add_fetch(&__t, 1, __ATOMIC_RELAXED);
-#else
- return __t += 1;
-#endif
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _Tp
-__libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT
-{
-#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
- return __atomic_add_fetch(&__t, -1, __ATOMIC_ACQ_REL);
-#else
- return __t -= 1;
-#endif
-}
-
-class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
- : public std::exception
-{
-public:
- bad_weak_ptr() _NOEXCEPT = default;
- bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default;
- virtual ~bad_weak_ptr() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
-};
-
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-void __throw_bad_weak_ptr()
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_weak_ptr();
-#else
- _VSTD::abort();
-#endif
-}
-
-template<class _Tp> class _LIBCPP_TEMPLATE_VIS weak_ptr;
-
-class _LIBCPP_TYPE_VIS __shared_count
-{
- __shared_count(const __shared_count&);
- __shared_count& operator=(const __shared_count&);
-
-protected:
- long __shared_owners_;
- virtual ~__shared_count();
-private:
- virtual void __on_zero_shared() _NOEXCEPT = 0;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- explicit __shared_count(long __refs = 0) _NOEXCEPT
- : __shared_owners_(__refs) {}
-
-#if defined(_LIBCPP_BUILDING_LIBRARY) && \
- defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
- void __add_shared() _NOEXCEPT;
- bool __release_shared() _NOEXCEPT;
-#else
- _LIBCPP_INLINE_VISIBILITY
- void __add_shared() _NOEXCEPT {
- __libcpp_atomic_refcount_increment(__shared_owners_);
- }
- _LIBCPP_INLINE_VISIBILITY
- bool __release_shared() _NOEXCEPT {
- if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1) {
- __on_zero_shared();
- return true;
- }
- return false;
- }
-#endif
- _LIBCPP_INLINE_VISIBILITY
- long use_count() const _NOEXCEPT {
- return __libcpp_relaxed_load(&__shared_owners_) + 1;
- }
-};
-
-class _LIBCPP_TYPE_VIS __shared_weak_count
- : private __shared_count
-{
- long __shared_weak_owners_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- explicit __shared_weak_count(long __refs = 0) _NOEXCEPT
- : __shared_count(__refs),
- __shared_weak_owners_(__refs) {}
-protected:
- virtual ~__shared_weak_count();
-
-public:
-#if defined(_LIBCPP_BUILDING_LIBRARY) && \
- defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
- void __add_shared() _NOEXCEPT;
- void __add_weak() _NOEXCEPT;
- void __release_shared() _NOEXCEPT;
-#else
- _LIBCPP_INLINE_VISIBILITY
- void __add_shared() _NOEXCEPT {
- __shared_count::__add_shared();
- }
- _LIBCPP_INLINE_VISIBILITY
- void __add_weak() _NOEXCEPT {
- __libcpp_atomic_refcount_increment(__shared_weak_owners_);
- }
- _LIBCPP_INLINE_VISIBILITY
- void __release_shared() _NOEXCEPT {
- if (__shared_count::__release_shared())
- __release_weak();
- }
-#endif
- void __release_weak() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
- long use_count() const _NOEXCEPT {return __shared_count::use_count();}
- __shared_weak_count* lock() _NOEXCEPT;
-
- // Define the function out only if we build static libc++ without RTTI.
- // Otherwise we may break clients who need to compile their projects with
- // -fno-rtti and yet link against a libc++.dylib compiled
- // without -fno-rtti.
-#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
- virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
-#endif
-private:
- virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
-};
-
-template <class _Tp, class _Dp, class _Alloc>
-class __shared_ptr_pointer
- : public __shared_weak_count
-{
- __compressed_pair<__compressed_pair<_Tp, _Dp>, _Alloc> __data_;
-public:
- _LIBCPP_INLINE_VISIBILITY
- __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
- : __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
-
-#ifndef _LIBCPP_NO_RTTI
- virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
-#endif
-
-private:
- virtual void __on_zero_shared() _NOEXCEPT;
- virtual void __on_zero_shared_weak() _NOEXCEPT;
-};
-
-#ifndef _LIBCPP_NO_RTTI
-
-template <class _Tp, class _Dp, class _Alloc>
-const void*
-__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT
-{
- return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr;
-}
-
-#endif // _LIBCPP_NO_RTTI
-
-template <class _Tp, class _Dp, class _Alloc>
-void
-__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared() _NOEXCEPT
-{
- __data_.first().second()(__data_.first().first());
- __data_.first().second().~_Dp();
-}
-
-template <class _Tp, class _Dp, class _Alloc>
-void
-__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
-{
- typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_pointer>::type _Al;
- typedef allocator_traits<_Al> _ATraits;
- typedef pointer_traits<typename _ATraits::pointer> _PTraits;
-
- _Al __a(__data_.second());
- __data_.second().~_Alloc();
- __a.deallocate(_PTraits::pointer_to(*this), 1);
-}
-
-template <class _Tp, class _Alloc>
-class __shared_ptr_emplace
- : public __shared_weak_count
-{
- __compressed_pair<_Alloc, _Tp> __data_;
-public:
-
- _LIBCPP_INLINE_VISIBILITY
- __shared_ptr_emplace(_Alloc __a)
- : __data_(_VSTD::move(__a), __value_init_tag()) {}
-
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
- : __data_(piecewise_construct, _VSTD::forward_as_tuple(__a),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)) {}
-#else // _LIBCPP_HAS_NO_VARIADICS
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- __shared_ptr_emplace(_Alloc __a, _A0& __a0)
- : __data_(__a, _Tp(__a0)) {}
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- __shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1)
- : __data_(__a, _Tp(__a0, __a1)) {}
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- __shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1, _A2& __a2)
- : __data_(__a, _Tp(__a0, __a1, __a2)) {}
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-private:
- virtual void __on_zero_shared() _NOEXCEPT;
- virtual void __on_zero_shared_weak() _NOEXCEPT;
-public:
- _LIBCPP_INLINE_VISIBILITY
- _Tp* get() _NOEXCEPT {return _VSTD::addressof(__data_.second());}
-};
-
-template <class _Tp, class _Alloc>
-void
-__shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared() _NOEXCEPT
-{
- __data_.second().~_Tp();
-}
-
-template <class _Tp, class _Alloc>
-void
-__shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
-{
- typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type _Al;
- typedef allocator_traits<_Al> _ATraits;
- typedef pointer_traits<typename _ATraits::pointer> _PTraits;
- _Al __a(__data_.first());
- __data_.first().~_Alloc();
- __a.deallocate(_PTraits::pointer_to(*this), 1);
-}
-
-struct __shared_ptr_dummy_rebind_allocator_type;
-template <>
-class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
-{
-public:
- template <class _Other>
- struct rebind
- {
- typedef allocator<_Other> other;
- };
-};
-
-template<class _Tp> class _LIBCPP_TEMPLATE_VIS enable_shared_from_this;
-
-template<class _Tp, class _Up>
-struct __compatible_with
-#if _LIBCPP_STD_VER > 14
- : is_convertible<remove_extent_t<_Tp>*, remove_extent_t<_Up>*> {};
-#else
- : is_convertible<_Tp*, _Up*> {};
-#endif // _LIBCPP_STD_VER > 14
-
-template<class _Tp>
-class _LIBCPP_TEMPLATE_VIS shared_ptr
-{
-public:
-#if _LIBCPP_STD_VER > 14
- typedef weak_ptr<_Tp> weak_type;
- typedef remove_extent_t<_Tp> element_type;
-#else
- typedef _Tp element_type;
-#endif
-
-private:
- element_type* __ptr_;
- __shared_weak_count* __cntrl_;
-
- struct __nat {int __for_bool_;};
-public:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT;
- template<class _Yp>
- explicit shared_ptr(_Yp* __p,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat());
- template<class _Yp, class _Dp>
- shared_ptr(_Yp* __p, _Dp __d,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat());
- template<class _Yp, class _Dp, class _Alloc>
- shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat());
- template <class _Dp> shared_ptr(nullptr_t __p, _Dp __d);
- template <class _Dp, class _Alloc> shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a);
- template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
- shared_ptr(const shared_ptr& __r) _NOEXCEPT;
- template<class _Yp>
- _LIBCPP_INLINE_VISIBILITY
- shared_ptr(const shared_ptr<_Yp>& __r,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())
- _NOEXCEPT;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- shared_ptr(shared_ptr&& __r) _NOEXCEPT;
- template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())
- _NOEXCEPT;
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
- typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type= __nat());
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template<class _Yp>
- shared_ptr(auto_ptr<_Yp>&& __r,
- typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
-#else
- template<class _Yp>
- shared_ptr(auto_ptr<_Yp> __r,
- typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
-#endif
-#endif
- template <class _Yp, class _Dp>
- shared_ptr(unique_ptr<_Yp, _Dp>&&,
- typename enable_if
- <
- !is_lvalue_reference<_Dp>::value &&
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
- __nat
- >::type = __nat());
- template <class _Yp, class _Dp>
- shared_ptr(unique_ptr<_Yp, _Dp>&&,
- typename enable_if
- <
- is_lvalue_reference<_Dp>::value &&
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
- __nat
- >::type = __nat());
-
- ~shared_ptr();
-
- _LIBCPP_INLINE_VISIBILITY
- shared_ptr& operator=(const shared_ptr& __r) _NOEXCEPT;
- template<class _Yp>
- typename enable_if
- <
- __compatible_with<_Yp, element_type>::value,
- shared_ptr&
- >::type
- _LIBCPP_INLINE_VISIBILITY
- operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
- template<class _Yp>
- typename enable_if
- <
- __compatible_with<_Yp, element_type>::value,
- shared_ptr&
- >::type
- _LIBCPP_INLINE_VISIBILITY
- operator=(shared_ptr<_Yp>&& __r);
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
- template<class _Yp>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_array<_Yp>::value &&
- is_convertible<_Yp*, element_type*>::value,
- shared_ptr
- >::type&
- operator=(auto_ptr<_Yp>&& __r);
-#endif
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
- template<class _Yp>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_array<_Yp>::value &&
- is_convertible<_Yp*, element_type*>::value,
- shared_ptr&
- >::type
- operator=(auto_ptr<_Yp> __r);
-#endif
-#endif
- template <class _Yp, class _Dp>
- typename enable_if
- <
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
- shared_ptr&
- >::type
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- operator=(unique_ptr<_Yp, _Dp>&& __r);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- operator=(unique_ptr<_Yp, _Dp> __r);
-#endif
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(shared_ptr& __r) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
- void reset() _NOEXCEPT;
- template<class _Yp>
- typename enable_if
- <
- __compatible_with<_Yp, element_type>::value,
- void
- >::type
- _LIBCPP_INLINE_VISIBILITY
- reset(_Yp* __p);
- template<class _Yp, class _Dp>
- typename enable_if
- <
- __compatible_with<_Yp, element_type>::value,
- void
- >::type
- _LIBCPP_INLINE_VISIBILITY
- reset(_Yp* __p, _Dp __d);
- template<class _Yp, class _Dp, class _Alloc>
- typename enable_if
- <
- __compatible_with<_Yp, element_type>::value,
- void
- >::type
- _LIBCPP_INLINE_VISIBILITY
- reset(_Yp* __p, _Dp __d, _Alloc __a);
-
- _LIBCPP_INLINE_VISIBILITY
- element_type* get() const _NOEXCEPT {return __ptr_;}
- _LIBCPP_INLINE_VISIBILITY
- typename add_lvalue_reference<element_type>::type operator*() const _NOEXCEPT
- {return *__ptr_;}
- _LIBCPP_INLINE_VISIBILITY
- element_type* operator->() const _NOEXCEPT
- {
- static_assert(!_VSTD::is_array<_Tp>::value,
- "std::shared_ptr<T>::operator-> is only valid when T is not an array type.");
- return __ptr_;
- }
- _LIBCPP_INLINE_VISIBILITY
- long use_count() const _NOEXCEPT {return __cntrl_ ? __cntrl_->use_count() : 0;}
- _LIBCPP_INLINE_VISIBILITY
- bool unique() const _NOEXCEPT {return use_count() == 1;}
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return get() != 0;}
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT
- {return __cntrl_ < __p.__cntrl_;}
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- bool owner_before(weak_ptr<_Up> const& __p) const _NOEXCEPT
- {return __cntrl_ < __p.__cntrl_;}
- _LIBCPP_INLINE_VISIBILITY
- bool
- __owner_equivalent(const shared_ptr& __p) const
- {return __cntrl_ == __p.__cntrl_;}
-
-#if _LIBCPP_STD_VER > 14
- typename add_lvalue_reference<element_type>::type
- _LIBCPP_INLINE_VISIBILITY
- operator[](ptrdiff_t __i) const
- {
- static_assert(_VSTD::is_array<_Tp>::value,
- "std::shared_ptr<T>::operator[] is only valid when T is an array type.");
- return __ptr_[__i];
- }
-#endif
-
-#ifndef _LIBCPP_NO_RTTI
- template <class _Dp>
- _LIBCPP_INLINE_VISIBILITY
- _Dp* __get_deleter() const _NOEXCEPT
- {return static_cast<_Dp*>(__cntrl_
- ? const_cast<void *>(__cntrl_->__get_deleter(typeid(_Dp)))
- : nullptr);}
-#endif // _LIBCPP_NO_RTTI
-
- template<class _Yp, class _CntrlBlk>
- static shared_ptr<_Tp>
- __create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl) _NOEXCEPT
- {
- shared_ptr<_Tp> __r;
- __r.__ptr_ = __p;
- __r.__cntrl_ = __cntrl;
- __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
- return __r;
- }
-
-private:
- template <class _Yp, bool = is_function<_Yp>::value>
- struct __shared_ptr_default_allocator
- {
- typedef allocator<_Yp> type;
- };
-
- template <class _Yp>
- struct __shared_ptr_default_allocator<_Yp, true>
- {
- typedef allocator<__shared_ptr_dummy_rebind_allocator_type> type;
- };
-
- template <class _Yp, class _OrigPtr>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if<is_convertible<_OrigPtr*,
- const enable_shared_from_this<_Yp>*
- >::value,
- void>::type
- __enable_weak_this(const enable_shared_from_this<_Yp>* __e,
- _OrigPtr* __ptr) _NOEXCEPT
- {
- typedef typename remove_cv<_Yp>::type _RawYp;
- if (__e && __e->__weak_this_.expired())
- {
- __e->__weak_this_ = shared_ptr<_RawYp>(*this,
- const_cast<_RawYp*>(static_cast<const _Yp*>(__ptr)));
- }
- }
-
- _LIBCPP_INLINE_VISIBILITY void __enable_weak_this(...) _NOEXCEPT {}
-
- template <class, class _Yp>
- struct __shared_ptr_default_delete
- : default_delete<_Yp> {};
-
- template <class _Yp, class _Un, size_t _Sz>
- struct __shared_ptr_default_delete<_Yp[_Sz], _Un>
- : default_delete<_Yp[]> {};
-
- template <class _Yp, class _Un>
- struct __shared_ptr_default_delete<_Yp[], _Un>
- : default_delete<_Yp[]> {};
-
- template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
- template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
-};
-
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-template<class _Tp>
-shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
-template<class _Tp, class _Dp>
-shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>;
-#endif
-
-template<class _Tp>
-inline
-_LIBCPP_CONSTEXPR
-shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
- : __ptr_(0),
- __cntrl_(0)
-{
-}
-
-template<class _Tp>
-inline
-_LIBCPP_CONSTEXPR
-shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
- : __ptr_(0),
- __cntrl_(0)
-{
-}
-
-template<class _Tp>
-template<class _Yp>
-shared_ptr<_Tp>::shared_ptr(_Yp* __p,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type)
- : __ptr_(__p)
-{
- unique_ptr<_Yp> __hold(__p);
- typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
- typedef __shared_ptr_pointer<_Yp*, __shared_ptr_default_delete<_Tp, _Yp>, _AllocT > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__p, __shared_ptr_default_delete<_Tp, _Yp>(), _AllocT());
- __hold.release();
- __enable_weak_this(__p, __p);
-}
-
-template<class _Tp>
-template<class _Yp, class _Dp>
-shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type)
- : __ptr_(__p)
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
-#endif // _LIBCPP_NO_EXCEPTIONS
- typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
- typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
- __enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- __d(__p);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
-}
-
-template<class _Tp>
-template<class _Dp>
-shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d)
- : __ptr_(0)
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
-#endif // _LIBCPP_NO_EXCEPTIONS
- typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
- typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- __d(__p);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
-}
-
-template<class _Tp>
-template<class _Yp, class _Dp, class _Alloc>
-shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type)
- : __ptr_(__p)
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
-#endif // _LIBCPP_NO_EXCEPTIONS
- typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
- typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
- typedef __allocator_destructor<_A2> _D2;
- _A2 __a2(__a);
- unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
- ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
- _CntrlBlk(__p, __d, __a);
- __cntrl_ = _VSTD::addressof(*__hold2.release());
- __enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- __d(__p);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
-}
-
-template<class _Tp>
-template<class _Dp, class _Alloc>
-shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
- : __ptr_(0)
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
-#endif // _LIBCPP_NO_EXCEPTIONS
- typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
- typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
- typedef __allocator_destructor<_A2> _D2;
- _A2 __a2(__a);
- unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
- ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
- _CntrlBlk(__p, __d, __a);
- __cntrl_ = _VSTD::addressof(*__hold2.release());
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- __d(__p);
- throw;
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) _NOEXCEPT
- : __ptr_(__p),
- __cntrl_(__r.__cntrl_)
-{
- if (__cntrl_)
- __cntrl_->__add_shared();
-}
-
-template<class _Tp>
-inline
-shared_ptr<_Tp>::shared_ptr(const shared_ptr& __r) _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- if (__cntrl_)
- __cntrl_->__add_shared();
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type)
- _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- if (__cntrl_)
- __cntrl_->__add_shared();
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template<class _Tp>
-inline
-shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- __r.__ptr_ = 0;
- __r.__cntrl_ = 0;
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
- typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type)
- _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- __r.__ptr_ = 0;
- __r.__cntrl_ = 0;
-}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-template<class _Tp>
-template<class _Yp>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r,
-#else
-shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r,
-#endif
- typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
- : __ptr_(__r.get())
-{
- typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__r.get(), default_delete<_Yp>(), allocator<_Yp>());
- __enable_weak_this(__r.get(), __r.get());
- __r.release();
-}
-#endif
-
-template<class _Tp>
-template <class _Yp, class _Dp>
-shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
- typename enable_if
- <
- !is_lvalue_reference<_Dp>::value &&
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
- __nat
- >::type)
- : __ptr_(__r.get())
-{
-#if _LIBCPP_STD_VER > 11
- if (__ptr_ == nullptr)
- __cntrl_ = nullptr;
- else
-#endif
- {
- typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
- typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), _AllocT());
- __enable_weak_this(__r.get(), __r.get());
- }
- __r.release();
-}
-
-template<class _Tp>
-template <class _Yp, class _Dp>
-shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
- typename enable_if
- <
- is_lvalue_reference<_Dp>::value &&
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
- __nat
- >::type)
- : __ptr_(__r.get())
-{
-#if _LIBCPP_STD_VER > 11
- if (__ptr_ == nullptr)
- __cntrl_ = nullptr;
- else
-#endif
- {
- typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
- typedef __shared_ptr_pointer<_Yp*,
- reference_wrapper<typename remove_reference<_Dp>::type>,
- _AllocT > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__r.get(), _VSTD::ref(__r.get_deleter()), _AllocT());
- __enable_weak_this(__r.get(), __r.get());
- }
- __r.release();
-}
-
-template<class _Tp>
-shared_ptr<_Tp>::~shared_ptr()
-{
- if (__cntrl_)
- __cntrl_->__release_shared();
-}
-
-template<class _Tp>
-inline
-shared_ptr<_Tp>&
-shared_ptr<_Tp>::operator=(const shared_ptr& __r) _NOEXCEPT
-{
- shared_ptr(__r).swap(*this);
- return *this;
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-typename enable_if
-<
- __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
- shared_ptr<_Tp>&
->::type
-shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
-{
- shared_ptr(__r).swap(*this);
- return *this;
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template<class _Tp>
-inline
-shared_ptr<_Tp>&
-shared_ptr<_Tp>::operator=(shared_ptr&& __r) _NOEXCEPT
-{
- shared_ptr(_VSTD::move(__r)).swap(*this);
- return *this;
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-typename enable_if
-<
- __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
- shared_ptr<_Tp>&
->::type
-shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
-{
- shared_ptr(_VSTD::move(__r)).swap(*this);
- return *this;
-}
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-template<class _Tp>
-template<class _Yp>
-inline
-typename enable_if
-<
- !is_array<_Yp>::value &&
- is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
- shared_ptr<_Tp>
->::type&
-shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
-{
- shared_ptr(_VSTD::move(__r)).swap(*this);
- return *this;
-}
-#endif
-
-template<class _Tp>
-template <class _Yp, class _Dp>
-inline
-typename enable_if
-<
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer,
- typename shared_ptr<_Tp>::element_type*>::value,
- shared_ptr<_Tp>&
->::type
-shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
-{
- shared_ptr(_VSTD::move(__r)).swap(*this);
- return *this;
-}
-
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-template<class _Tp>
-template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_array<_Yp>::value &&
- is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
- shared_ptr<_Tp>&
->::type
-shared_ptr<_Tp>::operator=(auto_ptr<_Yp> __r)
-{
- shared_ptr(__r).swap(*this);
- return *this;
-}
-#endif
-
-template<class _Tp>
-template <class _Yp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer,
- typename shared_ptr<_Tp>::element_type*>::value,
- shared_ptr<_Tp>&
->::type
-shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r)
-{
- shared_ptr(_VSTD::move(__r)).swap(*this);
- return *this;
-}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template<class _Tp>
-inline
-void
-shared_ptr<_Tp>::swap(shared_ptr& __r) _NOEXCEPT
-{
- _VSTD::swap(__ptr_, __r.__ptr_);
- _VSTD::swap(__cntrl_, __r.__cntrl_);
-}
-
-template<class _Tp>
-inline
-void
-shared_ptr<_Tp>::reset() _NOEXCEPT
-{
- shared_ptr().swap(*this);
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-typename enable_if
-<
- __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
- void
->::type
-shared_ptr<_Tp>::reset(_Yp* __p)
-{
- shared_ptr(__p).swap(*this);
-}
-
-template<class _Tp>
-template<class _Yp, class _Dp>
-inline
-typename enable_if
-<
- __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
- void
->::type
-shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d)
-{
- shared_ptr(__p, __d).swap(*this);
-}
-
-template<class _Tp>
-template<class _Yp, class _Dp, class _Alloc>
-inline
-typename enable_if
-<
- __compatible_with<_Yp, typename shared_ptr<_Tp>::element_type>::value,
- void
->::type
-shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a)
-{
- shared_ptr(__p, __d, __a).swap(*this);
-}
-
-template<class _Tp, class ..._Args>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_array<_Tp>::value,
- shared_ptr<_Tp>
->::type
-make_shared(_Args&& ...__args)
-{
- static_assert(is_constructible<_Tp, _Args...>::value, "Can't construct object in make_shared");
- typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
- typedef allocator<_CntrlBlk> _A2;
- typedef __allocator_destructor<_A2> _D2;
-
- _A2 __a2;
- unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
- ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
-
- _Tp *__ptr = __hold2.get()->get();
- return shared_ptr<_Tp>::__create_with_control_block(__ptr, __hold2.release());
-}
-
-template<class _Tp, class _Alloc, class ..._Args>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_array<_Tp>::value,
- shared_ptr<_Tp>
->::type
-allocate_shared(const _Alloc& __a, _Args&& ...__args)
-{
- static_assert( is_constructible<_Tp, _Args...>::value, "Can't construct object in allocate_shared");
-
- typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
- typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
- typedef __allocator_destructor<_A2> _D2;
-
- _A2 __a2(__a);
- unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
- ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
- _CntrlBlk(__a, _VSTD::forward<_Args>(__args)...);
-
- typename shared_ptr<_Tp>::element_type *__p = __hold2.get()->get();
- return shared_ptr<_Tp>::__create_with_control_block(__p, _VSTD::addressof(*__hold2.release()));
-}
-
-template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
-{
- return __x.get() == __y.get();
-}
-
-template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
-{
- return !(__x == __y);
-}
-
-template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
-{
-#if _LIBCPP_STD_VER <= 11
- typedef typename common_type<_Tp*, _Up*>::type _Vp;
- return less<_Vp>()(__x.get(), __y.get());
-#else
- return less<>()(__x.get(), __y.get());
-#endif
-
-}
-
-template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
-{
- return __y < __x;
-}
-
-template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
-{
- return !(__y < __x);
-}
-
-template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
-{
- return !(__x < __y);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
-{
- return !__x;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
-{
- return !__x;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
-{
- return static_cast<bool>(__x);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
-{
- return static_cast<bool>(__x);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
-{
- return less<_Tp*>()(__x.get(), nullptr);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
-{
- return less<_Tp*>()(nullptr, __x.get());
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
-{
- return nullptr < __x;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
-{
- return __x < nullptr;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
-{
- return !(nullptr < __x);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
-{
- return !(__x < nullptr);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
-{
- return !(__x < nullptr);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
-{
- return !(nullptr < __x);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __y) _NOEXCEPT
-{
- __x.swap(__y);
-}
-
-template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-shared_ptr<_Tp>
-static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
-{
- return shared_ptr<_Tp>(__r,
- static_cast<
- typename shared_ptr<_Tp>::element_type*>(__r.get()));
-}
-
-template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-shared_ptr<_Tp>
-dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
-{
- typedef typename shared_ptr<_Tp>::element_type _ET;
- _ET* __p = dynamic_cast<_ET*>(__r.get());
- return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>();
-}
-
-template<class _Tp, class _Up>
-shared_ptr<_Tp>
-const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
-{
- typedef typename shared_ptr<_Tp>::element_type _RTp;
- return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get()));
-}
-
-template<class _Tp, class _Up>
-shared_ptr<_Tp>
-reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
-{
- return shared_ptr<_Tp>(__r,
- reinterpret_cast<
- typename shared_ptr<_Tp>::element_type*>(__r.get()));
-}
-
-#ifndef _LIBCPP_NO_RTTI
-
-template<class _Dp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_Dp*
-get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
-{
- return __p.template __get_deleter<_Dp>();
-}
-
-#endif // _LIBCPP_NO_RTTI
-
-template<class _Tp>
-class _LIBCPP_TEMPLATE_VIS weak_ptr
-{
-public:
- typedef _Tp element_type;
-private:
- element_type* __ptr_;
- __shared_weak_count* __cntrl_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT;
- template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
- _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
- weak_ptr(weak_ptr const& __r) _NOEXCEPT;
- template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
- _NOEXCEPT;
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- weak_ptr(weak_ptr&& __r) _NOEXCEPT;
- template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
- _NOEXCEPT;
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- ~weak_ptr();
-
- _LIBCPP_INLINE_VISIBILITY
- weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT;
- template<class _Yp>
- typename enable_if
- <
- is_convertible<_Yp*, element_type*>::value,
- weak_ptr&
- >::type
- _LIBCPP_INLINE_VISIBILITY
- operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- _LIBCPP_INLINE_VISIBILITY
- weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;
- template<class _Yp>
- typename enable_if
- <
- is_convertible<_Yp*, element_type*>::value,
- weak_ptr&
- >::type
- _LIBCPP_INLINE_VISIBILITY
- operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- template<class _Yp>
- typename enable_if
- <
- is_convertible<_Yp*, element_type*>::value,
- weak_ptr&
- >::type
- _LIBCPP_INLINE_VISIBILITY
- operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT;
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(weak_ptr& __r) _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
- void reset() _NOEXCEPT;
-
- _LIBCPP_INLINE_VISIBILITY
- long use_count() const _NOEXCEPT
- {return __cntrl_ ? __cntrl_->use_count() : 0;}
- _LIBCPP_INLINE_VISIBILITY
- bool expired() const _NOEXCEPT
- {return __cntrl_ == 0 || __cntrl_->use_count() == 0;}
- shared_ptr<_Tp> lock() const _NOEXCEPT;
- template<class _Up>
- _LIBCPP_INLINE_VISIBILITY
- bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT
- {return __cntrl_ < __r.__cntrl_;}
- template<class _Up>
- _LIBCPP_INLINE_VISIBILITY
- bool owner_before(const weak_ptr<_Up>& __r) const _NOEXCEPT
- {return __cntrl_ < __r.__cntrl_;}
-
- template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
- template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
-};
-
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-template<class _Tp>
-weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
-#endif
-
-template<class _Tp>
-inline
-_LIBCPP_CONSTEXPR
-weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
- : __ptr_(0),
- __cntrl_(0)
-{
-}
-
-template<class _Tp>
-inline
-weak_ptr<_Tp>::weak_ptr(weak_ptr const& __r) _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- if (__cntrl_)
- __cntrl_->__add_weak();
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
- _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- if (__cntrl_)
- __cntrl_->__add_weak();
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
- _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- if (__cntrl_)
- __cntrl_->__add_weak();
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template<class _Tp>
-inline
-weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- __r.__ptr_ = 0;
- __r.__cntrl_ = 0;
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
- _NOEXCEPT
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_)
-{
- __r.__ptr_ = 0;
- __r.__cntrl_ = 0;
-}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template<class _Tp>
-weak_ptr<_Tp>::~weak_ptr()
-{
- if (__cntrl_)
- __cntrl_->__release_weak();
-}
-
-template<class _Tp>
-inline
-weak_ptr<_Tp>&
-weak_ptr<_Tp>::operator=(weak_ptr const& __r) _NOEXCEPT
-{
- weak_ptr(__r).swap(*this);
- return *this;
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-typename enable_if
-<
- is_convertible<_Yp*, _Tp*>::value,
- weak_ptr<_Tp>&
->::type
-weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT
-{
- weak_ptr(__r).swap(*this);
- return *this;
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template<class _Tp>
-inline
-weak_ptr<_Tp>&
-weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT
-{
- weak_ptr(_VSTD::move(__r)).swap(*this);
- return *this;
-}
-
-template<class _Tp>
-template<class _Yp>
-inline
-typename enable_if
-<
- is_convertible<_Yp*, _Tp*>::value,
- weak_ptr<_Tp>&
->::type
-weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
-{
- weak_ptr(_VSTD::move(__r)).swap(*this);
- return *this;
-}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template<class _Tp>
-template<class _Yp>
-inline
-typename enable_if
-<
- is_convertible<_Yp*, _Tp*>::value,
- weak_ptr<_Tp>&
->::type
-weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT
-{
- weak_ptr(__r).swap(*this);
- return *this;
-}
-
-template<class _Tp>
-inline
-void
-weak_ptr<_Tp>::swap(weak_ptr& __r) _NOEXCEPT
-{
- _VSTD::swap(__ptr_, __r.__ptr_);
- _VSTD::swap(__cntrl_, __r.__cntrl_);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-swap(weak_ptr<_Tp>& __x, weak_ptr<_Tp>& __y) _NOEXCEPT
-{
- __x.swap(__y);
-}
-
-template<class _Tp>
-inline
-void
-weak_ptr<_Tp>::reset() _NOEXCEPT
-{
- weak_ptr().swap(*this);
-}
-
-template<class _Tp>
-template<class _Yp>
-shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r,
- typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
- : __ptr_(__r.__ptr_),
- __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_)
-{
- if (__cntrl_ == 0)
- __throw_bad_weak_ptr();
-}
-
-template<class _Tp>
-shared_ptr<_Tp>
-weak_ptr<_Tp>::lock() const _NOEXCEPT
-{
- shared_ptr<_Tp> __r;
- __r.__cntrl_ = __cntrl_ ? __cntrl_->lock() : __cntrl_;
- if (__r.__cntrl_)
- __r.__ptr_ = __ptr_;
- return __r;
-}
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp = void> struct owner_less;
-#else
-template <class _Tp> struct owner_less;
-#endif
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS owner_less<shared_ptr<_Tp> >
- : binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
-{
- typedef bool result_type;
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS owner_less<weak_ptr<_Tp> >
- : binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool>
-{
- typedef bool result_type;
- _LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
-};
-
-#if _LIBCPP_STD_VER > 14
-template <>
-struct _LIBCPP_TEMPLATE_VIS owner_less<void>
-{
- template <class _Tp, class _Up>
- _LIBCPP_INLINE_VISIBILITY
- bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
- template <class _Tp, class _Up>
- _LIBCPP_INLINE_VISIBILITY
- bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
- template <class _Tp, class _Up>
- _LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
- template <class _Tp, class _Up>
- _LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT
- {return __x.owner_before(__y);}
- typedef void is_transparent;
-};
-#endif
-
-template<class _Tp>
-class _LIBCPP_TEMPLATE_VIS enable_shared_from_this
-{
- mutable weak_ptr<_Tp> __weak_this_;
-protected:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- enable_shared_from_this() _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY
- enable_shared_from_this(enable_shared_from_this const&) _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY
- enable_shared_from_this& operator=(enable_shared_from_this const&) _NOEXCEPT
- {return *this;}
- _LIBCPP_INLINE_VISIBILITY
- ~enable_shared_from_this() {}
-public:
- _LIBCPP_INLINE_VISIBILITY
- shared_ptr<_Tp> shared_from_this()
- {return shared_ptr<_Tp>(__weak_this_);}
- _LIBCPP_INLINE_VISIBILITY
- shared_ptr<_Tp const> shared_from_this() const
- {return shared_ptr<const _Tp>(__weak_this_);}
-
-#if _LIBCPP_STD_VER > 14
- _LIBCPP_INLINE_VISIBILITY
- weak_ptr<_Tp> weak_from_this() _NOEXCEPT
- { return __weak_this_; }
-
- _LIBCPP_INLINE_VISIBILITY
- weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT
- { return __weak_this_; }
-#endif // _LIBCPP_STD_VER > 14
-
- template <class _Up> friend class shared_ptr;
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS hash<shared_ptr<_Tp> >
-{
- typedef shared_ptr<_Tp> argument_type;
- typedef size_t result_type;
-
- _LIBCPP_INLINE_VISIBILITY
- result_type operator()(const argument_type& __ptr) const _NOEXCEPT
- {
- return hash<typename shared_ptr<_Tp>::element_type*>()(__ptr.get());
- }
-};
-
-template<class _CharT, class _Traits, class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_ostream<_CharT, _Traits>&
-operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
-
-
-#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
-
-class _LIBCPP_TYPE_VIS __sp_mut
-{
- void* __lx;
-public:
- void lock() _NOEXCEPT;
- void unlock() _NOEXCEPT;
-
-private:
- _LIBCPP_CONSTEXPR __sp_mut(void*) _NOEXCEPT;
- __sp_mut(const __sp_mut&);
- __sp_mut& operator=(const __sp_mut&);
-
- friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
-};
-
-_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-__sp_mut& __get_sp_mut(const void*);
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_is_lock_free(const shared_ptr<_Tp>*)
-{
- return false;
-}
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-shared_ptr<_Tp>
-atomic_load(const shared_ptr<_Tp>* __p)
-{
- __sp_mut& __m = __get_sp_mut(__p);
- __m.lock();
- shared_ptr<_Tp> __q = *__p;
- __m.unlock();
- return __q;
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-shared_ptr<_Tp>
-atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
-{
- return atomic_load(__p);
-}
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-void
-atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
-{
- __sp_mut& __m = __get_sp_mut(__p);
- __m.lock();
- __p->swap(__r);
- __m.unlock();
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-void
-atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
-{
- atomic_store(__p, __r);
-}
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-shared_ptr<_Tp>
-atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
-{
- __sp_mut& __m = __get_sp_mut(__p);
- __m.lock();
- __p->swap(__r);
- __m.unlock();
- return __r;
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-shared_ptr<_Tp>
-atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
-{
- return atomic_exchange(__p, __r);
-}
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-bool
-atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
-{
- shared_ptr<_Tp> __temp;
- __sp_mut& __m = __get_sp_mut(__p);
- __m.lock();
- if (__p->__owner_equivalent(*__v))
- {
- _VSTD::swap(__temp, *__p);
- *__p = __w;
- __m.unlock();
- return true;
- }
- _VSTD::swap(__temp, *__v);
- *__v = *__p;
- __m.unlock();
- return false;
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-bool
-atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
-{
- return atomic_compare_exchange_strong(__p, __v, __w);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-bool
-atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
- shared_ptr<_Tp> __w, memory_order, memory_order)
-{
- return atomic_compare_exchange_strong(__p, __v, __w);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-bool
-atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
- shared_ptr<_Tp> __w, memory_order, memory_order)
-{
- return atomic_compare_exchange_weak(__p, __v, __w);
-}
-
-#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
-
-//enum class
-#if defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE)
-# ifndef _LIBCPP_CXX03_LANG
-enum class pointer_safety : unsigned char {
- relaxed,
- preferred,
- strict
-};
-# endif
-#else
-struct _LIBCPP_TYPE_VIS pointer_safety
-{
- enum __lx
- {
- relaxed,
- preferred,
- strict
- };
-
- __lx __v_;
-
- _LIBCPP_INLINE_VISIBILITY
- pointer_safety() : __v_() {}
-
- _LIBCPP_INLINE_VISIBILITY
- pointer_safety(__lx __v) : __v_(__v) {}
- _LIBCPP_INLINE_VISIBILITY
- operator int() const {return __v_;}
-};
-#endif
-
-#if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE) && \
- defined(_LIBCPP_BUILDING_LIBRARY)
-_LIBCPP_FUNC_VIS pointer_safety get_pointer_safety() _NOEXCEPT;
-#else
-// This function is only offered in C++03 under ABI v1.
-# if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE) || !defined(_LIBCPP_CXX03_LANG)
-inline _LIBCPP_INLINE_VISIBILITY
-pointer_safety get_pointer_safety() _NOEXCEPT {
- return pointer_safety::relaxed;
-}
-# endif
-#endif
-
-
-_LIBCPP_FUNC_VIS void declare_reachable(void* __p);
-_LIBCPP_FUNC_VIS void declare_no_pointers(char* __p, size_t __n);
-_LIBCPP_FUNC_VIS void undeclare_no_pointers(char* __p, size_t __n);
-_LIBCPP_FUNC_VIS void* __undeclare_reachable(void* __p);
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_Tp*
-undeclare_reachable(_Tp* __p)
-{
- return static_cast<_Tp*>(__undeclare_reachable(__p));
-}
-
-_LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
-
-// --- Helper for container swap --
-template <typename _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
-void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
- _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
-#endif
-{
- __swap_allocator(__a1, __a2,
- integral_constant<bool, _VSTD::allocator_traits<_Alloc>::propagate_on_container_swap::value>());
-}
-
-template <typename _Alloc>
-_LIBCPP_INLINE_VISIBILITY
-void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
-#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
-#else
- _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
-#endif
-{
- using _VSTD::swap;
- swap(__a1, __a2);
-}
-
-template <typename _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
-void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
-
-template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
-struct __noexcept_move_assign_container : public integral_constant<bool,
- _Traits::propagate_on_container_move_assignment::value
-#if _LIBCPP_STD_VER > 14
- || _Traits::is_always_equal::value
-#else
- && is_nothrow_move_assignable<_Alloc>::value
-#endif
- > {};
-
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-template <class _Tp, class _Alloc>
-struct __temp_value {
- typedef allocator_traits<_Alloc> _Traits;
-
- typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;
- _Alloc &__a;
-
- _Tp *__addr() { return reinterpret_cast<_Tp *>(addressof(__v)); }
- _Tp & get() { return *__addr(); }
-
- template<class... _Args>
- _LIBCPP_NO_CFI
- __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
- _Traits::construct(__a, reinterpret_cast<_Tp*>(addressof(__v)),
- _VSTD::forward<_Args>(__args)...);
- }
+ template<class... _Args>
+ _LIBCPP_NO_CFI
+ __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
+ _Traits::construct(__a, reinterpret_cast<_Tp*>(addressof(__v)),
+ _VSTD::forward<_Args>(__args)...);
+ }
~__temp_value() { _Traits::destroy(__a, __addr()); }
};
-#endif
template<typename _Alloc, typename = void, typename = void>
struct __is_allocator : false_type {};
template<typename _Alloc>
struct __is_allocator<_Alloc,
typename __void_t<typename _Alloc::value_type>::type,
- typename __void_t<decltype(_VSTD::declval<_Alloc&>().allocate(size_t(0)))>::type
+ typename __void_t<decltype(declval<_Alloc&>().allocate(size_t(0)))>::type
>
: true_type {};
: __size_(__size), __align_(__align) {}
void operator()(void* p) const _NOEXCEPT {
- std::__libcpp_deallocate(p, __size_, __align_);
+ _VSTD::__libcpp_deallocate(p, __size_, __align_);
}
private:
typedef unique_ptr<void, __builtin_new_deleter> __holder_t;
static __holder_t __allocate_bytes(size_t __s, size_t __align) {
- return __holder_t(std::__libcpp_allocate(__s, __align),
+ return __holder_t(_VSTD::__libcpp_allocate(__s, __align),
__builtin_new_deleter(__s, __align));
}
static void __deallocate_bytes(void* __p, size_t __s,
size_t __align) _NOEXCEPT {
- std::__libcpp_deallocate(__p, __s, __align);
+ _VSTD::__libcpp_deallocate(__p, __s, __align);
}
template <class _Tp>
# include <__pstl_memory>
#endif
-#endif // _LIBCPP_MEMORY
+#endif // _LIBCPP_MEMORY
header "algorithm"
export initializer_list
export *
+
+ module __algorithm {
+ module adjacent_find { private header "__algorithm/adjacent_find.h" }
+ module all_of { private header "__algorithm/all_of.h" }
+ module any_of { private header "__algorithm/any_of.h" }
+ module binary_search { private header "__algorithm/binary_search.h" }
+ module clamp { private header "__algorithm/clamp.h" }
+ module comp { private header "__algorithm/comp.h" }
+ module comp_ref_type { private header "__algorithm/comp_ref_type.h" }
+ module copy { private header "__algorithm/copy.h" }
+ module copy_backward { private header "__algorithm/copy_backward.h" }
+ module copy_if { private header "__algorithm/copy_if.h" }
+ module copy_n { private header "__algorithm/copy_n.h" }
+ module count { private header "__algorithm/count.h" }
+ module count_if { private header "__algorithm/count_if.h" }
+ module equal { private header "__algorithm/equal.h" }
+ module equal_range { private header "__algorithm/equal_range.h" }
+ module fill { private header "__algorithm/fill.h" }
+ module fill_n { private header "__algorithm/fill_n.h" }
+ module find { private header "__algorithm/find.h" }
+ module find_end { private header "__algorithm/find_end.h" }
+ module find_first_of { private header "__algorithm/find_first_of.h" }
+ module find_if { private header "__algorithm/find_if.h" }
+ module find_if_not { private header "__algorithm/find_if_not.h" }
+ module for_each { private header "__algorithm/for_each.h" }
+ module for_each_n { private header "__algorithm/for_each_n.h" }
+ module generate { private header "__algorithm/generate.h" }
+ module generate_n { private header "__algorithm/generate_n.h" }
+ module half_positive { private header "__algorithm/half_positive.h" }
+ module includes { private header "__algorithm/includes.h" }
+ module inplace_merge { private header "__algorithm/inplace_merge.h" }
+ module is_heap { private header "__algorithm/is_heap.h" }
+ module is_heap_until { private header "__algorithm/is_heap_until.h" }
+ module is_partitioned { private header "__algorithm/is_partitioned.h" }
+ module is_permutation { private header "__algorithm/is_permutation.h" }
+ module is_sorted { private header "__algorithm/is_sorted.h" }
+ module is_sorted_until { private header "__algorithm/is_sorted_until.h" }
+ module iter_swap { private header "__algorithm/iter_swap.h" }
+ module lexicographical_compare { private header "__algorithm/lexicographical_compare.h" }
+ module lower_bound { private header "__algorithm/lower_bound.h" }
+ module make_heap { private header "__algorithm/make_heap.h" }
+ module max { private header "__algorithm/max.h" }
+ module max_element { private header "__algorithm/max_element.h" }
+ module merge { private header "__algorithm/merge.h" }
+ module min { private header "__algorithm/min.h" }
+ module min_element { private header "__algorithm/min_element.h" }
+ module minmax { private header "__algorithm/minmax.h" }
+ module minmax_element { private header "__algorithm/minmax_element.h" }
+ module mismatch { private header "__algorithm/mismatch.h" }
+ module move { private header "__algorithm/move.h" }
+ module move_backward { private header "__algorithm/move_backward.h" }
+ module next_permutation { private header "__algorithm/next_permutation.h" }
+ module none_of { private header "__algorithm/none_of.h" }
+ module nth_element { private header "__algorithm/nth_element.h" }
+ module partial_sort { private header "__algorithm/partial_sort.h" }
+ module partial_sort_copy { private header "__algorithm/partial_sort_copy.h" }
+ module partition { private header "__algorithm/partition.h" }
+ module partition_copy { private header "__algorithm/partition_copy.h" }
+ module partition_point { private header "__algorithm/partition_point.h" }
+ module pop_heap { private header "__algorithm/pop_heap.h" }
+ module prev_permutation { private header "__algorithm/prev_permutation.h" }
+ module push_heap { private header "__algorithm/push_heap.h" }
+ module remove { private header "__algorithm/remove.h" }
+ module remove_copy { private header "__algorithm/remove_copy.h" }
+ module remove_copy_if { private header "__algorithm/remove_copy_if.h" }
+ module remove_if { private header "__algorithm/remove_if.h" }
+ module replace { private header "__algorithm/replace.h" }
+ module replace_copy { private header "__algorithm/replace_copy.h" }
+ module replace_copy_if { private header "__algorithm/replace_copy_if.h" }
+ module replace_if { private header "__algorithm/replace_if.h" }
+ module reverse { private header "__algorithm/reverse.h" }
+ module reverse_copy { private header "__algorithm/reverse_copy.h" }
+ module rotate { private header "__algorithm/rotate.h" }
+ module rotate_copy { private header "__algorithm/rotate_copy.h" }
+ module sample { private header "__algorithm/sample.h" }
+ module search { private header "__algorithm/search.h" }
+ module search_n { private header "__algorithm/search_n.h" }
+ module set_difference { private header "__algorithm/set_difference.h" }
+ module set_intersection { private header "__algorithm/set_intersection.h" }
+ module set_symmetric_difference { private header "__algorithm/set_symmetric_difference.h" }
+ module set_union { private header "__algorithm/set_union.h" }
+ module shift_left { private header "__algorithm/shift_left.h" }
+ module shift_right { private header "__algorithm/shift_right.h" }
+ module shuffle { private header "__algorithm/shuffle.h" }
+ module sift_down { private header "__algorithm/sift_down.h" }
+ module sort { private header "__algorithm/sort.h" }
+ module sort_heap { private header "__algorithm/sort_heap.h" }
+ module stable_partition { private header "__algorithm/stable_partition.h" }
+ module stable_sort { private header "__algorithm/stable_sort.h" }
+ module swap_ranges { private header "__algorithm/swap_ranges.h" }
+ module transform { private header "__algorithm/transform.h" }
+ module unique { private header "__algorithm/unique.h" }
+ module unique_copy { private header "__algorithm/unique_copy.h" }
+ module unwrap_iter { private header "__algorithm/unwrap_iter.h" }
+ module upper_bound { private header "__algorithm/upper_bound.h" }
+ }
}
module any {
header "any"
header "filesystem"
export *
}
+ module format {
+ header "format"
+ export *
+
+ module __format {
+ module format_error { private header "__format/format_error.h" }
+ module format_parse_context { private header "__format/format_parse_context.h" }
+ }
+ }
module forward_list {
header "forward_list"
export initializer_list
module functional {
header "functional"
export *
+
+ module __functional {
+ module binary_function { private header "__functional/binary_function.h" }
+ module binary_negate { private header "__functional/binary_negate.h" }
+ module bind { private header "__functional/bind.h" }
+ module bind_front { private header "__functional/bind_front.h" }
+ module binder1st { private header "__functional/binder1st.h" }
+ module binder2nd { private header "__functional/binder2nd.h" }
+ module default_searcher { private header "__functional/default_searcher.h" }
+ module function { private header "__functional/function.h" }
+ module hash { private header "__functional/hash.h" }
+ module identity { private header "__functional/identity.h" }
+ module is_transparent { private header "__functional/is_transparent.h" }
+ module invoke { private header "__functional/invoke.h" }
+ module mem_fn { private header "__functional/mem_fn.h" }
+ module mem_fun_ref { private header "__functional/mem_fun_ref.h" }
+ module not_fn { private header "__functional/not_fn.h" }
+ module operations { private header "__functional/operations.h" }
+ module perfect_forward { private header "__functional/perfect_forward.h" }
+ module pointer_to_binary_function { private header "__functional/pointer_to_binary_function.h" }
+ module pointer_to_unary_function { private header "__functional/pointer_to_unary_function.h" }
+ module ranges_operations { private header "__functional/ranges_operations.h" }
+ module reference_wrapper { private header "__functional/reference_wrapper.h" }
+ module unary_function { private header "__functional/unary_function.h" }
+ module unary_negate { private header "__functional/unary_negate.h" }
+ module unwrap_ref { private header "__functional/unwrap_ref.h" }
+ module weak_result_type { private header "__functional/weak_result_type.h" }
+ }
}
module future {
header "future"
module iterator {
header "iterator"
export *
+
+ module __iterator {
+ module access { private header "__iterator/access.h" }
+ module advance {
+ private header "__iterator/advance.h"
+ export __function_like
+ }
+ module back_insert_iterator { private header "__iterator/back_insert_iterator.h" }
+ module common_iterator { private header "__iterator/common_iterator.h" }
+ module concepts { private header "__iterator/concepts.h" }
+ module counted_iterator { private header "__iterator/counted_iterator.h" }
+ module data { private header "__iterator/data.h" }
+ module default_sentinel { private header "__iterator/default_sentinel.h" }
+ module distance { private header "__iterator/distance.h" }
+ module empty { private header "__iterator/empty.h" }
+ module erase_if_container { private header "__iterator/erase_if_container.h" }
+ module front_insert_iterator { private header "__iterator/front_insert_iterator.h" }
+ module incrementable_traits { private header "__iterator/incrementable_traits.h" }
+ module insert_iterator { private header "__iterator/insert_iterator.h" }
+ module istream_iterator { private header "__iterator/istream_iterator.h" }
+ module istreambuf_iterator { private header "__iterator/istreambuf_iterator.h" }
+ module iter_move { private header "__iterator/iter_move.h" }
+ module iter_swap { private header "__iterator/iter_swap.h" }
+ module iterator { private header "__iterator/iterator.h" }
+ module iterator_traits { private header "__iterator/iterator_traits.h" }
+ module move_iterator { private header "__iterator/move_iterator.h" }
+ module next {
+ private header "__iterator/next.h"
+ export __function_like
+ }
+ module ostream_iterator { private header "__iterator/ostream_iterator.h" }
+ module ostreambuf_iterator { private header "__iterator/ostreambuf_iterator.h" }
+ module prev {
+ private header "__iterator/prev.h"
+ export __function_like
+ }
+ module projected { private header "__iterator/projected.h" }
+ module readable_traits { private header "__iterator/readable_traits.h" }
+ module reverse_access { private header "__iterator/reverse_access.h" }
+ module reverse_iterator { private header "__iterator/reverse_iterator.h" }
+ module size { private header "__iterator/size.h" }
+ module wrap_iter { private header "__iterator/wrap_iter.h" }
+ }
}
module latch {
requires cplusplus14
module memory {
header "memory"
export *
+
+ module __memory {
+ module addressof { private header "__memory/addressof.h" }
+ module allocation_guard { private header "__memory/allocation_guard.h" }
+ module allocator { private header "__memory/allocator.h" }
+ module allocator_arg_t { private header "__memory/allocator_arg_t.h" }
+ module allocator_traits { private header "__memory/allocator_traits.h" }
+ module auto_ptr { private header "__memory/auto_ptr.h" }
+ module compressed_pair { private header "__memory/compressed_pair.h" }
+ module construct_at { private header "__memory/construct_at.h" }
+ module pointer_safety { private header "__memory/pointer_safety.h" }
+ module pointer_traits { private header "__memory/pointer_traits.h" }
+ module raw_storage_iterator { private header "__memory/raw_storage_iterator.h" }
+ module shared_ptr { private header "__memory/shared_ptr.h" }
+ module temporary_buffer { private header "__memory/temporary_buffer.h" }
+ module uninitialized_algorithms { private header "__memory/uninitialized_algorithms.h" }
+ module unique_ptr { private header "__memory/unique_ptr.h" }
+ module uses_allocator { private header "__memory/uses_allocator.h" }
+ }
}
module mutex {
header "mutex"
header "random"
export initializer_list
export *
+
+ module __random {
+ module uniform_int_distribution { private header "__random/uniform_int_distribution.h" }
+ }
+ }
+ module ranges {
+ header "ranges"
+ export compare
+ export initializer_list
+ export iterator
+ export *
+
+ module __ranges {
+ module access { private header "__ranges/access.h" }
+ module all { private header "__ranges/all.h" }
+ module common_view { private header "__ranges/common_view.h" }
+ module concepts { private header "__ranges/concepts.h" }
+ module copyable_box { private header "__ranges/copyable_box.h" }
+ module dangling { private header "__ranges/dangling.h" }
+ module data { private header "__ranges/data.h" }
+ module drop_view { private header "__ranges/drop_view.h" }
+ module empty { private header "__ranges/empty.h" }
+ module empty_view { private header "__ranges/empty_view.h" }
+ module enable_borrowed_range { private header "__ranges/enable_borrowed_range.h" }
+ module enable_view { private header "__ranges/enable_view.h" }
+ module non_propagating_cache { private header "__ranges/non_propagating_cache.h" }
+ module ref_view { private header "__ranges/ref_view.h" }
+ module size { private header "__ranges/size.h" }
+ module subrange { private header "__ranges/subrange.h" }
+ module transform_view { private header "__ranges/transform_view.h" }
+ module view_interface { private header "__ranges/view_interface.h" }
+ }
}
module ratio {
header "ratio"
export initializer_list
export *
}
+ module shared_mutex {
+ header "shared_mutex"
+ export version
+ }
+ module span {
+ header "span"
+ export ranges.__ranges.enable_borrowed_range
+ export version
+ }
module sstream {
header "sstream"
// FIXME: should re-export istream, ostream, ios, streambuf, string?
}
module type_traits {
header "type_traits"
+ export functional.__functional.unwrap_ref
export *
}
module typeindex {
header "utility"
export initializer_list
export *
+
+ module __utility {
+ module __decay_copy { private header "__utility/__decay_copy.h" }
+ module as_const { private header "__utility/as_const.h" }
+ module cmp { private header "__utility/cmp.h" }
+ module declval { private header "__utility/declval.h" }
+ module exchange { private header "__utility/exchange.h" }
+ module forward { private header "__utility/forward.h" }
+ module in_place { private header "__utility/in_place.h" }
+ module integer_sequence { private header "__utility/integer_sequence.h" }
+ module move { private header "__utility/move.h" }
+ module pair { private header "__utility/pair.h" }
+ module piecewise_construct { private header "__utility/piecewise_construct.h" }
+ module rel_ops { private header "__utility/rel_ops.h" }
+ module swap { private header "__utility/swap.h" }
+ module to_underlying { private header "__utility/to_underlying.h" }
+ }
}
module valarray {
header "valarray"
module variant {
header "variant"
export *
+
+ module __variant {
+ module monostate { private header "__variant/monostate.h" }
+ }
}
module vector {
header "vector"
export *
}
+ // __config not modularised due to a bug in Clang
// FIXME: These should be private.
- module __bit_reference { header "__bit_reference" export * }
- module __debug { header "__debug" export * }
- module __errc { header "__errc" export * }
- module __functional_base { header "__functional_base" export * }
- module __hash_table { header "__hash_table" export * }
- module __locale { header "__locale" export * }
- module __mutex_base { header "__mutex_base" export * }
- module __split_buffer { header "__split_buffer" export * }
- module __sso_allocator { header "__sso_allocator" export * }
- module __std_stream { header "__std_stream" export * }
- module __string { header "__string" export * }
- module __tree { header "__tree" export * }
- module __tuple { header "__tuple" export * }
- module __undef_macros { header "__undef_macros" export * }
- module __node_handle { header "__node_handle" export * }
+ module __availability { private header "__availability" export * }
+ module __bit_reference { private header "__bit_reference" export * }
+ module __bits { private header "__bits" export * }
+ module __debug { header "__debug" export * }
+ module __errc { private header "__errc" export * }
+ module __function_like { private header "__function_like.h" export * }
+ module __hash_table { header "__hash_table" export * }
+ module __locale { private header "__locale" export * }
+ module __mutex_base { private header "__mutex_base" export * }
+ module __node_handle { private header "__node_handle" export * }
+ module __nullptr { header "__nullptr" export * }
+ module __split_buffer { private header "__split_buffer" export * }
+ module __std_stream { private header "__std_stream" export * }
+ module __string { private header "__string" export * }
+ module __threading_support { header "__threading_support" export * }
+ module __tree { header "__tree" export * }
+ module __tuple { private header "__tuple" export * }
+ module __undef_macros { header "__undef_macros" export * }
module experimental {
requires cplusplus11
#include <__config>
#include <__mutex_base>
+#include <__threading_support>
+#include <__utility/forward.h>
#include <cstdint>
#include <functional>
#include <memory>
#ifndef _LIBCPP_CXX03_LANG
-#include <tuple>
+# include <tuple>
#endif
#include <version>
-#include <__threading_support>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
return __r;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _L0, class _L1>
void
_VSTD::__unlock(__l2, __l3...);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
template <class ..._Mutexes>
_LIBCPP_INLINE_VISIBILITY
void call_once(once_flag&, const _Callable&);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
struct _LIBCPP_TEMPLATE_VIS once_flag
{
template<class _Callable>
friend
void call_once(once_flag&, const _Callable&);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
};
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void __execute(__tuple_indices<_Indices...>)
{
- __invoke(_VSTD::get<0>(_VSTD::move(__f_)), _VSTD::get<_Indices>(_VSTD::move(__f_))...);
+ _VSTD::__invoke(_VSTD::get<0>(_VSTD::move(__f_)), _VSTD::get<_Indices>(_VSTD::move(__f_))...);
}
};
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_MUTEX
+#endif // _LIBCPP_MUTEX
template <class T> constexpr T* launder(T* p) noexcept; // C++17
} // std
-void* operator new(std::size_t size); // replaceable, nodiscard in C++2a
-void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17, nodiscard in C++2a
-void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++2a
+void* operator new(std::size_t size); // replaceable, nodiscard in C++20
+void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17, nodiscard in C++20
+void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++20
void* operator new(std::size_t size, std::align_val_t alignment,
- const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++2a
+ const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++20
void operator delete(void* ptr) noexcept; // replaceable
void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14
void operator delete(void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++17
void operator delete(void* ptr, std:align_val_t alignment,
const std::nothrow_t&) noexcept; // replaceable, C++17
-void* operator new[](std::size_t size); // replaceable, nodiscard in C++2a
+void* operator new[](std::size_t size); // replaceable, nodiscard in C++20
void* operator new[](std::size_t size,
- std::align_val_t alignment) noexcept; // replaceable, C++17, nodiscard in C++2a
-void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++2a
+ std::align_val_t alignment) noexcept; // replaceable, C++17, nodiscard in C++20
+void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++20
void* operator new[](std::size_t size, std::align_val_t alignment,
- const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++2a
+ const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++20
void operator delete[](void* ptr) noexcept; // replaceable
void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14
void operator delete[](void* ptr,
void operator delete[](void* ptr, std::align_val_t alignment,
const std::nothrow_t&) noexcept; // replaceable, C++17
-void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++2a
-void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++2a
+void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++20
+void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++20
void operator delete (void* ptr, void*) noexcept;
void operator delete[](void* ptr, void*) noexcept;
*/
+#include <__availability>
#include <__config>
+#include <cstddef>
+#include <cstdlib>
#include <exception>
#include <type_traits>
-#include <cstddef>
#include <version>
-#ifdef _LIBCPP_NO_EXCEPTIONS
-#include <cstdlib>
-#endif
#if defined(_LIBCPP_ABI_VCRUNTIME)
#include <new.h>
# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION
#endif
-#if !__has_builtin(__builtin_operator_new) || \
- __has_builtin(__builtin_operator_new) < 201802L
-#define _LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE
-#endif
-
namespace std // purposefully not using versioning namespace
{
#endif
}
-inline _LIBCPP_INLINE_VISIBILITY void *__libcpp_allocate(size_t __size, size_t __align) {
+template <class ..._Args>
+_LIBCPP_INLINE_VISIBILITY
+void* __libcpp_operator_new(_Args ...__args) {
+#if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
+ return __builtin_operator_new(__args...);
+#else
+ return ::operator new(__args...);
+#endif
+}
+
+template <class ..._Args>
+_LIBCPP_INLINE_VISIBILITY
+void __libcpp_operator_delete(_Args ...__args) {
+#if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
+ __builtin_operator_delete(__args...);
+#else
+ ::operator delete(__args...);
+#endif
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void *__libcpp_allocate(size_t __size, size_t __align) {
#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
if (__is_overaligned_for_new(__align)) {
const align_val_t __align_val = static_cast<align_val_t>(__align);
-# ifdef _LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE
- return ::operator new(__size, __align_val);
-# else
- return __builtin_operator_new(__size, __align_val);
-# endif
+ return __libcpp_operator_new(__size, __align_val);
}
-#else
- ((void)__align);
#endif
-#ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
- return ::operator new(__size);
+
+ (void)__align;
+ return __libcpp_operator_new(__size);
+}
+
+template <class ..._Args>
+_LIBCPP_INLINE_VISIBILITY
+void __do_deallocate_handle_size(void *__ptr, size_t __size, _Args ...__args) {
+#ifdef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+ (void)__size;
+ return __libcpp_operator_delete(__ptr, __args...);
#else
- return __builtin_operator_new(__size);
+ return __libcpp_operator_delete(__ptr, __size, __args...);
#endif
}
-struct _DeallocateCaller {
- static inline _LIBCPP_INLINE_VISIBILITY
- void __do_deallocate_handle_size_align(void *__ptr, size_t __size, size_t __align) {
+inline _LIBCPP_INLINE_VISIBILITY
+void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) {
#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
- ((void)__align);
+ (void)__align;
return __do_deallocate_handle_size(__ptr, __size);
#else
if (__is_overaligned_for_new(__align)) {
return __do_deallocate_handle_size(__ptr, __size);
}
#endif
- }
+}
- static inline _LIBCPP_INLINE_VISIBILITY
- void __do_deallocate_handle_align(void *__ptr, size_t __align) {
+inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, size_t __align) {
#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
- ((void)__align);
- return __do_call(__ptr);
+ (void)__align;
+ return __libcpp_operator_delete(__ptr);
#else
if (__is_overaligned_for_new(__align)) {
const align_val_t __align_val = static_cast<align_val_t>(__align);
- return __do_call(__ptr, __align_val);
+ return __libcpp_operator_delete(__ptr, __align_val);
} else {
- return __do_call(__ptr);
+ return __libcpp_operator_delete(__ptr);
}
#endif
- }
-
- private:
- static inline void __do_deallocate_handle_size(void *__ptr, size_t __size) {
-#ifdef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
- ((void)__size);
- return __do_call(__ptr);
-#else
- return __do_call(__ptr, __size);
-#endif
- }
-
-#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
- static inline void __do_deallocate_handle_size(void *__ptr, size_t __size, align_val_t __align) {
-#ifdef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
- ((void)__size);
- return __do_call(__ptr, __align);
-#else
- return __do_call(__ptr, __size, __align);
-#endif
- }
-#endif
-
-private:
- template <class _A1, class _A2>
- static inline void __do_call(void *__ptr, _A1 __a1, _A2 __a2) {
-#if defined(_LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE) || \
- defined(_LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE)
- return ::operator delete(__ptr, __a1, __a2);
-#else
- return __builtin_operator_delete(__ptr, __a1, __a2);
-#endif
- }
+}
- template <class _A1>
- static inline void __do_call(void *__ptr, _A1 __a1) {
-#if defined(_LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE) || \
- defined(_LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE)
- return ::operator delete(__ptr, __a1);
+#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
+// Low-level helpers to call the aligned allocation and deallocation functions
+// on the target platform. This is used to implement libc++'s own memory
+// allocation routines -- if you need to allocate memory inside the library,
+// chances are that you want to use `__libcpp_allocate` instead.
+//
+// Returns the allocated memory, or `nullptr` on failure.
+inline _LIBCPP_INLINE_VISIBILITY
+void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
+#if defined(_LIBCPP_MSVCRT_LIKE)
+ return ::_aligned_malloc(__size, __alignment);
#else
- return __builtin_operator_delete(__ptr, __a1);
+ void* __result = nullptr;
+ (void)::posix_memalign(&__result, __alignment, __size);
+ // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
+ return __result;
#endif
- }
+}
- static inline void __do_call(void *__ptr) {
-#ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
- return ::operator delete(__ptr);
+inline _LIBCPP_INLINE_VISIBILITY
+void __libcpp_aligned_free(void* __ptr) {
+#if defined(_LIBCPP_MSVCRT_LIKE)
+ ::_aligned_free(__ptr);
#else
- return __builtin_operator_delete(__ptr);
+ ::free(__ptr);
#endif
- }
-};
-
-inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) {
- _DeallocateCaller::__do_deallocate_handle_size_align(__ptr, __size, __align);
}
+#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION
-inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, size_t __align) {
- _DeallocateCaller::__do_deallocate_handle_align(__ptr, __align);
-}
template <class _Tp>
_LIBCPP_NODISCARD_AFTER_CXX17 inline
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_NEW
+#endif // _LIBCPP_NEW
*/
#include <__config>
-
-#if _LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
-
+#include <concepts>
#include <type_traits>
#include <version>
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
template <class T> inline constexpr T egamma_v = __illformed<T>{};
template <class T> inline constexpr T phi_v = __illformed<T>{};
-template <class T>
-concept __floating_point = std::is_floating_point_v<T>;
-
-template <__floating_point T> inline constexpr T e_v<T> = 2.718281828459045235360287471352662;
-template <__floating_point T> inline constexpr T log2e_v<T> = 1.442695040888963407359924681001892;
-template <__floating_point T> inline constexpr T log10e_v<T> = 0.434294481903251827651128918916605;
-template <__floating_point T> inline constexpr T pi_v<T> = 3.141592653589793238462643383279502;
-template <__floating_point T> inline constexpr T inv_pi_v<T> = 0.318309886183790671537767526745028;
-template <__floating_point T> inline constexpr T inv_sqrtpi_v<T> = 0.564189583547756286948079451560772;
-template <__floating_point T> inline constexpr T ln2_v<T> = 0.693147180559945309417232121458176;
-template <__floating_point T> inline constexpr T ln10_v<T> = 2.302585092994045684017991454684364;
-template <__floating_point T> inline constexpr T sqrt2_v<T> = 1.414213562373095048801688724209698;
-template <__floating_point T> inline constexpr T sqrt3_v<T> = 1.732050807568877293527446341505872;
-template <__floating_point T> inline constexpr T inv_sqrt3_v<T> = 0.577350269189625764509148780501957;
-template <__floating_point T> inline constexpr T egamma_v<T> = 0.577215664901532860606512090082402;
-template <__floating_point T> inline constexpr T phi_v<T> = 1.618033988749894848204586834365638;
+template <floating_point T> inline constexpr T e_v<T> = 2.718281828459045235360287471352662;
+template <floating_point T> inline constexpr T log2e_v<T> = 1.442695040888963407359924681001892;
+template <floating_point T> inline constexpr T log10e_v<T> = 0.434294481903251827651128918916605;
+template <floating_point T> inline constexpr T pi_v<T> = 3.141592653589793238462643383279502;
+template <floating_point T> inline constexpr T inv_pi_v<T> = 0.318309886183790671537767526745028;
+template <floating_point T> inline constexpr T inv_sqrtpi_v<T> = 0.564189583547756286948079451560772;
+template <floating_point T> inline constexpr T ln2_v<T> = 0.693147180559945309417232121458176;
+template <floating_point T> inline constexpr T ln10_v<T> = 2.302585092994045684017991454684364;
+template <floating_point T> inline constexpr T sqrt2_v<T> = 1.414213562373095048801688724209698;
+template <floating_point T> inline constexpr T sqrt3_v<T> = 1.732050807568877293527446341505872;
+template <floating_point T> inline constexpr T inv_sqrt3_v<T> = 0.577350269189625764509148780501957;
+template <floating_point T> inline constexpr T egamma_v<T> = 0.577215664901532860606512090082402;
+template <floating_point T> inline constexpr T phi_v<T> = 1.618033988749894848204586834365638;
inline constexpr double e = e_v<double>;
inline constexpr double log2e = log2e_v<double>;
_LIBCPP_POP_MACROS
-#endif //_LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
+#endif //_LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
#endif // _LIBCPP_NUMBERS
{
template <class InputIterator, class T>
- T
+ constexpr T // constexpr since C++20
accumulate(InputIterator first, InputIterator last, T init);
template <class InputIterator, class T, class BinaryOperation>
- T
+ constexpr T // constexpr since C++20
accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op);
template<class InputIterator>
- typename iterator_traits<InputIterator>::value_type
+ constexpr typename iterator_traits<InputIterator>::value_type // constexpr since C++20
reduce(InputIterator first, InputIterator last); // C++17
template<class InputIterator, class T>
- T
+ constexpr T // constexpr since C++20
reduce(InputIterator first, InputIterator last, T init); // C++17
template<class InputIterator, class T, class BinaryOperation>
- T
+ constexpr T // constexpr since C++20
reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); // C++17
template <class InputIterator1, class InputIterator2, class T>
- T
+ constexpr T // constexpr since C++20
inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init);
template <class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
- T
+ constexpr T // constexpr since C++20
inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
template<class InputIterator1, class InputIterator2, class T>
- T
+ constexpr T // constexpr since C++20
transform_reduce(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init); // C++17
template<class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
- T
+ constexpr T // constexpr since C++20
transform_reduce(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init,
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); // C++17
template<class InputIterator, class T, class BinaryOperation, class UnaryOperation>
- T
+ constexpr T // constexpr since C++20
transform_reduce(InputIterator first, InputIterator last, T init,
BinaryOperation binary_op, UnaryOperation unary_op); // C++17
template <class InputIterator, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
partial_sum(InputIterator first, InputIterator last, OutputIterator result);
template <class InputIterator, class OutputIterator, class BinaryOperation>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
template<class InputIterator, class OutputIterator, class T>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
exclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, T init); // C++17
template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
exclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, T init, BinaryOperation binary_op); // C++17
template<class InputIterator, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
inclusive_scan(InputIterator first, InputIterator last, OutputIterator result); // C++17
template<class InputIterator, class OutputIterator, class BinaryOperation>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation binary_op); // C++17
template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation binary_op, T init); // C++17
template<class InputIterator, class OutputIterator, class T,
class BinaryOperation, class UnaryOperation>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
transform_exclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, T init,
BinaryOperation binary_op, UnaryOperation unary_op); // C++17
template<class InputIterator, class OutputIterator,
class BinaryOperation, class UnaryOperation>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
transform_inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result,
BinaryOperation binary_op, UnaryOperation unary_op); // C++17
template<class InputIterator, class OutputIterator,
class BinaryOperation, class UnaryOperation, class T>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
transform_inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result,
BinaryOperation binary_op, UnaryOperation unary_op,
T init); // C++17
template <class InputIterator, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
adjacent_difference(InputIterator first, InputIterator last, OutputIterator result);
template <class InputIterator, class OutputIterator, class BinaryOperation>
- OutputIterator
+ constexpr OutputIterator // constexpr since C++20
adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
template <class ForwardIterator, class T>
- void iota(ForwardIterator first, ForwardIterator last, T value);
+ constexpr void // constexpr since C++20
+ iota(ForwardIterator first, ForwardIterator last, T value);
template <class M, class N>
constexpr common_type_t<M,N> gcd(M m, N n); // C++17
template <class M, class N>
constexpr common_type_t<M,N> lcm(M m, N n); // C++17
-integer midpoint(integer a, integer b); // C++20
-pointer midpoint(pointer a, pointer b); // C++20
-floating_point midpoint(floating_point a, floating_point b); // C++20
+template<class T>
+ constexpr T midpoint(T a, T b) noexcept; // C++20
+
+template<class T>
+ constexpr T* midpoint(T* a, T* b); // C++20
} // std
*/
#include <__config>
+#include <__debug>
+#include <cmath> // for isnormal
+#include <functional>
#include <iterator>
#include <limits> // for numeric_limits
-#include <functional>
-#include <cmath> // for isnormal
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
{
for (; __first != __last; ++__first)
+#if _LIBCPP_STD_VER > 17
+ __init = _VSTD::move(__init) + *__first;
+#else
__init = __init + *__first;
+#endif
return __init;
}
template <class _InputIterator, class _Tp, class _BinaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op)
{
for (; __first != __last; ++__first)
+#if _LIBCPP_STD_VER > 17
+ __init = __binary_op(_VSTD::move(__init), *__first);
+#else
__init = __binary_op(__init, *__first);
+#endif
return __init;
}
#if _LIBCPP_STD_VER > 14
template <class _InputIterator, class _Tp, class _BinaryOp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b)
{
}
template <class _InputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
reduce(_InputIterator __first, _InputIterator __last, _Tp __init)
{
}
template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
typename iterator_traits<_InputIterator>::value_type
reduce(_InputIterator __first, _InputIterator __last)
{
#endif
template <class _InputIterator1, class _InputIterator2, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init)
{
for (; __first1 != __last1; ++__first1, (void) ++__first2)
+#if _LIBCPP_STD_VER > 17
+ __init = _VSTD::move(__init) + *__first1 * *__first2;
+#else
__init = __init + *__first1 * *__first2;
+#endif
return __init;
}
template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
_Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
{
for (; __first1 != __last1; ++__first1, (void) ++__first2)
+#if _LIBCPP_STD_VER > 17
+ __init = __binary_op1(_VSTD::move(__init), __binary_op2(*__first1, *__first2));
+#else
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
+#endif
return __init;
}
#if _LIBCPP_STD_VER > 14
template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
transform_reduce(_InputIterator __first, _InputIterator __last,
_Tp __init, _BinaryOp __b, _UnaryOp __u)
template <class _InputIterator1, class _InputIterator2,
class _Tp, class _BinaryOp1, class _BinaryOp2>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _Tp __init, _BinaryOp1 __b1, _BinaryOp2 __b2)
}
template <class _InputIterator1, class _InputIterator2, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Tp
transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _Tp __init)
#endif
template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
*__result = __t;
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
+#if _LIBCPP_STD_VER > 17
+ __t = _VSTD::move(__t) + *__first;
+#else
__t = __t + *__first;
+#endif
*__result = __t;
}
}
}
template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
_BinaryOperation __binary_op)
*__result = __t;
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
+#if _LIBCPP_STD_VER > 17
+ __t = __binary_op(_VSTD::move(__t), *__first);
+#else
__t = __binary_op(__t, *__first);
+#endif
*__result = __t;
}
}
#if _LIBCPP_STD_VER > 14
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
exclusive_scan(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _Tp __init, _BinaryOp __b)
{
if (__first != __last)
{
- _Tp __saved = __init;
- do
+ _Tp __tmp(__b(__init, *__first));
+ while (true)
{
- __init = __b(__init, *__first);
- *__result = __saved;
- __saved = __init;
+ *__result = _VSTD::move(__init);
++__result;
- } while (++__first != __last);
+ ++__first;
+ if (__first == __last)
+ break;
+ __init = _VSTD::move(__tmp);
+ __tmp = __b(__init, *__first);
+ }
}
return __result;
}
template <class _InputIterator, class _OutputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
exclusive_scan(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _Tp __init)
}
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOp __b, _Tp __init)
{
for (; __first != __last; ++__first, (void) ++__result) {
__init = __b(__init, *__first);
*__result = __init;
- }
+ }
return __result;
}
template <class _InputIterator, class _OutputIterator, class _BinaryOp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOp __b)
{
if (__first != __last) {
- typename std::iterator_traits<_InputIterator>::value_type __init = *__first;
+ typename iterator_traits<_InputIterator>::value_type __init = *__first;
*__result++ = __init;
if (++__first != __last)
return _VSTD::inclusive_scan(__first, __last, __result, __b, __init);
- }
+ }
return __result;
}
template <class _InputIterator, class _OutputIterator>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
_OutputIterator __result)
{
- return _VSTD::inclusive_scan(__first, __last, __result, std::plus<>());
+ return _VSTD::inclusive_scan(__first, __last, __result, _VSTD::plus<>());
}
template <class _InputIterator, class _OutputIterator, class _Tp,
class _BinaryOp, class _UnaryOp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _Tp __init,
}
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
-_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOp __b, _UnaryOp __u, _Tp __init)
{
for (; __first != __last; ++__first, (void) ++__result) {
}
template <class _InputIterator, class _OutputIterator, class _BinaryOp, class _UnaryOp>
-_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_OutputIterator
+transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOp __b, _UnaryOp __u)
{
if (__first != __last) {
- typename std::iterator_traits<_InputIterator>::value_type __init = __u(*__first);
+ typename iterator_traits<_InputIterator>::value_type __init = __u(*__first);
*__result++ = __init;
if (++__first != __last)
return _VSTD::transform_inclusive_scan(__first, __last, __result, __b, __u, __init);
- }
+ }
return __result;
}
#endif
template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
if (__first != __last)
{
- typename iterator_traits<_InputIterator>::value_type __t1(*__first);
- *__result = __t1;
+ typename iterator_traits<_InputIterator>::value_type __acc(*__first);
+ *__result = __acc;
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
- typename iterator_traits<_InputIterator>::value_type __t2(*__first);
- *__result = __t2 - __t1;
- __t1 = _VSTD::move(__t2);
+ typename iterator_traits<_InputIterator>::value_type __val(*__first);
+#if _LIBCPP_STD_VER > 17
+ *__result = __val - _VSTD::move(__acc);
+#else
+ *__result = __val - __acc;
+#endif
+ __acc = _VSTD::move(__val);
}
}
return __result;
}
template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
_BinaryOperation __binary_op)
{
if (__first != __last)
{
- typename iterator_traits<_InputIterator>::value_type __t1(*__first);
- *__result = __t1;
+ typename iterator_traits<_InputIterator>::value_type __acc(*__first);
+ *__result = __acc;
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
- typename iterator_traits<_InputIterator>::value_type __t2(*__first);
- *__result = __binary_op(__t2, __t1);
- __t1 = _VSTD::move(__t2);
+ typename iterator_traits<_InputIterator>::value_type __val(*__first);
+#if _LIBCPP_STD_VER > 17
+ *__result = __binary_op(__val, _VSTD::move(__acc));
+#else
+ *__result = __binary_op(__val, __acc);
+#endif
+ __acc = _VSTD::move(__val);
}
}
return __result;
}
template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void
iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_)
{
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
_Result operator()(_Source __t) const noexcept
{
- if (__t >= 0) return __t;
- if (__t == numeric_limits<_Source>::min()) return -static_cast<_Result>(__t);
- return -__t;
+ if (__t >= 0) return __t;
+ if (__t == numeric_limits<_Source>::min()) return -static_cast<_Result>(__t);
+ return -__t;
}
};
midpoint(_Tp __a, _Tp __b) noexcept
_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
- using _Up = std::make_unsigned_t<_Tp>;
- constexpr _Up __bitshift = std::numeric_limits<_Up>::digits - 1;
+ using _Up = make_unsigned_t<_Tp>;
+ constexpr _Up __bitshift = numeric_limits<_Up>::digits - 1;
_Up __diff = _Up(__b) - _Up(__a);
_Up __sign_bit = __b < __a;
enable_if_t<is_floating_point_v<_Fp>, _Fp>
midpoint(_Fp __a, _Fp __b) noexcept
{
- constexpr _Fp __lo = numeric_limits<_Fp>::min()*2;
- constexpr _Fp __hi = numeric_limits<_Fp>::max()/2;
+ constexpr _Fp __lo = numeric_limits<_Fp>::min()*2;
+ constexpr _Fp __hi = numeric_limits<_Fp>::max()/2;
return __fp_abs(__a) <= __hi && __fp_abs(__b) <= __hi ? // typical case: overflow is impossible
(__a + __b)/2 : // always correctly rounded
__fp_abs(__a) < __lo ? __a + __b/2 : // not safe to halve a
# include <__pstl_numeric>
#endif
-#endif // _LIBCPP_NUMERIC
+#endif // _LIBCPP_NUMERIC
template <class T, class U> constexpr bool operator>=(const T&, const optional<U>&);
// 23.6.9, specialized algorithms
- template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below );
+ template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below ); // constexpr in C++20
template <class T> constexpr optional<see below > make_optional(T&&);
template <class T, class... Args>
constexpr optional<T> make_optional(Args&&... args);
template <class U = T>
constexpr EXPLICIT optional(U &&);
template <class U>
- constexpr EXPLICIT optional(const optional<U> &);
+ EXPLICIT optional(const optional<U> &); // constexpr in C++20
template <class U>
- constexpr EXPLICIT optional(optional<U> &&);
+ EXPLICIT optional(optional<U> &&); // constexpr in C++20
// 23.6.3.2, destructor
- ~optional();
+ ~optional(); // constexpr in C++20
// 23.6.3.3, assignment
- optional &operator=(nullopt_t) noexcept;
- optional &operator=(const optional &); // constexpr in C++20
- optional &operator=(optional &&) noexcept(see below); // constexpr in C++20
- template <class U = T> optional &operator=(U &&);
- template <class U> optional &operator=(const optional<U> &);
- template <class U> optional &operator=(optional<U> &&);
- template <class... Args> T& emplace(Args &&...);
+ optional &operator=(nullopt_t) noexcept; // constexpr in C++20
+ optional &operator=(const optional &); // constexpr in C++20
+ optional &operator=(optional &&) noexcept(see below); // constexpr in C++20
+ template <class U = T> optional &operator=(U &&); // constexpr in C++20
+ template <class U> optional &operator=(const optional<U> &); // constexpr in C++20
+ template <class U> optional &operator=(optional<U> &&); // constexpr in C++20
+ template <class... Args> T& emplace(Args &&...); // constexpr in C++20
template <class U, class... Args>
- T& emplace(initializer_list<U>, Args &&...);
+ T& emplace(initializer_list<U>, Args &&...); // constexpr in C++20
// 23.6.3.4, swap
- void swap(optional &) noexcept(see below );
+ void swap(optional &) noexcept(see below ); // constexpr in C++20
// 23.6.3.5, observers
constexpr T const *operator->() const;
template <class U> constexpr T value_or(U &&) &&;
// 23.6.3.6, modifiers
- void reset() noexcept;
+ void reset() noexcept; // constexpr in C++20
private:
T *val; // exposition only
*/
+#include <__availability>
#include <__config>
#include <__debug>
#include <__functional_base>
+#include <compare>
#include <functional>
#include <initializer_list>
#include <new>
bool __engaged_;
_LIBCPP_INLINE_VISIBILITY
- ~__optional_destruct_base()
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 ~__optional_destruct_base()
{
if (__engaged_)
__val_.~value_type();
__engaged_(true) {}
_LIBCPP_INLINE_VISIBILITY
- void reset() noexcept
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void reset() noexcept
{
if (__engaged_)
{
__engaged_(true) {}
_LIBCPP_INLINE_VISIBILITY
- void reset() noexcept
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void reset() noexcept
{
if (__engaged_)
{
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- void __construct(_Args&&... __args)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct(_Args&&... __args)
{
_LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
- ::new((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
+#if _LIBCPP_STD_VER > 17
+ _VSTD::construct_at(_VSTD::addressof(this->__val_), _VSTD::forward<_Args>(__args)...);
+#else
+ ::new ((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
+#endif
this->__engaged_ = true;
}
template <class _That>
_LIBCPP_INLINE_VISIBILITY
- void __construct_from(_That&& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct_from(_That&& __opt)
{
if (__opt.has_value())
__construct(_VSTD::forward<_That>(__opt).__get());
template <class _That>
_LIBCPP_INLINE_VISIBILITY
- void __assign_from(_That&& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void __assign_from(_That&& __opt)
{
if (this->__engaged_ == __opt.has_value())
{
}
_LIBCPP_INLINE_VISIBILITY
- void reset() noexcept { __value_ = nullptr; }
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void reset() noexcept { __value_ = nullptr; }
_LIBCPP_INLINE_VISIBILITY
constexpr bool has_value() const noexcept
template <class _UArg>
_LIBCPP_INLINE_VISIBILITY
- void __construct(_UArg&& __val)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct(_UArg&& __val)
{
_LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
static_assert(__can_bind_reference<_UArg>(),
template <class _That>
_LIBCPP_INLINE_VISIBILITY
- void __construct_from(_That&& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct_from(_That&& __opt)
{
if (__opt.has_value())
__construct(_VSTD::forward<_That>(__opt).__get());
template <class _That>
_LIBCPP_INLINE_VISIBILITY
- void __assign_from(_That&& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void __assign_from(_That&& __opt)
{
if (has_value() == __opt.has_value())
{
__optional_copy_base() = default;
_LIBCPP_INLINE_VISIBILITY
- __optional_copy_base(const __optional_copy_base& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 __optional_copy_base(const __optional_copy_base& __opt)
{
this->__construct_from(__opt);
}
__optional_move_base(const __optional_move_base&) = default;
_LIBCPP_INLINE_VISIBILITY
- __optional_move_base(__optional_move_base&& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 __optional_move_base(__optional_move_base&& __opt)
noexcept(is_nothrow_move_constructible_v<value_type>)
{
this->__construct_from(_VSTD::move(__opt));
__optional_copy_assign_base(__optional_copy_assign_base&&) = default;
_LIBCPP_INLINE_VISIBILITY
- __optional_copy_assign_base& operator=(const __optional_copy_assign_base& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 __optional_copy_assign_base& operator=(const __optional_copy_assign_base& __opt)
{
this->__assign_from(__opt);
return *this;
__optional_move_assign_base& operator=(const __optional_move_assign_base&) = default;
_LIBCPP_INLINE_VISIBILITY
- __optional_move_assign_base& operator=(__optional_move_assign_base&& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 __optional_move_assign_base& operator=(__optional_move_assign_base&& __opt)
noexcept(is_nothrow_move_assignable_v<value_type> &&
is_nothrow_move_constructible_v<value_type>)
{
}
template <class _Up, class _QUp = _QualUp>
static constexpr bool __enable_assign() {
- // Construction and assignability of _Qup to _Tp has already been
+ // Construction and assignability of _QUp to _Tp has already been
// checked.
return !__check_constructible_from_opt<_Up>::value &&
!__check_assignable_from_opt<_Up>::value;
_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>()
, int> = 0>
_LIBCPP_INLINE_VISIBILITY
- optional(const optional<_Up>& __v)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 optional(const optional<_Up>& __v)
{
this->__construct_from(__v);
}
_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>()
, int> = 0>
_LIBCPP_INLINE_VISIBILITY
- explicit optional(const optional<_Up>& __v)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit optional(const optional<_Up>& __v)
{
this->__construct_from(__v);
}
_CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_implicit<_Up>()
, int> = 0>
_LIBCPP_INLINE_VISIBILITY
- optional(optional<_Up>&& __v)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 optional(optional<_Up>&& __v)
{
this->__construct_from(_VSTD::move(__v));
}
_CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_explicit<_Up>()
, int> = 0>
_LIBCPP_INLINE_VISIBILITY
- explicit optional(optional<_Up>&& __v)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit optional(optional<_Up>&& __v)
{
this->__construct_from(_VSTD::move(__v));
}
_LIBCPP_INLINE_VISIBILITY
- optional& operator=(nullopt_t) noexcept
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 optional& operator=(nullopt_t) noexcept
{
reset();
return *this;
>::value>
>
_LIBCPP_INLINE_VISIBILITY
- optional&
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
operator=(_Up&& __v)
{
if (this->has_value())
_CheckOptionalLikeAssign<_Up, _Up const&>::template __enable_assign<_Up>()
, int> = 0>
_LIBCPP_INLINE_VISIBILITY
- optional&
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
operator=(const optional<_Up>& __v)
{
this->__assign_from(__v);
_CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_assign<_Up>()
, int> = 0>
_LIBCPP_INLINE_VISIBILITY
- optional&
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
operator=(optional<_Up>&& __v)
{
this->__assign_from(_VSTD::move(__v));
>
>
_LIBCPP_INLINE_VISIBILITY
- _Tp &
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp &
emplace(_Args&&... __args)
{
reset();
>
>
_LIBCPP_INLINE_VISIBILITY
- _Tp &
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp &
emplace(initializer_list<_Up> __il, _Args&&... __args)
{
reset();
}
_LIBCPP_INLINE_VISIBILITY
- void swap(optional& __opt)
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(optional& __opt)
noexcept(is_nothrow_move_constructible_v<value_type> &&
is_nothrow_swappable_v<value_type>)
{
add_pointer_t<value_type const>
operator->() const
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
+ _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
return _VSTD::addressof(this->__get());
#else
add_pointer_t<value_type>
operator->()
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
+ _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
return _VSTD::addressof(this->__get());
#else
_LIBCPP_INLINE_VISIBILITY
constexpr
const value_type&
- operator*() const&
+ operator*() const& noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
return this->__get();
}
_LIBCPP_INLINE_VISIBILITY
constexpr
value_type&
- operator*() &
+ operator*() & noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
return this->__get();
}
_LIBCPP_INLINE_VISIBILITY
constexpr
value_type&&
- operator*() &&
+ operator*() && noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
return _VSTD::move(this->__get());
}
_LIBCPP_INLINE_VISIBILITY
constexpr
const value_type&&
- operator*() const&&
+ operator*() const&& noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
return _VSTD::move(this->__get());
}
private:
template <class _Up>
_LIBCPP_INLINE_VISIBILITY
- static _Up*
+ static _LIBCPP_CONSTEXPR_AFTER_CXX17 _Up*
__operator_arrow(true_type, _Up& __x)
{
return _VSTD::addressof(__x);
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() ==
+ declval<const _Up&>()), bool>,
bool
>
operator==(const optional<_Tp>& __x, const optional<_Up>& __y)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() !=
+ declval<const _Up&>()), bool>,
bool
>
operator!=(const optional<_Tp>& __x, const optional<_Up>& __y)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() <
+ declval<const _Up&>()), bool>,
bool
>
operator<(const optional<_Tp>& __x, const optional<_Up>& __y)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() >
+ declval<const _Up&>()), bool>,
bool
>
operator>(const optional<_Tp>& __x, const optional<_Up>& __y)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() <=
+ declval<const _Up&>()), bool>,
bool
>
operator<=(const optional<_Tp>& __x, const optional<_Up>& __y)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() >=
+ declval<const _Up&>()), bool>,
bool
>
operator>=(const optional<_Tp>& __x, const optional<_Up>& __y)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() ==
+ declval<const _Up&>()), bool>,
bool
>
operator==(const optional<_Tp>& __x, const _Up& __v)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() ==
+ declval<const _Up&>()), bool>,
bool
>
operator==(const _Tp& __v, const optional<_Up>& __x)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() !=
+ declval<const _Up&>()), bool>,
bool
>
operator!=(const optional<_Tp>& __x, const _Up& __v)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() !=
+ declval<const _Up&>()), bool>,
bool
>
operator!=(const _Tp& __v, const optional<_Up>& __x)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() <
+ declval<const _Up&>()), bool>,
bool
>
operator<(const optional<_Tp>& __x, const _Up& __v)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() <
+ declval<const _Up&>()), bool>,
bool
>
operator<(const _Tp& __v, const optional<_Up>& __x)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() <=
+ declval<const _Up&>()), bool>,
bool
>
operator<=(const optional<_Tp>& __x, const _Up& __v)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() <=
+ declval<const _Up&>()), bool>,
bool
>
operator<=(const _Tp& __v, const optional<_Up>& __x)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() >
+ declval<const _Up&>()), bool>,
bool
>
operator>(const optional<_Tp>& __x, const _Up& __v)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() >
+ declval<const _Up&>()), bool>,
bool
>
operator>(const _Tp& __v, const optional<_Up>& __x)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() >=
+ declval<const _Up&>()), bool>,
bool
>
operator>=(const optional<_Tp>& __x, const _Up& __v)
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr
_EnableIf<
- is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
- _VSTD::declval<const _Up&>()), bool>,
+ is_convertible_v<decltype(declval<const _Tp&>() >=
+ declval<const _Up&>()), bool>,
bool
>
operator>=(const _Tp& __v, const optional<_Up>& __x)
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_EnableIf<
is_move_constructible_v<_Tp> && is_swappable_v<_Tp>,
void
__enable_hash_helper<optional<_Tp>, remove_const_t<_Tp>>
>
{
- typedef optional<_Tp> argument_type;
- typedef size_t result_type;
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef optional<_Tp> argument_type;
+ _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type;
+#endif
_LIBCPP_INLINE_VISIBILITY
- result_type operator()(const argument_type& __opt) const
+ size_t operator()(const optional<_Tp>& __opt) const
{
return static_cast<bool>(__opt) ? hash<remove_const_t<_Tp>>()(*__opt) : 0;
}
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER > 14
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_OPTIONAL
+#endif // _LIBCPP_OPTIONAL
basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os);
// rvalue stream insertion
-template <class charT, class traits, class T>
- basic_ostream<charT, traits>&
- operator<<(basic_ostream<charT, traits>&& os, const T& x);
+template <class Stream, class T>
+ Stream&& operator<<(Stream&& os, const T& x);
} // std
*/
#include <__config>
+#include <bitset>
#include <ios>
-#include <streambuf>
-#include <locale>
#include <iterator>
-#include <bitset>
+#include <locale>
+#include <streambuf>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
{ this->init(__sb); }
virtual ~basic_ostream();
protected:
-#ifndef _LIBCPP_CXX03_LANG
inline _LIBCPP_INLINE_VISIBILITY
basic_ostream(basic_ostream&& __rhs);
// 27.7.2.3 Assign/swap
inline _LIBCPP_INLINE_VISIBILITY
basic_ostream& operator=(basic_ostream&& __rhs);
-#endif
+
inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
void swap(basic_ostream& __rhs)
{ basic_ios<char_type, traits_type>::swap(__rhs); }
-#ifndef _LIBCPP_CXX03_LANG
basic_ostream (const basic_ostream& __rhs) = delete;
basic_ostream& operator=(const basic_ostream& __rhs) = delete;
-#else
- basic_ostream (const basic_ostream& __rhs); // not defined
- basic_ostream& operator=(const basic_ostream& __rhs); // not defined
-#endif
-public:
+public:
// 27.7.2.4 Prefix/suffix:
class _LIBCPP_TEMPLATE_VIS sentry;
~sentry();
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT
- operator bool() const {return __ok_;}
+ explicit operator bool() const {return __ok_;}
};
template <class _CharT, class _Traits>
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (__os_.rdbuf()->pubsync() == -1)
__os_.setstate(ios_base::badbit);
#ifndef _LIBCPP_NO_EXCEPTIONS
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs)
{
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>::~basic_ostream()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef ostreambuf_iterator<_CharT, _Traits> _Op;
_Ip __i(__sb);
{
this->__set_failbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
else
this->setstate(ios_base::badbit);
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return __os;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return __os;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return __os;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
sentry __sen(*this);
if (__sen && __n)
{
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (this->rdbuf())
{
sentry __s(*this);
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return *this;
}
return __os;
}
-#ifndef _LIBCPP_CXX03_LANG
+template <class _Stream, class _Tp, class = void>
+struct __is_ostreamable : false_type { };
template <class _Stream, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_lvalue_reference<_Stream>::value &&
- is_base_of<ios_base, _Stream>::value,
- _Stream&&
->::type
-operator<<(_Stream&& __os, const _Tp& __x)
+struct __is_ostreamable<_Stream, _Tp, decltype(
+ declval<_Stream>() << declval<_Tp>(), void()
+)> : true_type { };
+
+template <class _Stream, class _Tp, class = typename enable_if<
+ _And<is_base_of<ios_base, _Stream>,
+ __is_ostreamable<_Stream&, const _Tp&> >::value
+>::type>
+_LIBCPP_INLINE_VISIBILITY
+_Stream&& operator<<(_Stream&& __os, const _Tp& __x)
{
__os << __x;
return _VSTD::move(__os);
}
-#endif // _LIBCPP_CXX03_LANG
-
template<class _CharT, class _Traits, class _Allocator>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os,
use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
}
-#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
-#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_OSTREAM
+#endif // _LIBCPP_OSTREAM
Compare comp;
public:
- priority_queue() = default;
- ~priority_queue() = default;
-
- priority_queue(const priority_queue& q) = default;
- priority_queue(priority_queue&& q) = default;
-
- priority_queue& operator=(const priority_queue& q) = default;
- priority_queue& operator=(priority_queue&& q) = default;
-
- explicit priority_queue(const Compare& comp);
- priority_queue(const Compare& comp, const container_type& c);
- explicit priority_queue(const Compare& comp, container_type&& c);
+ priority_queue() : priority_queue(Compare()) {} // C++20
+ explicit priority_queue(const Compare& x) : priority_queue(x, Container()) {}
+ priority_queue(const Compare& x, const Container&);
+ explicit priority_queue(const Compare& x = Compare(), Container&&= Container()); // before C++20
+ priority_queue(const Compare& x, Container&&); // C++20
template <class InputIterator>
priority_queue(InputIterator first, InputIterator last,
const Compare& comp = Compare());
*/
#include <__config>
+#include <__memory/uses_allocator.h>
+#include <__utility/forward.h>
+#include <algorithm>
+#include <compare>
#include <deque>
-#include <vector>
#include <functional>
-#include <algorithm>
+#include <vector>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
queue& operator=(queue&& __q)
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
{c = _VSTD::move(__q.c); return *this;}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit queue(const container_type& __c) : c(__c) {}
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit queue(const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(__a) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
queue(const queue& __q, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(__q.c, __a) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
queue(const container_type& __c, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(__c, __a) {}
#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
queue(container_type&& __c, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(_VSTD::move(__c), __a) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
queue(queue&& __q, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(_VSTD::move(__q.c), __a) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
bool empty() const {return c.empty();}
void emplace(_Args&&... __args)
{ c.emplace_back(_VSTD::forward<_Args>(__args)...);}
#endif
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void pop() {c.pop_front();}
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _Container,
- class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type
+ class = _EnableIf<!__is_allocator<_Container>::value>
>
queue(_Container)
-> queue<typename _Container::value_type, _Container>;
template<class _Container,
class _Alloc,
- class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type,
- class = typename enable_if< __is_allocator<_Alloc>::value, nullptr_t>::type
+ class = _EnableIf<!__is_allocator<_Container>::value>,
+ class = _EnableIf<uses_allocator<_Container, _Alloc>::value>
>
queue(_Container, _Alloc)
-> queue<typename _Container::value_type, _Container>;
template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<
- __is_swappable<_Container>::value,
- void
->::type
+_EnableIf<__is_swappable<_Container>::value, void>
swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
{
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
is_nothrow_move_assignable<value_compare>::value)
{c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit priority_queue(const value_compare& __comp)
priority_queue(const value_compare& __comp, const container_type& __c);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- explicit priority_queue(const value_compare& __comp, container_type&& __c);
+ priority_queue(const value_compare& __comp, container_type&& __c);
#endif
template <class _InputIter>
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp, container_type&& __c);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit priority_queue(const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0);
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
priority_queue(const value_compare& __comp, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0);
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
priority_queue(const value_compare& __comp, const container_type& __c,
const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0);
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
priority_queue(const priority_queue& __q, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0);
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
priority_queue(const value_compare& __comp, container_type&& __c,
const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0);
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
priority_queue(priority_queue&& __q, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0);
-#endif // _LIBCPP_CXX03_LANG
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0);
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
bool empty() const {return c.empty();}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
void emplace(_Args&&... __args);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void pop();
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template <class _Compare,
class _Container,
- class = typename enable_if<!__is_allocator<_Compare>::value, nullptr_t>::type,
- class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type
+ class = _EnableIf<!__is_allocator<_Compare>::value>,
+ class = _EnableIf<!__is_allocator<_Container>::value>
>
priority_queue(_Compare, _Container)
-> priority_queue<typename _Container::value_type, _Container, _Compare>;
template<class _InputIterator,
- class _Compare = less<typename iterator_traits<_InputIterator>::value_type>,
- class _Container = vector<typename iterator_traits<_InputIterator>::value_type>,
- class = typename enable_if< __is_cpp17_input_iterator<_InputIterator>::value, nullptr_t>::type,
- class = typename enable_if<!__is_allocator<_Compare>::value, nullptr_t>::type,
- class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type
+ class _Compare = less<__iter_value_type<_InputIterator>>,
+ class _Container = vector<__iter_value_type<_InputIterator>>,
+ class = _EnableIf<__is_cpp17_input_iterator<_InputIterator>::value>,
+ class = _EnableIf<!__is_allocator<_Compare>::value>,
+ class = _EnableIf<!__is_allocator<_Container>::value>
>
priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container())
- -> priority_queue<typename iterator_traits<_InputIterator>::value_type, _Container, _Compare>;
+ -> priority_queue<__iter_value_type<_InputIterator>, _Container, _Compare>;
template<class _Compare,
class _Container,
class _Alloc,
- class = typename enable_if<!__is_allocator<_Compare>::value, nullptr_t>::type,
- class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type,
- class = typename enable_if< __is_allocator<_Alloc>::value, nullptr_t>::type
+ class = _EnableIf<!__is_allocator<_Compare>::value>,
+ class = _EnableIf<!__is_allocator<_Container>::value>,
+ class = _EnableIf<uses_allocator<_Container, _Alloc>::value>
>
priority_queue(_Compare, _Container, _Alloc)
-> priority_queue<typename _Container::value_type, _Container, _Compare>;
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
template <class _InputIter>
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type*)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
: c(__a)
{
}
inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type*)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
: c(__a),
comp(__comp)
{
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
const container_type& __c,
const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type*)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
: c(__c, __a),
comp(__comp)
{
inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q,
const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type*)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
: c(__q.c, __a),
comp(__q.comp)
{
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
container_type&& __c,
const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type*)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
: c(_VSTD::move(__c), __a),
comp(__comp)
{
inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type*)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>*)
: c(_VSTD::move(__q.c), __a),
comp(_VSTD::move(__q.comp))
{
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
inline
_VSTD::push_heap(c.begin(), c.end(), comp);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
inline
template <class _Tp, class _Container, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<
- __is_swappable<_Container>::value
- && __is_swappable<_Compare>::value,
+_EnableIf<
+ __is_swappable<_Container>::value && __is_swappable<_Compare>::value,
void
->::type
+>
swap(priority_queue<_Tp, _Container, _Compare>& __x,
priority_queue<_Tp, _Container, _Compare>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_QUEUE
+#endif // _LIBCPP_QUEUE
namespace std
{
+// [rand.req.urng], uniform random bit generator requirements
+template<class G>
+concept uniform_random_bit_generator = see below; // C++20
// Engines
static constexpr result_type default_seed = 1u;
// constructors and seeding functions
- explicit linear_congruential_engine(result_type s = default_seed);
+ explicit linear_congruential_engine(result_type s = default_seed); // before C++20
+ linear_congruential_engine() : linear_congruential_engine(default_seed) {} // C++20
+ explicit linear_congruential_engine(result_type s); // C++20
template<class Sseq> explicit linear_congruential_engine(Sseq& q);
void seed(result_type s = default_seed);
template<class Sseq> void seed(Sseq& q);
static constexpr result_type default_seed = 5489u;
// constructors and seeding functions
- explicit mersenne_twister_engine(result_type value = default_seed);
+ explicit mersenne_twister_engine(result_type s = default_seed); // before C++20
+ mersenne_twister_engine() : mersenne_twister_engine(default_seed) {} // C++20
+ explicit mersenne_twister_engine(result_type s); // C++20
template<class Sseq> explicit mersenne_twister_engine(Sseq& q);
void seed(result_type value = default_seed);
template<class Sseq> void seed(Sseq& q);
static constexpr result_type default_seed = 19780503u;
// constructors and seeding functions
- explicit subtract_with_carry_engine(result_type value = default_seed);
+ explicit subtract_with_carry_engine(result_type value = default_seed); // before C++20
+ subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {} // C++20
+ explicit subtract_with_carry_engine(result_type value); // C++20
template<class Sseq> explicit subtract_with_carry_engine(Sseq& q);
void seed(result_type value = default_seed);
template<class Sseq> void seed(Sseq& q);
static constexpr result_type max() { return numeric_limits<result_type>::max(); }
// constructors
- explicit random_device(const string& token = "/dev/urandom");
+ explicit random_device(const string& token = implementation-defined); // before C++20
+ random_device() : random_device(implementation-defined) {} // C++20
+ explicit random_device(const string& token); // C++20
// generating functions
result_type operator()();
// constructors and reset functions
explicit uniform_int_distribution(IntType a = 0,
- IntType b = numeric_limits<IntType>::max());
+ IntType b = numeric_limits<IntType>::max()); // before C++20
+ uniform_int_distribution() : uniform_int_distribution(0) {} // C++20
+ explicit uniform_int_distribution(IntType a,
+ IntType b = numeric_limits<IntType>::max()); // C++20
explicit uniform_int_distribution(const param_type& parm);
void reset();
};
// constructors and reset functions
- explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0);
+ explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
+ uniform_real_distribution() : uniform_real_distribution(0.0) {} // C++20
+ explicit uniform_real_distribution(RealType a, RealType b = 1.0); // C++20
explicit uniform_real_distribution(const param_type& parm);
void reset();
};
// constructors and reset functions
- explicit bernoulli_distribution(double p = 0.5);
+ explicit bernoulli_distribution(double p = 0.5); // before C++20
+ bernoulli_distribution() : bernoulli_distribution(0.5) {} // C++20
+ explicit bernoulli_distribution(double p); // C++20
explicit bernoulli_distribution(const param_type& parm);
void reset();
};
// constructors and reset functions
- explicit binomial_distribution(IntType t = 1, double p = 0.5);
+ explicit binomial_distribution(IntType t = 1, double p = 0.5); // before C++20
+ binomial_distribution() : binomial_distribution(1) {} // C++20
+ explicit binomial_distribution(IntType t, double p = 0.5); // C++20
explicit binomial_distribution(const param_type& parm);
void reset();
};
// constructors and reset functions
- explicit geometric_distribution(double p = 0.5);
+ explicit geometric_distribution(double p = 0.5); // before C++20
+ geometric_distribution() : geometric_distribution(0.5) {} // C++20
+ explicit geometric_distribution(double p); // C++20
explicit geometric_distribution(const param_type& parm);
void reset();
};
// constructor and reset functions
- explicit negative_binomial_distribution(result_type k = 1, double p = 0.5);
+ explicit negative_binomial_distribution(IntType k = 1, double p = 0.5); // before C++20
+ negative_binomial_distribution() : negative_binomial_distribution(1) {} // C++20
+ explicit negative_binomial_distribution(IntType k, double p = 0.5); // C++20
explicit negative_binomial_distribution(const param_type& parm);
void reset();
};
// constructors and reset functions
- explicit poisson_distribution(double mean = 1.0);
+ explicit poisson_distribution(double mean = 1.0); // before C++20
+ poisson_distribution() : poisson_distribution(1.0) {} // C++20
+ explicit poisson_distribution(double mean); // C++20
explicit poisson_distribution(const param_type& parm);
void reset();
};
// constructors and reset functions
- explicit exponential_distribution(result_type lambda = 1.0);
+ explicit exponential_distribution(RealType lambda = 1.0); // before C++20
+ exponential_distribution() : exponential_distribution(1.0) {} // C++20
+ explicit exponential_distribution(RealType lambda); // C++20
explicit exponential_distribution(const param_type& parm);
void reset();
};
// constructors and reset functions
- explicit gamma_distribution(result_type alpha = 1, result_type beta = 1);
+ explicit gamma_distribution(RealType alpha = 0.0, RealType beta = 1.0); // before C++20
+ gamma_distribution() : gamma_distribution(0.0) {} // C++20
+ explicit gamma_distribution(RealType alpha, RealType beta = 1.0); // C++20
explicit gamma_distribution(const param_type& parm);
void reset();
};
// constructor and reset functions
- explicit weibull_distribution(result_type a = 1, result_type b = 1);
+ explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0); // before C++20
+ weibull_distribution() : weibull_distribution(1.0) {} // C++20
+ explicit weibull_distribution(RealType a, RealType b = 1.0); // C++20
explicit weibull_distribution(const param_type& parm);
void reset();
};
// constructor and reset functions
- explicit extreme_value_distribution(result_type a = 0, result_type b = 1);
+ explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
+ extreme_value_distribution() : extreme_value_distribution(0.0) {} // C++20
+ explicit extreme_value_distribution(RealType a, RealType b = 1.0); // C++20
explicit extreme_value_distribution(const param_type& parm);
void reset();
};
// constructors and reset functions
- explicit normal_distribution(result_type mean = 0, result_type stddev = 1);
+ explicit normal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20
+ normal_distribution() : normal_distribution(0.0) {} // C++20
+ explicit normal_distribution(RealType mean, RealType stddev = 1.0); // C++20
explicit normal_distribution(const param_type& parm);
void reset();
};
// constructor and reset functions
- explicit lognormal_distribution(result_type m = 0, result_type s = 1);
+ explicit lognormal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20
+ lognormal_distribution() : lognormal_distribution(0.0) {} // C++20
+ explicit lognormal_distribution(RealType mean, RealType stddev = 1.0); // C++20
explicit lognormal_distribution(const param_type& parm);
void reset();
};
// constructor and reset functions
- explicit chi_squared_distribution(result_type n = 1);
+ explicit chi_squared_distribution(RealType n = 1.0); // before C++20
+ chi_squared_distribution() : chi_squared_distribution(1.0) {} // C++20
+ explicit chi_squared_distribution(RealType n); // C++20
explicit chi_squared_distribution(const param_type& parm);
void reset();
};
// constructor and reset functions
- explicit cauchy_distribution(result_type a = 0, result_type b = 1);
+ explicit cauchy_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
+ cauchy_distribution() : cauchy_distribution(0.0) {} // C++20
+ explicit cauchy_distribution(RealType a, RealType b = 1.0); // C++20
explicit cauchy_distribution(const param_type& parm);
void reset();
};
// constructor and reset functions
- explicit fisher_f_distribution(result_type m = 1, result_type n = 1);
+ explicit fisher_f_distribution(RealType m = 1.0, RealType n = 1.0); // before C++20
+ fisher_f_distribution() : fisher_f_distribution(1.0) {} // C++20
+ explicit fisher_f_distribution(RealType m, RealType n = 1.0); // C++20
explicit fisher_f_distribution(const param_type& parm);
void reset();
};
// constructor and reset functions
- explicit student_t_distribution(result_type n = 1);
+ explicit student_t_distribution(RealType n = 1.0); // before C++20
+ student_t_distribution() : student_t_distribution(1.0) {} // C++20
+ explicit student_t_distribution(RealType n); // C++20
explicit student_t_distribution(const param_type& parm);
void reset();
*/
#include <__config>
+#include <__random/uniform_int_distribution.h>
+#include <algorithm>
+#include <cmath>
+#include <concepts>
#include <cstddef>
#include <cstdint>
-#include <cmath>
-#include <type_traits>
#include <initializer_list>
+#include <iosfwd>
#include <limits>
-#include <algorithm>
#include <numeric>
-#include <vector>
#include <string>
-#include <istream>
-#include <ostream>
+#include <type_traits>
+#include <vector>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
_LIBCPP_BEGIN_NAMESPACE_STD
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+
+// [rand.req.urng]
+template<class _Gen>
+concept uniform_random_bit_generator =
+ invocable<_Gen&> && unsigned_integral<invoke_result_t<_Gen&>> &&
+ requires {
+ { _Gen::min() } -> same_as<invoke_result_t<_Gen&>>;
+ { _Gen::max() } -> same_as<invoke_result_t<_Gen&>>;
+ requires bool_constant<(_Gen::min() < _Gen::max())>::value;
+ };
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+
// __is_seed_sequence
template <class _Sseq, class _Engine>
template <unsigned long long __a, unsigned long long __c,
unsigned long long __m, unsigned long long _Mp,
- bool _MightOverflow = (__a != 0 && __m != 0 && __m-1 > (_Mp-__c)/__a)>
+ bool _MightOverflow = (__a != 0 && __m != 0 && __m-1 > (_Mp-__c)/__a),
+ bool _OverflowOK = ((__m | (__m-1)) > __m), // m = 2^n
+ bool _SchrageOK = (__a != 0 && __m != 0 && __m % __a <= __m / __a)> // r <= q
+struct __lce_alg_picker
+{
+ static_assert(__a != 0 || __m != 0 || !_MightOverflow || _OverflowOK || _SchrageOK,
+ "The current values of a, c, and m cannot generate a number "
+ "within bounds of linear_congruential_engine.");
+
+ static _LIBCPP_CONSTEXPR const bool __use_schrage = _MightOverflow &&
+ !_OverflowOK &&
+ _SchrageOK;
+};
+
+template <unsigned long long __a, unsigned long long __c,
+ unsigned long long __m, unsigned long long _Mp,
+ bool _UseSchrage = __lce_alg_picker<__a, __c, __m, _Mp>::__use_schrage>
struct __lce_ta;
// 64
static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters");
static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters");
+ static_assert(is_unsigned<_UIntType>::value, "_UIntType must be unsigned type");
public:
static _LIBCPP_CONSTEXPR const result_type _Min = __c == 0u ? 1u: 0u;
static _LIBCPP_CONSTEXPR const result_type _Max = __m - 1u;
static _LIBCPP_CONSTEXPR const result_type default_seed = 1u;
// constructors and seeding functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ linear_congruential_engine() : linear_congruential_engine(default_seed) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit linear_congruential_engine(result_type __s) { seed(__s); }
+#else
_LIBCPP_INLINE_VISIBILITY
- explicit linear_congruential_engine(result_type __s = default_seed)
- {seed(__s);}
+ explicit linear_congruential_engine(result_type __s = default_seed) {
+ seed(__s);
+ }
+#endif
template<class _Sseq>
_LIBCPP_INLINE_VISIBILITY
explicit linear_congruential_engine(_Sseq& __q,
const linear_congruential_engine<_UIntType, __a, __c, __m>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left);
+ typedef basic_ostream<_CharT, _Traits> _Ostream;
+ __os.flags(_Ostream::dec | _Ostream::left);
__os.fill(__os.widen(' '));
return __os << __x.__x_;
}
linear_congruential_engine<_UIntType, __a, __c, __m>& __x)
{
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
_UIntType __t;
__is >> __t;
if (!__is.fail())
static _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;
// constructors and seeding functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ mersenne_twister_engine() : mersenne_twister_engine(default_seed) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit mersenne_twister_engine(result_type __sd) { seed(__sd); }
+#else
_LIBCPP_INLINE_VISIBILITY
- explicit mersenne_twister_engine(result_type __sd = default_seed)
- {seed(__sd);}
+ explicit mersenne_twister_engine(result_type __sd = default_seed) {
+ seed(__sd);
+ }
+#endif
template<class _Sseq>
_LIBCPP_INLINE_VISIBILITY
explicit mersenne_twister_engine(_Sseq& __q,
_Bp, _Tp, _Cp, _Lp, _Fp>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left);
+ typedef basic_ostream<_CharT, _Traits> _Ostream;
+ __os.flags(_Ostream::dec | _Ostream::left);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.__x_[__x.__i_];
_Bp, _Tp, _Cp, _Lp, _Fp>& __x)
{
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
_UInt __t[_Np];
for (size_t __i = 0; __i < _Np; ++__i)
__is >> __t[__i];
static _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;
// constructors and seeding functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {}
_LIBCPP_INLINE_VISIBILITY
- explicit subtract_with_carry_engine(result_type __sd = default_seed)
- {seed(__sd);}
+ explicit subtract_with_carry_engine(result_type __sd) { seed(__sd); }
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ explicit subtract_with_carry_engine(result_type __sd = default_seed) {
+ seed(__sd);
+ }
+#endif
template<class _Sseq>
_LIBCPP_INLINE_VISIBILITY
explicit subtract_with_carry_engine(_Sseq& __q,
const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left);
+ typedef basic_ostream<_CharT, _Traits> _Ostream;
+ __os.flags(_Ostream::dec | _Ostream::left);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.__x_[__x.__i_];
subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)
{
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
_UInt __t[_Rp+1];
for (size_t __i = 0; __i < _Rp+1; ++__i)
__is >> __t[__i];
_LIBCPP_INLINE_VISIBILITY
explicit discard_block_engine(_Engine&& __e)
: __e_(_VSTD::move(__e)), __n_(0) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
template<class _Sseq>
const discard_block_engine<_Eng, _Pp, _Rp>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left);
+ typedef basic_ostream<_CharT, _Traits> _Ostream;
+ __os.flags(_Ostream::dec | _Ostream::left);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
return __os << __x.__e_ << __sp << __x.__n_;
discard_block_engine<_Eng, _Pp, _Rp>& __x)
{
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
_Eng __e;
int __n;
__is >> __e >> __n;
_LIBCPP_INLINE_VISIBILITY
explicit independent_bits_engine(_Engine&& __e)
: __e_(_VSTD::move(__e)) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
template<class _Sseq>
_LIBCPP_INLINE_VISIBILITY
explicit shuffle_order_engine(_Engine&& __e)
: __e_(_VSTD::move(__e)) {__init();}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
template<class _Sseq>
const shuffle_order_engine<_Eng, _Kp>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left);
+ typedef basic_ostream<_CharT, _Traits> _Ostream;
+ __os.flags(_Ostream::dec | _Ostream::left);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.__e_ << __sp << __x._V_[0];
{
typedef typename shuffle_order_engine<_Eng, _Kp>::result_type result_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
_Eng __e;
result_type _Vp[_Kp+1];
__is >> __e;
// random_device
+#if !defined(_LIBCPP_HAS_NO_RANDOM_DEVICE)
+
class _LIBCPP_TYPE_VIS random_device
{
#ifdef _LIBCPP_USING_DEV_RANDOM
static _LIBCPP_CONSTEXPR result_type max() { return _Max;}
// constructors
+#ifndef _LIBCPP_CXX03_LANG
+ random_device() : random_device("/dev/urandom") {}
+ explicit random_device(const string& __token);
+#else
explicit random_device(const string& __token = "/dev/urandom");
+#endif
~random_device();
// generating functions
random_device& operator=(const random_device&); // = delete;
};
+#endif // !_LIBCPP_HAS_NO_RANDOM_DEVICE
+
// seed_seq
class _LIBCPP_TEMPLATE_VIS seed_seq
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY
seed_seq(initializer_list<_Tp> __il) {init(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
return _Sp / __base;
}
-// uniform_int_distribution
-
-// in <algorithm>
-
-template <class _CharT, class _Traits, class _IT>
-basic_ostream<_CharT, _Traits>&
-operator<<(basic_ostream<_CharT, _Traits>& __os,
- const uniform_int_distribution<_IT>& __x)
-{
- __save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left);
- _CharT __sp = __os.widen(' ');
- __os.fill(__sp);
- return __os << __x.a() << __sp << __x.b();
-}
-
-template <class _CharT, class _Traits, class _IT>
-basic_istream<_CharT, _Traits>&
-operator>>(basic_istream<_CharT, _Traits>& __is,
- uniform_int_distribution<_IT>& __x)
-{
- typedef uniform_int_distribution<_IT> _Eng;
- typedef typename _Eng::result_type result_type;
- typedef typename _Eng::param_type param_type;
- __save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
- result_type __a;
- result_type __b;
- __is >> __a >> __b;
- if (!__is.fail())
- __x.param(param_type(__a, __b));
- return __is;
-}
-
// uniform_real_distribution
template<class _RealType = double>
public:
// constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ uniform_real_distribution() : uniform_real_distribution(0) {}
+ explicit uniform_real_distribution(result_type __a, result_type __b = 1)
+ : __p_(param_type(__a, __b)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
explicit uniform_real_distribution(result_type __a = 0, result_type __b = 1)
: __p_(param_type(__a, __b)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit uniform_real_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_INLINE_VISIBILITY
const uniform_real_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
return __os << __x.a() << __sp << __x.b();
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __a;
result_type __b;
__is >> __a >> __b;
public:
// constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ bernoulli_distribution() : bernoulli_distribution(0.5) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit bernoulli_distribution(double __p) : __p_(param_type(__p)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
- explicit bernoulli_distribution(double __p = 0.5)
- : __p_(param_type(__p)) {}
+ explicit bernoulli_distribution(double __p = 0.5) : __p_(param_type(__p)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit bernoulli_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_INLINE_VISIBILITY
operator<<(basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
return __os << __x.p();
typedef bernoulli_distribution _Eng;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
double __p;
__is >> __p;
if (!__is.fail())
public:
// constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ binomial_distribution() : binomial_distribution(1) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit binomial_distribution(result_type __t, double __p = 0.5)
+ : __p_(param_type(__t, __p)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
explicit binomial_distribution(result_type __t = 1, double __p = 0.5)
: __p_(param_type(__t, __p)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit binomial_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_INLINE_VISIBILITY
{return !(__x == __y);}
};
-#ifndef _LIBCPP_MSVCRT
+#ifndef _LIBCPP_MSVCRT_LIKE
extern "C" double lgamma_r(double, int *);
#endif
inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) {
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_MSVCRT_LIKE)
return lgamma(__d);
#else
int __sign;
}
template<class _IntType>
-binomial_distribution<_IntType>::param_type::param_type(const result_type __t, const double __p)
+binomial_distribution<_IntType>::param_type::param_type(result_type __t, double __p)
: __t_(__t), __p_(__p)
{
if (0 < __p_ && __p_ < 1)
const binomial_distribution<_IntType>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
return __os << __x.t() << __sp << __x.p();
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __t;
double __p;
__is >> __t >> __p;
public:
// constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ exponential_distribution() : exponential_distribution(1) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit exponential_distribution(result_type __lambda)
+ : __p_(param_type(__lambda)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
explicit exponential_distribution(result_type __lambda = 1)
: __p_(param_type(__lambda)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit exponential_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_INLINE_VISIBILITY
const exponential_distribution<_RealType>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
return __os << __x.lambda();
}
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __lambda;
__is >> __lambda;
if (!__is.fail())
public:
// constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ normal_distribution() : normal_distribution(0) {}
_LIBCPP_INLINE_VISIBILITY
- explicit normal_distribution(result_type __mean = 0, result_type __stddev = 1)
+ explicit normal_distribution(result_type __mean, result_type __stddev = 1)
: __p_(param_type(__mean, __stddev)), _V_hot_(false) {}
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ explicit normal_distribution(result_type __mean = 0,
+ result_type __stddev = 1)
+ : __p_(param_type(__mean, __stddev)), _V_hot_(false) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit normal_distribution(const param_type& __p)
: __p_(__p), _V_hot_(false) {}
const normal_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.mean() << __sp << __x.stddev() << __sp << __x._V_hot_;
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __mean;
result_type __stddev;
result_type _Vp = 0;
public:
// constructor and reset functions
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- explicit lognormal_distribution(result_type __m = 0, result_type __s = 1)
+ lognormal_distribution() : lognormal_distribution(0) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit lognormal_distribution(result_type __m, result_type __s = 1)
: __p_(param_type(__m, __s)) {}
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ explicit lognormal_distribution(result_type __m = 0,
+ result_type __s = 1)
+ : __p_(param_type(__m, __s)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit lognormal_distribution(const param_type& __p)
: __p_(__p) {}
public:
// constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ poisson_distribution() : poisson_distribution(1.0) {}
_LIBCPP_INLINE_VISIBILITY
- explicit poisson_distribution(double __mean = 1.0) : __p_(__mean) {}
+ explicit poisson_distribution(double __mean)
+ : __p_(__mean) {}
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ explicit poisson_distribution(double __mean = 1.0)
+ : __p_(__mean) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit poisson_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_INLINE_VISIBILITY
{
__s_ = _VSTD::sqrt(__mean_);
__d_ = 6 * __mean_ * __mean_;
- __l_ = std::trunc(__mean_ - 1.1484);
+ __l_ = _VSTD::trunc(__mean_ - 1.1484);
__omega_ = .3989423 / __s_;
double __b1_ = .4166667E-1 / __mean_;
double __b2_ = .3 * __b1_ * __b1_;
double __u;
if (__g > 0)
{
- __tx = std::trunc(__g);
+ __tx = _VSTD::trunc(__g);
if (__tx >= __pr.__l_)
- return std::__clamp_to_integral<result_type>(__tx);
+ return _VSTD::__clamp_to_integral<result_type>(__tx);
__difmuk = __pr.__mean_ - __tx;
__u = __urd(__urng);
if (__pr.__d_ * __u >= __difmuk * __difmuk * __difmuk)
- return std::__clamp_to_integral<result_type>(__tx);
+ return _VSTD::__clamp_to_integral<result_type>(__tx);
}
exponential_distribution<double> __edist;
for (bool __using_exp_dist = false; true; __using_exp_dist = true)
__u += __u - 1;
__t = 1.8 + (__u < 0 ? -__e : __e);
} while (__t <= -.6744);
- __tx = std::trunc(__pr.__mean_ + __pr.__s_ * __t);
+ __tx = _VSTD::trunc(__pr.__mean_ + __pr.__s_ * __t);
__difmuk = __pr.__mean_ - __tx;
__using_exp_dist = true;
}
}
}
}
- return std::__clamp_to_integral<result_type>(__tx);
+ return _VSTD::__clamp_to_integral<result_type>(__tx);
}
template <class _CharT, class _Traits, class _IntType>
const poisson_distribution<_IntType>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
return __os << __x.mean();
}
typedef poisson_distribution<_IntType> _Eng;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
double __mean;
__is >> __mean;
if (!__is.fail())
public:
// constructor and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ weibull_distribution() : weibull_distribution(1) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit weibull_distribution(result_type __a, result_type __b = 1)
+ : __p_(param_type(__a, __b)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
explicit weibull_distribution(result_type __a = 1, result_type __b = 1)
: __p_(param_type(__a, __b)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit weibull_distribution(const param_type& __p)
: __p_(__p) {}
const weibull_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.a() << __sp << __x.b();
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __a;
result_type __b;
__is >> __a >> __b;
public:
// constructor and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ extreme_value_distribution() : extreme_value_distribution(0) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit extreme_value_distribution(result_type __a, result_type __b = 1)
+ : __p_(param_type(__a, __b)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
- explicit extreme_value_distribution(result_type __a = 0, result_type __b = 1)
+ explicit extreme_value_distribution(result_type __a = 0,
+ result_type __b = 1)
: __p_(param_type(__a, __b)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit extreme_value_distribution(const param_type& __p)
: __p_(__p) {}
const extreme_value_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.a() << __sp << __x.b();
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __a;
result_type __b;
__is >> __a >> __b;
public:
// constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ gamma_distribution() : gamma_distribution(1) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit gamma_distribution(result_type __alpha, result_type __beta = 1)
+ : __p_(param_type(__alpha, __beta)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
- explicit gamma_distribution(result_type __alpha = 1, result_type __beta = 1)
+ explicit gamma_distribution(result_type __alpha = 1,
+ result_type __beta = 1)
: __p_(param_type(__alpha, __beta)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit gamma_distribution(const param_type& __p)
: __p_(__p) {}
const gamma_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.alpha() << __sp << __x.beta();
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __alpha;
result_type __beta;
__is >> __alpha >> __beta;
public:
// constructor and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ negative_binomial_distribution() : negative_binomial_distribution(1) {}
_LIBCPP_INLINE_VISIBILITY
- explicit negative_binomial_distribution(result_type __k = 1, double __p = 0.5)
+ explicit negative_binomial_distribution(result_type __k, double __p = 0.5)
: __p_(__k, __p) {}
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ explicit negative_binomial_distribution(result_type __k = 1,
+ double __p = 0.5)
+ : __p_(__k, __p) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit negative_binomial_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_INLINE_VISIBILITY
const negative_binomial_distribution<_IntType>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
return __os << __x.k() << __sp << __x.p();
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __k;
double __p;
__is >> __k >> __p;
public:
// constructors and reset functions
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- explicit geometric_distribution(double __p = 0.5) : __p_(__p) {}
+ geometric_distribution() : geometric_distribution(0.5) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit geometric_distribution(double __p)
+ : __p_(__p) {}
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ explicit geometric_distribution(double __p = 0.5)
+ : __p_(__p) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit geometric_distribution(const param_type& __p) : __p_(__p) {}
_LIBCPP_INLINE_VISIBILITY
const geometric_distribution<_IntType>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
return __os << __x.p();
}
typedef geometric_distribution<_IntType> _Eng;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
double __p;
__is >> __p;
if (!__is.fail())
public:
// constructor and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ chi_squared_distribution() : chi_squared_distribution(1) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit chi_squared_distribution(result_type __n)
+ : __p_(param_type(__n)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
explicit chi_squared_distribution(result_type __n = 1)
: __p_(param_type(__n)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit chi_squared_distribution(const param_type& __p)
: __p_(__p) {}
const chi_squared_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
__os << __x.n();
return __os;
}
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __n;
__is >> __n;
if (!__is.fail())
public:
// constructor and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ cauchy_distribution() : cauchy_distribution(0) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit cauchy_distribution(result_type __a, result_type __b = 1)
+ : __p_(param_type(__a, __b)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
explicit cauchy_distribution(result_type __a = 0, result_type __b = 1)
: __p_(param_type(__a, __b)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit cauchy_distribution(const param_type& __p)
: __p_(__p) {}
const cauchy_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.a() << __sp << __x.b();
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __a;
result_type __b;
__is >> __a >> __b;
public:
// constructor and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ fisher_f_distribution() : fisher_f_distribution(1) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit fisher_f_distribution(result_type __m, result_type __n = 1)
+ : __p_(param_type(__m, __n)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
explicit fisher_f_distribution(result_type __m = 1, result_type __n = 1)
: __p_(param_type(__m, __n)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit fisher_f_distribution(const param_type& __p)
: __p_(__p) {}
const fisher_f_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
__os << __x.m() << __sp << __x.n();
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __m;
result_type __n;
__is >> __m >> __n;
public:
// constructor and reset functions
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ student_t_distribution() : student_t_distribution(1) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit student_t_distribution(result_type __n)
+ : __p_(param_type(__n)) {}
+#else
_LIBCPP_INLINE_VISIBILITY
explicit student_t_distribution(result_type __n = 1)
: __p_(param_type(__n)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
explicit student_t_distribution(const param_type& __p)
: __p_(__p) {}
const student_t_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
__os << __x.n();
return __os;
}
typedef typename _Eng::result_type result_type;
typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
result_type __n;
__is >> __n;
if (!__is.fail())
_LIBCPP_INLINE_VISIBILITY
param_type(initializer_list<double> __wl)
: __p_(__wl.begin(), __wl.end()) {__init();}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(size_t __nw, double __xmin, double __xmax,
_UnaryOperation __fw);
_LIBCPP_INLINE_VISIBILITY
discrete_distribution(initializer_list<double> __wl)
: __p_(__wl) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
_LIBCPP_INLINE_VISIBILITY
discrete_distribution(size_t __nw, double __xmin, double __xmax,
if (__p_.size() > 1)
{
double __s = _VSTD::accumulate(__p_.begin(), __p_.end(), 0.0);
- for (_VSTD::vector<double>::iterator __i = __p_.begin(), __e = __p_.end();
- __i < __e; ++__i)
+ for (vector<double>::iterator __i = __p_.begin(), __e = __p_.end(); __i < __e; ++__i)
*__i /= __s;
vector<double> __t(__p_.size() - 1);
_VSTD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin());
discrete_distribution<_IntType>::param_type::probabilities() const
{
size_t __n = __p_.size();
- _VSTD::vector<double> __p(__n+1);
+ vector<double> __p(__n+1);
_VSTD::adjacent_difference(__p_.begin(), __p_.end(), __p.begin());
if (__n > 0)
__p[__n] = 1 - __p_[__n-1];
const discrete_distribution<_IT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
size_t __n = __x.__p_.__p_.size();
discrete_distribution<_IT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
size_t __n;
__is >> __n;
vector<double> __p(__n);
#ifndef _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(size_t __nw, result_type __xmin, result_type __xmax,
_UnaryOperation __fw);
piecewise_constant_distribution(initializer_list<result_type> __bl,
_UnaryOperation __fw)
: __p_(__bl, __fw) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
_LIBCPP_INLINE_VISIBILITY
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _RealType>
template<class _UnaryOperation>
const piecewise_constant_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
size_t __n = __x.__p_.__b_.size();
typedef piecewise_constant_distribution<_RT> _Eng;
typedef typename _Eng::result_type result_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
size_t __n;
__is >> __n;
vector<result_type> __b(__n);
#ifndef _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(size_t __nw, result_type __xmin, result_type __xmax,
_UnaryOperation __fw);
piecewise_linear_distribution(initializer_list<result_type> __bl,
_UnaryOperation __fw)
: __p_(__bl, __fw) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
_LIBCPP_INLINE_VISIBILITY
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template<class _RealType>
template<class _UnaryOperation>
const piecewise_linear_distribution<_RT>& __x)
{
__save_flags<_CharT, _Traits> __lx(__os);
- __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
- ios_base::scientific);
+ typedef basic_ostream<_CharT, _Traits> _OStream;
+ __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
+ _OStream::scientific);
_CharT __sp = __os.widen(' ');
__os.fill(__sp);
size_t __n = __x.__p_.__b_.size();
typedef piecewise_linear_distribution<_RT> _Eng;
typedef typename _Eng::result_type result_type;
__save_flags<_CharT, _Traits> __lx(__is);
- __is.flags(ios_base::dec | ios_base::skipws);
+ typedef basic_istream<_CharT, _Traits> _Istream;
+ __is.flags(_Istream::dec | _Istream::skipws);
size_t __n;
__is >> __n;
vector<result_type> __b(__n);
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_RANDOM
+#endif // _LIBCPP_RANDOM
--- /dev/null
+// -*- C++ -*-
+//===--------------------------- ranges -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_RANGES
+#define _LIBCPP_RANGES
+
+/*
+
+#include <compare> // see [compare.syn]
+#include <initializer_list> // see [initializer.list.syn]
+#include <iterator> // see [iterator.synopsis]
+
+namespace std::ranges {
+ inline namespace unspecified {
+ // [range.access], range access
+ inline constexpr unspecified begin = unspecified;
+ inline constexpr unspecified end = unspecified;
+ inline constexpr unspecified cbegin = unspecified;
+ inline constexpr unspecified cend = unspecified;
+
+ inline constexpr unspecified size = unspecified;
+ inline constexpr unspecified ssize = unspecified;
+ }
+
+ // [range.range], ranges
+ template<class T>
+ concept range = see below;
+
+ template<class T>
+ inline constexpr bool enable_borrowed_range = false;
+
+ template<class T>
+ using iterator_t = decltype(ranges::begin(declval<R&>()));
+ template<range R>
+ using sentinel_t = decltype(ranges::end(declval<R&>()));
+ template<range R>
+ using range_difference_t = iter_difference_t<iterator_t<R>>;
+ template<sized_range R>
+ using range_size_t = decltype(ranges::size(declval<R&>()));
+ template<range R>
+ using range_value_t = iter_value_t<iterator_t<R>>;
+ template<range R>
+ using range_reference_t = iter_reference_t<iterator_t<R>>;
+ template<range R>
+ using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>;
+
+ // [range.sized], sized ranges
+ template<class>
+ inline constexpr bool disable_sized_range = false;
+
+ template<class T>
+ concept sized_range = ...;
+
+ // [range.view], views
+ template<class T>
+ inline constexpr bool enable_view = ...;
+
+ struct view_base { };
+
+ template<class T>
+ concept view = ...;
+
+ // [range.refinements], other range refinements
+ template<class R, class T>
+ concept output_range = see below;
+
+ template<class T>
+ concept input_range = see below;
+
+ template<class T>
+ concept forward_range = see below;
+
+ template<class T>
+ concept bidirectional_range = see below;
+
+ template<class T>
+ concept random_access_range = see below;
+
+ template<class T>
+ concept contiguous_range = see below;
+
+ template <class _Tp>
+ concept common_range = see below;
+
+ template<class T>
+ concept viewable_range = see below;
+
+ // [view.interface], class template view_interface
+ template<class D>
+ requires is_class_v<D> && same_as<D, remove_cv_t<D>>
+ class view_interface;
+
+ // [range.subrange], sub-ranges
+ enum class subrange_kind : bool { unsized, sized };
+
+ template<input_or_output_iterator I, sentinel_for<I> S = I, subrange_kind K = see below>
+ requires (K == subrange_kind::sized || !sized_sentinel_for<S, I>)
+ class subrange;
+
+ template<class I, class S, subrange_kind K>
+ inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true;
+
+ // [range.dangling], dangling iterator handling
+ struct dangling;
+
+ template<range R>
+ using borrowed_iterator_t = see below;
+
+ template<range R>
+ using borrowed_subrange_t = see below;
+
+ // [range.empty], empty view
+ template<class T>
+ requires is_object_v<T>
+ class empty_view;
+
+ // [range.all], all view
+ namespace views {
+ inline constexpr unspecified all = unspecified;
+
+ template<viewable_range R>
+ using all_t = decltype(all(declval<R>()));
+ }
+
+ template<range R>
+ requires is_object_v<R>
+ class ref_view;
+
+ template<class T>
+ inline constexpr bool enable_borrowed_range<ref_view<T>> = true;
+
+ // [range.drop], drop view
+ template<view V>
+ class drop_view;
+
+ template<class T>
+ inline constexpr bool enable_borrowed_range<drop_view<T>> = enable_borrowed_range<T>;
+
+ // [range.transform], transform view
+ template<input_range V, copy_constructible F>
+ requires view<V> && is_object_v<F> &&
+ regular_invocable<F&, range_reference_t<V>> &&
+ can-reference<invoke_result_t<F&, range_reference_t<V>>>
+ class transform_view;
+
+ // [range.common], common view
+ template<view V>
+ requires (!common_range<V> && copyable<iterator_t<V>>)
+ class common_view;
+
+ template<class T>
+ inline constexpr bool enable_borrowed_range<common_view<T>> = enable_borrowed_range<T>;
+}
+
+*/
+
+// Make sure all feature tests macros are always available.
+#include <version>
+// Only enable the contents of the header when libc++ was build with LIBCXX_ENABLE_INCOMPLETE_FEATURES enabled
+#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#include <__config>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/common_view.h>
+#include <__ranges/concepts.h>
+#include <__ranges/dangling.h>
+#include <__ranges/data.h>
+#include <__ranges/drop_view.h>
+#include <__ranges/empty.h>
+#include <__ranges/empty_view.h>
+#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/enable_view.h>
+#include <__ranges/ref_view.h>
+#include <__ranges/size.h>
+#include <__ranges/subrange.h>
+#include <__ranges/transform_view.h>
+#include <__ranges/view_interface.h>
+#include <compare> // Required by the standard.
+#include <initializer_list> // Required by the standard.
+#include <iterator> // Required by the standard.
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // _LIBCPP_RANGES
*/
#include <__config>
-#include <cstdint>
#include <climits>
+#include <cstdint>
#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
struct _LIBCPP_TEMPLATE_VIS ratio_multiply
: public __ratio_multiply<_R1, _R2>::type {};
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_divide
struct _LIBCPP_TEMPLATE_VIS ratio_divide
: public __ratio_divide<_R1, _R2>::type {};
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_add
struct _LIBCPP_TEMPLATE_VIS ratio_add
: public __ratio_add<_R1, _R2>::type {};
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_subtract
struct _LIBCPP_TEMPLATE_VIS ratio_subtract
: public __ratio_subtract<_R1, _R2>::type {};
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
// ratio_equal
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_RATIO
+#endif // _LIBCPP_RATIO
extended = unspecified,
awk = unspecified,
grep = unspecified,
- egrep = unspecified
+ egrep = unspecified,
+ multiline = unspecified
};
constexpr syntax_option_type operator~(syntax_option_type f);
static constexpr regex_constants::syntax_option_type awk = regex_constants::awk;
static constexpr regex_constants::syntax_option_type grep = regex_constants::grep;
static constexpr regex_constants::syntax_option_type egrep = regex_constants::egrep;
+ static constexpr regex_constants::syntax_option_type multiline = regex_constants::multiline;
// construct/copy/destroy:
basic_regex();
typedef basic_string<char_type> string_type;
// construct/copy/destroy:
- explicit match_results(const Allocator& a = Allocator());
+ explicit match_results(const Allocator& a = Allocator()); // before C++20
+ match_results() : match_results(Allocator()) {} // C++20
+ explicit match_results(const Allocator& a); // C++20
match_results(const match_results& m);
match_results(match_results&& m) noexcept;
match_results& operator=(const match_results& m);
*/
#include <__config>
-#include <stdexcept>
+#include <__debug>
+#include <__iterator/wrap_iter.h>
#include <__locale>
+#include <compare>
+#include <deque>
#include <initializer_list>
-#include <utility>
#include <iterator>
-#include <string>
#include <memory>
+#include <stdexcept>
+#include <string>
+#include <utility>
#include <vector>
-#include <deque>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
extended = 1 << 5,
awk = 1 << 6,
grep = 1 << 7,
- egrep = 1 << 8
+ egrep = 1 << 8,
+ // 1 << 9 may be used by ECMAScript
+ multiline = 1 << 10
};
inline _LIBCPP_CONSTEXPR
// __l_anchor
template <class _CharT>
-class __l_anchor
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+bool __is_eol(_CharT c)
+{
+ return c == '\r' || c == '\n';
+}
+
+template <class _CharT>
+class __l_anchor_multiline
: public __owns_one_state<_CharT>
{
typedef __owns_one_state<_CharT> base;
+ bool __multiline_;
+
public:
typedef _VSTD::__state<_CharT> __state;
_LIBCPP_INLINE_VISIBILITY
- __l_anchor(__node<_CharT>* __s)
- : base(__s) {}
+ __l_anchor_multiline(bool __multiline, __node<_CharT>* __s)
+ : base(__s), __multiline_(__multiline) {}
virtual void __exec(__state&) const;
};
template <class _CharT>
void
-__l_anchor<_CharT>::__exec(__state& __s) const
+__l_anchor_multiline<_CharT>::__exec(__state& __s) const
{
if (__s.__at_first_ && __s.__current_ == __s.__first_ &&
!(__s.__flags_ & regex_constants::match_not_bol))
__s.__do_ = __state::__accept_but_not_consume;
__s.__node_ = this->first();
}
+ else if (__multiline_ &&
+ !__s.__at_first_ &&
+ __is_eol(*_VSTD::prev(__s.__current_)))
+ {
+ __s.__do_ = __state::__accept_but_not_consume;
+ __s.__node_ = this->first();
+ }
else
{
__s.__do_ = __state::__reject;
// __r_anchor
template <class _CharT>
-class __r_anchor
+class __r_anchor_multiline
: public __owns_one_state<_CharT>
{
typedef __owns_one_state<_CharT> base;
+ bool __multiline;
+
public:
typedef _VSTD::__state<_CharT> __state;
_LIBCPP_INLINE_VISIBILITY
- __r_anchor(__node<_CharT>* __s)
- : base(__s) {}
+ __r_anchor_multiline(bool __multiline, __node<_CharT>* __s)
+ : base(__s), __multiline(__multiline) {}
virtual void __exec(__state&) const;
};
template <class _CharT>
void
-__r_anchor<_CharT>::__exec(__state& __s) const
+__r_anchor_multiline<_CharT>::__exec(__state& __s) const
{
if (__s.__current_ == __s.__last_ &&
!(__s.__flags_ & regex_constants::match_not_eol))
__s.__do_ = __state::__accept_but_not_consume;
__s.__node_ = this->first();
}
+ else if (__multiline && __is_eol(*__s.__current_))
+ {
+ __s.__do_ = __state::__accept_but_not_consume;
+ __s.__node_ = this->first();
+ }
else
{
__s.__do_ = __state::__reject;
{
const bool __in_neg_mask = __traits_.isctype(__ch, __neg_mask_);
const bool __in_neg_chars =
- std::find(__neg_chars_.begin(), __neg_chars_.end(), __ch) !=
+ _VSTD::find(__neg_chars_.begin(), __neg_chars_.end(), __ch) !=
__neg_chars_.end();
if (!(__in_neg_mask || __in_neg_chars))
{
template <class _CharT, class _Traits> class __lookahead;
template <class _CharT, class _Traits = regex_traits<_CharT> >
-class _LIBCPP_TEMPLATE_VIS basic_regex
+ class _LIBCPP_TEMPLATE_VIS basic_regex;
+
+typedef basic_regex<char> regex;
+typedef basic_regex<wchar_t> wregex;
+
+template <class _CharT, class _Traits>
+class
+ _LIBCPP_TEMPLATE_VIS
+ _LIBCPP_PREFERRED_NAME(regex)
+ _LIBCPP_PREFERRED_NAME(wregex)
+ basic_regex
{
public:
// types:
static const regex_constants::syntax_option_type awk = regex_constants::awk;
static const regex_constants::syntax_option_type grep = regex_constants::grep;
static const regex_constants::syntax_option_type egrep = regex_constants::egrep;
+ static const regex_constants::syntax_option_type multiline = regex_constants::multiline;
// construct/copy/destroy:
_LIBCPP_INLINE_VISIBILITY
basic_regex()
: __flags_(regex_constants::ECMAScript), __marked_count_(0), __loop_count_(0), __open_count_(0),
- __end_(0)
+ __end_(nullptr)
{}
_LIBCPP_INLINE_VISIBILITY
explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
- __end_(0)
+ __end_(nullptr)
{
__init(__p, __p + __traits_.length(__p));
}
_LIBCPP_INLINE_VISIBILITY
basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
- __end_(0)
+ __end_(nullptr)
{
__init(__p, __p + __len);
}
explicit basic_regex(const basic_string<value_type, _ST, _SA>& __p,
flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
- __end_(0)
+ __end_(nullptr)
{
__init(__p.begin(), __p.end());
}
basic_regex(_ForwardIterator __first, _ForwardIterator __last,
flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
- __end_(0)
+ __end_(nullptr)
{
__init(__first, __last);
}
basic_regex(initializer_list<value_type> __il,
flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
- __end_(0)
+ __end_(nullptr)
{
__init(__il.begin(), __il.end());
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
// ~basic_regex() = default;
_LIBCPP_INLINE_VISIBILITY
basic_regex& operator=(initializer_list<value_type> __il)
{return assign(__il);}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _ST, class _SA>
_LIBCPP_INLINE_VISIBILITY
basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
flag_type __f = regex_constants::ECMAScript)
{return assign(__il.begin(), __il.end(), __f);}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
// const operations:
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
unsigned __loop_count() const {return __loop_count_;}
+ _LIBCPP_INLINE_VISIBILITY
+ bool __use_multiline() const
+ {
+ return __get_grammar(__flags_) == ECMAScript && (__flags_ & multiline);
+ }
+
template <class _ForwardIterator>
void
__init(_ForwardIterator __first, _ForwardIterator __last);
__first != __last && ( __val = __traits_.value(*__first, 10)) != -1;
++__first)
{
- if (__c >= std::numeric_limits<int>::max() / 10)
+ if (__c >= numeric_limits<int>::max() / 10)
__throw_regex_error<regex_constants::error_badbrace>();
__c *= 10;
__c += __val;
for (++__first;
__first != __last && '0' <= *__first && *__first <= '9'; ++__first)
{
- if (__v >= std::numeric_limits<unsigned>::max() / 10)
+ if (__v >= numeric_limits<unsigned>::max() / 10)
__throw_regex_error<regex_constants::error_backref>();
__v = 10 * __v + *__first - '0';
}
if (__hd == -1)
__throw_regex_error<regex_constants::error_escape>();
__sum = 16 * __sum + static_cast<unsigned>(__hd);
- // drop through
+ // fallthrough
case 'x':
++__first;
if (__first == __last)
void
basic_regex<_CharT, _Traits>::__push_l_anchor()
{
- __end_->first() = new __l_anchor<_CharT>(__end_->first());
+ __end_->first() = new __l_anchor_multiline<_CharT>(__use_multiline(), __end_->first());
__end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
}
void
basic_regex<_CharT, _Traits>::__push_r_anchor()
{
- __end_->first() = new __r_anchor<_CharT>(__end_->first());
+ __end_->first() = new __r_anchor_multiline<_CharT>(__use_multiline(), __end_->first());
__end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
}
__end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
}
-typedef basic_regex<char> regex;
-typedef basic_regex<wchar_t> wregex;
-
// sub_match
+typedef sub_match<const char*> csub_match;
+typedef sub_match<const wchar_t*> wcsub_match;
+typedef sub_match<string::const_iterator> ssub_match;
+typedef sub_match<wstring::const_iterator> wssub_match;
+
template <class _BidirectionalIterator>
-class _LIBCPP_TEMPLATE_VIS sub_match
+class
+ _LIBCPP_TEMPLATE_VIS
+ _LIBCPP_PREFERRED_NAME(csub_match)
+ _LIBCPP_PREFERRED_NAME(wcsub_match)
+ _LIBCPP_PREFERRED_NAME(ssub_match)
+ _LIBCPP_PREFERRED_NAME(wssub_match)
+ sub_match
: public pair<_BidirectionalIterator, _BidirectionalIterator>
{
public:
{return str().compare(__s);}
};
-typedef sub_match<const char*> csub_match;
-typedef sub_match<const wchar_t*> wcsub_match;
-typedef sub_match<string::const_iterator> ssub_match;
-typedef sub_match<wstring::const_iterator> wssub_match;
-
template <class _BiIter>
inline _LIBCPP_INLINE_VISIBILITY
bool
return __os << __m.str();
}
+typedef match_results<const char*> cmatch;
+typedef match_results<const wchar_t*> wcmatch;
+typedef match_results<string::const_iterator> smatch;
+typedef match_results<wstring::const_iterator> wsmatch;
+
template <class _BidirectionalIterator, class _Allocator>
-class _LIBCPP_TEMPLATE_VIS match_results
+class
+ _LIBCPP_TEMPLATE_VIS
+ _LIBCPP_PREFERRED_NAME(cmatch)
+ _LIBCPP_PREFERRED_NAME(wcmatch)
+ _LIBCPP_PREFERRED_NAME(smatch)
+ _LIBCPP_PREFERRED_NAME(wsmatch)
+ match_results
{
public:
typedef _Allocator allocator_type;
typedef basic_string<char_type> string_type;
// construct/copy/destroy:
+#ifndef _LIBCPP_CXX03_LANG
+ match_results() : match_results(allocator_type()) {}
+ explicit match_results(const allocator_type& __a);
+#else
explicit match_results(const allocator_type& __a = allocator_type());
+#endif
+
// match_results(const match_results&) = default;
// match_results& operator=(const match_results&) = default;
// match_results(match_results&& __m) = default;
'0' <= __fmt_first[1] && __fmt_first[1] <= '9')
{
++__fmt_first;
- if (__idx >= std::numeric_limits<size_t>::max() / 10)
+ if (__idx >= numeric_limits<size_t>::max() / 10)
__throw_regex_error<regex_constants::error_escape>();
__idx = 10 * __idx + *__fmt_first - '0';
}
swap(__ready_, __m.__ready_);
}
-typedef match_results<const char*> cmatch;
-typedef match_results<const wchar_t*> wcmatch;
-typedef match_results<string::const_iterator> smatch;
-typedef match_results<wstring::const_iterator> wsmatch;
-
template <class _BidirectionalIterator, class _Allocator>
bool
operator==(const match_results<_BidirectionalIterator, _Allocator>& __x,
{
vector<__state> __states;
__state __best_state;
- ptrdiff_t __j = 0;
ptrdiff_t __highest_j = 0;
ptrdiff_t _Np = _VSTD::distance(__first, __last);
__node* __st = __start_.get();
__states.back().__node_ = __st;
__states.back().__flags_ = __flags;
__states.back().__at_first_ = __at_first;
- const _CharT* __current = __first;
bool __matched = false;
int __counter = 0;
int __length = __last - __first;
__states.pop_back();
break;
case __state::__accept_and_consume:
- __j += __s.__current_ - __current;
- __current = __s.__current_;
- break;
case __state::__repeat:
case __state::__accept_but_not_consume:
break;
template <class _BidirectionalIterator,
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
class _Traits = regex_traits<_CharT> >
-class _LIBCPP_TEMPLATE_VIS regex_iterator
+ class _LIBCPP_TEMPLATE_VIS regex_iterator;
+
+typedef regex_iterator<const char*> cregex_iterator;
+typedef regex_iterator<const wchar_t*> wcregex_iterator;
+typedef regex_iterator<string::const_iterator> sregex_iterator;
+typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
+
+template <class _BidirectionalIterator, class _CharT, class _Traits>
+class
+ _LIBCPP_TEMPLATE_VIS
+ _LIBCPP_PREFERRED_NAME(cregex_iterator)
+ _LIBCPP_PREFERRED_NAME(wcregex_iterator)
+ _LIBCPP_PREFERRED_NAME(sregex_iterator)
+ _LIBCPP_PREFERRED_NAME(wsregex_iterator)
+ regex_iterator
{
public:
typedef basic_regex<_CharT, _Traits> regex_type;
return *this;
}
-typedef regex_iterator<const char*> cregex_iterator;
-typedef regex_iterator<const wchar_t*> wcregex_iterator;
-typedef regex_iterator<string::const_iterator> sregex_iterator;
-typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
-
// regex_token_iterator
template <class _BidirectionalIterator,
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
class _Traits = regex_traits<_CharT> >
-class _LIBCPP_TEMPLATE_VIS regex_token_iterator
+ class _LIBCPP_TEMPLATE_VIS regex_token_iterator;
+
+typedef regex_token_iterator<const char*> cregex_token_iterator;
+typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
+typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
+typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
+
+template <class _BidirectionalIterator, class _CharT, class _Traits>
+class
+ _LIBCPP_TEMPLATE_VIS
+ _LIBCPP_PREFERRED_NAME(cregex_token_iterator)
+ _LIBCPP_PREFERRED_NAME(wcregex_token_iterator)
+ _LIBCPP_PREFERRED_NAME(sregex_token_iterator)
+ _LIBCPP_PREFERRED_NAME(wsregex_token_iterator)
+ regex_token_iterator
{
public:
typedef basic_regex<_CharT, _Traits> regex_type;
regex_constants::match_flag_type __m =
regex_constants::match_default) = delete;
#endif
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <size_t _Np>
regex_token_iterator(_BidirectionalIterator __a,
_BidirectionalIterator __b,
regex_constants::match_flag_type __m =
regex_constants::match_default);
#if _LIBCPP_STD_VER > 11
- template <std::size_t _Np>
+ template <size_t _Np>
regex_token_iterator(_BidirectionalIterator __a,
_BidirectionalIterator __b,
const regex_type&& __re,
__init(__a, __b);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _BidirectionalIterator, class _CharT, class _Traits>
template <size_t _Np>
return *this;
}
-typedef regex_token_iterator<const char*> cregex_token_iterator;
-typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
-typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
-typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
-
// regex_replace
template <class _OutputIterator, class _BidirectionalIterator,
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_REGEX
+#endif // _LIBCPP_REGEX
*/
#include <__config>
+#include <__utility/forward.h>
#include <memory>
#include <version>
{
typedef typename remove_reference
<
- decltype(_VSTD::declval<_Alloc>().outer_allocator())
+ decltype(declval<_Alloc>().outer_allocator())
>::type _OuterAlloc;
typedef typename __outermost<_OuterAlloc>::type type;
_LIBCPP_INLINE_VISIBILITY
return !(__a == __b);
}
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_SCOPED_ALLOCATOR
+#endif // _LIBCPP_SCOPED_ALLOCATOR
*/
+#include <__availability>
#include <__config>
#include <__threading_support>
#include <atomic>
-#include <cassert>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
# error <semaphore> is not supported on this single threaded system
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
#if _LIBCPP_STD_VER >= 14
_LIBCPP_BEGIN_NAMESPACE_STD
user-requested least-max values that exceed the OS implementation support
(incl. when the OS has no support of its own) and for binary semaphores.
-It is a typical Dijsktra semaphore algorithm over atomics, wait and notify
+It is a typical Dijkstra semaphore algorithm over atomics, wait and notify
functions. It avoids contention against users' own use of those facilities.
*/
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
void acquire()
{
- auto const __test_fn = [=]() -> bool {
+ auto const __test_fn = [this]() -> bool {
auto __old = __a.load(memory_order_relaxed);
return (__old != 0) && __a.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed);
};
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
bool try_acquire_for(chrono::duration<Rep, Period> const& __rel_time)
{
- auto const __test_fn = [=]() -> bool {
+ auto const __test_fn = [this]() -> bool {
auto __old = __a.load(memory_order_acquire);
while(1) {
if (__old == 0)
#endif // _LIBCPP_STD_VER >= 14
+_LIBCPP_POP_MACROS
+
#endif //_LIBCPP_SEMAPHORE
iterator find(const K& x);
template<typename K>
const_iterator find(const K& x) const; // C++14
+
template<typename K>
size_type count(const K& x) const; // C++14
size_type count(const key_type& k) const;
- bool contains(const key_type& x) const; // C++20
+
+ bool contains(const key_type& x) const; // C++20
+ template<class K> bool contains(const K& x) const; // C++20
+
iterator lower_bound(const key_type& k);
const_iterator lower_bound(const key_type& k) const;
template<typename K>
iterator find(const K& x);
template<typename K>
const_iterator find(const K& x) const; // C++14
+
template<typename K>
size_type count(const K& x) const; // C++14
size_type count(const key_type& k) const;
- bool contains(const key_type& x) const; // C++20
+
+ bool contains(const key_type& x) const; // C++20
+ template<class K> bool contains(const K& x) const; // C++20
+
iterator lower_bound(const key_type& k);
const_iterator lower_bound(const key_type& k) const;
template<typename K>
*/
#include <__config>
-#include <__tree>
+#include <__debug>
+#include <__functional/is_transparent.h>
#include <__node_handle>
+#include <__tree>
+#include <__utility/forward.h>
+#include <compare>
#include <functional>
+#include <initializer_list>
+#include <iterator> // __libcpp_erase_if_container
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
typedef key_type value_type;
typedef _Compare key_compare;
typedef key_compare value_compare;
- typedef typename __identity<_Allocator>::type allocator_type;
+ typedef __identity_t<_Allocator> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
set(set&& __s)
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
: __tree_(_VSTD::move(__s.__tree_)) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit set(const allocator_type& __a)
__tree_ = _VSTD::move(__s.__tree_);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
~set() {
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _Args&&... __args)
{return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
pair<iterator,bool> insert(const value_type& __v)
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
+ contains(const _K2& __k) const { return find(__k) != end(); }
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _InputIterator,
- class _Compare = less<typename iterator_traits<_InputIterator>::value_type>,
- class _Allocator = allocator<typename iterator_traits<_InputIterator>::value_type>,
+ class _Compare = less<__iter_value_type<_InputIterator>>,
+ class _Allocator = allocator<__iter_value_type<_InputIterator>>,
class = _EnableIf<__is_allocator<_Allocator>::value, void>,
class = _EnableIf<!__is_allocator<_Compare>::value, void>>
set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
- -> set<typename iterator_traits<_InputIterator>::value_type, _Compare, _Allocator>;
+ -> set<__iter_value_type<_InputIterator>, _Compare, _Allocator>;
template<class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key>,
template<class _InputIterator, class _Allocator,
class = _EnableIf<__is_allocator<_Allocator>::value, void>>
set(_InputIterator, _InputIterator, _Allocator)
- -> set<typename iterator_traits<_InputIterator>::value_type,
- less<typename iterator_traits<_InputIterator>::value_type>, _Allocator>;
+ -> set<__iter_value_type<_InputIterator>,
+ less<__iter_value_type<_InputIterator>>, _Allocator>;
template<class _Key, class _Allocator,
class = _EnableIf<__is_allocator<_Allocator>::value, void>>
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
inline _LIBCPP_INLINE_VISIBILITY
typename set<_Key, _Compare, _Allocator>::size_type
erase_if(set<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {
- return __libcpp_erase_if_container(__c, __pred);
+ return _VSTD::__libcpp_erase_if_container(__c, __pred);
}
#endif
{
public:
// types:
- typedef _Key key_type;
+ typedef _Key key_type;
typedef key_type value_type;
- typedef _Compare key_compare;
+ typedef _Compare key_compare;
typedef key_compare value_compare;
- typedef typename __identity<_Allocator>::type allocator_type;
+ typedef __identity_t<_Allocator> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
: __tree_(_VSTD::move(__s.__tree_)) {}
multiset(multiset&& __s, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit multiset(const allocator_type& __a)
: __tree_(__a) {}
__tree_ = _VSTD::move(__s.__tree_);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
~multiset() {
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _Args&&... __args)
{return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __v)
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
#if _LIBCPP_STD_VER > 11
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
- typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+ typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
find(const _K2& __k) {return __tree_.find(__k);}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
- typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
find(const _K2& __k) const {return __tree_.find(__k);}
#endif
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
+ contains(const _K2& __k) const { return find(__k) != end(); }
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
#if _LIBCPP_STD_VER > 11
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
- typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+ typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
lower_bound(const _K2& __k) {return __tree_.lower_bound(__k);}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
- typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
#endif
#if _LIBCPP_STD_VER > 11
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
- typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type
+ typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
upper_bound(const _K2& __k) {return __tree_.upper_bound(__k);}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
- typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type
+ typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
#endif
#if _LIBCPP_STD_VER > 11
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
- typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
+ typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
equal_range(const _K2& __k) {return __tree_.__equal_range_multi(__k);}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
- typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
+ typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
#endif
};
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _InputIterator,
- class _Compare = less<typename iterator_traits<_InputIterator>::value_type>,
- class _Allocator = allocator<typename iterator_traits<_InputIterator>::value_type>,
+ class _Compare = less<__iter_value_type<_InputIterator>>,
+ class _Allocator = allocator<__iter_value_type<_InputIterator>>,
class = _EnableIf<__is_allocator<_Allocator>::value, void>,
class = _EnableIf<!__is_allocator<_Compare>::value, void>>
multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
- -> multiset<typename iterator_traits<_InputIterator>::value_type, _Compare, _Allocator>;
+ -> multiset<__iter_value_type<_InputIterator>, _Compare, _Allocator>;
template<class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key>,
template<class _InputIterator, class _Allocator,
class = _EnableIf<__is_allocator<_Allocator>::value, void>>
multiset(_InputIterator, _InputIterator, _Allocator)
- -> multiset<typename iterator_traits<_InputIterator>::value_type,
- less<typename iterator_traits<_InputIterator>::value_type>, _Allocator>;
+ -> multiset<__iter_value_type<_InputIterator>,
+ less<__iter_value_type<_InputIterator>>, _Allocator>;
template<class _Key, class _Allocator,
class = _EnableIf<__is_allocator<_Allocator>::value, void>>
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
inline _LIBCPP_INLINE_VISIBILITY
typename multiset<_Key, _Compare, _Allocator>::size_type
erase_if(multiset<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {
- return __libcpp_erase_if_container(__c, __pred);
+ return _VSTD::__libcpp_erase_if_container(__c, __pred);
}
#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_SET
+#endif // _LIBCPP_SET
#endif // __cplusplus
-#endif // _LIBCPP_SETJMP_H
+#endif // _LIBCPP_SETJMP_H
*/
+#include <__availability>
#include <__config>
#include <version>
_LIBCPP_END_NAMESPACE_STD
-#endif // !_LIBCPP_HAS_NO_THREADS
+#endif // !_LIBCPP_HAS_NO_THREADS
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER > 11
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_SHARED_MUTEX
+#endif // _LIBCPP_SHARED_MUTEX
template <class ElementType, size_t Extent = dynamic_extent>
class span;
+template<class ElementType, size_t Extent>
+ inline constexpr bool ranges::enable_view<span<ElementType, Extent>> = true;
+
+template<class ElementType, size_t Extent>
+ inline constexpr bool ranges::enable_borrowed_range<span<ElementType, Extent>> = true;
+
// [span.objectrep], views of object representation
template <class ElementType, size_t Extent>
span<const byte, ((Extent == dynamic_extent) ? dynamic_extent :
(sizeof(ElementType) * Extent))> as_writable_bytes(span<ElementType, Extent> s) noexcept;
-namespace std {
template <class ElementType, size_t Extent = dynamic_extent>
class span {
public:
*/
#include <__config>
+#include <__debug>
+#include <__iterator/wrap_iter.h>
+#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/enable_view.h>
#include <array> // for array
#include <cstddef> // for byte
#include <iterator> // for iterators
+#include <limits>
#include <type_traits> // for remove_cv, etc
+#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER > 17
-inline constexpr size_t dynamic_extent = (numeric_limits<size_t>::max)();
+inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();
template <typename _Tp, size_t _Extent = dynamic_extent> class span;
using const_pointer = const _Tp *;
using reference = _Tp &;
using const_reference = const _Tp &;
- using iterator = __wrap_iter<pointer>;
+#if (_LIBCPP_DEBUG_LEVEL == 2) || defined(_LIBCPP_ABI_SPAN_POINTER_ITERATORS)
+ using iterator = pointer;
+#else
+ using iterator = __wrap_iter<pointer>;
+#endif
using reverse_iterator = _VSTD::reverse_iterator<iterator>;
static constexpr size_type extent = _Extent;
using const_pointer = const _Tp *;
using reference = _Tp &;
using const_reference = const _Tp &;
- using iterator = __wrap_iter<pointer>;
+#if (_LIBCPP_DEBUG_LEVEL == 2) || defined(_LIBCPP_ABI_SPAN_POINTER_ITERATORS)
+ using iterator = pointer;
+#else
+ using iterator = __wrap_iter<pointer>;
+#endif
using reverse_iterator = _VSTD::reverse_iterator<iterator>;
static constexpr size_type extent = dynamic_extent;
size_type __size;
};
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+template <class _Tp, size_t _Extent>
+inline constexpr bool ranges::enable_borrowed_range<span<_Tp, _Extent> > = true;
+
+template <class _ElementType, size_t _Extent>
+inline constexpr bool ranges::enable_view<span<_ElementType, _Extent>> = true;
+#endif // !defined(_LIBCPP_HAS_NO_RANGES)
+
// as_bytes & as_writable_bytes
template <class _Tp, size_t _Extent>
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP_SPAN
typedef typename traits_type::off_type off_type;
typedef Allocator allocator_type;
- // 27.8.1.1 Constructors:
- explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out);
+ // 27.8.1.1 [stringbuf.cons], constructors:
+ explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out); // before C++20
+ basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} // C++20
+ explicit basic_stringbuf(ios_base::openmode which); // C++20
explicit basic_stringbuf(const basic_string<char_type, traits_type, allocator_type>& str,
ios_base::openmode which = ios_base::in | ios_base::out);
basic_stringbuf(basic_stringbuf&& rhs);
typedef Allocator allocator_type;
// 27.8.2.1 Constructors:
- explicit basic_istringstream(ios_base::openmode which = ios_base::in);
+ explicit basic_istringstream(ios_base::openmode which = ios_base::in); // before C++20
+ basic_istringstream() : basic_istringstream(ios_base::in) {} // C++20
+ explicit basic_istringstream(ios_base::openmode which); // C++20
+
explicit basic_istringstream(const basic_string<char_type, traits_type,allocator_type>& str,
ios_base::openmode which = ios_base::in);
basic_istringstream(basic_istringstream&& rhs);
typedef Allocator allocator_type;
// 27.8.3.1 Constructors/destructor:
- explicit basic_ostringstream(ios_base::openmode which = ios_base::out);
+ explicit basic_ostringstream(ios_base::openmode which = ios_base::out); // before C++20
+ basic_ostringstream() : basic_ostringstream(ios_base::out) {} // C++20
+ explicit basic_ostringstream(ios_base::openmode which); // C++20
+
explicit basic_ostringstream(const basic_string<char_type, traits_type, allocator_type>& str,
ios_base::openmode which = ios_base::out);
basic_ostringstream(basic_ostringstream&& rhs);
typedef Allocator allocator_type;
// constructors/destructor
- explicit basic_stringstream(ios_base::openmode which = ios_base::out|ios_base::in);
+ explicit basic_stringstream(ios_base::openmode which = ios_base::out | ios_base::in); // before C++20
+ basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {} // C++20
+ explicit basic_stringstream(ios_base::openmode which); // C++20
+
explicit basic_stringstream(const basic_string<char_type, traits_type, allocator_type>& str,
ios_base::openmode which = ios_base::out|ios_base::in);
basic_stringstream(basic_stringstream&& rhs);
*/
#include <__config>
-#include <ostream>
#include <istream>
+#include <ostream>
#include <string>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
ios_base::openmode __mode_;
public:
- // 27.8.1.1 Constructors:
- inline _LIBCPP_INLINE_VISIBILITY
- explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in | ios_base::out);
- inline _LIBCPP_INLINE_VISIBILITY
+ // 30.8.2.1 [stringbuf.cons], constructors
+ _LIBCPP_INLINE_VISIBILITY
+ basic_stringbuf()
+ : __hm_(nullptr), __mode_(ios_base::in | ios_base::out) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit basic_stringbuf(ios_base::openmode __wch)
+ : __hm_(nullptr), __mode_(__wch) {}
+
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_stringbuf(const string_type& __s,
- ios_base::openmode __wch = ios_base::in | ios_base::out);
-#ifndef _LIBCPP_CXX03_LANG
+ ios_base::openmode __wch = ios_base::in | ios_base::out)
+ : __str_(__s.get_allocator()), __hm_(nullptr), __mode_(__wch)
+ {
+ str(__s);
+ }
+
basic_stringbuf(basic_stringbuf&& __rhs);
// 27.8.1.2 Assign and swap:
basic_stringbuf& operator=(basic_stringbuf&& __rhs);
-#endif
void swap(basic_stringbuf& __rhs);
// 27.8.1.3 Get and set:
virtual int_type overflow (int_type __c = traits_type::eof());
virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode __wch = ios_base::in | ios_base::out);
- inline _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY
virtual pos_type seekpos(pos_type __sp,
- ios_base::openmode __wch = ios_base::in | ios_base::out);
+ ios_base::openmode __wch = ios_base::in | ios_base::out) {
+ return seekoff(__sp, ios_base::beg, __wch);
+ }
};
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode __wch)
- : __hm_(0),
- __mode_(__wch)
-{
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& __s,
- ios_base::openmode __wch)
- : __str_(__s.get_allocator()),
- __hm_(0),
- __mode_(__wch)
-{
- str(__s);
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits, class _Allocator>
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
: __mode_(__rhs.__mode_)
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _CharT, class _Traits, class _Allocator>
void
basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
__str_ = __s;
- __hm_ = 0;
+ __hm_ = nullptr;
if (__mode_ & ios_base::in)
{
__hm_ = const_cast<char_type*>(__str_.data()) + __str_.size();
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
ptrdiff_t __nout = this->pptr() - this->pbase();
ptrdiff_t __hm = __hm_ - this->pbase();
__str_.push_back(char_type());
{
return traits_type::eof();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
__hm_ = _VSTD::max(this->pptr() + 1, __hm_);
if (__mode_ & ios_base::in)
return pos_type(-1);
if (__noff != 0)
{
- if ((__wch & ios_base::in) && this->gptr() == 0)
+ if ((__wch & ios_base::in) && this->gptr() == nullptr)
return pos_type(-1);
- if ((__wch & ios_base::out) && this->pptr() == 0)
+ if ((__wch & ios_base::out) && this->pptr() == nullptr)
return pos_type(-1);
}
if (__wch & ios_base::in)
return pos_type(__noff);
}
-template <class _CharT, class _Traits, class _Allocator>
-typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type
-basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
- ios_base::openmode __wch)
-{
- return seekoff(__sp, ios_base::beg, __wch);
-}
-
// basic_istringstream
template <class _CharT, class _Traits, class _Allocator>
basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
public:
- // 27.8.2.1 Constructors:
- inline _LIBCPP_INLINE_VISIBILITY
- explicit basic_istringstream(ios_base::openmode __wch = ios_base::in);
- inline _LIBCPP_INLINE_VISIBILITY
+ // 30.8.3.1 [istringstream.cons], constructors
+ _LIBCPP_INLINE_VISIBILITY
+ basic_istringstream()
+ : basic_istream<_CharT, _Traits>(&__sb_), __sb_(ios_base::in) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit basic_istringstream(ios_base::openmode __wch)
+ : basic_istream<_CharT, _Traits>(&__sb_), __sb_(__wch | ios_base::in) {}
+
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_istringstream(const string_type& __s,
- ios_base::openmode __wch = ios_base::in);
-#ifndef _LIBCPP_CXX03_LANG
- inline _LIBCPP_INLINE_VISIBILITY
- basic_istringstream(basic_istringstream&& __rhs);
+ ios_base::openmode __wch = ios_base::in)
+ : basic_istream<_CharT, _Traits>(&__sb_)
+ , __sb_(__s, __wch | ios_base::in)
+ { }
+
+ _LIBCPP_INLINE_VISIBILITY
+ basic_istringstream(basic_istringstream&& __rhs)
+ : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
+ , __sb_(_VSTD::move(__rhs.__sb_))
+ {
+ basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
+ }
// 27.8.2.2 Assign and swap:
- basic_istringstream& operator=(basic_istringstream&& __rhs);
-#endif // _LIBCPP_CXX03_LANG
- inline _LIBCPP_INLINE_VISIBILITY
- void swap(basic_istringstream& __rhs);
+ basic_istringstream& operator=(basic_istringstream&& __rhs) {
+ basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+ __sb_ = _VSTD::move(__rhs.__sb_);
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(basic_istringstream& __rhs) {
+ basic_istream<char_type, traits_type>::swap(__rhs);
+ __sb_.swap(__rhs.__sb_);
+ }
// 27.8.2.3 Members:
- inline _LIBCPP_INLINE_VISIBILITY
- basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
- inline _LIBCPP_INLINE_VISIBILITY
- string_type str() const;
- inline _LIBCPP_INLINE_VISIBILITY
- void str(const string_type& __s);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
+ return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ string_type str() const {
+ return __sb_.str();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void str(const string_type& __s) {
+ __sb_.str(__s);
+ }
};
-template <class _CharT, class _Traits, class _Allocator>
-basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::openmode __wch)
- : basic_istream<_CharT, _Traits>(&__sb_),
- __sb_(__wch | ios_base::in)
-{
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const string_type& __s,
- ios_base::openmode __wch)
- : basic_istream<_CharT, _Traits>(&__sb_),
- __sb_(__s, __wch | ios_base::in)
-{
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
- : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
- __sb_(_VSTD::move(__rhs.__sb_))
-{
- basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_istringstream<_CharT, _Traits, _Allocator>&
-basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&& __rhs)
-{
- basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
- __sb_ = _VSTD::move(__rhs.__sb_);
- return *this;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-template <class _CharT, class _Traits, class _Allocator>
-void basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs)
-{
- basic_istream<char_type, traits_type>::swap(__rhs);
- __sb_.swap(__rhs.__sb_);
-}
-
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
__x.swap(__y);
}
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringbuf<_CharT, _Traits, _Allocator>*
-basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const
-{
- return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>
-basic_istringstream<_CharT, _Traits, _Allocator>::str() const
-{
- return __sb_.str();
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-void basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
-{
- __sb_.str(__s);
-}
-
// basic_ostringstream
template <class _CharT, class _Traits, class _Allocator>
basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
public:
- // 27.8.2.1 Constructors:
- inline _LIBCPP_INLINE_VISIBILITY
- explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out);
- inline _LIBCPP_INLINE_VISIBILITY
+ // 30.8.4.1 [ostringstream.cons], constructors
+ _LIBCPP_INLINE_VISIBILITY
+ basic_ostringstream()
+ : basic_ostream<_CharT, _Traits>(&__sb_), __sb_(ios_base::out) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit basic_ostringstream(ios_base::openmode __wch)
+ : basic_ostream<_CharT, _Traits>(&__sb_), __sb_(__wch | ios_base::out) {}
+
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_ostringstream(const string_type& __s,
- ios_base::openmode __wch = ios_base::out);
-#ifndef _LIBCPP_CXX03_LANG
- inline _LIBCPP_INLINE_VISIBILITY
- basic_ostringstream(basic_ostringstream&& __rhs);
+ ios_base::openmode __wch = ios_base::out)
+ : basic_ostream<_CharT, _Traits>(&__sb_)
+ , __sb_(__s, __wch | ios_base::out)
+ { }
+
+ _LIBCPP_INLINE_VISIBILITY
+ basic_ostringstream(basic_ostringstream&& __rhs)
+ : basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs))
+ , __sb_(_VSTD::move(__rhs.__sb_))
+ {
+ basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
+ }
// 27.8.2.2 Assign and swap:
- basic_ostringstream& operator=(basic_ostringstream&& __rhs);
-#endif // _LIBCPP_CXX03_LANG
- inline _LIBCPP_INLINE_VISIBILITY
- void swap(basic_ostringstream& __rhs);
+ basic_ostringstream& operator=(basic_ostringstream&& __rhs) {
+ basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+ __sb_ = _VSTD::move(__rhs.__sb_);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(basic_ostringstream& __rhs) {
+ basic_ostream<char_type, traits_type>::swap(__rhs);
+ __sb_.swap(__rhs.__sb_);
+ }
// 27.8.2.3 Members:
- inline _LIBCPP_INLINE_VISIBILITY
- basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
- inline _LIBCPP_INLINE_VISIBILITY
- string_type str() const;
- inline _LIBCPP_INLINE_VISIBILITY
- void str(const string_type& __s);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
+ return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ string_type str() const {
+ return __sb_.str();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void str(const string_type& __s) {
+ __sb_.str(__s);
+ }
};
-template <class _CharT, class _Traits, class _Allocator>
-basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::openmode __wch)
- : basic_ostream<_CharT, _Traits>(&__sb_),
- __sb_(__wch | ios_base::out)
-{
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const string_type& __s,
- ios_base::openmode __wch)
- : basic_ostream<_CharT, _Traits>(&__sb_),
- __sb_(__s, __wch | ios_base::out)
-{
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
- : basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
- __sb_(_VSTD::move(__rhs.__sb_))
-{
- basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_ostringstream<_CharT, _Traits, _Allocator>&
-basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&& __rhs)
-{
- basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
- __sb_ = _VSTD::move(__rhs.__sb_);
- return *this;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-template <class _CharT, class _Traits, class _Allocator>
-void
-basic_ostringstream<_CharT, _Traits, _Allocator>::swap(basic_ostringstream& __rhs)
-{
- basic_ostream<char_type, traits_type>::swap(__rhs);
- __sb_.swap(__rhs.__sb_);
-}
-
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
__x.swap(__y);
}
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringbuf<_CharT, _Traits, _Allocator>*
-basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const
-{
- return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>
-basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
-{
- return __sb_.str();
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-void
-basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
-{
- __sb_.str(__s);
-}
-
// basic_stringstream
template <class _CharT, class _Traits, class _Allocator>
basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
public:
- // 27.8.2.1 Constructors:
- inline _LIBCPP_INLINE_VISIBILITY
- explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
- inline _LIBCPP_INLINE_VISIBILITY
+ // 30.8.5.1 [stringstream.cons], constructors
+ _LIBCPP_INLINE_VISIBILITY
+ basic_stringstream()
+ : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(ios_base::in | ios_base::out) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit basic_stringstream(ios_base::openmode __wch)
+ : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(__wch) {}
+
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_stringstream(const string_type& __s,
- ios_base::openmode __wch = ios_base::in | ios_base::out);
-#ifndef _LIBCPP_CXX03_LANG
- inline _LIBCPP_INLINE_VISIBILITY
- basic_stringstream(basic_stringstream&& __rhs);
+ ios_base::openmode __wch = ios_base::in | ios_base::out)
+ : basic_iostream<_CharT, _Traits>(&__sb_)
+ , __sb_(__s, __wch)
+ { }
+
+ _LIBCPP_INLINE_VISIBILITY
+ basic_stringstream(basic_stringstream&& __rhs)
+ : basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs))
+ , __sb_(_VSTD::move(__rhs.__sb_))
+ {
+ basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
+ }
// 27.8.2.2 Assign and swap:
- basic_stringstream& operator=(basic_stringstream&& __rhs);
-#endif // _LIBCPP_CXX03_LANG
- inline _LIBCPP_INLINE_VISIBILITY
- void swap(basic_stringstream& __rhs);
+ basic_stringstream& operator=(basic_stringstream&& __rhs) {
+ basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
+ __sb_ = _VSTD::move(__rhs.__sb_);
+ return *this;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(basic_stringstream& __rhs) {
+ basic_iostream<char_type, traits_type>::swap(__rhs);
+ __sb_.swap(__rhs.__sb_);
+ }
// 27.8.2.3 Members:
- inline _LIBCPP_INLINE_VISIBILITY
- basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
- inline _LIBCPP_INLINE_VISIBILITY
- string_type str() const;
- inline _LIBCPP_INLINE_VISIBILITY
- void str(const string_type& __s);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
+ return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ string_type str() const {
+ return __sb_.str();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void str(const string_type& __s) {
+ __sb_.str(__s);
+ }
};
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::openmode __wch)
- : basic_iostream<_CharT, _Traits>(&__sb_),
- __sb_(__wch)
-{
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string_type& __s,
- ios_base::openmode __wch)
- : basic_iostream<_CharT, _Traits>(&__sb_),
- __sb_(__s, __wch)
-{
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
- : basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)),
- __sb_(_VSTD::move(__rhs.__sb_))
-{
- basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringstream<_CharT, _Traits, _Allocator>&
-basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&& __rhs)
-{
- basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
- __sb_ = _VSTD::move(__rhs.__sb_);
- return *this;
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-template <class _CharT, class _Traits, class _Allocator>
-void
-basic_stringstream<_CharT, _Traits, _Allocator>::swap(basic_stringstream& __rhs)
-{
- basic_iostream<char_type, traits_type>::swap(__rhs);
- __sb_.swap(__rhs.__sb_);
-}
-
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
__x.swap(__y);
}
-template <class _CharT, class _Traits, class _Allocator>
-basic_stringbuf<_CharT, _Traits, _Allocator>*
-basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const
-{
- return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>
-basic_stringstream<_CharT, _Traits, _Allocator>::str() const
-{
- return __sb_.str();
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-void
-basic_stringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
-{
- __sb_.str(__s);
-}
+#if defined(_LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringbuf<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringstream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream<char>)
+#endif
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_SSTREAM
+#endif // _LIBCPP_SSTREAM
*/
#include <__config>
+#include <__memory/uses_allocator.h>
+#include <__utility/forward.h>
#include <deque>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
_LIBCPP_INLINE_VISIBILITY
explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit stack(const container_type& __c) : c(__c) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit stack(const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(__a) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(const container_type& __c, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(__c, __a) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(const stack& __s, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(__s.c, __a) {}
#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(container_type&& __c, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(_VSTD::move(__c), __a) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(stack&& __s, const _Alloc& __a,
- typename enable_if<uses_allocator<container_type,
- _Alloc>::value>::type* = 0)
+ _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0)
: c(_VSTD::move(__s.c), __a) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
bool empty() const {return c.empty();}
void emplace(_Args&&... __args)
{ c.emplace_back(_VSTD::forward<_Args>(__args)...);}
#endif
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void pop() {c.pop_back();}
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _Container,
- class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type
+ class = _EnableIf<!__is_allocator<_Container>::value>
>
stack(_Container)
-> stack<typename _Container::value_type, _Container>;
template<class _Container,
class _Alloc,
- class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type,
- class = typename enable_if< __is_allocator<_Alloc>::value, nullptr_t>::type
+ class = _EnableIf<!__is_allocator<_Container>::value>,
+ class = _EnableIf<uses_allocator<_Container, _Alloc>::value>
>
stack(_Container, _Alloc)
-> stack<typename _Container::value_type, _Container>;
template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<
- __is_swappable<_Container>::value,
- void
->::type
+_EnableIf<__is_swappable<_Container>::value, void>
swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
{
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STACK
+#endif // _LIBCPP_STACK
#define __bool_true_false_are_defined 1
#endif
-#endif // _LIBCPP_STDBOOL_H
+#endif // _LIBCPP_STDBOOL_H
#endif
-#endif // _LIBCPP_STDDEF_H
+#endif // _LIBCPP_STDDEF_H
#include <__config>
#include <exception>
#include <iosfwd> // for string forward decl
-#ifdef _LIBCPP_NO_EXCEPTIONS
#include <cstdlib>
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STDEXCEPT
+#endif // _LIBCPP_STDEXCEPT
#include_next <stdint.h>
-#endif // _LIBCPP_STDINT_H
+#endif // _LIBCPP_STDINT_H
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP_STEAMBUF
-#define _LIBCPP_STEAMBUF
+#ifndef _LIBCPP_STREAMBUF
+#define _LIBCPP_STREAMBUF
/*
streambuf synopsis
*/
#include <__config>
-#include <iosfwd>
#include <ios>
+#include <iosfwd>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
template <class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits>::basic_streambuf()
- : __binp_(0),
- __ninp_(0),
- __einp_(0),
- __bout_(0),
- __nout_(0),
- __eout_(0)
+ : __binp_(nullptr),
+ __ninp_(nullptr),
+ __einp_(nullptr),
+ __bout_(nullptr),
+ __nout_(nullptr),
+ __eout_(nullptr)
{
}
return traits_type::eof();
}
-#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)
-#endif
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STEAMBUF
+#endif // _LIBCPP_STREAMBUF
template <> struct char_traits<char>;
template <> struct char_traits<wchar_t>;
+template <> struct char_traits<char8_t>; // C++20
+template <> struct char_traits<char16_t>;
+template <> struct char_traits<char32_t>;
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
class basic_string
explicit basic_string(const T& t, const Allocator& a = Allocator()); // C++17
basic_string(const value_type* s, const allocator_type& a = allocator_type());
basic_string(const value_type* s, size_type n, const allocator_type& a = allocator_type());
+ basic_string(nullptr_t) = delete; // C++2b
basic_string(size_type n, value_type c, const allocator_type& a = allocator_type());
template<class InputIterator>
basic_string(InputIterator begin, InputIterator end,
allocator_type::propagate_on_container_move_assignment::value ||
allocator_type::is_always_equal::value ); // C++17
basic_string& operator=(const value_type* s);
+ basic_string& operator=(nullptr_t) = delete; // C++2b
basic_string& operator=(value_type c);
basic_string& operator=(initializer_list<value_type>);
void resize(size_type n, value_type c);
void resize(size_type n);
- void reserve(size_type res_arg = 0);
+ void reserve(size_type res_arg);
+ void reserve(); // deprecated in C++20
void shrink_to_fit();
void clear() noexcept;
bool empty() const noexcept;
size_type find(const basic_string& str, size_type pos = 0) const noexcept;
template <class T>
- size_type find(const T& t, size_type pos = 0) const; // C++17
+ size_type find(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension
size_type find(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find(const value_type* s, size_type pos = 0) const noexcept;
size_type find(value_type c, size_type pos = 0) const noexcept;
size_type rfind(const basic_string& str, size_type pos = npos) const noexcept;
template <class T>
- size_type rfind(const T& t, size_type pos = npos) const; // C++17
+ size_type rfind(const T& t, size_type pos = npos) const noexcept; // C++17, noexcept as an extension
size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept;
size_type rfind(const value_type* s, size_type pos = npos) const noexcept;
size_type rfind(value_type c, size_type pos = npos) const noexcept;
size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept;
template <class T>
- size_type find_first_of(const T& t, size_type pos = 0) const; // C++17
+ size_type find_first_of(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension
size_type find_first_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_first_of(const value_type* s, size_type pos = 0) const noexcept;
size_type find_first_of(value_type c, size_type pos = 0) const noexcept;
size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept;
template <class T>
- size_type find_last_of(const T& t, size_type pos = npos) const noexcept; // C++17
+ size_type find_last_of(const T& t, size_type pos = npos) const noexcept noexcept; // C++17, noexcept as an extension
size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept;
size_type find_last_of(value_type c, size_type pos = npos) const noexcept;
size_type find_first_not_of(const basic_string& str, size_type pos = 0) const noexcept;
template <class T>
- size_type find_first_not_of(const T& t, size_type pos = 0) const; // C++17
+ size_type find_first_not_of(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension
size_type find_first_not_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_first_not_of(const value_type* s, size_type pos = 0) const noexcept;
size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept;
size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept;
template <class T>
- size_type find_last_not_of(const T& t, size_type pos = npos) const; // C++17
+ size_type find_last_not_of(const T& t, size_type pos = npos) const noexcept; // C++17, noexcept as an extension
size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept;
size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept;
int compare(const basic_string& str) const noexcept;
template <class T>
- int compare(const T& t) const noexcept; // C++17
+ int compare(const T& t) const noexcept; // C++17, noexcept as an extension
int compare(size_type pos1, size_type n1, const basic_string& str) const;
template <class T>
int compare(size_type pos1, size_type n1, const T& t) const; // C++17
int compare(size_type pos1, size_type n1, const value_type* s) const;
int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const;
- bool starts_with(basic_string_view<charT, traits> sv) const noexcept; // C++2a
- bool starts_with(charT c) const noexcept; // C++2a
- bool starts_with(const charT* s) const; // C++2a
- bool ends_with(basic_string_view<charT, traits> sv) const noexcept; // C++2a
- bool ends_with(charT c) const noexcept; // C++2a
- bool ends_with(const charT* s) const; // C++2a
+ bool starts_with(basic_string_view<charT, traits> sv) const noexcept; // C++20
+ bool starts_with(charT c) const noexcept; // C++20
+ bool starts_with(const charT* s) const; // C++20
+ bool ends_with(basic_string_view<charT, traits> sv) const noexcept; // C++20
+ bool ends_with(charT c) const noexcept; // C++20
+ bool ends_with(const charT* s) const; // C++20
+
+ constexpr bool contains(basic_string_view<charT, traits> sv) const noexcept; // C++2b
+ constexpr bool contains(charT c) const noexcept; // C++2b
+ constexpr bool contains(const charT* s) const; // C++2b
bool __invariants() const;
};
typedef basic_string<char> string;
typedef basic_string<wchar_t> wstring;
+typedef basic_string<char8_t> u8string; // C++20
typedef basic_string<char16_t> u16string;
typedef basic_string<char32_t> u32string;
-int stoi (const string& str, size_t* idx = 0, int base = 10);
-long stol (const string& str, size_t* idx = 0, int base = 10);
-unsigned long stoul (const string& str, size_t* idx = 0, int base = 10);
-long long stoll (const string& str, size_t* idx = 0, int base = 10);
-unsigned long long stoull(const string& str, size_t* idx = 0, int base = 10);
+int stoi (const string& str, size_t* idx = nullptr, int base = 10);
+long stol (const string& str, size_t* idx = nullptr, int base = 10);
+unsigned long stoul (const string& str, size_t* idx = nullptr, int base = 10);
+long long stoll (const string& str, size_t* idx = nullptr, int base = 10);
+unsigned long long stoull(const string& str, size_t* idx = nullptr, int base = 10);
-float stof (const string& str, size_t* idx = 0);
-double stod (const string& str, size_t* idx = 0);
-long double stold(const string& str, size_t* idx = 0);
+float stof (const string& str, size_t* idx = nullptr);
+double stod (const string& str, size_t* idx = nullptr);
+long double stold(const string& str, size_t* idx = nullptr);
string to_string(int val);
string to_string(unsigned val);
string to_string(double val);
string to_string(long double val);
-int stoi (const wstring& str, size_t* idx = 0, int base = 10);
-long stol (const wstring& str, size_t* idx = 0, int base = 10);
-unsigned long stoul (const wstring& str, size_t* idx = 0, int base = 10);
-long long stoll (const wstring& str, size_t* idx = 0, int base = 10);
-unsigned long long stoull(const wstring& str, size_t* idx = 0, int base = 10);
+int stoi (const wstring& str, size_t* idx = nullptr, int base = 10);
+long stol (const wstring& str, size_t* idx = nullptr, int base = 10);
+unsigned long stoul (const wstring& str, size_t* idx = nullptr, int base = 10);
+long long stoll (const wstring& str, size_t* idx = nullptr, int base = 10);
+unsigned long long stoull(const wstring& str, size_t* idx = nullptr, int base = 10);
-float stof (const wstring& str, size_t* idx = 0);
-double stod (const wstring& str, size_t* idx = 0);
-long double stold(const wstring& str, size_t* idx = 0);
+float stof (const wstring& str, size_t* idx = nullptr);
+double stod (const wstring& str, size_t* idx = nullptr);
+long double stold(const wstring& str, size_t* idx = nullptr);
wstring to_wstring(int val);
wstring to_wstring(unsigned val);
wstring to_wstring(long double val);
template <> struct hash<string>;
+template <> struct hash<u8string>; // C++20
template <> struct hash<u16string>;
template <> struct hash<u32string>;
template <> struct hash<wstring>;
basic_string<char> operator "" s( const char *str, size_t len ); // C++14
basic_string<wchar_t> operator "" s( const wchar_t *str, size_t len ); // C++14
+basic_string<char8_t> operator "" s( const char8_t *str, size_t len ); // C++20
basic_string<char16_t> operator "" s( const char16_t *str, size_t len ); // C++14
basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++14
*/
#include <__config>
-#include <string_view>
-#include <iosfwd>
+#include <__debug>
+#include <__functional_base>
+#include <__iterator/wrap_iter.h>
+#include <algorithm>
+#include <compare>
+#include <cstdio> // EOF
+#include <cstdlib>
#include <cstring>
-#include <cstdio> // For EOF.
#include <cwchar>
-#include <algorithm>
+#include <initializer_list>
+#include <iosfwd>
#include <iterator>
-#include <utility>
#include <memory>
#include <stdexcept>
+#include <string_view>
#include <type_traits>
-#include <initializer_list>
-#include <__functional_base>
+#include <utility>
#include <version>
+
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-#include <cstdint>
+# include <cstdint>
#endif
-#include <__debug>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __basic_string_common<true>)
-#ifdef _LIBCPP_NO_EXCEPTIONS
template <class _Iter>
-struct __libcpp_string_gets_noexcept_iterator_impl : public true_type {};
-#elif defined(_LIBCPP_HAS_NO_NOEXCEPT)
-template <class _Iter>
-struct __libcpp_string_gets_noexcept_iterator_impl : public false_type {};
-#else
-template <class _Iter, bool = __is_cpp17_forward_iterator<_Iter>::value>
-struct __libcpp_string_gets_noexcept_iterator_impl : public _LIBCPP_BOOL_CONSTANT((
- noexcept(++(declval<_Iter&>())) &&
- is_nothrow_assignable<_Iter&, _Iter>::value &&
- noexcept(declval<_Iter>() == declval<_Iter>()) &&
- noexcept(*declval<_Iter>())
-)) {};
-
-template <class _Iter>
-struct __libcpp_string_gets_noexcept_iterator_impl<_Iter, false> : public false_type {};
-#endif
+struct __string_is_trivial_iterator : public false_type {};
+template <class _Tp>
+struct __string_is_trivial_iterator<_Tp*>
+ : public is_arithmetic<_Tp> {};
template <class _Iter>
-struct __libcpp_string_gets_noexcept_iterator
- : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value || __libcpp_string_gets_noexcept_iterator_impl<_Iter>::value) {};
+struct __string_is_trivial_iterator<__wrap_iter<_Iter> >
+ : public __string_is_trivial_iterator<_Iter> {};
template <class _CharT, class _Traits, class _Tp>
struct __can_be_converted_to_string_view : public _BoolConstant<
{
};
-#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+typedef basic_string<char8_t> u8string;
+#endif
+
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+typedef basic_string<char16_t> u16string;
+typedef basic_string<char32_t> u32string;
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
template<class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TEMPLATE_VIS basic_string
+class
+ _LIBCPP_TEMPLATE_VIS
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ _LIBCPP_PREFERRED_NAME(u8string)
+#endif
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+ _LIBCPP_PREFERRED_NAME(u16string)
+ _LIBCPP_PREFERRED_NAME(u32string)
+#endif
+ basic_string
: private __basic_string_common<true>
{
public:
#else // _LIBCPP_BIG_ENDIAN
static const size_type __short_mask = 0x80;
static const size_type __long_mask = ~(size_type(~0) >> 1);
-#endif // _LIBCPP_BIG_ENDIAN
+#endif // _LIBCPP_BIG_ENDIAN
enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?
(sizeof(__long) - 1)/sizeof(value_type) : 2};
#else // _LIBCPP_BIG_ENDIAN
static const size_type __short_mask = 0x01;
static const size_type __long_mask = 0x1ul;
-#endif // _LIBCPP_BIG_ENDIAN
+#endif // _LIBCPP_BIG_ENDIAN
enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?
(sizeof(__long) - 1)/sizeof(value_type) : 2};
value_type __data_[__min_cap];
};
-#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
union __ulx{__long __lx; __short __lxx;};
__compressed_pair<__rep, allocator_type> __r_;
public:
- _LIBCPP_FUNC_VIS
+ _LIBCPP_TEMPLATE_DATA_VIS
static const size_type npos = -1;
_LIBCPP_INLINE_VISIBILITY basic_string()
_LIBCPP_INLINE_VISIBILITY
basic_string(basic_string&& __str, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class = _EnableIf<__is_allocator<_Allocator>::value, nullptr_t> >
_LIBCPP_INLINE_VISIBILITY
basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {
_LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
__init(__s, traits_type::length(__s));
-# if _LIBCPP_DEBUG_LEVEL >= 2
+# if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
# endif
}
_LIBCPP_INLINE_VISIBILITY
basic_string(const _CharT* __s, const _Allocator& __a);
+#if _LIBCPP_STD_VER > 20
+ basic_string(nullptr_t) = delete;
+#endif
+
_LIBCPP_INLINE_VISIBILITY
basic_string(const _CharT* __s, size_type __n);
_LIBCPP_INLINE_VISIBILITY
basic_string(initializer_list<_CharT> __il);
_LIBCPP_INLINE_VISIBILITY
basic_string(initializer_list<_CharT> __il, const _Allocator& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
inline ~basic_string();
basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
#endif
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
+#if _LIBCPP_STD_VER > 20
+ basic_string& operator=(nullptr_t) = delete;
+#endif
basic_string& operator=(value_type __c);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT
{return iterator(this, __get_pointer());}
_LIBCPP_INLINE_VISIBILITY
const_iterator end() const _NOEXCEPT
{return const_iterator(__get_pointer() + size());}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_INLINE_VISIBILITY
reverse_iterator rbegin() _NOEXCEPT
{return reverse_iterator(end());}
void resize(size_type __n, value_type __c);
_LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
- void reserve(size_type __res_arg);
+ void reserve(size_type __requested_capacity);
_LIBCPP_INLINE_VISIBILITY void __resize_default_init(size_type __n);
+ _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
+ void reserve() _NOEXCEPT {shrink_to_fit();}
_LIBCPP_INLINE_VISIBILITY
- void reserve() _NOEXCEPT {reserve(0);}
- _LIBCPP_INLINE_VISIBILITY
- void shrink_to_fit() _NOEXCEPT {reserve();}
+ void shrink_to_fit() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT;
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c) {push_back(__c); return *this;}
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& append(const basic_string& __str);
_LIBCPP_INLINE_VISIBILITY
void __append_default_init(size_type __n);
- template <class _ForwardIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- basic_string& __append_forward_unsafe(_ForwardIterator, _ForwardIterator);
template<class _InputIterator>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
_EnableIf
<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value
- || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
+ __is_exactly_cpp17_input_iterator<_InputIterator>::value,
basic_string&
>
_LIBCPP_INLINE_VISIBILITY
append(_InputIterator __first, _InputIterator __last) {
- const basic_string __temp (__first, __last, __alloc());
+ const basic_string __temp(__first, __last, __alloc());
append(__temp.data(), __temp.size());
return *this;
}
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
_EnableIf
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value
- && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
+ __is_cpp17_forward_iterator<_ForwardIterator>::value,
basic_string&
>
_LIBCPP_INLINE_VISIBILITY
- append(_ForwardIterator __first, _ForwardIterator __last) {
- return __append_forward_unsafe(__first, __last);
- }
+ append(_ForwardIterator __first, _ForwardIterator __last);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
void push_back(value_type __c);
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
_EnableIf
<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value
- || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
+ __is_exactly_cpp17_input_iterator<_InputIterator>::value,
basic_string&
>
assign(_InputIterator __first, _InputIterator __last);
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
_EnableIf
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value
- && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
+ __is_cpp17_forward_iterator<_ForwardIterator>::value,
basic_string&
>
assign(_ForwardIterator __first, _ForwardIterator __last);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& insert(size_type __pos1, const basic_string& __str);
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
_EnableIf
<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value
- || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
+ __is_exactly_cpp17_input_iterator<_InputIterator>::value,
iterator
>
insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
_EnableIf
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value
- && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
+ __is_cpp17_forward_iterator<_ForwardIterator>::value,
iterator
>
insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __pos, initializer_list<value_type> __il)
{return insert(__pos, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
basic_string& erase(size_type __pos = 0, size_type __n = npos);
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il)
{return replace(__i1, __i2, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;
_LIBCPP_INLINE_VISIBILITY
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
size_type
>
- find(const _Tp& __t, size_type __pos = 0) const;
+ find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
size_type
>
- rfind(const _Tp& __t, size_type __pos = npos) const;
+ rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
size_type
>
- find_first_of(const _Tp& __t, size_type __pos = 0) const;
+ find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
size_type
>
- find_last_of(const _Tp& __t, size_type __pos = npos) const;
+ find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
size_type
>
- find_first_not_of(const _Tp &__t, size_type __pos = 0) const;
+ find_first_not_of(const _Tp &__t, size_type __pos = 0) const _NOEXCEPT;
size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
size_type
>
- find_last_not_of(const _Tp& __t, size_type __pos = npos) const;
+ find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
int
>
- compare(const _Tp &__t) const;
+ compare(const _Tp &__t) const _NOEXCEPT;
template <class _Tp>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
{ return ends_with(__self_view(__s)); }
#endif
+#if _LIBCPP_STD_VER > 20
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool contains(__self_view __sv) const noexcept
+ { return __self_view(data(), size()).contains(__sv); }
+
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool contains(value_type __c) const noexcept
+ { return __self_view(data(), size()).contains(__c); }
+
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool contains(const value_type* __s) const
+ { return __self_view(data(), size()).contains(__s); }
+#endif
+
_LIBCPP_INLINE_VISIBILITY bool __invariants() const;
_LIBCPP_INLINE_VISIBILITY void __clear_and_shrink() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY void __shrink_or_extend(size_type __target_capacity);
+
_LIBCPP_INLINE_VISIBILITY
bool __is_long() const _NOEXCEPT
{return bool(__r_.first().__s.__size_ & __short_mask);}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
bool __dereferenceable(const const_iterator* __i) const;
bool __decrementable(const const_iterator* __i) const;
bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
private:
_LIBCPP_INLINE_VISIBILITY
{return __r_.first().__s.__size_ >> 1;}
# endif
-#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
_LIBCPP_INLINE_VISIBILITY
void __set_long_size(size_type __s) _NOEXCEPT
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
_LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(size_type);
+ template<class _Tp>
+ _LIBCPP_INLINE_VISIBILITY
+ bool __addr_in_range(_Tp&& __t) const {
+ const volatile void *__p = _VSTD::addressof(__t);
+ return data() <= __p && __p <= data() + size();
+ }
+
+ _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
+ void __throw_length_error() const {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ __basic_string_common<true>::__throw_length_error();
+#else
+ _VSTD::abort();
+#endif
+ }
+
+ _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
+ void __throw_out_of_range() const {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ __basic_string_common<true>::__throw_out_of_range();
+#else
+ _VSTD::abort();
+#endif
+ }
+
friend basic_string operator+<>(const basic_string&, const basic_string&);
friend basic_string operator+<>(const value_type*, const basic_string&);
friend basic_string operator+<>(value_type, const basic_string&);
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _InputIterator,
- class _CharT = typename iterator_traits<_InputIterator>::value_type,
+ class _CharT = __iter_value_type<_InputIterator>,
class _Allocator = allocator<_CharT>,
class = _EnableIf<__is_cpp17_input_iterator<_InputIterator>::value>,
class = _EnableIf<__is_allocator<_Allocator>::value>
void
basic_string<_CharT, _Traits, _Allocator>::__invalidate_all_iterators()
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__invalidate_all(this);
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif
}
template <class _CharT, class _Traits, class _Allocator>
inline
void
-basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __pos
-#endif
- )
+basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type __pos)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
if (__c)
{
{
(*__p)->__c_ = nullptr;
if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
}
}
__get_db()->unlock();
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#else
+ (void)__pos;
+#endif // _LIBCPP_DEBUG_LEVEL == 2
}
template <class _CharT, class _Traits, class _Allocator>
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
: __r_(__default_init_tag(), __default_init_tag())
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__zero();
#endif
: __r_(__default_init_tag(), __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__zero();
{
_LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
__init(__s, traits_type::length(__s));
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
__init(__s, __n);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
__init(__s, __n);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
__init_copy_ctor_external(_VSTD::__to_address(__str.__get_long_pointer()),
__str.__get_long_size());
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
else
__init_copy_ctor_external(_VSTD::__to_address(__str.__get_long_pointer()),
__str.__get_long_size());
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
: __r_(_VSTD::move(__str.__r_))
{
__str.__zero();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
if (__is_long())
__get_db()->swap(this, &__str);
__r_.first().__r = __str.__r_.first().__r;
__str.__zero();
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
if (__is_long())
__get_db()->swap(this, &__str);
#endif
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
void
: __r_(__default_init_tag(), __default_init_tag())
{
__init(__n, __c);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
: __r_(__default_init_tag(), __a)
{
__init(__n, __c);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
if (__pos > __str_sz)
this->__throw_out_of_range();
__init(__str.data() + __pos, _VSTD::min(__n, __str_sz - __pos));
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
if (__pos > __str_sz)
this->__throw_out_of_range();
__init(__str.data() + __pos, __str_sz - __pos);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
__self_view __sv0 = __t;
__self_view __sv = __sv0.substr(__pos, __n);
__init(__sv.data(), __sv.size());
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
{
__self_view __sv = __t;
__init(__sv.data(), __sv.size());
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
{
__self_view __sv = __t;
__init(__sv.data(), __sv.size());
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
#ifndef _LIBCPP_NO_EXCEPTIONS
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template <class _CharT, class _Traits, class _Allocator>
__set_long_cap(__cap+1);
__set_long_size(__sz);
}
+
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __first != __last; ++__first, (void) ++__p)
traits_type::assign(*__p, *__first);
traits_type::assign(*__p, value_type());
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ if (__is_long())
+ __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
+ throw;
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template <class _CharT, class _Traits, class _Allocator>
: __r_(__default_init_tag(), __default_init_tag())
{
__init(__first, __last);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
: __r_(__default_init_tag(), __a)
{
__init(__first, __last);
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
: __r_(__default_init_tag(), __default_init_tag())
{
__init(__il.begin(), __il.end());
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
: __r_(__default_init_tag(), __a)
{
__init(__il.begin(), __il.end());
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>::~basic_string()
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__erase_c(this);
#endif
if (__is_long())
size_type __sz = size();
__grow_by(__cap, __n - __cap, __sz, 0, __sz);
}
- else
- __invalidate_iterators_past(__n);
value_type* __p = _VSTD::__to_address(__get_pointer());
traits_type::assign(__p, __n, __c);
traits_type::assign(__p[__n], value_type());
__set_size(__n);
+ __invalidate_iterators_past(__n);
return *this;
}
template<class _InputIterator>
_EnableIf
<
- __is_exactly_cpp17_input_iterator <_InputIterator>::value
- || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
+ __is_exactly_cpp17_input_iterator<_InputIterator>::value,
basic_string<_CharT, _Traits, _Allocator>&
>
basic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
template<class _ForwardIterator>
_EnableIf
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value
- && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
+ __is_cpp17_forward_iterator<_ForwardIterator>::value,
basic_string<_CharT, _Traits, _Allocator>&
>
basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
{
- size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
size_type __cap = capacity();
- if (__cap < __n)
+ size_type __n = __string_is_trivial_iterator<_ForwardIterator>::value ?
+ static_cast<size_type>(_VSTD::distance(__first, __last)) : 0;
+
+ if (__string_is_trivial_iterator<_ForwardIterator>::value &&
+ (__cap >= __n || !__addr_in_range(*__first)))
{
- size_type __sz = size();
- __grow_by(__cap, __n - __cap, __sz, 0, __sz);
+ if (__cap < __n)
+ {
+ size_type __sz = size();
+ __grow_by(__cap, __n - __cap, __sz, 0, __sz);
+ }
+ pointer __p = __get_pointer();
+ for (; __first != __last; ++__first, ++__p)
+ traits_type::assign(*__p, *__first);
+ traits_type::assign(*__p, value_type());
+ __set_size(__n);
+ __invalidate_iterators_past(__n);
}
else
- __invalidate_iterators_past(__n);
- pointer __p = __get_pointer();
- for (; __first != __last; ++__first, ++__p)
- traits_type::assign(*__p, *__first);
- traits_type::assign(*__p, value_type());
- __set_size(__n);
+ {
+ const basic_string __temp(__first, __last, __alloc());
+ assign(__temp.data(), __temp.size());
+ }
return *this;
}
traits_type::assign(*++__p, value_type());
}
-template <class _Tp>
-bool __ptr_in_range (const _Tp* __p, const _Tp* __first, const _Tp* __last)
-{
- return __first <= __p && __p < __last;
-}
-
-template <class _Tp1, class _Tp2>
-bool __ptr_in_range (const _Tp1*, const _Tp2*, const _Tp2*)
-{
- return false;
-}
-
template <class _CharT, class _Traits, class _Allocator>
template<class _ForwardIterator>
-basic_string<_CharT, _Traits, _Allocator>&
-basic_string<_CharT, _Traits, _Allocator>::__append_forward_unsafe(
+_EnableIf
+<
+ __is_cpp17_forward_iterator<_ForwardIterator>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+>
+basic_string<_CharT, _Traits, _Allocator>::append(
_ForwardIterator __first, _ForwardIterator __last)
{
- static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
- "function requires a ForwardIterator");
size_type __sz = size();
size_type __cap = capacity();
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n)
{
- typedef typename iterator_traits<_ForwardIterator>::reference _CharRef;
- _CharRef __tmp_ref = *__first;
- if (__ptr_in_range(_VSTD::addressof(__tmp_ref), data(), data() + size()))
- {
- const basic_string __temp (__first, __last, __alloc());
- append(__temp.data(), __temp.size());
- }
- else
+ if (__string_is_trivial_iterator<_ForwardIterator>::value &&
+ !__addr_in_range(*__first))
{
if (__cap - __sz < __n)
__grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
traits_type::assign(*__p, value_type());
__set_size(__sz + __n);
}
+ else
+ {
+ const basic_string __temp(__first, __last, __alloc());
+ append(__temp.data(), __temp.size());
+ }
}
return *this;
}
template<class _InputIterator>
_EnableIf
<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value
- || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
+ __is_exactly_cpp17_input_iterator<_InputIterator>::value,
typename basic_string<_CharT, _Traits, _Allocator>::iterator
>
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
"string::insert(iterator, range) called with an iterator not"
" referring to this string");
template<class _ForwardIterator>
_EnableIf
<
- __is_cpp17_forward_iterator<_ForwardIterator>::value
- && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
+ __is_cpp17_forward_iterator<_ForwardIterator>::value,
typename basic_string<_CharT, _Traits, _Allocator>::iterator
>
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
"string::insert(iterator, range) called with an iterator not"
" referring to this string");
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n)
{
- typedef typename iterator_traits<_ForwardIterator>::reference _CharRef;
- _CharRef __tmp_char = *__first;
- if (__ptr_in_range(_VSTD::addressof(__tmp_char), data(), data() + size()))
+ if (__string_is_trivial_iterator<_ForwardIterator>::value &&
+ !__addr_in_range(*__first))
{
- const basic_string __temp(__first, __last, __alloc());
- return insert(__pos, __temp.data(), __temp.data() + __temp.size());
- }
-
- size_type __sz = size();
- size_type __cap = capacity();
- value_type* __p;
- if (__cap - __sz >= __n)
- {
- __p = _VSTD::__to_address(__get_pointer());
- size_type __n_move = __sz - __ip;
- if (__n_move != 0)
- traits_type::move(__p + __ip + __n, __p + __ip, __n_move);
+ size_type __sz = size();
+ size_type __cap = capacity();
+ value_type* __p;
+ if (__cap - __sz >= __n)
+ {
+ __p = _VSTD::__to_address(__get_pointer());
+ size_type __n_move = __sz - __ip;
+ if (__n_move != 0)
+ traits_type::move(__p + __ip + __n, __p + __ip, __n_move);
+ }
+ else
+ {
+ __grow_by(__cap, __sz + __n - __cap, __sz, __ip, 0, __n);
+ __p = _VSTD::__to_address(__get_long_pointer());
+ }
+ __sz += __n;
+ __set_size(__sz);
+ traits_type::assign(__p[__sz], value_type());
+ for (__p += __ip; __first != __last; ++__p, ++__first)
+ traits_type::assign(*__p, *__first);
}
else
{
- __grow_by(__cap, __sz + __n - __cap, __sz, __ip, 0, __n);
- __p = _VSTD::__to_address(__get_long_pointer());
+ const basic_string __temp(__first, __last, __alloc());
+ return insert(__pos, __temp.data(), __temp.data() + __temp.size());
}
- __sz += __n;
- __set_size(__sz);
- traits_type::assign(__p[__sz], value_type());
- for (__p += __ip; __first != __last; ++__p, ++__first)
- traits_type::assign(*__p, *__first);
}
return begin() + __ip;
}
typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, size_type __n, value_type __c)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
"string::insert(iterator, n, value) called with an iterator not"
" referring to this string");
typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __pos)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
"string::erase(iterator) called with an iterator not"
" referring to this string");
typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __first, const_iterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
"string::erase(iterator, iterator) called with an iterator not"
" referring to this string");
template <class _CharT, class _Traits, class _Allocator>
void
-basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __res_arg)
+basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __requested_capacity)
{
- if (__res_arg > max_size())
+ if (__requested_capacity > max_size())
this->__throw_length_error();
+
+#if _LIBCPP_STD_VER > 17
+ // Reserve never shrinks as of C++20.
+ if (__requested_capacity <= capacity()) return;
+#endif
+
+ size_type __target_capacity = _VSTD::max(__requested_capacity, size());
+ __target_capacity = __recommend(__target_capacity);
+ if (__target_capacity == capacity()) return;
+
+ __shrink_or_extend(__target_capacity);
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+void
+basic_string<_CharT, _Traits, _Allocator>::shrink_to_fit() _NOEXCEPT
+{
+ size_type __target_capacity = __recommend(size());
+ if (__target_capacity == capacity()) return;
+
+ __shrink_or_extend(__target_capacity);
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+void
+basic_string<_CharT, _Traits, _Allocator>::__shrink_or_extend(size_type __target_capacity)
+{
size_type __cap = capacity();
size_type __sz = size();
- __res_arg = _VSTD::max(__res_arg, __sz);
- __res_arg = __recommend(__res_arg);
- if (__res_arg != __cap)
+
+ pointer __new_data, __p;
+ bool __was_long, __now_long;
+ if (__target_capacity == __min_cap - 1)
{
- pointer __new_data, __p;
- bool __was_long, __now_long;
- if (__res_arg == __min_cap - 1)
- {
- __was_long = true;
- __now_long = false;
- __new_data = __get_short_pointer();
- __p = __get_long_pointer();
- }
+ __was_long = true;
+ __now_long = false;
+ __new_data = __get_short_pointer();
+ __p = __get_long_pointer();
+ }
+ else
+ {
+ if (__target_capacity > __cap)
+ __new_data = __alloc_traits::allocate(__alloc(), __target_capacity+1);
else
{
- if (__res_arg > __cap)
- __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);
- else
+ #ifndef _LIBCPP_NO_EXCEPTIONS
+ try
{
- #ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
- #endif // _LIBCPP_NO_EXCEPTIONS
- __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);
- #ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- return;
- }
- #else // _LIBCPP_NO_EXCEPTIONS
- if (__new_data == nullptr)
- return;
- #endif // _LIBCPP_NO_EXCEPTIONS
+ #endif // _LIBCPP_NO_EXCEPTIONS
+ __new_data = __alloc_traits::allocate(__alloc(), __target_capacity+1);
+ #ifndef _LIBCPP_NO_EXCEPTIONS
}
- __now_long = true;
- __was_long = __is_long();
- __p = __get_pointer();
- }
- traits_type::copy(_VSTD::__to_address(__new_data),
- _VSTD::__to_address(__p), size()+1);
- if (__was_long)
- __alloc_traits::deallocate(__alloc(), __p, __cap+1);
- if (__now_long)
- {
- __set_long_cap(__res_arg+1);
- __set_long_size(__sz);
- __set_long_pointer(__new_data);
+ catch (...)
+ {
+ return;
+ }
+ #else // _LIBCPP_NO_EXCEPTIONS
+ if (__new_data == nullptr)
+ return;
+ #endif // _LIBCPP_NO_EXCEPTIONS
}
- else
- __set_short_size(__sz);
- __invalidate_all_iterators();
+ __now_long = true;
+ __was_long = __is_long();
+ __p = __get_pointer();
}
+ traits_type::copy(_VSTD::__to_address(__new_data),
+ _VSTD::__to_address(__p), size()+1);
+ if (__was_long)
+ __alloc_traits::deallocate(__alloc(), __p, __cap+1);
+ if (__now_long)
+ {
+ __set_long_cap(__target_capacity+1);
+ __set_long_size(__sz);
+ __set_long_pointer(__new_data);
+ }
+ else
+ __set_short_size(__sz);
+ __invalidate_all_iterators();
}
template <class _CharT, class _Traits, class _Allocator>
__is_nothrow_swappable<allocator_type>::value)
#endif
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
if (!__is_long())
__get_db()->__invalidate_all(this);
if (!__str.__is_long())
__alloc_traits::is_always_equal::value ||
__alloc() == __str.__alloc(), "swapping non-equal allocators");
_VSTD::swap(__r_.first(), __str.__r_.first());
- __swap_allocator(__alloc(), __str.__alloc());
+ _VSTD::__swap_allocator(__alloc(), __str.__alloc());
}
// find
typename basic_string<_CharT, _Traits, _Allocator>::size_type
>
basic_string<_CharT, _Traits, _Allocator>::find(const _Tp &__t,
- size_type __pos) const
+ size_type __pos) const _NOEXCEPT
{
__self_view __sv = __t;
return __str_find<value_type, size_type, traits_type, npos>
typename basic_string<_CharT, _Traits, _Allocator>::size_type
>
basic_string<_CharT, _Traits, _Allocator>::rfind(const _Tp& __t,
- size_type __pos) const
+ size_type __pos) const _NOEXCEPT
{
__self_view __sv = __t;
return __str_rfind<value_type, size_type, traits_type, npos>
typename basic_string<_CharT, _Traits, _Allocator>::size_type
>
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const _Tp& __t,
- size_type __pos) const
+ size_type __pos) const _NOEXCEPT
{
__self_view __sv = __t;
return __str_find_first_of<value_type, size_type, traits_type, npos>
typename basic_string<_CharT, _Traits, _Allocator>::size_type
>
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const _Tp& __t,
- size_type __pos) const
+ size_type __pos) const _NOEXCEPT
{
__self_view __sv = __t;
return __str_find_last_of<value_type, size_type, traits_type, npos>
typename basic_string<_CharT, _Traits, _Allocator>::size_type
>
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const _Tp& __t,
- size_type __pos) const
+ size_type __pos) const _NOEXCEPT
{
__self_view __sv = __t;
return __str_find_first_not_of<value_type, size_type, traits_type, npos>
typename basic_string<_CharT, _Traits, _Allocator>::size_type
>
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const _Tp& __t,
- size_type __pos) const
+ size_type __pos) const _NOEXCEPT
{
__self_view __sv = __t;
return __str_find_last_not_of<value_type, size_type, traits_type, npos>
__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
int
>
-basic_string<_CharT, _Traits, _Allocator>::compare(const _Tp& __t) const
+basic_string<_CharT, _Traits, _Allocator>::compare(const _Tp& __t) const _NOEXCEPT
{
__self_view __sv = __t;
size_t __lhs_sz = size();
return false;
if (capacity() < __min_cap - 1)
return false;
- if (data() == 0)
+ if (data() == nullptr)
return false;
- if (data()[size()] != value_type(0))
+ if (data()[size()] != value_type())
return false;
return true;
}
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), capacity() + 1);
__set_long_cap(0);
__set_short_size(0);
+ traits_type::assign(*__get_short_pointer(), value_type());
}
}
return _VSTD::move(__lhs);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
// swap
__lhs.swap(__rhs);
}
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
-typedef basic_string<char8_t> u8string;
-#endif
-
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-typedef basic_string<char16_t> u16string;
-typedef basic_string<char32_t> u32string;
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
-
-_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = 0, int __base = 10);
-_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = 0, int __base = 10);
-_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = 0, int __base = 10);
-_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = 0, int __base = 10);
-_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = 0, int __base = 10);
+_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = 0);
-_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = 0);
-_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = 0);
+_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = nullptr);
+_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = nullptr);
+_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = nullptr);
_LIBCPP_FUNC_VIS string to_string(int __val);
_LIBCPP_FUNC_VIS string to_string(unsigned __val);
_LIBCPP_FUNC_VIS string to_string(double __val);
_LIBCPP_FUNC_VIS string to_string(long double __val);
-_LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = 0, int __base = 10);
-_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = 0, int __base = 10);
-_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = 0, int __base = 10);
-_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = 0, int __base = 10);
-_LIBCPP_FUNC_VIS unsigned long long stoull(const wstring& __str, size_t* __idx = 0, int __base = 10);
+_LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
+_LIBCPP_FUNC_VIS unsigned long long stoull(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
-_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = 0);
-_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = 0);
-_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = 0);
+_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = nullptr);
+_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = nullptr);
+_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = nullptr);
_LIBCPP_FUNC_VIS wstring to_wstring(int __val);
_LIBCPP_FUNC_VIS wstring to_wstring(unsigned __val);
_LIBCPP_FUNC_VIS wstring to_wstring(long double __val);
template<class _CharT, class _Traits, class _Allocator>
-_LIBCPP_FUNC_VIS
+_LIBCPP_TEMPLATE_DATA_VIS
const typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::npos;
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Allocator>& __str);
-#ifndef _LIBCPP_CXX03_LANG
-
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Allocator>& __str);
-#endif // _LIBCPP_CXX03_LANG
-
#if _LIBCPP_STD_VER > 17
template <class _CharT, class _Traits, class _Allocator, class _Up>
inline _LIBCPP_INLINE_VISIBILITY
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
template<class _CharT, class _Traits, class _Allocator>
bool
return this->data() <= __p && __p < this->data() + this->size();
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
#if _LIBCPP_STD_VER > 11
// Literal suffixes for basic_string [basic.string.literals]
return basic_string<wchar_t> (__str, __len);
}
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
inline _LIBCPP_INLINE_VISIBILITY
basic_string<char8_t> operator "" s(const char8_t *__str, size_t __len) _NOEXCEPT
{
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STRING
+#endif // _LIBCPP_STRING
}
#endif
-#endif // _LIBCPP_STRING_H
+#endif // _LIBCPP_STRING_H
template<class charT, class traits = char_traits<charT>>
class basic_string_view;
+ template<class charT, class traits>
+ inline constexpr bool ranges::enable_view<basic_string_view<charT, traits>> = true;
+
+ template<class charT, class traits>
+ inline constexpr bool ranges::enable_borrowed_range<basic_string_view<charT, traits>> = true; // C++20
+
// 7.9, basic_string_view non-member comparison functions
template<class charT, class traits>
constexpr bool operator==(basic_string_view<charT, traits> x,
// basic_string_view typedef names
typedef basic_string_view<char> string_view;
+ typedef basic_string_view<char8_t> u8string_view; // C++20
typedef basic_string_view<char16_t> u16string_view;
typedef basic_string_view<char32_t> u32string_view;
typedef basic_string_view<wchar_t> wstring_view;
basic_string_view& operator=(const basic_string_view&) noexcept = default;
template<class Allocator>
constexpr basic_string_view(const charT* str);
+ basic_string_view(nullptr_t) = delete; // C++2b
constexpr basic_string_view(const charT* str, size_type len);
// 7.4, basic_string_view iterator support
constexpr void remove_suffix(size_type n);
constexpr void swap(basic_string_view& s) noexcept;
- size_type copy(charT* s, size_type n, size_type pos = 0) const;
+ size_type copy(charT* s, size_type n, size_type pos = 0) const; // constexpr in C++20
constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
constexpr int compare(basic_string_view s) const noexcept;
const charT* s, size_type n2) const;
constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept;
constexpr size_type find(charT c, size_type pos = 0) const noexcept;
- constexpr size_type find(const charT* s, size_type pos, size_type n) const;
- constexpr size_type find(const charT* s, size_type pos = 0) const;
+ constexpr size_type find(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+ constexpr size_type find(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension
constexpr size_type rfind(basic_string_view s, size_type pos = npos) const noexcept;
constexpr size_type rfind(charT c, size_type pos = npos) const noexcept;
- constexpr size_type rfind(const charT* s, size_type pos, size_type n) const;
- constexpr size_type rfind(const charT* s, size_type pos = npos) const;
+ constexpr size_type rfind(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+ constexpr size_type rfind(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension
constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept;
constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept;
- constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const;
- constexpr size_type find_first_of(const charT* s, size_type pos = 0) const;
+ constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+ constexpr size_type find_first_of(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension
constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept;
constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept;
- constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const;
- constexpr size_type find_last_of(const charT* s, size_type pos = npos) const;
+ constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+ constexpr size_type find_last_of(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension
constexpr size_type find_first_not_of(basic_string_view s, size_type pos = 0) const noexcept;
constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept;
- constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const;
- constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const;
+ constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+ constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension
constexpr size_type find_last_not_of(basic_string_view s, size_type pos = npos) const noexcept;
constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept;
- constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
- constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
+ constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension
+ constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension
+
+ constexpr bool starts_with(basic_string_view s) const noexcept; // C++20
+ constexpr bool starts_with(charT c) const noexcept; // C++20
+ constexpr bool starts_with(const charT* s) const; // C++20
+ constexpr bool ends_with(basic_string_view s) const noexcept; // C++20
+ constexpr bool ends_with(charT c) const noexcept; // C++20
+ constexpr bool ends_with(const charT* s) const; // C++20
- constexpr bool starts_with(basic_string_view s) const noexcept; // C++2a
- constexpr bool starts_with(charT c) const noexcept; // C++2a
- constexpr bool starts_with(const charT* s) const; // C++2a
- constexpr bool ends_with(basic_string_view s) const noexcept; // C++2a
- constexpr bool ends_with(charT c) const noexcept; // C++2a
- constexpr bool ends_with(const charT* s) const; // C++2a
+ constexpr bool contains(basic_string_view s) const noexcept; // C++2b
+ constexpr bool contains(charT c) const noexcept; // C++2b
+ constexpr bool contains(const charT* s) const; // C++2b
private:
const_pointer data_; // exposition only
// 7.11, Hash support
template <class T> struct hash;
template <> struct hash<string_view>;
+ template <> struct hash<u8string_view>; // C++20
template <> struct hash<u16string_view>;
template <> struct hash<u32string_view>;
template <> struct hash<wstring_view>;
constexpr basic_string_view<char> operator "" sv( const char *str, size_t len ) noexcept;
constexpr basic_string_view<wchar_t> operator "" sv( const wchar_t *str, size_t len ) noexcept;
+ constexpr basic_string_view<char8_t> operator "" sv( const char8_t *str, size_t len ) noexcept; // C++20
constexpr basic_string_view<char16_t> operator "" sv( const char16_t *str, size_t len ) noexcept;
constexpr basic_string_view<char32_t> operator "" sv( const char32_t *str, size_t len ) noexcept;
*/
#include <__config>
+#include <__debug>
+#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/enable_view.h>
#include <__string>
-#include <iosfwd>
#include <algorithm>
+#include <compare>
+#include <iosfwd>
#include <iterator>
#include <limits>
#include <stdexcept>
#include <version>
-#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
_LIBCPP_BEGIN_NAMESPACE_STD
template<class _CharT, class _Traits = char_traits<_CharT> >
-class _LIBCPP_TEMPLATE_VIS basic_string_view {
+ class _LIBCPP_TEMPLATE_VIS basic_string_view;
+
+typedef basic_string_view<char> string_view;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+typedef basic_string_view<char8_t> u8string_view;
+#endif
+typedef basic_string_view<char16_t> u16string_view;
+typedef basic_string_view<char32_t> u32string_view;
+typedef basic_string_view<wchar_t> wstring_view;
+
+template<class _CharT, class _Traits>
+class
+ _LIBCPP_PREFERRED_NAME(string_view)
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ _LIBCPP_PREFERRED_NAME(u8string_view)
+#endif
+ _LIBCPP_PREFERRED_NAME(u16string_view)
+ _LIBCPP_PREFERRED_NAME(u32string_view)
+ _LIBCPP_PREFERRED_NAME(wstring_view)
+ basic_string_view {
public:
// types
typedef _Traits traits_type;
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
basic_string_view(const _CharT* __s)
- : __data(__s), __size(std::__char_traits_length_checked<_Traits>(__s)) {}
+ : __data(__s), __size(_VSTD::__char_traits_length_checked<_Traits>(__s)) {}
+
+#if _LIBCPP_STD_VER > 20
+ basic_string_view(nullptr_t) = delete;
+#endif
// [string.view.iterators], iterators
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
// [string.view.access], element access
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
- const_reference operator[](size_type __pos) const _NOEXCEPT { return __data[__pos]; }
+ const_reference operator[](size_type __pos) const _NOEXCEPT {
+ return _LIBCPP_ASSERT(__pos < size(), "string_view[] index out of bounds"), __data[__pos];
+ }
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference at(size_type __pos) const
__other.__size = __sz;
}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const
{
if (__pos > size())
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find(const _CharT* __s, size_type __pos, size_type __n) const
+ size_type find(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
return __str_find<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find(const _CharT* __s, size_type __pos = 0) const
+ size_type find(const _CharT* __s, size_type __pos = 0) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string_view::find(): received nullptr");
return __str_find<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
return __str_rfind<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type rfind(const _CharT* __s, size_type __pos=npos) const
+ size_type rfind(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): received nullptr");
return __str_rfind<value_type, size_type, traits_type, npos>
{ return find(__c, __pos); }
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
return __str_find_first_of<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find_first_of(const _CharT* __s, size_type __pos=0) const
+ size_type find_first_of(const _CharT* __s, size_type __pos=0) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): received nullptr");
return __str_find_first_of<value_type, size_type, traits_type, npos>
{ return rfind(__c, __pos); }
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
return __str_find_last_of<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find_last_of(const _CharT* __s, size_type __pos=npos) const
+ size_type find_last_of(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): received nullptr");
return __str_find_last_of<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
return __str_find_first_not_of<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const
+ size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
return __str_find_first_not_of<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
return __str_find_last_not_of<value_type, size_type, traits_type, npos>
}
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const
+ size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
return __str_find_last_not_of<value_type, size_type, traits_type, npos>
{ return ends_with(basic_string_view(__s)); }
#endif
+#if _LIBCPP_STD_VER > 20
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool contains(basic_string_view __sv) const noexcept
+ { return find(__sv) != npos; }
+
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool contains(value_type __c) const noexcept
+ { return find(__c) != npos; }
+
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool contains(const value_type* __s) const
+ { return find(__s) != npos; }
+#endif
+
private:
const value_type* __data;
size_type __size;
};
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
+template <class _CharT, class _Traits>
+inline constexpr bool ranges::enable_view<basic_string_view<_CharT, _Traits>> = true;
+
+template <class _CharT, class _Traits>
+inline constexpr bool ranges::enable_borrowed_range<basic_string_view<_CharT, _Traits> > = true;
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
// [string.view.comparison]
// operator ==
operator<<(basic_ostream<_CharT, _Traits>& __os,
basic_string_view<_CharT, _Traits> __str);
-typedef basic_string_view<char> string_view;
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
-typedef basic_string_view<char8_t> u8string_view;
-#endif
-typedef basic_string_view<char16_t> u16string_view;
-typedef basic_string_view<char32_t> u32string_view;
-typedef basic_string_view<wchar_t> wstring_view;
-
// [string.view.hash]
template<class _CharT>
struct _LIBCPP_TEMPLATE_VIS hash<basic_string_view<_CharT, char_traits<_CharT> > >
return basic_string_view<wchar_t> (__str, __len);
}
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
basic_string_view<char8_t> operator "" sv(const char8_t *__str, size_t __len) _NOEXCEPT
{
: public basic_streambuf<char>
{
public:
- explicit strstreambuf(streamsize alsize_arg = 0);
+ explicit strstreambuf(streamsize alsize_arg = 0); // before C++20
+ strstreambuf() : strstreambuf(0) {} // C++20
+ explicit strstreambuf(streamsize alsize_arg); // C++20
+
strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*));
- strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0);
+ strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = nullptr);
strstreambuf(const char* gnext_arg, streamsize n);
- strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = 0);
+ strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = nullptr);
strstreambuf(const signed char* gnext_arg, streamsize n);
- strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = 0);
+ strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = nullptr);
strstreambuf(const unsigned char* gnext_arg, streamsize n);
strstreambuf(strstreambuf&& rhs);
*/
#include <__config>
-#include <ostream>
#include <istream>
+#include <ostream>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
: public streambuf
{
public:
+#ifndef _LIBCPP_CXX03_LANG
+ strstreambuf() : strstreambuf(0) {}
+ explicit strstreambuf(streamsize __alsize);
+#else
explicit strstreambuf(streamsize __alsize = 0);
+#endif
strstreambuf(void* (*__palloc)(size_t), void (*__pfree)(void*));
- strstreambuf(char* __gnext, streamsize __n, char* __pbeg = 0);
+ strstreambuf(char* __gnext, streamsize __n, char* __pbeg = nullptr);
strstreambuf(const char* __gnext, streamsize __n);
- strstreambuf(signed char* __gnext, streamsize __n, signed char* __pbeg = 0);
+ strstreambuf(signed char* __gnext, streamsize __n, signed char* __pbeg = nullptr);
strstreambuf(const signed char* __gnext, streamsize __n);
- strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0);
+ strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = nullptr);
strstreambuf(const unsigned char* __gnext, streamsize __n);
#ifndef _LIBCPP_CXX03_LANG
strstreambuf(strstreambuf&& __rhs);
_LIBCPP_INLINE_VISIBILITY
strstreambuf& operator=(strstreambuf&& __rhs);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
virtual ~strstreambuf();
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
class _LIBCPP_TYPE_VIS istrstream
: public istream
__sb_ = _VSTD::move(__rhs.__sb_);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
virtual ~istrstream();
_LIBCPP_INLINE_VISIBILITY
ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)
: ostream(&__sb_),
- __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
+ __sb_(__s, __n, __s + (__mode & ios::app ? _VSTD::strlen(__s) : 0))
{}
#ifndef _LIBCPP_CXX03_LANG
__sb_ = _VSTD::move(__rhs.__sb_);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
virtual ~ostrstream();
_LIBCPP_INLINE_VISIBILITY
strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)
: iostream(&__sb_),
- __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
+ __sb_(__s, __n, __s + (__mode & ios::app ? _VSTD::strlen(__s) : 0))
{}
#ifndef _LIBCPP_CXX03_LANG
__sb_ = _VSTD::move(__rhs.__sb_);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
virtual ~strstream();
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STRSTREAM
+#endif // _LIBCPP_STRSTREAM
*/
+#include <__config>
#include <__errc>
-#include <type_traits>
-#include <stdexcept>
+#include <__functional/unary_function.h>
#include <__functional_base>
+#include <compare>
+#include <stdexcept>
#include <string>
+#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
template <class _Ep>
_LIBCPP_INLINE_VISIBILITY
error_condition(_Ep __e,
- typename enable_if<is_error_condition_enum<_Ep>::value>::type* = 0
+ typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr
) _NOEXCEPT
{*this = make_error_condition(__e);}
string message() const;
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT
- operator bool() const _NOEXCEPT {return __val_ != 0;}
+ explicit operator bool() const _NOEXCEPT {return __val_ != 0;}
};
inline _LIBCPP_INLINE_VISIBILITY
template <class _Ep>
_LIBCPP_INLINE_VISIBILITY
error_code(_Ep __e,
- typename enable_if<is_error_code_enum<_Ep>::value>::type* = 0
+ typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr
) _NOEXCEPT
{*this = make_error_code(__e);}
string message() const;
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT
- operator bool() const _NOEXCEPT {return __val_ != 0;}
+ explicit operator bool() const _NOEXCEPT {return __val_ != 0;}
};
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_SYSTEM_ERROR
+#endif // _LIBCPP_SYSTEM_ERROR
#include_next <tgmath.h>
-#endif // __cplusplus
+#endif // __cplusplus
-#endif // _LIBCPP_TGMATH_H
+#endif // _LIBCPP_TGMATH_H
*/
#include <__config>
-#include <iosfwd>
+#include <__debug>
#include <__functional_base>
-#include <type_traits>
+#include <__mutex_base>
+#include <__threading_support>
+#include <__utility/__decay_copy.h>
+#include <__utility/forward.h>
+#include <chrono>
#include <cstddef>
#include <functional>
+#include <iosfwd>
#include <memory>
#include <system_error>
-#include <chrono>
-#include <__mutex_base>
-#ifndef _LIBCPP_CXX03_LANG
#include <tuple>
-#endif
-#include <__threading_support>
-#include <__debug>
+#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
void
__thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>)
{
- __invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
+ _VSTD::__invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
}
template <class _Fp>
_LIBCPP_INLINE_VISIBILITY
void* __thread_proxy(void* __vp)
{
- // _Fp = std::tuple< unique_ptr<__thread_struct>, Functor, Args...>
- std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
- __thread_local_data().set_pointer(_VSTD::get<0>(*__p).release());
+ // _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>
+ unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
+ __thread_local_data().set_pointer(_VSTD::get<0>(*__p.get()).release());
typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;
- __thread_execute(*__p, _Index());
+ _VSTD::__thread_execute(*__p.get(), _Index());
return nullptr;
}
typedef unique_ptr<__thread_struct> _TSPtr;
_TSPtr __tsp(new __thread_struct);
typedef tuple<_TSPtr, typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;
- _VSTD::unique_ptr<_Gp> __p(
- new _Gp(std::move(__tsp),
- __decay_copy(_VSTD::forward<_Fp>(__f)),
- __decay_copy(_VSTD::forward<_Args>(__args))...));
- int __ec = __libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
+ unique_ptr<_Gp> __p(
+ new _Gp(_VSTD::move(__tsp),
+ _VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
+ _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
+ int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
if (__ec == 0)
__p.release();
else
template <class _Fp>
void* __thread_proxy_cxx03(void* __vp)
{
- std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
+ unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
__thread_local_data().set_pointer(__p->__tsp_.release());
(__p->__fn_)();
return nullptr;
{
typedef __thread_invoke_pair<_Fp> _InvokePair;
- typedef std::unique_ptr<_InvokePair> _PairPtr;
+ typedef unique_ptr<_InvokePair> _PairPtr;
_PairPtr __pp(new _InvokePair(__f));
- int __ec = __libcpp_thread_create(&__t_, &__thread_proxy_cxx03<_InvokePair>, __pp.get());
+ int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy_cxx03<_InvokePair>, __pp.get());
if (__ec == 0)
__pp.release();
else
__throw_system_error(__ec, "thread constructor failed");
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
inline _LIBCPP_INLINE_VISIBILITY
void swap(thread& __x, thread& __y) _NOEXCEPT {__x.swap(__y);}
void
sleep_for(const chrono::duration<_Rep, _Period>& __d)
{
- using namespace chrono;
- if (__d > duration<_Rep, _Period>::zero())
+ if (__d > chrono::duration<_Rep, _Period>::zero())
{
-#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
- // GCC's long double const folding is incomplete for IBM128 long doubles.
- _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
-#else
- _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
-#endif
- nanoseconds __ns;
+ // The standard guarantees a 64bit signed integer resolution for nanoseconds,
+ // so use INT64_MAX / 1e9 as cut-off point. Use a constant to avoid <climits>
+ // and issues with long double folding on PowerPC with GCC.
+ _LIBCPP_CONSTEXPR chrono::duration<long double> _Max =
+ chrono::duration<long double>(9223372036.0L);
+ chrono::nanoseconds __ns;
if (__d < _Max)
{
- __ns = duration_cast<nanoseconds>(__d);
+ __ns = chrono::duration_cast<chrono::nanoseconds>(__d);
if (__ns < __d)
++__ns;
}
else
- __ns = nanoseconds::max();
- sleep_for(__ns);
+ __ns = chrono::nanoseconds::max();
+ this_thread::sleep_for(__ns);
}
}
void
sleep_until(const chrono::time_point<_Clock, _Duration>& __t)
{
- using namespace chrono;
mutex __mut;
condition_variable __cv;
unique_lock<mutex> __lk(__mut);
void
sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
{
- using namespace chrono;
- sleep_for(__t - steady_clock::now());
+ this_thread::sleep_for(__t - chrono::steady_clock::now());
}
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_THREAD
+#endif // _LIBCPP_THREAD
template <class Alloc>
tuple(allocator_arg_t, const Alloc& a);
template <class Alloc>
- explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const T&...);
+ explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const T&...); // constexpr in C++20
template <class Alloc, class... U>
- explicit(see-below) tuple(allocator_arg_t, const Alloc& a, U&&...);
+ explicit(see-below) tuple(allocator_arg_t, const Alloc& a, U&&...); // constexpr in C++20
template <class Alloc>
- tuple(allocator_arg_t, const Alloc& a, const tuple&);
+ tuple(allocator_arg_t, const Alloc& a, const tuple&); // constexpr in C++20
template <class Alloc>
- tuple(allocator_arg_t, const Alloc& a, tuple&&);
+ tuple(allocator_arg_t, const Alloc& a, tuple&&); // constexpr in C++20
template <class Alloc, class... U>
- explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const tuple<U...>&);
+ explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const tuple<U...>&); // constexpr in C++20
template <class Alloc, class... U>
- explicit(see-below) tuple(allocator_arg_t, const Alloc& a, tuple<U...>&&);
+ explicit(see-below) tuple(allocator_arg_t, const Alloc& a, tuple<U...>&&); // constexpr in C++20
template <class Alloc, class U1, class U2>
- explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const pair<U1, U2>&);
+ explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const pair<U1, U2>&); // constexpr in C++20
template <class Alloc, class U1, class U2>
- explicit(see-below) tuple(allocator_arg_t, const Alloc& a, pair<U1, U2>&&);
+ explicit(see-below) tuple(allocator_arg_t, const Alloc& a, pair<U1, U2>&&); // constexpr in C++20
- tuple& operator=(const tuple&);
- tuple&
- operator=(tuple&&) noexcept(AND(is_nothrow_move_assignable<T>::value ...));
+ tuple& operator=(const tuple&); // constexpr in C++20
+ tuple& operator=(tuple&&) noexcept(is_nothrow_move_assignable_v<T> && ...); // constexpr in C++20
template <class... U>
- tuple& operator=(const tuple<U...>&);
+ tuple& operator=(const tuple<U...>&); // constexpr in C++20
template <class... U>
- tuple& operator=(tuple<U...>&&);
+ tuple& operator=(tuple<U...>&&); // constexpr in C++20
template <class U1, class U2>
- tuple& operator=(const pair<U1, U2>&); // iff sizeof...(T) == 2
+ tuple& operator=(const pair<U1, U2>&); // iff sizeof...(T) == 2 // constexpr in C++20
template <class U1, class U2>
- tuple& operator=(pair<U1, U2>&&); // iff sizeof...(T) == 2
+ tuple& operator=(pair<U1, U2>&&); // iff sizeof...(T) == 2 // constexpr in C++20
- void swap(tuple&) noexcept(AND(swap(declval<T&>(), declval<T&>())...));
+ template<class U, size_t N>
+ tuple& operator=(array<U, N> const&) // iff sizeof...(T) == N, EXTENSION
+ template<class U, size_t N>
+ tuple& operator=(array<U, N>&&) // iff sizeof...(T) == N, EXTENSION
+
+ void swap(tuple&) noexcept(AND(swap(declval<T&>(), declval<T&>())...)); // constexpr in C++20
};
template <class ...T>
*/
#include <__config>
+#include <__functional/unwrap_ref.h>
+#include <__functional_base>
+#include <__memory/allocator_arg_t.h>
+#include <__memory/uses_allocator.h>
#include <__tuple>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <compare>
#include <cstddef>
#include <type_traits>
-#include <__functional_base>
#include <utility>
#include <version>
class __tuple_leaf;
template <size_t _Ip, class _Hp, bool _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
void swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y)
_NOEXCEPT_(__is_nothrow_swappable<_Hp>::value)
{
#endif
}
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
__tuple_leaf& operator=(const __tuple_leaf&);
public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
+ _LIBCPP_INLINE_VISIBILITY constexpr __tuple_leaf()
_NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : __value_()
{static_assert(!is_reference<_Hp>::value,
"Attempted to default construct a reference element in a tuple");}
template <class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
__tuple_leaf(integral_constant<int, 0>, const _Alloc&)
: __value_()
{static_assert(!is_reference<_Hp>::value,
"Attempted to default construct a reference element in a tuple");}
template <class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
__tuple_leaf(integral_constant<int, 1>, const _Alloc& __a)
: __value_(allocator_arg_t(), __a)
{static_assert(!is_reference<_Hp>::value,
"Attempted to default construct a reference element in a tuple");}
template <class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
__tuple_leaf(integral_constant<int, 2>, const _Alloc& __a)
: __value_(__a)
{static_assert(!is_reference<_Hp>::value,
"Attempted construction of reference element binds to a temporary whose lifetime has ended");}
template <class _Tp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
: __value_(_VSTD::forward<_Tp>(__t))
{static_assert(__can_bind_reference<_Tp&&>(),
"Attempted construction of reference element binds to a temporary whose lifetime has ended");}
template <class _Tp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
: __value_(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t))
{static_assert(!is_reference<_Hp>::value,
"Attempted to uses-allocator construct a reference element in a tuple");}
template <class _Tp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
: __value_(_VSTD::forward<_Tp>(__t), __a)
{static_assert(!is_reference<_Hp>::value,
__tuple_leaf(const __tuple_leaf& __t) = default;
__tuple_leaf(__tuple_leaf&& __t) = default;
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- __tuple_leaf&
- operator=(_Tp&& __t) _NOEXCEPT_((is_nothrow_assignable<_Hp&, _Tp>::value))
- {
- __value_ = _VSTD::forward<_Tp>(__t);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
int swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
{
_VSTD::swap(*this, __t);
class __tuple_leaf<_Ip, _Hp, true>
: private _Hp
{
-
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
__tuple_leaf& operator=(const __tuple_leaf&);
public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
+ _LIBCPP_INLINE_VISIBILITY constexpr __tuple_leaf()
_NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) {}
template <class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
__tuple_leaf(integral_constant<int, 0>, const _Alloc&) {}
template <class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
__tuple_leaf(integral_constant<int, 1>, const _Alloc& __a)
: _Hp(allocator_arg_t(), __a) {}
template <class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
__tuple_leaf(integral_constant<int, 2>, const _Alloc& __a)
: _Hp(__a) {}
: _Hp(_VSTD::forward<_Tp>(__t)) {}
template <class _Tp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
: _Hp(_VSTD::forward<_Tp>(__t)) {}
template <class _Tp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
: _Hp(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t)) {}
template <class _Tp, class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY constexpr
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
: _Hp(_VSTD::forward<_Tp>(__t), __a) {}
__tuple_leaf(__tuple_leaf const &) = default;
__tuple_leaf(__tuple_leaf &&) = default;
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- __tuple_leaf&
- operator=(_Tp&& __t) _NOEXCEPT_((is_nothrow_assignable<_Hp&, _Tp>::value))
- {
- _Hp::operator=(_VSTD::forward<_Tp>(__t));
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
int
swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
{
};
template <class ..._Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
void __swallow(_Tp&&...) _NOEXCEPT {}
template <class _Tp>
: public __tuple_leaf<_Indx, _Tp>...
{
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR __tuple_impl()
+ constexpr __tuple_impl()
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
template <size_t ..._Uf, class ..._Tf,
template <class _Alloc, size_t ..._Uf, class ..._Tf,
size_t ..._Ul, class ..._Tl, class ..._Up>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit
__tuple_impl(allocator_arg_t, const _Alloc& __a,
__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
__tuple_constructible<_Tuple, tuple<_Tp...> >::value
>::type
>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
__tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, typename tuple_element<_Indx,
typename __make_tuple_types<_Tuple>::type>::type>(), __a,
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
{}
- template <class _Tuple>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- __tuple_assignable<_Tuple, tuple<_Tp...> >::value,
- __tuple_impl&
- >::type
- operator=(_Tuple&& __t) _NOEXCEPT_((__all<is_nothrow_assignable<_Tp&, typename tuple_element<_Indx,
- typename __make_tuple_types<_Tuple>::type>::type>::value...>::value))
- {
- __swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<typename tuple_element<_Indx,
- typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...);
- return *this;
- }
-
__tuple_impl(const __tuple_impl&) = default;
__tuple_impl(__tuple_impl&&) = default;
- _LIBCPP_INLINE_VISIBILITY
- __tuple_impl&
- operator=(const __tuple_impl& __t) _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
- {
- __swallow(__tuple_leaf<_Indx, _Tp>::operator=(static_cast<const __tuple_leaf<_Indx, _Tp>&>(__t).get())...);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __tuple_impl&
- operator=(__tuple_impl&& __t) _NOEXCEPT_((__all<is_nothrow_move_assignable<_Tp>::value...>::value))
- {
- __swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<_Tp>(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t).get()))...);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
void swap(__tuple_impl& __t)
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
{
- __swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...);
+ _VSTD::__swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...);
}
};
+template<class _Dest, class _Source, size_t ..._Np>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+void __memberwise_copy_assign(_Dest& __dest, _Source const& __source, __tuple_indices<_Np...>) {
+ _VSTD::__swallow(((_VSTD::get<_Np>(__dest) = _VSTD::get<_Np>(__source)), void(), 0)...);
+}
+template<class _Dest, class _Source, class ..._Up, size_t ..._Np>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+void __memberwise_forward_assign(_Dest& __dest, _Source&& __source, __tuple_types<_Up...>, __tuple_indices<_Np...>) {
+ _VSTD::__swallow(((
+ _VSTD::get<_Np>(__dest) = _VSTD::forward<_Up>(_VSTD::get<_Np>(__source))
+ ), void(), 0)...);
+}
template <class ..._Tp>
class _LIBCPP_TEMPLATE_VIS tuple
_BaseT __base_;
-#if defined(_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION)
- static constexpr bool _EnableImplicitReducedArityExtension = true;
-#else
- static constexpr bool _EnableImplicitReducedArityExtension = false;
-#endif
-
- template <class ..._Args>
- struct _PackExpandsToThisTuple : false_type {};
-
- template <class _Arg>
- struct _PackExpandsToThisTuple<_Arg>
- : is_same<typename __uncvref<_Arg>::type, tuple> {};
-
- template <bool _MaybeEnable, class _Dummy = void>
- struct _CheckArgsConstructor : __check_tuple_constructor_fail {};
-
- template <class _Dummy>
- struct _CheckArgsConstructor<true, _Dummy>
- {
- template <int&...>
- static constexpr bool __enable_implicit_default() {
- return __all<__is_implicitly_default_constructible<_Tp>::value... >::value;
- }
-
- template <int&...>
- static constexpr bool __enable_explicit_default() {
- return
- __all<is_default_constructible<_Tp>::value...>::value &&
- !__enable_implicit_default< >();
- }
-
-
- template <class ..._Args>
- static constexpr bool __enable_explicit() {
- return
- __tuple_constructible<
- tuple<_Args...>,
- typename __make_tuple_types<tuple,
- sizeof...(_Args) < sizeof...(_Tp) ?
- sizeof...(_Args) :
- sizeof...(_Tp)>::type
- >::value &&
- !__tuple_convertible<
- tuple<_Args...>,
- typename __make_tuple_types<tuple,
- sizeof...(_Args) < sizeof...(_Tp) ?
- sizeof...(_Args) :
- sizeof...(_Tp)>::type
- >::value &&
- __all_default_constructible<
- typename __make_tuple_types<tuple, sizeof...(_Tp),
- sizeof...(_Args) < sizeof...(_Tp) ?
- sizeof...(_Args) :
- sizeof...(_Tp)>::type
- >::value;
- }
-
- template <class ..._Args>
- static constexpr bool __enable_implicit() {
- return
- __tuple_constructible<
- tuple<_Args...>,
- typename __make_tuple_types<tuple,
- sizeof...(_Args) < sizeof...(_Tp) ?
- sizeof...(_Args) :
- sizeof...(_Tp)>::type
- >::value &&
- __tuple_convertible<
- tuple<_Args...>,
- typename __make_tuple_types<tuple,
- sizeof...(_Args) < sizeof...(_Tp) ?
- sizeof...(_Args) :
- sizeof...(_Tp)>::type
- >::value &&
- __all_default_constructible<
- typename __make_tuple_types<tuple, sizeof...(_Tp),
- sizeof...(_Args) < sizeof...(_Tp) ?
- sizeof...(_Args) :
- sizeof...(_Tp)>::type
- >::value;
- }
- };
-
- template <bool _MaybeEnable,
- bool = sizeof...(_Tp) == 1,
- class _Dummy = void>
- struct _CheckTupleLikeConstructor : __check_tuple_constructor_fail {};
-
- template <class _Dummy>
- struct _CheckTupleLikeConstructor<true, false, _Dummy>
- {
- template <class _Tuple>
- static constexpr bool __enable_implicit() {
- return __tuple_constructible<_Tuple, tuple>::value
- && __tuple_convertible<_Tuple, tuple>::value;
- }
-
- template <class _Tuple>
- static constexpr bool __enable_explicit() {
- return __tuple_constructible<_Tuple, tuple>::value
- && !__tuple_convertible<_Tuple, tuple>::value;
- }
- };
-
- template <class _Dummy>
- struct _CheckTupleLikeConstructor<true, true, _Dummy>
- {
- // This trait is used to disable the tuple-like constructor when
- // the UTypes... constructor should be selected instead.
- // See LWG issue #2549.
- template <class _Tuple>
- using _PreferTupleLikeConstructor = _Or<
- // Don't attempt the two checks below if the tuple we are given
- // has the same type as this tuple.
- _IsSame<__uncvref_t<_Tuple>, tuple>,
- _Lazy<_And,
- _Not<is_constructible<_Tp..., _Tuple>>,
- _Not<is_convertible<_Tuple, _Tp...>>
- >
- >;
-
- template <class _Tuple>
- static constexpr bool __enable_implicit() {
- return _And<
- __tuple_constructible<_Tuple, tuple>,
- __tuple_convertible<_Tuple, tuple>,
- _PreferTupleLikeConstructor<_Tuple>
- >::value;
- }
-
- template <class _Tuple>
- static constexpr bool __enable_explicit() {
- return _And<
- __tuple_constructible<_Tuple, tuple>,
- _PreferTupleLikeConstructor<_Tuple>,
- _Not<__tuple_convertible<_Tuple, tuple>>
- >::value;
- }
- };
-
- template <class _Tuple, bool _DisableIfLValue>
- using _EnableImplicitTupleLikeConstructor = _EnableIf<
- _CheckTupleLikeConstructor<
- __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value
- && !_PackExpandsToThisTuple<_Tuple>::value
- && (!is_lvalue_reference<_Tuple>::value || !_DisableIfLValue)
- >::template __enable_implicit<_Tuple>(),
- bool
- >;
-
- template <class _Tuple, bool _DisableIfLValue>
- using _EnableExplicitTupleLikeConstructor = _EnableIf<
- _CheckTupleLikeConstructor<
- __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value
- && !_PackExpandsToThisTuple<_Tuple>::value
- && (!is_lvalue_reference<_Tuple>::value || !_DisableIfLValue)
- >::template __enable_explicit<_Tuple>(),
- bool
- >;
template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Jp, tuple<_Up...> >::type& get(tuple<_Up...>&) _NOEXCEPT;
template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Jp, tuple<_Up...> >::type&& get(const tuple<_Up...>&&) _NOEXCEPT;
public:
-
- template <bool _Dummy = true, _EnableIf<
- _CheckArgsConstructor<_Dummy>::__enable_implicit_default()
- , void*> = nullptr>
+ // [tuple.cnstr]
+
+ // tuple() constructors (including allocator_arg_t variants)
+ template <template<class...> class _IsImpDefault = __is_implicitly_default_constructible, _EnableIf<
+ _And<
+ _IsImpDefault<_Tp>... // explicit check
+ >::value
+ , int> = 0>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
tuple()
- _NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
-
- template <bool _Dummy = true, _EnableIf<
- _CheckArgsConstructor<_Dummy>::__enable_explicit_default()
- , void*> = nullptr>
- explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- tuple()
- _NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
-
- tuple(tuple const&) = default;
- tuple(tuple&&) = default;
-
- template <class _AllocArgT, class _Alloc, _EnableIf<
- _CheckArgsConstructor<_IsSame<allocator_arg_t, _AllocArgT>::value >::__enable_implicit_default()
- , void*> = nullptr
- >
- _LIBCPP_INLINE_VISIBILITY
- tuple(_AllocArgT, _Alloc const& __a)
+ _NOEXCEPT_(_And<is_nothrow_default_constructible<_Tp>...>::value)
+ { }
+
+ template <template<class...> class _IsImpDefault = __is_implicitly_default_constructible,
+ template<class...> class _IsDefault = is_default_constructible, _EnableIf<
+ _And<
+ _IsDefault<_Tp>...,
+ _Not<_Lazy<_And, _IsImpDefault<_Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ explicit tuple()
+ _NOEXCEPT_(_And<is_nothrow_default_constructible<_Tp>...>::value)
+ { }
+
+ template <class _Alloc, template<class...> class _IsImpDefault = __is_implicitly_default_constructible, _EnableIf<
+ _And<
+ _IsImpDefault<_Tp>... // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple(allocator_arg_t, _Alloc const& __a)
: __base_(allocator_arg_t(), __a,
__tuple_indices<>(), __tuple_types<>(),
typename __make_tuple_indices<sizeof...(_Tp), 0>::type(),
__tuple_types<_Tp...>()) {}
- template <class _AllocArgT, class _Alloc, _EnableIf<
- _CheckArgsConstructor<_IsSame<allocator_arg_t, _AllocArgT>::value>::__enable_explicit_default()
- , void*> = nullptr
- >
- explicit _LIBCPP_INLINE_VISIBILITY
- tuple(_AllocArgT, _Alloc const& __a)
+ template <class _Alloc,
+ template<class...> class _IsImpDefault = __is_implicitly_default_constructible,
+ template<class...> class _IsDefault = is_default_constructible, _EnableIf<
+ _And<
+ _IsDefault<_Tp>...,
+ _Not<_Lazy<_And, _IsImpDefault<_Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit tuple(allocator_arg_t, _Alloc const& __a)
: __base_(allocator_arg_t(), __a,
__tuple_indices<>(), __tuple_types<>(),
typename __make_tuple_indices<sizeof...(_Tp), 0>::type(),
__tuple_types<_Tp...>()) {}
- template <bool _Dummy = true,
- typename enable_if
- <
- _CheckArgsConstructor<
- _Dummy
- >::template __enable_implicit<_Tp const&...>(),
- bool
- >::type = false
- >
+ // tuple(const T&...) constructors (including allocator_arg_t variants)
+ template <template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) >= 1>,
+ is_copy_constructible<_Tp>...,
+ is_convertible<const _Tp&, _Tp>... // explicit check
+ >::value
+ , int> = 0>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
+ tuple(const _Tp& ... __t)
+ _NOEXCEPT_(_And<is_nothrow_copy_constructible<_Tp>...>::value)
: __base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
typename __make_tuple_indices<0>::type(),
__t...
) {}
- template <bool _Dummy = true,
- typename enable_if
- <
- _CheckArgsConstructor<
- _Dummy
- >::template __enable_explicit<_Tp const&...>(),
- bool
- >::type = false
- >
+ template <template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) >= 1>,
+ is_copy_constructible<_Tp>...,
+ _Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> > // explicit check
+ >::value
+ , int> = 0>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
+ explicit tuple(const _Tp& ... __t)
+ _NOEXCEPT_(_And<is_nothrow_copy_constructible<_Tp>...>::value)
: __base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
typename __make_tuple_indices<0>::type(),
__t...
) {}
- template <class _Alloc, bool _Dummy = true,
- typename enable_if
- <
- _CheckArgsConstructor<
- _Dummy
- >::template __enable_implicit<_Tp const&...>(),
- bool
- >::type = false
- >
- _LIBCPP_INLINE_VISIBILITY
- tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
+ template <class _Alloc, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) >= 1>,
+ is_copy_constructible<_Tp>...,
+ is_convertible<const _Tp&, _Tp>... // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
: __base_(allocator_arg_t(), __a,
typename __make_tuple_indices<sizeof...(_Tp)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
__t...
) {}
- template <class _Alloc, bool _Dummy = true,
- typename enable_if
- <
- _CheckArgsConstructor<
- _Dummy
- >::template __enable_explicit<_Tp const&...>(),
- bool
- >::type = false
- >
- _LIBCPP_INLINE_VISIBILITY
- explicit
- tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
+ template <class _Alloc, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) >= 1>,
+ is_copy_constructible<_Tp>...,
+ _Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
: __base_(allocator_arg_t(), __a,
typename __make_tuple_indices<sizeof...(_Tp)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
__t...
) {}
- template <class ..._Up,
- bool _PackIsTuple = _PackExpandsToThisTuple<_Up...>::value,
- typename enable_if
- <
- _CheckArgsConstructor<
- sizeof...(_Up) == sizeof...(_Tp)
- && !_PackIsTuple
- >::template __enable_implicit<_Up...>() ||
- _CheckArgsConstructor<
- _EnableImplicitReducedArityExtension
- && sizeof...(_Up) < sizeof...(_Tp)
- && !_PackIsTuple
- >::template __enable_implicit<_Up...>(),
- bool
- >::type = false
- >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- tuple(_Up&&... __u)
- _NOEXCEPT_((
- is_nothrow_constructible<_BaseT,
- typename __make_tuple_indices<sizeof...(_Up)>::type,
- typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
- typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
- typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type,
- _Up...
- >::value
- ))
- : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
+ // tuple(U&& ...) constructors (including allocator_arg_t variants)
+ template <class ..._Up> struct _IsThisTuple : false_type { };
+ template <class _Up> struct _IsThisTuple<_Up> : is_same<__uncvref_t<_Up>, tuple> { };
+
+ template <class ..._Up>
+ struct _EnableUTypesCtor : _And<
+ _BoolConstant<sizeof...(_Tp) >= 1>,
+ _Not<_IsThisTuple<_Up...> >, // extension to allow mis-behaved user constructors
+ is_constructible<_Tp, _Up>...
+ > { };
+
+ template <class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableUTypesCtor<_Up...>,
+ is_convertible<_Up, _Tp>... // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ tuple(_Up&&... __u)
+ _NOEXCEPT_((_And<is_nothrow_constructible<_Tp, _Up>...>::value))
+ : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
_VSTD::forward<_Up>(__u)...) {}
- template <class ..._Up,
- typename enable_if
- <
- _CheckArgsConstructor<
- sizeof...(_Up) <= sizeof...(_Tp)
- && !_PackExpandsToThisTuple<_Up...>::value
- >::template __enable_explicit<_Up...>() ||
- _CheckArgsConstructor<
- !_EnableImplicitReducedArityExtension
- && sizeof...(_Up) < sizeof...(_Tp)
- && !_PackExpandsToThisTuple<_Up...>::value
- >::template __enable_implicit<_Up...>(),
- bool
- >::type = false
- >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit
- tuple(_Up&&... __u)
- _NOEXCEPT_((
- is_nothrow_constructible<_BaseT,
- typename __make_tuple_indices<sizeof...(_Up)>::type,
- typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
- typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
- typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type,
- _Up...
- >::value
- ))
- : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
+ template <class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableUTypesCtor<_Up...>,
+ _Not<_Lazy<_And, is_convertible<_Up, _Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit tuple(_Up&&... __u)
+ _NOEXCEPT_((_And<is_nothrow_constructible<_Tp, _Up>...>::value))
+ : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
_VSTD::forward<_Up>(__u)...) {}
- template <class _Alloc, class ..._Up,
- typename enable_if
- <
- _CheckArgsConstructor<
- sizeof...(_Up) == sizeof...(_Tp) &&
- !_PackExpandsToThisTuple<_Up...>::value
- >::template __enable_implicit<_Up...>(),
- bool
- >::type = false
- >
- _LIBCPP_INLINE_VISIBILITY
- tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
- : __base_(allocator_arg_t(), __a,
+ template <class _Alloc, class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableUTypesCtor<_Up...>,
+ is_convertible<_Up, _Tp>... // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
+ : __base_(allocator_arg_t(), __a,
typename __make_tuple_indices<sizeof...(_Up)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
_VSTD::forward<_Up>(__u)...) {}
- template <class _Alloc, class ..._Up,
- typename enable_if
- <
- _CheckArgsConstructor<
- sizeof...(_Up) == sizeof...(_Tp) &&
- !_PackExpandsToThisTuple<_Up...>::value
- >::template __enable_explicit<_Up...>(),
- bool
- >::type = false
- >
- _LIBCPP_INLINE_VISIBILITY
- explicit
- tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
- : __base_(allocator_arg_t(), __a,
+ template <class _Alloc, class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableUTypesCtor<_Up...>,
+ _Not<_Lazy<_And, is_convertible<_Up, _Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
+ : __base_(allocator_arg_t(), __a,
typename __make_tuple_indices<sizeof...(_Up)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
_VSTD::forward<_Up>(__u)...) {}
- template <class _Tuple, _EnableImplicitTupleLikeConstructor<_Tuple, true> = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, _Tuple>::value))
- : __base_(_VSTD::forward<_Tuple>(__t)) {}
+ // Copy and move constructors (including the allocator_arg_t variants)
+ tuple(const tuple&) = default;
+ tuple(tuple&&) = default;
- template <class _Tuple, _EnableImplicitTupleLikeConstructor<const _Tuple&, false> = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- tuple(const _Tuple& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, const _Tuple&>::value))
- : __base_(__t) {}
- template <class _Tuple, _EnableExplicitTupleLikeConstructor<_Tuple, true> = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit
- tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, _Tuple>::value))
- : __base_(_VSTD::forward<_Tuple>(__t)) {}
+ template <class _Alloc, template<class...> class _And = _And, _EnableIf<
+ _And<is_copy_constructible<_Tp>...>::value
+ , int> = 0>
+ tuple(allocator_arg_t, const _Alloc& __alloc, const tuple& __t)
+ : __base_(allocator_arg_t(), __alloc, __t)
+ { }
+
+ template <class _Alloc, template<class...> class _And = _And, _EnableIf<
+ _And<is_move_constructible<_Tp>...>::value
+ , int> = 0>
+ tuple(allocator_arg_t, const _Alloc& __alloc, tuple&& __t)
+ : __base_(allocator_arg_t(), __alloc, _VSTD::move(__t))
+ { }
+
+ // tuple(const tuple<U...>&) constructors (including allocator_arg_t variants)
+ template <class ..._Up>
+ struct _EnableCopyFromOtherTuple : _And<
+ _Not<is_same<tuple<_Tp...>, tuple<_Up...> > >,
+ _Lazy<_Or,
+ _BoolConstant<sizeof...(_Tp) != 1>,
+ // _Tp and _Up are 1-element packs - the pack expansions look
+ // weird to avoid tripping up the type traits in degenerate cases
+ _Lazy<_And,
+ _Not<is_convertible<const tuple<_Up>&, _Tp> >...,
+ _Not<is_constructible<_Tp, const tuple<_Up>&> >...
+ >
+ >,
+ is_constructible<_Tp, const _Up&>...
+ > { };
+
+ template <class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableCopyFromOtherTuple<_Up...>,
+ is_convertible<const _Up&, _Tp>... // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ tuple(const tuple<_Up...>& __t)
+ _NOEXCEPT_((_And<is_nothrow_constructible<_Tp, const _Up&>...>::value))
+ : __base_(__t)
+ { }
+
+ template <class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableCopyFromOtherTuple<_Up...>,
+ _Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit tuple(const tuple<_Up...>& __t)
+ _NOEXCEPT_((_And<is_nothrow_constructible<_Tp, const _Up&>...>::value))
+ : __base_(__t)
+ { }
+
+ template <class ..._Up, class _Alloc, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableCopyFromOtherTuple<_Up...>,
+ is_convertible<const _Up&, _Tp>... // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple(allocator_arg_t, const _Alloc& __a, const tuple<_Up...>& __t)
+ : __base_(allocator_arg_t(), __a, __t)
+ { }
+
+ template <class ..._Up, class _Alloc, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableCopyFromOtherTuple<_Up...>,
+ _Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit tuple(allocator_arg_t, const _Alloc& __a, const tuple<_Up...>& __t)
+ : __base_(allocator_arg_t(), __a, __t)
+ { }
+
+ // tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)
+ template <class ..._Up>
+ struct _EnableMoveFromOtherTuple : _And<
+ _Not<is_same<tuple<_Tp...>, tuple<_Up...> > >,
+ _Lazy<_Or,
+ _BoolConstant<sizeof...(_Tp) != 1>,
+ // _Tp and _Up are 1-element packs - the pack expansions look
+ // weird to avoid tripping up the type traits in degenerate cases
+ _Lazy<_And,
+ _Not<is_convertible<tuple<_Up>, _Tp> >...,
+ _Not<is_constructible<_Tp, tuple<_Up> > >...
+ >
+ >,
+ is_constructible<_Tp, _Up>...
+ > { };
+
+ template <class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableMoveFromOtherTuple<_Up...>,
+ is_convertible<_Up, _Tp>... // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ tuple(tuple<_Up...>&& __t)
+ _NOEXCEPT_((_And<is_nothrow_constructible<_Tp, _Up>...>::value))
+ : __base_(_VSTD::move(__t))
+ { }
+
+ template <class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableMoveFromOtherTuple<_Up...>,
+ _Not<_Lazy<_And, is_convertible<_Up, _Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit tuple(tuple<_Up...>&& __t)
+ _NOEXCEPT_((_And<is_nothrow_constructible<_Tp, _Up>...>::value))
+ : __base_(_VSTD::move(__t))
+ { }
+
+ template <class _Alloc, class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableMoveFromOtherTuple<_Up...>,
+ is_convertible<_Up, _Tp>... // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple(allocator_arg_t, const _Alloc& __a, tuple<_Up...>&& __t)
+ : __base_(allocator_arg_t(), __a, _VSTD::move(__t))
+ { }
+
+ template <class _Alloc, class ..._Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>,
+ _EnableMoveFromOtherTuple<_Up...>,
+ _Not<_Lazy<_And, is_convertible<_Up, _Tp>...> > // explicit check
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit tuple(allocator_arg_t, const _Alloc& __a, tuple<_Up...>&& __t)
+ : __base_(allocator_arg_t(), __a, _VSTD::move(__t))
+ { }
+
+ // tuple(const pair<U1, U2>&) constructors (including allocator_arg_t variants)
+ template <class _Up1, class _Up2, class ..._DependentTp>
+ struct _EnableImplicitCopyFromPair : _And<
+ is_constructible<_FirstType<_DependentTp...>, const _Up1&>,
+ is_constructible<_SecondType<_DependentTp...>, const _Up2&>,
+ is_convertible<const _Up1&, _FirstType<_DependentTp...> >, // explicit check
+ is_convertible<const _Up2&, _SecondType<_DependentTp...> >
+ > { };
+
+ template <class _Up1, class _Up2, class ..._DependentTp>
+ struct _EnableExplicitCopyFromPair : _And<
+ is_constructible<_FirstType<_DependentTp...>, const _Up1&>,
+ is_constructible<_SecondType<_DependentTp...>, const _Up2&>,
+ _Not<is_convertible<const _Up1&, _FirstType<_DependentTp...> > >, // explicit check
+ _Not<is_convertible<const _Up2&, _SecondType<_DependentTp...> > >
+ > { };
+
+ template <class _Up1, class _Up2, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ _EnableImplicitCopyFromPair<_Up1, _Up2, _Tp...>
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ tuple(const pair<_Up1, _Up2>& __p)
+ _NOEXCEPT_((_And<
+ is_nothrow_constructible<_FirstType<_Tp...>, const _Up1&>,
+ is_nothrow_constructible<_SecondType<_Tp...>, const _Up2&>
+ >::value))
+ : __base_(__p)
+ { }
+
+ template <class _Up1, class _Up2, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ _EnableExplicitCopyFromPair<_Up1, _Up2, _Tp...>
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit tuple(const pair<_Up1, _Up2>& __p)
+ _NOEXCEPT_((_And<
+ is_nothrow_constructible<_FirstType<_Tp...>, const _Up1&>,
+ is_nothrow_constructible<_SecondType<_Tp...>, const _Up2&>
+ >::value))
+ : __base_(__p)
+ { }
+
+ template <class _Alloc, class _Up1, class _Up2, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ _EnableImplicitCopyFromPair<_Up1, _Up2, _Tp...>
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple(allocator_arg_t, const _Alloc& __a, const pair<_Up1, _Up2>& __p)
+ : __base_(allocator_arg_t(), __a, __p)
+ { }
+
+ template <class _Alloc, class _Up1, class _Up2, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ _EnableExplicitCopyFromPair<_Up1, _Up2, _Tp...>
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit tuple(allocator_arg_t, const _Alloc& __a, const pair<_Up1, _Up2>& __p)
+ : __base_(allocator_arg_t(), __a, __p)
+ { }
+
+ // tuple(pair<U1, U2>&&) constructors (including allocator_arg_t variants)
+ template <class _Up1, class _Up2, class ..._DependentTp>
+ struct _EnableImplicitMoveFromPair : _And<
+ is_constructible<_FirstType<_DependentTp...>, _Up1>,
+ is_constructible<_SecondType<_DependentTp...>, _Up2>,
+ is_convertible<_Up1, _FirstType<_DependentTp...> >, // explicit check
+ is_convertible<_Up2, _SecondType<_DependentTp...> >
+ > { };
+
+ template <class _Up1, class _Up2, class ..._DependentTp>
+ struct _EnableExplicitMoveFromPair : _And<
+ is_constructible<_FirstType<_DependentTp...>, _Up1>,
+ is_constructible<_SecondType<_DependentTp...>, _Up2>,
+ _Not<is_convertible<_Up1, _FirstType<_DependentTp...> > >, // explicit check
+ _Not<is_convertible<_Up2, _SecondType<_DependentTp...> > >
+ > { };
+
+ template <class _Up1, class _Up2, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ _EnableImplicitMoveFromPair<_Up1, _Up2, _Tp...>
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ tuple(pair<_Up1, _Up2>&& __p)
+ _NOEXCEPT_((_And<
+ is_nothrow_constructible<_FirstType<_Tp...>, _Up1>,
+ is_nothrow_constructible<_SecondType<_Tp...>, _Up2>
+ >::value))
+ : __base_(_VSTD::move(__p))
+ { }
+
+ template <class _Up1, class _Up2, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ _EnableExplicitMoveFromPair<_Up1, _Up2, _Tp...>
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit tuple(pair<_Up1, _Up2>&& __p)
+ _NOEXCEPT_((_And<
+ is_nothrow_constructible<_FirstType<_Tp...>, _Up1>,
+ is_nothrow_constructible<_SecondType<_Tp...>, _Up2>
+ >::value))
+ : __base_(_VSTD::move(__p))
+ { }
+
+ template <class _Alloc, class _Up1, class _Up2, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ _EnableImplicitMoveFromPair<_Up1, _Up2, _Tp...>
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple(allocator_arg_t, const _Alloc& __a, pair<_Up1, _Up2>&& __p)
+ : __base_(allocator_arg_t(), __a, _VSTD::move(__p))
+ { }
+
+ template <class _Alloc, class _Up1, class _Up2, template<class...> class _And = _And, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ _EnableExplicitMoveFromPair<_Up1, _Up2, _Tp...>
+ >::value
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ explicit tuple(allocator_arg_t, const _Alloc& __a, pair<_Up1, _Up2>&& __p)
+ : __base_(allocator_arg_t(), __a, _VSTD::move(__p))
+ { }
+
+ // [tuple.assign]
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple& operator=(_If<_And<is_copy_assignable<_Tp>...>::value, tuple, __nat> const& __tuple)
+ _NOEXCEPT_((_And<is_nothrow_copy_assignable<_Tp>...>::value))
+ {
+ _VSTD::__memberwise_copy_assign(*this, __tuple,
+ typename __make_tuple_indices<sizeof...(_Tp)>::type());
+ return *this;
+ }
- template <class _Tuple, _EnableExplicitTupleLikeConstructor<const _Tuple&, false> = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit
- tuple(const _Tuple& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, const _Tuple&>::value))
- : __base_(__t) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple& operator=(_If<_And<is_move_assignable<_Tp>...>::value, tuple, __nat>&& __tuple)
+ _NOEXCEPT_((_And<is_nothrow_move_assignable<_Tp>...>::value))
+ {
+ _VSTD::__memberwise_forward_assign(*this, _VSTD::move(__tuple),
+ __tuple_types<_Tp...>(),
+ typename __make_tuple_indices<sizeof...(_Tp)>::type());
+ return *this;
+ }
- template <class _Alloc, class _Tuple,
- typename enable_if
- <
- _CheckTupleLikeConstructor<
- __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value
- >::template __enable_implicit<_Tuple>(),
- bool
- >::type = false
- >
- _LIBCPP_INLINE_VISIBILITY
- tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
- : __base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
+ template<class... _Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == sizeof...(_Up)>,
+ is_assignable<_Tp&, _Up const&>...
+ >::value
+ ,int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple& operator=(tuple<_Up...> const& __tuple)
+ _NOEXCEPT_((_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value))
+ {
+ _VSTD::__memberwise_copy_assign(*this, __tuple,
+ typename __make_tuple_indices<sizeof...(_Tp)>::type());
+ return *this;
+ }
- template <class _Alloc, class _Tuple,
- typename enable_if
- <
- _CheckTupleLikeConstructor<
- __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value
- >::template __enable_explicit<_Tuple>(),
- bool
- >::type = false
- >
- _LIBCPP_INLINE_VISIBILITY
- explicit
- tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
- : __base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
+ template<class... _Up, _EnableIf<
+ _And<
+ _BoolConstant<sizeof...(_Tp) == sizeof...(_Up)>,
+ is_assignable<_Tp&, _Up>...
+ >::value
+ ,int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple& operator=(tuple<_Up...>&& __tuple)
+ _NOEXCEPT_((_And<is_nothrow_assignable<_Tp&, _Up>...>::value))
+ {
+ _VSTD::__memberwise_forward_assign(*this, _VSTD::move(__tuple),
+ __tuple_types<_Up...>(),
+ typename __make_tuple_indices<sizeof...(_Tp)>::type());
+ return *this;
+ }
- using _CanCopyAssign = __all<is_copy_assignable<_Tp>::value...>;
- using _CanMoveAssign = __all<is_move_assignable<_Tp>::value...>;
+ template<class _Up1, class _Up2, class _Dep = true_type, _EnableIf<
+ _And<_Dep,
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ is_assignable<_FirstType<_Tp..., _Dep>&, _Up1 const&>,
+ is_assignable<_SecondType<_Tp..., _Dep>&, _Up2 const&>
+ >::value
+ ,int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple& operator=(pair<_Up1, _Up2> const& __pair)
+ _NOEXCEPT_((_And<
+ is_nothrow_assignable<_FirstType<_Tp...>&, _Up1 const&>,
+ is_nothrow_assignable<_SecondType<_Tp...>&, _Up2 const&>
+ >::value))
+ {
+ _VSTD::get<0>(*this) = __pair.first;
+ _VSTD::get<1>(*this) = __pair.second;
+ return *this;
+ }
- _LIBCPP_INLINE_VISIBILITY
- tuple& operator=(typename conditional<_CanCopyAssign::value, tuple, __nat>::type const& __t)
- _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
+ template<class _Up1, class _Up2, class _Dep = true_type, _EnableIf<
+ _And<_Dep,
+ _BoolConstant<sizeof...(_Tp) == 2>,
+ is_assignable<_FirstType<_Tp..., _Dep>&, _Up1>,
+ is_assignable<_SecondType<_Tp..., _Dep>&, _Up2>
+ >::value
+ ,int> = 0>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple& operator=(pair<_Up1, _Up2>&& __pair)
+ _NOEXCEPT_((_And<
+ is_nothrow_assignable<_FirstType<_Tp...>&, _Up1>,
+ is_nothrow_assignable<_SecondType<_Tp...>&, _Up2>
+ >::value))
{
- __base_.operator=(__t.__base_);
+ _VSTD::get<0>(*this) = _VSTD::forward<_Up1>(__pair.first);
+ _VSTD::get<1>(*this) = _VSTD::forward<_Up2>(__pair.second);
return *this;
}
- _LIBCPP_INLINE_VISIBILITY
- tuple& operator=(typename conditional<_CanMoveAssign::value, tuple, __nat>::type&& __t)
- _NOEXCEPT_((__all<is_nothrow_move_assignable<_Tp>::value...>::value))
+ // EXTENSION
+ template<class _Up, size_t _Np, class = _EnableIf<
+ _And<
+ _BoolConstant<_Np == sizeof...(_Tp)>,
+ is_assignable<_Tp&, _Up const&>...
+ >::value
+ > >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple& operator=(array<_Up, _Np> const& __array)
+ _NOEXCEPT_((_And<is_nothrow_assignable<_Tp&, _Up const&>...>::value))
{
- __base_.operator=(static_cast<_BaseT&&>(__t.__base_));
+ _VSTD::__memberwise_copy_assign(*this, __array,
+ typename __make_tuple_indices<sizeof...(_Tp)>::type());
return *this;
}
- template <class _Tuple,
- class = typename enable_if
- <
- __tuple_assignable<_Tuple, tuple>::value
- >::type
- >
- _LIBCPP_INLINE_VISIBILITY
- tuple&
- operator=(_Tuple&& __t) _NOEXCEPT_((is_nothrow_assignable<_BaseT&, _Tuple>::value))
- {
- __base_.operator=(_VSTD::forward<_Tuple>(__t));
- return *this;
- }
+ // EXTENSION
+ template<class _Up, size_t _Np, class = void, class = _EnableIf<
+ _And<
+ _BoolConstant<_Np == sizeof...(_Tp)>,
+ is_assignable<_Tp&, _Up>...
+ >::value
+ > >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ tuple& operator=(array<_Up, _Np>&& __array)
+ _NOEXCEPT_((_And<is_nothrow_assignable<_Tp&, _Up>...>::value))
+ {
+ _VSTD::__memberwise_forward_assign(*this, _VSTD::move(__array),
+ __tuple_types<_If<true, _Up, _Tp>...>(),
+ typename __make_tuple_indices<sizeof...(_Tp)>::type());
+ return *this;
+ }
- _LIBCPP_INLINE_VISIBILITY
+ // [tuple.swap]
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void swap(tuple& __t) _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
{__base_.swap(__t.__base_);}
};
class _LIBCPP_TEMPLATE_VIS tuple<>
{
public:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR tuple() _NOEXCEPT = default;
+ _LIBCPP_INLINE_VISIBILITY constexpr
+ tuple() _NOEXCEPT = default;
template <class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
tuple(allocator_arg_t, const _Alloc&) _NOEXCEPT {}
template <class _Alloc>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
tuple(allocator_arg_t, const _Alloc&, const tuple&) _NOEXCEPT {}
template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
tuple(array<_Up, 0>) _NOEXCEPT {}
template <class _Alloc, class _Up>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void swap(tuple&) _NOEXCEPT {}
};
#endif
template <class ..._Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
typename enable_if
<
__all<__is_swappable<_Tp>::value...>::value,
namespace __find_detail {
-static constexpr size_t __not_found = -1;
+static constexpr size_t __not_found = static_cast<size_t>(-1);
static constexpr size_t __ambiguous = __not_found - 1;
inline _LIBCPP_INLINE_VISIBILITY
template <class _T1, class _T2>
template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
pair<_T1, _T2>::pair(piecewise_construct_t,
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
__tuple_indices<_I1...>, __tuple_indices<_I2...>)
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_TUPLE
+#endif // _LIBCPP_TUPLE
template <class T> struct is_arithmetic;
template <class T> struct is_fundamental;
template <class T> struct is_member_pointer;
+ template <class T> struct is_scoped_enum; // C++2b
template <class T> struct is_scalar;
template <class T> struct is_object;
template <class T> struct is_compound;
template <class T> struct is_trivial;
template <class T> struct is_trivially_copyable;
template <class T> struct is_standard_layout;
- template <class T> struct is_literal_type;
+ template <class T> struct is_literal_type; // Deprecated in C++17; removed in C++20
template <class T> struct is_empty;
template <class T> struct is_polymorphic;
template <class T> struct is_abstract;
template <class T> struct decay;
template <class... T> struct common_type;
template <class T> struct underlying_type;
- template <class> class result_of; // undefined
- template <class Fn, class... ArgTypes> class result_of<Fn(ArgTypes...)>;
+ template <class> class result_of; // undefined; deprecated in C++17; removed in C++20
+ template <class Fn, class... ArgTypes> class result_of<Fn(ArgTypes...)>; // deprecated in C++17; removed in C++20
template <class Fn, class... ArgTypes> struct invoke_result; // C++17
// const-volatile modifications:
using add_pointer_t = typename add_pointer<T>::type; // C++14
// other transformations:
- template <size_t Len, std::size_t Align=default-alignment>
+ template <size_t Len, size_t Align=default-alignment>
using aligned_storage_t = typename aligned_storage<Len,Align>::type; // C++14
- template <std::size_t Len, class... Types>
+ template <size_t Len, class... Types>
using aligned_union_t = typename aligned_union<Len,Types...>::type; // C++14
template <class T>
using remove_cvref_t = typename remove_cvref<T>::type; // C++20
template <class T>
using underlying_type_t = typename underlying_type<T>::type; // C++14
template <class T>
- using result_of_t = typename result_of<T>::type; // C++14
+ using result_of_t = typename result_of<T>::type; // C++14; deprecated in C++17; removed in C++20
template <class Fn, class... ArgTypes>
using invoke_result_t = typename invoke_result<Fn, ArgTypes...>::type; // C++17
= is_compound<T>::value; // C++17
template <class T> inline constexpr bool is_member_pointer_v
= is_member_pointer<T>::value; // C++17
+ template <class T> inline constexpr bool is_scoped_enum_v
+ = is_scoped_enum<T>::value; // C++2b
// See C++14 20.10.4.3, type properties
template <class T> inline constexpr bool is_const_v
template <class T> inline constexpr bool is_pod_v
= is_pod<T>::value; // C++17
template <class T> inline constexpr bool is_literal_type_v
- = is_literal_type<T>::value; // C++17
+ = is_literal_type<T>::value; // C++17; deprecated in C++17; removed in C++20
template <class T> inline constexpr bool is_empty_v
= is_empty<T>::value; // C++17
template <class T> inline constexpr bool is_polymorphic_v
using _EnableIfImpl _LIBCPP_NODEBUG_TYPE = _Tp;
template <class _Result, class _First, class ..._Rest>
using _OrImpl _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_First::value != true && sizeof...(_Rest) != 0>::template _OrImpl<_First, _Rest...>;
- template <class _Result, class _First, class ..._Rest>
- using _AndImpl _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_First::value == true && sizeof...(_Rest) != 0>::template _AndImpl<_First, _Rest...>;
};
template <>
using _SelectApplyImpl _LIBCPP_NODEBUG_TYPE = _SecondFn<_Args...>;
template <class _Result, class ...>
using _OrImpl _LIBCPP_NODEBUG_TYPE = _Result;
- template <class _Result, class ...>
- using _AndImpl _LIBCPP_NODEBUG_TYPE = _Result;
};
template <bool _Cond, class _Ret = void>
using _EnableIf _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_Cond>::template _EnableIfImpl<_Ret>;
using _If _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_Cond>::template _SelectImpl<_IfRes, _ElseRes>;
template <class ..._Rest>
using _Or _LIBCPP_NODEBUG_TYPE = typename _MetaBase< sizeof...(_Rest) != 0 >::template _OrImpl<false_type, _Rest...>;
-template <class ..._Rest>
-using _And _LIBCPP_NODEBUG_TYPE = typename _MetaBase< sizeof...(_Rest) != 0 >::template _AndImpl<true_type, _Rest...>;
template <class _Pred>
struct _Not : _BoolConstant<!_Pred::value> {};
template <class ..._Args>
template <class ..._Args>
using _SecondType _LIBCPP_NODEBUG_TYPE = typename _MetaBase<(sizeof...(_Args) >= 2)>::template _SecondImpl<_Args...>;
+template <class ...> using __expand_to_true = true_type;
+template <class ..._Pred>
+__expand_to_true<_EnableIf<_Pred::value>...> __and_helper(int);
+template <class ...>
+false_type __and_helper(...);
+template <class ..._Pred>
+using _And _LIBCPP_NODEBUG_TYPE = decltype(__and_helper<_Pred...>(0));
+
template <template <class...> class _Func, class ..._Args>
struct _Lazy : _Func<_Args...> {};
false_type __sfinae_test_impl(...);
template <template <class ...> class _Templ, class ..._Args>
-using _IsValidExpansion _LIBCPP_NODEBUG_TYPE = decltype(std::__sfinae_test_impl<_Templ, _Args...>(0));
+using _IsValidExpansion _LIBCPP_NODEBUG_TYPE = decltype(__sfinae_test_impl<_Templ, _Args...>(0));
template <class>
struct __void_t { typedef void type; };
template <class _Tp>
struct __identity { typedef _Tp type; };
+template <class _Tp>
+using __identity_t _LIBCPP_NODEBUG_TYPE = typename __identity<_Tp>::type;
+
template <class _Tp, bool>
struct _LIBCPP_TEMPLATE_VIS __dependent_type : public _Tp {};
#ifdef __clang__
__is_same(_Tp, _Up)
#else
- _VSTD::is_same<_Tp, _Up>::value
+ is_same<_Tp, _Up>::value
#endif
>;
#ifdef __clang__
!__is_same(_Tp, _Up)
#else
- !_VSTD::is_same<_Tp, _Up>::value
+ !is_same<_Tp, _Up>::value
#endif
>;
__test_for_primary_template, _Tp
>;
-// addressof
-#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
-
-template <class _Tp>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
-_LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
-_Tp*
-addressof(_Tp& __x) _NOEXCEPT
-{
- return __builtin_addressof(__x);
-}
-
-#else
-
-template <class _Tp>
-inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
-_Tp*
-addressof(_Tp& __x) _NOEXCEPT
-{
- return reinterpret_cast<_Tp *>(
- const_cast<char *>(&reinterpret_cast<const volatile char &>(__x)));
-}
-
-#endif // _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
-
-#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
-// Objective-C++ Automatic Reference Counting uses qualified pointers
-// that require special addressof() signatures. When
-// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
-// itself is providing these definitions. Otherwise, we provide them.
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__strong _Tp*
-addressof(__strong _Tp& __x) _NOEXCEPT
-{
- return &__x;
-}
-
-#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__weak _Tp*
-addressof(__weak _Tp& __x) _NOEXCEPT
-{
- return &__x;
-}
-#endif
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__autoreleasing _Tp*
-addressof(__autoreleasing _Tp& __x) _NOEXCEPT
-{
- return &__x;
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__unsafe_unretained _Tp*
-addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
-{
- return &__x;
-}
-#endif
-
-#if !defined(_LIBCPP_CXX03_LANG)
-template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;
-#endif
-
struct __two {char __lx[2];};
// helper class:
#endif // __has_keyword(__is_integral)
+// __libcpp_is_signed_integer, __libcpp_is_unsigned_integer
+
+// [basic.fundamental] defines five standard signed integer types;
+// __int128_t is an extended signed integer type.
+// The signed and unsigned integer types, plus bool and the
+// five types with "char" in their name, compose the "integral" types.
+
+template <class _Tp> struct __libcpp_is_signed_integer : public false_type {};
+template <> struct __libcpp_is_signed_integer<signed char> : public true_type {};
+template <> struct __libcpp_is_signed_integer<signed short> : public true_type {};
+template <> struct __libcpp_is_signed_integer<signed int> : public true_type {};
+template <> struct __libcpp_is_signed_integer<signed long> : public true_type {};
+template <> struct __libcpp_is_signed_integer<signed long long> : public true_type {};
+#ifndef _LIBCPP_HAS_NO_INT128
+template <> struct __libcpp_is_signed_integer<__int128_t> : public true_type {};
+#endif
+
+template <class _Tp> struct __libcpp_is_unsigned_integer : public false_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned char> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned short> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned int> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned long> : public true_type {};
+template <> struct __libcpp_is_unsigned_integer<unsigned long long> : public true_type {};
+#ifndef _LIBCPP_HAS_NO_INT128
+template <> struct __libcpp_is_unsigned_integer<__uint128_t> : public true_type {};
+#endif
+
// is_floating_point
template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
// is_pointer
-// In clang 10.0.0 and earlier __is_pointer didn't work with Objective-C types.
-#if __has_keyword(__is_pointer) && _LIBCPP_CLANG_VER > 1000
+// Before Clang 11 / AppleClang 12.0.5, __is_pointer didn't work for Objective-C types.
+#if __has_keyword(__is_pointer) && \
+ !(defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1100) && \
+ !(defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 1205)
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_pointer : _BoolConstant<__is_pointer(_Tp)> { };
// is_fundamental
-// In clang 9 and lower, this builtin did not work for nullptr_t. Additionally, in C++03 mode,
-// nullptr isn't defined by the compiler so, this builtin won't work.
-#if __has_keyword(__is_fundamental) && _LIBCPP_CLANG_VER > 900 && !defined(_LIBCPP_CXX03_LANG)
+// Before Clang 10, __is_fundamental didn't work for nullptr_t.
+// In C++03 nullptr_t is library-provided but must still count as "fundamental."
+#if __has_keyword(__is_fundamental) && \
+ !(defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1000) && \
+ !defined(_LIBCPP_CXX03_LANG)
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_fundamental : _BoolConstant<__is_fundamental(_Tp)> { };
// is_scalar
-// >= 11 because in C++03 nullptr isn't actually nullptr
+// In C++03 nullptr_t is library-provided but must still count as "scalar."
#if __has_keyword(__is_scalar) && !defined(_LIBCPP_CXX03_LANG)
template<class _Tp>
_LIBCPP_SUPPRESS_DEPRECATED_POP
template <class _Tp>
-decltype(_VSTD::__declval<_Tp>(0))
+decltype(__declval<_Tp>(0))
declval() _NOEXCEPT;
// __uncvref
// is_signed
-// In clang 9 and earlier, this builtin did not work for floating points or enums
-#if __has_keyword(__is_signed) && _LIBCPP_CLANG_VER > 900
+// Before Clang 10, __is_signed didn't work for floating-point types or enums.
+#if __has_keyword(__is_signed) && \
+ !(defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1000)
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_signed : _BoolConstant<__is_signed(_Tp)> { };
// is_unsigned
-#if __has_keyword(__is_unsigned)
+// Before Clang 13, __is_unsigned returned true for enums with signed underlying type.
+// No currently-released version of AppleClang contains the fixed intrinsic.
+#if __has_keyword(__is_unsigned) && \
+ !(defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1300) && \
+ !defined(_LIBCPP_APPLE_CLANG_VER)
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_unsigned : _BoolConstant<__is_unsigned(_Tp)> { };
= is_base_of<_Bp, _Dp>::value;
#endif
+// __is_core_convertible
+
+// [conv.general]/3 says "E is convertible to T" whenever "T t=E;" is well-formed.
+// We can't test for that, but we can test implicit convertibility by passing it
+// to a function. Notice that __is_core_convertible<void,void> is false,
+// and __is_core_convertible<immovable-type,immovable-type> is true in C++17 and later.
+
+template <class _Tp, class _Up, class = void>
+struct __is_core_convertible : public false_type {};
+
+template <class _Tp, class _Up>
+struct __is_core_convertible<_Tp, _Up, decltype(
+ static_cast<void(*)(_Up)>(0) ( static_cast<_Tp(*)()>(0)() )
+)> : public true_type {};
+
// is_convertible
#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
template <class _From, class _To>
struct __is_convertible_test<_From, _To,
- decltype(_VSTD::__is_convertible_imp::__test_convert<_To>(_VSTD::declval<_From>()))> : public true_type
+ decltype(__is_convertible_imp::__test_convert<_To>(declval<_From>()))> : public true_type
{};
template <class _Tp, bool _IsArray = is_array<_Tp>::value,
static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
};
-#endif // __has_feature(is_convertible_to)
+#endif // __has_feature(is_convertible_to)
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _From, class _To>
static void __test_noexcept(_Tp) noexcept;
template<typename _Fm, typename _To>
-static bool_constant<noexcept(__test_noexcept<_To>(declval<_Fm>()))>
+static bool_constant<noexcept(_VSTD::__test_noexcept<_To>(declval<_Fm>()))>
__is_nothrow_convertible_test();
template <typename _Fm, typename _To>
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_empty : public __libcpp_empty<_Tp> {};
-#endif // __has_feature(is_empty)
+#endif // __has_feature(is_empty)
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp>
template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type;
#endif
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp>
+_LIBCPP_NODISCARD_ATTRIBUTE _LIBCPP_INLINE_VISIBILITY constexpr
+typename make_unsigned<_Tp>::type __to_unsigned_like(_Tp __x) noexcept {
+ return static_cast<typename make_unsigned<_Tp>::type>(__x);
+}
+#endif
+
#if _LIBCPP_STD_VER > 14
template <class...> using void_t = void;
#endif
#if _LIBCPP_STD_VER > 17
// Let COND_RES(X, Y) be:
template <class _Tp, class _Up>
-using __cond_type = decltype(false ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>());
+using __cond_type = decltype(false ? declval<_Tp>() : declval<_Up>());
template <class _Tp, class _Up, class = void>
struct __common_type3 {};
template <class _Tp, class _Up>
struct __common_type2_imp<_Tp, _Up,
typename __void_t<decltype(
- true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
+ true ? declval<_Tp>() : declval<_Up>()
)>::type>
{
typedef _LIBCPP_NODEBUG_TYPE typename decay<decltype(
- true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
+ true ? declval<_Tp>() : declval<_Up>()
)>::type type;
};
template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type;
#endif
+#if _LIBCPP_STD_VER > 11
+// Let COPYCV(FROM, TO) be an alias for type TO with the addition of FROM's
+// top-level cv-qualifiers.
+template <class _From, class _To>
+struct __copy_cv
+{
+ using type = _To;
+};
+
+template <class _From, class _To>
+struct __copy_cv<const _From, _To>
+{
+ using type = add_const_t<_To>;
+};
+
+template <class _From, class _To>
+struct __copy_cv<volatile _From, _To>
+{
+ using type = add_volatile_t<_To>;
+};
+
+template <class _From, class _To>
+struct __copy_cv<const volatile _From, _To>
+{
+ using type = add_cv_t<_To>;
+};
+
+template <class _From, class _To>
+using __copy_cv_t = typename __copy_cv<_From, _To>::type;
+
+template <class _From, class _To>
+struct __copy_cvref
+{
+ using type = __copy_cv_t<_From, _To>;
+};
+
+template <class _From, class _To>
+struct __copy_cvref<_From&, _To>
+{
+ using type = add_lvalue_reference_t<__copy_cv_t<_From, _To>>;
+};
+
+template <class _From, class _To>
+struct __copy_cvref<_From&&, _To>
+{
+ using type = add_rvalue_reference_t<__copy_cv_t<_From, _To>>;
+};
+
+template <class _From, class _To>
+using __copy_cvref_t = typename __copy_cvref<_From, _To>::type;
+
+#endif // _LIBCPP_STD_VER > 11
+
+// common_reference
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+// Let COND_RES(X, Y) be:
+template <class _Xp, class _Yp>
+using __cond_res =
+ decltype(false ? declval<_Xp(&)()>()() : declval<_Yp(&)()>()());
+
+// Let `XREF(A)` denote a unary alias template `T` such that `T<U>` denotes the same type as `U`
+// with the addition of `A`'s cv and reference qualifiers, for a non-reference cv-unqualified type
+// `U`.
+// [Note: `XREF(A)` is `__xref<A>::template __apply`]
+template <class _Tp>
+struct __xref {
+ template<class _Up>
+ using __apply = __copy_cvref_t<_Tp, _Up>;
+};
+
+// Given types A and B, let X be remove_reference_t<A>, let Y be remove_reference_t<B>,
+// and let COMMON-REF(A, B) be:
+template<class _Ap, class _Bp, class _Xp = remove_reference_t<_Ap>, class _Yp = remove_reference_t<_Bp>>
+struct __common_ref;
+
+template<class _Xp, class _Yp>
+using __common_ref_t = typename __common_ref<_Xp, _Yp>::__type;
+
+template<class _Xp, class _Yp>
+using __cv_cond_res = __cond_res<__copy_cv_t<_Xp, _Yp>&, __copy_cv_t<_Yp, _Xp>&>;
+
+
+// If A and B are both lvalue reference types, COMMON-REF(A, B) is
+// COND-RES(COPYCV(X, Y)&, COPYCV(Y, X)&) if that type exists and is a reference type.
+template<class _Ap, class _Bp, class _Xp, class _Yp>
+requires requires { typename __cv_cond_res<_Xp, _Yp>; } && is_reference_v<__cv_cond_res<_Xp, _Yp>>
+struct __common_ref<_Ap&, _Bp&, _Xp, _Yp>
+{
+ using __type = __cv_cond_res<_Xp, _Yp>;
+};
+
+// Otherwise, let C be remove_reference_t<COMMON-REF(X&, Y&)>&&. ...
+template <class _Xp, class _Yp>
+using __common_ref_C = remove_reference_t<__common_ref_t<_Xp&, _Yp&>>&&;
+
+
+// .... If A and B are both rvalue reference types, C is well-formed, and
+// is_convertible_v<A, C> && is_convertible_v<B, C> is true, then COMMON-REF(A, B) is C.
+template<class _Ap, class _Bp, class _Xp, class _Yp>
+requires
+ requires { typename __common_ref_C<_Xp, _Yp>; } &&
+ is_convertible_v<_Ap&&, __common_ref_C<_Xp, _Yp>> &&
+ is_convertible_v<_Bp&&, __common_ref_C<_Xp, _Yp>>
+struct __common_ref<_Ap&&, _Bp&&, _Xp, _Yp>
+{
+ using __type = __common_ref_C<_Xp, _Yp>;
+};
+
+// Otherwise, let D be COMMON-REF(const X&, Y&). ...
+template <class _Tp, class _Up>
+using __common_ref_D = __common_ref_t<const _Tp&, _Up&>;
+
+// ... If A is an rvalue reference and B is an lvalue reference and D is well-formed and
+// is_convertible_v<A, D> is true, then COMMON-REF(A, B) is D.
+template<class _Ap, class _Bp, class _Xp, class _Yp>
+requires requires { typename __common_ref_D<_Xp, _Yp>; } &&
+ is_convertible_v<_Ap&&, __common_ref_D<_Xp, _Yp>>
+struct __common_ref<_Ap&&, _Bp&, _Xp, _Yp>
+{
+ using __type = __common_ref_D<_Xp, _Yp>;
+};
+
+// Otherwise, if A is an lvalue reference and B is an rvalue reference, then
+// COMMON-REF(A, B) is COMMON-REF(B, A).
+template<class _Ap, class _Bp, class _Xp, class _Yp>
+struct __common_ref<_Ap&, _Bp&&, _Xp, _Yp> : __common_ref<_Bp&&, _Ap&> {};
+
+// Otherwise, COMMON-REF(A, B) is ill-formed.
+template<class _Ap, class _Bp, class _Xp, class _Yp>
+struct __common_ref {};
+
+// Note C: For the common_reference trait applied to a parameter pack [...]
+
+template <class...>
+struct common_reference;
+
+template <class... _Types>
+using common_reference_t = typename common_reference<_Types...>::type;
+
+// bullet 1 - sizeof...(T) == 0
+template<>
+struct common_reference<> {};
+
+// bullet 2 - sizeof...(T) == 1
+template <class _Tp>
+struct common_reference<_Tp>
+{
+ using type = _Tp;
+};
+
+// bullet 3 - sizeof...(T) == 2
+template <class _Tp, class _Up> struct __common_reference_sub_bullet3;
+template <class _Tp, class _Up> struct __common_reference_sub_bullet2 : __common_reference_sub_bullet3<_Tp, _Up> {};
+template <class _Tp, class _Up> struct __common_reference_sub_bullet1 : __common_reference_sub_bullet2<_Tp, _Up> {};
+
+// sub-bullet 1 - If T1 and T2 are reference types and COMMON-REF(T1, T2) is well-formed, then
+// the member typedef `type` denotes that type.
+template <class _Tp, class _Up> struct common_reference<_Tp, _Up> : __common_reference_sub_bullet1<_Tp, _Up> {};
+
+template <class _Tp, class _Up>
+requires is_reference_v<_Tp> && is_reference_v<_Up> && requires { typename __common_ref_t<_Tp, _Up>; }
+struct __common_reference_sub_bullet1<_Tp, _Up>
+{
+ using type = __common_ref_t<_Tp, _Up>;
+};
+
+// sub-bullet 2 - Otherwise, if basic_common_reference<remove_cvref_t<T1>, remove_cvref_t<T2>, XREF(T1), XREF(T2)>::type
+// is well-formed, then the member typedef `type` denotes that type.
+template <class, class, template <class> class, template <class> class> struct basic_common_reference {};
+
+template <class _Tp, class _Up>
+using __basic_common_reference_t = typename basic_common_reference<
+ remove_cvref_t<_Tp>, remove_cvref_t<_Up>,
+ __xref<_Tp>::template __apply, __xref<_Up>::template __apply>::type;
+
+template <class _Tp, class _Up>
+requires requires { typename __basic_common_reference_t<_Tp, _Up>; }
+struct __common_reference_sub_bullet2<_Tp, _Up>
+{
+ using type = __basic_common_reference_t<_Tp, _Up>;
+};
+
+// sub-bullet 3 - Otherwise, if COND-RES(T1, T2) is well-formed,
+// then the member typedef `type` denotes that type.
+template <class _Tp, class _Up>
+requires requires { typename __cond_res<_Tp, _Up>; }
+struct __common_reference_sub_bullet3<_Tp, _Up>
+{
+ using type = __cond_res<_Tp, _Up>;
+};
+
+
+// sub-bullet 4 & 5 - Otherwise, if common_type_t<T1, T2> is well-formed,
+// then the member typedef `type` denotes that type.
+// - Otherwise, there shall be no member `type`.
+template <class _Tp, class _Up> struct __common_reference_sub_bullet3 : common_type<_Tp, _Up> {};
+
+// bullet 4 - If there is such a type `C`, the member typedef type shall denote the same type, if
+// any, as `common_reference_t<C, Rest...>`.
+template <class _Tp, class _Up, class _Vp, class... _Rest>
+requires requires { typename common_reference_t<_Tp, _Up>; }
+struct common_reference<_Tp, _Up, _Vp, _Rest...>
+ : common_reference<common_reference_t<_Tp, _Up>, _Vp, _Rest...>
+{};
+
+// bullet 5 - Otherwise, there shall be no member `type`.
+template <class...> struct common_reference {};
+
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+
// is_assignable
template<typename, typename _Tp> struct __select_2nd { typedef _LIBCPP_NODEBUG_TYPE _Tp type; };
#else // __has_keyword(__is_assignable)
template <class _Tp, class _Arg>
-typename __select_2nd<decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>())), true_type>::type
+typename __select_2nd<decltype((declval<_Tp>() = declval<_Arg>())), true_type>::type
__is_assignable_test(int);
template <class, class>
= is_assignable<_Tp, _Arg>::value;
#endif
-#endif // __has_keyword(__is_assignable)
+#endif // __has_keyword(__is_assignable)
// is_copy_assignable
// if it's a function, return false
// if it's void, return false
// if it's an array of unknown bound, return false
-// Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed
+// Otherwise, return "declval<_Up&>().~_Up()" is well-formed
// where _Up is remove_all_extents<_Tp>::type
template <class>
struct __is_destructor_wellformed {
template <typename _Tp1>
static char __test (
- typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type
+ typename __is_destructible_apply<decltype(declval<_Tp1&>().~_Tp1())>::type
);
template <typename _Tp1>
template <class _Tp>
struct __destructible_imp<_Tp, false>
- : public _VSTD::integral_constant<bool,
- __is_destructor_wellformed<typename _VSTD::remove_all_extents<_Tp>::type>::value> {};
+ : public integral_constant<bool,
+ __is_destructor_wellformed<typename remove_all_extents<_Tp>::type>::value> {};
template <class _Tp>
struct __destructible_imp<_Tp, true>
- : public _VSTD::true_type {};
+ : public true_type {};
template <class _Tp, bool>
struct __destructible_false;
template <class _Tp>
-struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, _VSTD::is_reference<_Tp>::value> {};
+struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, is_reference<_Tp>::value> {};
template <class _Tp>
-struct __destructible_false<_Tp, true> : public _VSTD::false_type {};
+struct __destructible_false<_Tp, true> : public false_type {};
template <class _Tp>
struct is_destructible
- : public __destructible_false<_Tp, _VSTD::is_function<_Tp>::value> {};
+ : public __destructible_false<_Tp, is_function<_Tp>::value> {};
template <class _Tp>
struct is_destructible<_Tp[]>
- : public _VSTD::false_type {};
+ : public false_type {};
template <>
struct is_destructible<void>
- : public _VSTD::false_type {};
+ : public false_type {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp>
#endif // __has_keyword(__is_destructible)
-// move
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename remove_reference<_Tp>::type&&
-move(_Tp&& __t) _NOEXCEPT
-{
- typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up;
- return static_cast<_Up&&>(__t);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-_Tp&&
-forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT
-{
- return static_cast<_Tp&&>(__t);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-_Tp&&
-forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT
-{
- static_assert(!is_lvalue_reference<_Tp>::value,
- "can not forward an rvalue as an lvalue");
- return static_cast<_Tp&&>(__t);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename decay<_Tp>::type
-__decay_copy(_Tp&& __t)
-{
- return _VSTD::forward<_Tp>(__t);
-}
-
template <class _MP, bool _IsMemberFunctionPtr, bool _IsMemberObjectPtr>
struct __member_pointer_traits_imp
{
typedef _Rp (_FnType) (_Param..., ...);
};
-#endif // __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC)
+#endif // __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC)
template <class _Rp, class _Class>
typedef _ClassType type;
};
-// result_of
-
-template <class _Callable> class result_of;
-
-#ifdef _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Fn, bool, bool>
-class __result_of
-{
-};
-
-template <class _Fn>
-class __result_of<_Fn(), true, false>
-{
-public:
- typedef decltype(declval<_Fn>()()) type;
-};
-
-template <class _Fn, class _A0>
-class __result_of<_Fn(_A0), true, false>
-{
-public:
- typedef decltype(declval<_Fn>()(declval<_A0>())) type;
-};
-
-template <class _Fn, class _A0, class _A1>
-class __result_of<_Fn(_A0, _A1), true, false>
-{
-public:
- typedef decltype(declval<_Fn>()(declval<_A0>(), declval<_A1>())) type;
-};
-
-template <class _Fn, class _A0, class _A1, class _A2>
-class __result_of<_Fn(_A0, _A1, _A2), true, false>
-{
-public:
- typedef decltype(declval<_Fn>()(declval<_A0>(), declval<_A1>(), declval<_A2>())) type;
-};
-
-template <class _MP, class _Tp, bool _IsMemberFunctionPtr>
-struct __result_of_mp;
-
-// member function pointer
-
-template <class _MP, class _Tp>
-struct __result_of_mp<_MP, _Tp, true>
- : public __identity<typename __member_pointer_traits<_MP>::_ReturnType>
-{
-};
-
-// member data pointer
-
-template <class _MP, class _Tp, bool>
-struct __result_of_mdp;
-
-template <class _Rp, class _Class, class _Tp>
-struct __result_of_mdp<_Rp _Class::*, _Tp, false>
-{
- typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _Rp>::type& type;
-};
-
-template <class _Rp, class _Class, class _Tp>
-struct __result_of_mdp<_Rp _Class::*, _Tp, true>
-{
- typedef typename __apply_cv<_Tp, _Rp>::type& type;
-};
-
-template <class _Rp, class _Class, class _Tp>
-struct __result_of_mp<_Rp _Class::*, _Tp, false>
- : public __result_of_mdp<_Rp _Class::*, _Tp,
- is_base_of<_Class, typename remove_reference<_Tp>::type>::value>
-{
-};
-
-
-
-template <class _Fn, class _Tp>
-class __result_of<_Fn(_Tp), false, true> // _Fn must be member pointer
- : public __result_of_mp<typename remove_reference<_Fn>::type,
- _Tp,
- is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
-{
-};
-
-template <class _Fn, class _Tp, class _A0>
-class __result_of<_Fn(_Tp, _A0), false, true> // _Fn must be member pointer
- : public __result_of_mp<typename remove_reference<_Fn>::type,
- _Tp,
- is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
-{
-};
-
-template <class _Fn, class _Tp, class _A0, class _A1>
-class __result_of<_Fn(_Tp, _A0, _A1), false, true> // _Fn must be member pointer
- : public __result_of_mp<typename remove_reference<_Fn>::type,
- _Tp,
- is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
-{
-};
-
-template <class _Fn, class _Tp, class _A0, class _A1, class _A2>
-class __result_of<_Fn(_Tp, _A0, _A1, _A2), false, true> // _Fn must be member pointer
- : public __result_of_mp<typename remove_reference<_Fn>::type,
- _Tp,
- is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
-{
-};
-
-// result_of
-
-template <class _Fn>
-class _LIBCPP_TEMPLATE_VIS result_of<_Fn()>
- : public __result_of<_Fn(),
- is_class<typename remove_reference<_Fn>::type>::value ||
- is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
- is_member_pointer<typename remove_reference<_Fn>::type>::value
- >
-{
-};
-
-template <class _Fn, class _A0>
-class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0)>
- : public __result_of<_Fn(_A0),
- is_class<typename remove_reference<_Fn>::type>::value ||
- is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
- is_member_pointer<typename remove_reference<_Fn>::type>::value
- >
-{
-};
-
-template <class _Fn, class _A0, class _A1>
-class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0, _A1)>
- : public __result_of<_Fn(_A0, _A1),
- is_class<typename remove_reference<_Fn>::type>::value ||
- is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
- is_member_pointer<typename remove_reference<_Fn>::type>::value
- >
-{
-};
-
-template <class _Fn, class _A0, class _A1, class _A2>
-class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0, _A1, _A2)>
- : public __result_of<_Fn(_A0, _A1, _A2),
- is_class<typename remove_reference<_Fn>::type>::value ||
- is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
- is_member_pointer<typename remove_reference<_Fn>::type>::value
- >
-{
-};
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
// template <class T, class... Args> struct is_constructible;
-namespace __is_construct
-{
-struct __nat {};
-}
+#if defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER_NEW >= 10000
+# define _LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE
+#endif
-#if !defined(_LIBCPP_CXX03_LANG) && (!__has_feature(is_constructible) || \
- defined(_LIBCPP_TESTING_FALLBACK_IS_CONSTRUCTIBLE))
+#if !defined(_LIBCPP_CXX03_LANG) && !__has_feature(is_constructible) && !defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE)
template <class _Tp, class... _Args>
struct __libcpp_is_constructible;
// NOTE: The static_cast implementation below is required to support
// classes with explicit conversion operators.
template <class _To, class _From,
- class = decltype(__eat<_To>(_VSTD::declval<_From>()))>
+ class = decltype(__eat<_To>(declval<_From>()))>
static true_type __test_cast(int);
template <class _To, class _From,
- class = decltype(static_cast<_To>(_VSTD::declval<_From>()))>
+ class = decltype(static_cast<_To>(declval<_From>()))>
static integral_constant<bool,
!__is_invalid_base_to_derived_cast<_To, _From>::value &&
!__is_invalid_lvalue_to_rvalue_cast<_To, _From>::value
static false_type __test_cast(...);
template <class _Tp, class ..._Args,
- class = decltype(_Tp(_VSTD::declval<_Args>()...))>
+ class = decltype(_Tp(declval<_Args>()...))>
static true_type __test_nary(int);
template <class _Tp, class...>
static false_type __test_nary(...);
- template <class _Tp, class _A0, class = decltype(::new _Tp(_VSTD::declval<_A0>()))>
+ template <class _Tp, class _A0, class = decltype(::new _Tp(declval<_A0>()))>
static is_destructible<_Tp> __test_unary(int);
template <class, class>
static false_type __test_unary(...);
#endif
-#if __has_feature(is_constructible)
+#if __has_feature(is_constructible) || defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE)
template <class _Tp, class ..._Args>
struct _LIBCPP_TEMPLATE_VIS is_constructible
: public integral_constant<bool, __is_constructible(_Tp, _Args...)>
template <class _Tp>
void __test_implicit_default_constructible(_Tp);
-template <class _Tp, class = void, bool = is_default_constructible<_Tp>::value>
+template <class _Tp, class = void, class = typename is_default_constructible<_Tp>::type>
struct __is_implicitly_default_constructible
: false_type
{ };
template <class _Tp>
-struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), true>
+struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), true_type>
: true_type
{ };
template <class _Tp>
-struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), false>
+struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), false_type>
: false_type
{ };
#endif // !C++03
{
};
-#endif // !__has_feature(is_trivially_constructible)
+#endif // !__has_feature(is_trivially_constructible)
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
struct is_trivially_assignable<_Tp&, _Tp&&>
: integral_constant<bool, is_scalar<_Tp>::value> {};
-#endif // !__has_feature(is_trivially_assignable)
+#endif // !__has_feature(is_trivially_assignable)
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp, class _Arg>
template <class _Tp, class _Arg>
struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>
- : public integral_constant<bool, noexcept(__implicit_conversion_to<_Tp>(declval<_Arg>()))>
+ : public integral_constant<bool, noexcept(_VSTD::__implicit_conversion_to<_Tp>(declval<_Arg>()))>
{
};
{
};
-#endif // _LIBCPP_HAS_NO_NOEXCEPT
+#endif // _LIBCPP_HAS_NO_NOEXCEPT
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp, class _Arg>
struct __libcpp_is_nothrow_assignable<true, _Tp, _Arg>
- : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>()) >
+ : public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Arg>()) >
{
};
{
};
-#endif // _LIBCPP_HAS_NO_NOEXCEPT
+#endif // _LIBCPP_HAS_NO_NOEXCEPT
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp, class _Arg>
template <class _Tp>
struct __libcpp_is_nothrow_destructible<true, _Tp>
- : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>().~_Tp()) >
+ : public integral_constant<bool, noexcept(declval<_Tp>().~_Tp()) >
{
};
// is_literal_type;
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_literal_type
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 is_literal_type
: public integral_constant<bool, __is_literal_type(_Tp)>
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp>
-_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_literal_type_v
+_LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_literal_type_v
= is_literal_type<_Tp>::value;
-#endif
+#endif // _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
// is_standard_layout;
template <class _Fp, class _A0, class ..._Args,
class = __enable_if_bullet1<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
-auto
+_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
-_LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
+_LIBCPP_INVOKE_RETURN((static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...))
template <class _Fp, class _A0, class ..._Args,
class = __enable_if_bullet1<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR auto
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
-_LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
+_LIBCPP_INVOKE_RETURN((static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...))
template <class _Fp, class _A0, class ..._Args,
class = __enable_if_bullet2<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
-auto
+_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
-_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))
+_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(static_cast<_Args&&>(__args)...))
template <class _Fp, class _A0, class ..._Args,
class = __enable_if_bullet2<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR auto
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
-_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))
+_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(static_cast<_Args&&>(__args)...))
template <class _Fp, class _A0, class ..._Args,
class = __enable_if_bullet3<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
-auto
+_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
-_LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
+_LIBCPP_INVOKE_RETURN(((*static_cast<_A0&&>(__a0)).*__f)(static_cast<_Args&&>(__args)...))
template <class _Fp, class _A0, class ..._Args,
class = __enable_if_bullet3<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR auto
__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
-_LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
+_LIBCPP_INVOKE_RETURN(((*static_cast<_A0&&>(__a0)).*__f)(static_cast<_Args&&>(__args)...))
// bullets 4, 5 and 6
template <class _Fp, class _A0,
class = __enable_if_bullet4<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
-auto
+_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
__invoke(_Fp&& __f, _A0&& __a0)
-_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
+_LIBCPP_INVOKE_RETURN(static_cast<_A0&&>(__a0).*__f)
template <class _Fp, class _A0,
class = __enable_if_bullet4<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR auto
__invoke_constexpr(_Fp&& __f, _A0&& __a0)
-_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
+_LIBCPP_INVOKE_RETURN(static_cast<_A0&&>(__a0).*__f)
template <class _Fp, class _A0,
class = __enable_if_bullet5<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
-auto
+_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
__invoke(_Fp&& __f, _A0&& __a0)
_LIBCPP_INVOKE_RETURN(__a0.get().*__f)
template <class _Fp, class _A0,
class = __enable_if_bullet6<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
-auto
+_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
__invoke(_Fp&& __f, _A0&& __a0)
-_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
+_LIBCPP_INVOKE_RETURN((*static_cast<_A0&&>(__a0)).*__f)
template <class _Fp, class _A0,
class = __enable_if_bullet6<_Fp, _A0>>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR auto
__invoke_constexpr(_Fp&& __f, _A0&& __a0)
-_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
+_LIBCPP_INVOKE_RETURN((*static_cast<_A0&&>(__a0)).*__f)
// bullet 7
template <class _Fp, class ..._Args>
inline _LIBCPP_INLINE_VISIBILITY
-auto
+_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
__invoke(_Fp&& __f, _Args&& ...__args)
-_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
+_LIBCPP_INVOKE_RETURN(static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...))
template <class _Fp, class ..._Args>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR auto
__invoke_constexpr(_Fp&& __f, _Args&& ...__args)
-_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
+_LIBCPP_INVOKE_RETURN(static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...))
#undef _LIBCPP_INVOKE_RETURN
{
template <class _XFp, class ..._XArgs>
static auto __try_call(int) -> decltype(
- _VSTD::__invoke(_VSTD::declval<_XFp>(), _VSTD::declval<_XArgs>()...));
+ _VSTD::__invoke(declval<_XFp>(), declval<_XArgs>()...));
template <class _XFp, class ..._XArgs>
static __nat __try_call(...);
static void __test_noexcept(_Tp) noexcept;
static const bool value = noexcept(_ThisT::__test_noexcept<_Ret>(
- _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)));
+ _VSTD::__invoke(declval<_Fp>(), declval<_Args>()...)));
};
template <class _Ret, class _Fp, class ..._Args>
struct __nothrow_invokable_r_imp<true, true, _Ret, _Fp, _Args...>
{
static const bool value = noexcept(
- _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...));
+ _VSTD::__invoke(declval<_Fp>(), declval<_Args>()...));
};
template <class _Ret, class _Fp, class ..._Args>
{
};
+#endif // _LIBCPP_CXX03_LANG
+
// result_of
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
+template <class _Callable> class _LIBCPP_DEPRECATED_IN_CXX17 result_of;
+
+#ifndef _LIBCPP_CXX03_LANG
+
template <class _Fp, class ..._Args>
class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)>
: public __invoke_of<_Fp, _Args...>
{
};
+#else // C++03
+
+template <class _Fn, bool, bool>
+class __result_of
+{
+};
+
+template <class _Fn, class ..._Args>
+class __result_of<_Fn(_Args...), true, false>
+{
+public:
+ typedef decltype(declval<_Fn>()(declval<_Args>()...)) type;
+};
+
+template <class _MP, class _Tp, bool _IsMemberFunctionPtr>
+struct __result_of_mp;
+
+// member function pointer
+
+template <class _MP, class _Tp>
+struct __result_of_mp<_MP, _Tp, true>
+{
+ using type = typename __member_pointer_traits<_MP>::_ReturnType;
+};
+
+// member data pointer
+
+template <class _MP, class _Tp, bool>
+struct __result_of_mdp;
+
+template <class _Rp, class _Class, class _Tp>
+struct __result_of_mdp<_Rp _Class::*, _Tp, false>
+{
+ using type = typename __apply_cv<decltype(*declval<_Tp>()), _Rp>::type&;
+};
+
+template <class _Rp, class _Class, class _Tp>
+struct __result_of_mdp<_Rp _Class::*, _Tp, true>
+{
+ using type = typename __apply_cv<_Tp, _Rp>::type&;
+};
+
+template <class _Rp, class _Class, class _Tp>
+struct __result_of_mp<_Rp _Class::*, _Tp, false>
+ : public __result_of_mdp<_Rp _Class::*, _Tp,
+ is_base_of<_Class, typename remove_reference<_Tp>::type>::value>
+{
+};
+
+template <class _Fn, class _Tp>
+class __result_of<_Fn(_Tp), false, true> // _Fn must be member pointer
+ : public __result_of_mp<typename remove_reference<_Fn>::type,
+ _Tp,
+ is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
+{
+};
+
+template <class _Fn, class _Tp, class ..._Args>
+class __result_of<_Fn(_Tp, _Args...), false, true> // _Fn must be member pointer
+ : public __result_of_mp<typename remove_reference<_Fn>::type,
+ _Tp,
+ is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
+{
+};
+
+template <class _Fn, class ..._Args>
+class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_Args...)>
+ : public __result_of<_Fn(_Args...),
+ is_class<typename remove_reference<_Fn>::type>::value ||
+ is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
+ is_member_pointer<typename remove_reference<_Fn>::type>::value
+ >
+{
+};
+
+#endif // C++03
+
#if _LIBCPP_STD_VER > 11
-template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
-#endif
+template <class _Tp> using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type;
+#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
#if _LIBCPP_STD_VER > 14
#endif // _LIBCPP_STD_VER > 14
-#endif // !defined(_LIBCPP_CXX03_LANG)
+// __swappable
template <class _Tp> struct __is_swappable;
template <class _Tp> struct __is_nothrow_swappable;
-// swap, swap_ranges
-
-template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator2
-swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2);
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_CXX03_LANG
-typename enable_if
-<
- is_move_constructible<_Tp>::value &&
- is_move_assignable<_Tp>::value
->::type
+template <class _Tp>
+using __swap_result_t = typename enable_if<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>::type;
#else
-void
+template <class>
+using __swap_result_t = void;
#endif
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR_AFTER_CXX17 __swap_result_t<_Tp>
swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&
- is_nothrow_move_assignable<_Tp>::value)
-{
- _Tp __t(_VSTD::move(__x));
- __x = _VSTD::move(__y);
- __y = _VSTD::move(__t);
-}
+ is_nothrow_move_assignable<_Tp>::value);
template<class _Tp, size_t _Np>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
typename enable_if<
__is_swappable<_Tp>::value
>::type
-swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
-{
- _VSTD::swap_ranges(__a, __a + _Np, __b);
-}
-
-template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator2
-swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
-{
- for(; __first1 != __last1; ++__first1, (void) ++__first2)
- swap(*__first1, *__first2);
- return __first2;
-}
-
-// iter_swap
-
-template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-void
-iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
- // _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))
- _NOEXCEPT_(_NOEXCEPT_(swap(*_VSTD::declval<_ForwardIterator1>(),
- *_VSTD::declval<_ForwardIterator2>())))
-{
- swap(*__a, *__b);
-}
-
-// __swappable
+swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
namespace __detail
{
struct __swappable_with
{
template <class _LHS, class _RHS>
- static decltype(swap(_VSTD::declval<_LHS>(), _VSTD::declval<_RHS>()))
+ static decltype(swap(declval<_LHS>(), declval<_RHS>()))
__test_swap(int);
template <class, class>
static __nat __test_swap(long);
struct __nothrow_swappable_with {
static const bool value =
#ifndef _LIBCPP_HAS_NO_NOEXCEPT
- noexcept(swap(_VSTD::declval<_Tp>(), _VSTD::declval<_Up>()))
- && noexcept(swap(_VSTD::declval<_Up>(), _VSTD::declval<_Tp>()));
+ noexcept(swap(declval<_Tp>(), declval<_Up>()))
+ && noexcept(swap(declval<_Up>(), declval<_Tp>()));
#else
false;
#endif
{
template <class _Up>
static auto __test(int)
- -> typename __select_2nd<decltype(_VSTD::declval<_Up>().operator&()), true_type>::type;
+ -> typename __select_2nd<decltype(declval<_Up>().operator&()), true_type>::type;
template <class>
static auto __test(long) -> false_type;
{
template <class _Up>
static auto __test(int)
- -> typename __select_2nd<decltype(operator&(_VSTD::declval<_Up>())), true_type>::type;
+ -> typename __select_2nd<decltype(operator&(declval<_Up>())), true_type>::type;
template <class>
static auto __test(long) -> false_type;
|| __has_operator_addressof_free_imp<_Tp>::value>
{};
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
+
+// is_scoped_enum [meta.unary.prop]
+
+#if _LIBCPP_STD_VER > 20
+template <class _Tp, bool = is_enum_v<_Tp> >
+struct __is_scoped_enum_helper : false_type {};
+
+template <class _Tp>
+struct __is_scoped_enum_helper<_Tp, true>
+ : public bool_constant<!is_convertible_v<_Tp, underlying_type_t<_Tp> > > {};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_scoped_enum
+ : public __is_scoped_enum_helper<_Tp> {};
+
+template <class _Tp>
+_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_scoped_enum_v =
+ is_scoped_enum<_Tp>::value;
+#endif
#if _LIBCPP_STD_VER > 14
template<class _Tp>
_LIBCPP_INLINE_VAR constexpr bool negation_v
= negation<_Tp>::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER > 14
// These traits are used in __tree and __hash_table
-#ifndef _LIBCPP_CXX03_LANG
struct __extract_key_fail_tag {};
struct __extract_key_self_tag {};
struct __extract_key_first_tag {};
__extract_key_fail_tag>::type {};
template <class _Pair, class _Key, class _First, class _Second>
-struct __can_extract_key<_Pair, _Key, pair<_First, _Second>>
+struct __can_extract_key<_Pair, _Key, pair<_First, _Second> >
: conditional<_IsSame<typename remove_const<_First>::type, _Key>::value,
__extract_key_first_tag, __extract_key_fail_tag>::type {};
struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy>
: false_type {};
-#endif
-
#ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
template <class _CharT>
using _IsCharLikeType = _And<is_standard_layout<_CharT>, is_trivial<_CharT> >;
+template<class _Tp>
+using __make_const_lvalue_ref = const typename remove_reference<_Tp>::type&;
+
+#if _LIBCPP_STD_VER > 17
+template<bool _Const, class _Tp>
+using __maybe_const = conditional_t<_Const, const _Tp, _Tp>;
+#endif // _LIBCPP_STD_VER > 17
+
_LIBCPP_END_NAMESPACE_STD
#if _LIBCPP_STD_VER > 14
}
#endif
-#endif // _LIBCPP_TYPE_TRAITS
+#endif // _LIBCPP_TYPE_TRAITS
*/
#include <__config>
-#include <typeinfo>
+#include <__functional/unary_function.h>
#include <__functional_base>
+#include <compare>
+#include <typeinfo>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_TYPEINDEX
+#endif // _LIBCPP_TYPEINDEX
*/
+#include <__availability>
#include <__config>
-#include <exception>
#include <cstddef>
#include <cstdint>
+#include <exception>
#include <type_traits>
+
#ifdef _LIBCPP_NO_EXCEPTIONS
#include <cstdlib>
#endif
// (_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION = 1)
// ------------------------------------------------------------------------- //
// This implementation of type_info assumes a unique copy of the RTTI for a
-// given type inside a program. This is a valid assumption when abiding to
+// given type inside a program. This is a valid assumption when abiding to the
// Itanium ABI (http://itanium-cxx-abi.github.io/cxx-abi/abi.html#vtable-components).
// Under this assumption, we can always compare the addresses of the type names
// to implement equality-comparison of type_infos instead of having to perform
// comparison is equal.
// -------------------------------------------------------------------------- //
// NonUniqueARMRTTIBit
-// (selected on ARM64 regardless of _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION)
+// (_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION = 3)
// -------------------------------------------------------------------------- //
+// This implementation is specific to ARM64 on Apple platforms.
+//
// This implementation of type_info does not assume always a unique copy of
-// the RTTI for a given type inside a program. It packs the pointer to the
-// type name into a uintptr_t and reserves the high bit of that pointer (which
-// is assumed to be free for use under the ABI in use) to represent whether
-// that specific copy of the RTTI can be assumed unique inside the program.
-// To implement equality-comparison of type_infos, we check whether BOTH
-// type_infos are guaranteed unique, and if so, we simply compare the addresses
-// of their type names instead of doing a deep string comparison, which is
-// faster. If at least one of the type_infos can't guarantee uniqueness, we
-// have no choice but to fall back to a deep string comparison.
+// the RTTI for a given type inside a program. When constructing the type_info,
+// the compiler packs the pointer to the type name into a uintptr_t and reserves
+// the high bit of that pointer, which is assumed to be free for use under that
+// ABI. If that high bit is set, that specific copy of the RTTI can't be assumed
+// to be unique within the program. If the high bit is unset, then the RTTI can
+// be assumed to be unique within the program.
//
-// This implementation is specific to ARM64 on Apple platforms.
+// When comparing type_infos, if both RTTIs can be assumed to be unique, it
+// suffices to compare their addresses. If both the RTTIs can't be assumed to
+// be unique, we must perform a deep string comparison of the type names.
+// However, if one of the RTTIs is guaranteed unique and the other one isn't,
+// then both RTTIs are necessarily not to be considered equal.
//
-// Note that the compiler is the one setting (or unsetting) the high bit of
-// the pointer when it constructs the type_info, depending on whether it can
-// guarantee uniqueness for that specific type_info.
+// The intent of this design is to remove the need for weak symbols. Specifically,
+// if a type would normally have a default-visibility RTTI emitted as a weak
+// symbol, it is given hidden visibility instead and the non-unique bit is set.
+// Otherwise, types declared with hidden visibility are always considered to have
+// a unique RTTI: the RTTI is emitted with linkonce_odr linkage and is assumed
+// to be deduplicated by the linker within the linked image. Across linked image
+// boundaries, such types are thus considered different types.
+
+// This value can be overriden in the __config_site. When it's not overriden,
+// we pick a default implementation based on the platform here.
+#ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
+
+ // Windows binaries can't merge typeinfos, so use the NonUnique implementation.
+# ifdef _LIBCPP_OBJECT_FORMAT_COFF
+# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 2
+
+ // On arm64 on Apple platforms, use the special NonUniqueARMRTTIBit implementation.
+# elif defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)
+# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 3
+
+ // On all other platforms, assume the Itanium C++ ABI and use the Unique implementation.
+# else
+# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 1
+# endif
+#endif
struct __type_info_implementations {
struct __string_impl_base {
_LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
static size_t __hash(__type_name_t __v) _NOEXCEPT {
if (__is_type_name_unique(__v))
- return reinterpret_cast<size_t>(__v);
+ return __v;
return __non_unique_impl::__hash(__type_name_to_string(__v));
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
if (__lhs == __rhs)
return true;
- if (__is_type_name_unique(__lhs, __rhs))
+ if (__is_type_name_unique(__lhs) || __is_type_name_unique(__rhs))
+ // Either both are unique and have a different address, or one of them
+ // is unique and the other one isn't. In both cases they are unequal.
return false;
return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) == 0;
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
- if (__is_type_name_unique(__lhs, __rhs))
+ if (__is_type_name_unique(__lhs) || __is_type_name_unique(__rhs))
return __lhs < __rhs;
return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) < 0;
}
private:
// The unique bit is the top bit. It is expected that __type_name_t is 64 bits when
// this implementation is actually used.
- typedef std::integral_constant<__type_name_t,
+ typedef integral_constant<__type_name_t,
(1ULL << ((__CHAR_BIT__ * sizeof(__type_name_t)) - 1))> __non_unique_rtti_bit;
_LIBCPP_INLINE_VISIBILITY
static bool __is_type_name_unique(__type_name_t __lhs) _NOEXCEPT {
return !(__lhs & __non_unique_rtti_bit::value);
}
- _LIBCPP_INLINE_VISIBILITY
- static bool __is_type_name_unique(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
- return !((__lhs & __rhs) & __non_unique_rtti_bit::value);
- }
};
typedef
-#if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)
- __non_unique_arm_rtti_bit_impl
-#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 1
+#if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 1
__unique_impl
#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 2
__non_unique_impl
+#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 3
+ __non_unique_arm_rtti_bit_impl
#else
# error invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
#endif
}
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_TYPEINFO
+#endif // __LIBCPP_TYPEINFO
iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
+ template<typename K>
+ iterator find(const K& x); // C++20
+ template<typename K>
+ const_iterator find(const K& x) const; // C++20
size_type count(const key_type& k) const;
+ template<typename K>
+ size_type count(const K& k) const; // C++20
bool contains(const key_type& k) const; // C++20
+ template<typename K>
+ bool contains(const K& k) const; // C++20
pair<iterator, iterator> equal_range(const key_type& k);
pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+ template<typename K>
+ pair<iterator, iterator> equal_range(const K& k); // C++20
+ template<typename K>
+ pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
mapped_type& operator[](const key_type& k);
mapped_type& operator[](key_type&& k);
iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
+ template<typename K>
+ iterator find(const K& x); // C++20
+ template<typename K>
+ const_iterator find(const K& x) const; // C++20
size_type count(const key_type& k) const;
+ template<typename K>
+ size_type count(const K& k) const; // C++20
bool contains(const key_type& k) const; // C++20
+ template<typename K>
+ bool contains(const K& k) const; // C++20
pair<iterator, iterator> equal_range(const key_type& k);
pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+ template<typename K>
+ pair<iterator, iterator> equal_range(const K& k); // C++20
+ template<typename K>
+ pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
size_type bucket_count() const noexcept;
size_type max_bucket_count() const noexcept;
*/
#include <__config>
+#include <__debug>
+#include <__functional/is_transparent.h>
#include <__hash_table>
#include <__node_handle>
+#include <__utility/forward.h>
+#include <compare>
#include <functional>
+#include <iterator> // __libcpp_erase_if_container
#include <stdexcept>
#include <tuple>
#include <version>
-#include <__debug>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Key, class _Cp, class _Hash,
+template <class _Key, class _Cp, class _Hash, class _Pred,
bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value>
class __unordered_map_hasher
: private _Hash
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Key& __x) const
{return static_cast<const _Hash&>(*this)(__x);}
+#if _LIBCPP_STD_VER > 17
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(const _K2& __x) const
+ {return static_cast<const _Hash&>(*this)(__x);}
+#endif
void swap(__unordered_map_hasher&__y)
_NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
{
}
};
-template <class _Key, class _Cp, class _Hash>
-class __unordered_map_hasher<_Key, _Cp, _Hash, false>
+template <class _Key, class _Cp, class _Hash, class _Pred>
+class __unordered_map_hasher<_Key, _Cp, _Hash, _Pred, false>
{
_Hash __hash_;
public:
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Key& __x) const
{return __hash_(__x);}
+#if _LIBCPP_STD_VER > 17
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(const _K2& __x) const
+ {return __hash_(__x);}
+#endif
void swap(__unordered_map_hasher&__y)
_NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
{
}
};
-template <class _Key, class _Cp, class _Hash, bool __b>
+template <class _Key, class _Cp, class _Hash, class _Pred, bool __b>
inline _LIBCPP_INLINE_VISIBILITY
void
-swap(__unordered_map_hasher<_Key, _Cp, _Hash, __b>& __x,
- __unordered_map_hasher<_Key, _Cp, _Hash, __b>& __y)
+swap(__unordered_map_hasher<_Key, _Cp, _Hash, _Pred, __b>& __x,
+ __unordered_map_hasher<_Key, _Cp, _Hash, _Pred, __b>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
{
__x.swap(__y);
}
-template <class _Key, class _Cp, class _Pred,
+template <class _Key, class _Cp, class _Pred, class _Hash,
bool = is_empty<_Pred>::value && !__libcpp_is_final<_Pred>::value>
class __unordered_map_equal
: private _Pred
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
{return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);}
+#if _LIBCPP_STD_VER > 17
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Cp& __x, const _K2& __y) const
+ {return static_cast<const _Pred&>(*this)(__x.__get_value().first, __y);}
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _K2& __x, const _Cp& __y) const
+ {return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);}
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Key& __x, const _K2& __y) const
+ {return static_cast<const _Pred&>(*this)(__x, __y);}
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _K2& __x, const _Key& __y) const
+ {return static_cast<const _Pred&>(*this)(__x, __y);}
+#endif
void swap(__unordered_map_equal&__y)
_NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
{
}
};
-template <class _Key, class _Cp, class _Pred>
-class __unordered_map_equal<_Key, _Cp, _Pred, false>
+template <class _Key, class _Cp, class _Pred, class _Hash>
+class __unordered_map_equal<_Key, _Cp, _Pred, _Hash, false>
{
_Pred __pred_;
public:
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
{return __pred_(__x, __y.__get_value().first);}
+#if _LIBCPP_STD_VER > 17
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Cp& __x, const _K2& __y) const
+ {return __pred_(__x.__get_value().first, __y);}
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _K2& __x, const _Cp& __y) const
+ {return __pred_(__x, __y.__get_value().first);}
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _Key& __x, const _K2& __y) const
+ {return __pred_(__x, __y);}
+ template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()(const _K2& __x, const _Key& __y) const
+ {return __pred_(__x, __y);}
+#endif
void swap(__unordered_map_equal&__y)
_NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
{
}
};
-template <class _Key, class _Cp, class _Pred, bool __b>
+template <class _Key, class _Cp, class _Pred, class _Hash, bool __b>
inline _LIBCPP_INLINE_VISIBILITY
void
-swap(__unordered_map_equal<_Key, _Cp, _Pred, __b>& __x,
- __unordered_map_equal<_Key, _Cp, _Pred, __b>& __y)
+swap(__unordered_map_equal<_Key, _Cp, _Pred, _Hash, __b>& __x,
+ __unordered_map_equal<_Key, _Cp, _Pred, _Hash, __b>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
{
__x.swap(__y);
{
const_cast<bool&>(__x.__value_constructed) = false;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void operator()(pointer __p) _NOEXCEPT
#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp>
-struct __hash_value_type
+struct _LIBCPP_STANDALONE_DEBUG __hash_value_type
{
typedef _Key key_type;
typedef _Tp mapped_type;
// types
typedef _Key key_type;
typedef _Tp mapped_type;
- typedef typename __identity<_Hash>::type hasher;
- typedef typename __identity<_Pred>::type key_equal;
- typedef typename __identity<_Alloc>::type allocator_type;
+ typedef __identity_t<_Hash> hasher;
+ typedef __identity_t<_Pred> key_equal;
+ typedef __identity_t<_Alloc> allocator_type;
typedef pair<const key_type, mapped_type> value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
"Invalid allocator::value_type");
private:
- typedef __hash_value_type<key_type, mapped_type> __value_type;
- typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;
- typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;
+ typedef __hash_value_type<key_type, mapped_type> __value_type;
+ typedef __unordered_map_hasher<key_type, __value_type, hasher, key_equal> __hasher;
+ typedef __unordered_map_equal<key_type, __value_type, key_equal, hasher> __key_equal;
typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
- __value_type>::type __allocator_type;
+ __value_type>::type __allocator_type;
typedef __hash_table<__value_type, __hasher,
__key_equal, __allocator_type> __table;
unordered_map()
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
unordered_map(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 11
_LIBCPP_INLINE_VISIBILITY
unordered_map(size_type __n, const allocator_type& __a)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
_LIBCPP_INLINE_VISIBILITY
unordered_map& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
{return __table_.__insert_unique(__x);}
iterator insert(const_iterator __p, const value_type& __x) {
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
" referring to this unordered_map");
{return __table_.__insert_unique(_VSTD::move(__x));}
iterator insert(const_iterator __p, value_type&& __x) {
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
" referring to this unordered_map");
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, _Pp&& __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, value_type&&) called with an iterator not"
" referring to this unordered_map");
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _Args&&... __args) {
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
" referring to this unordered_map");
return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)
{
- return __table_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct,
+ return __table_.__emplace_unique_key_args(__k, piecewise_construct,
_VSTD::forward_as_tuple(__k),
_VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
}
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args)
{
- return __table_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct,
+ return __table_.__emplace_unique_key_args(__k, piecewise_construct,
_VSTD::forward_as_tuple(_VSTD::move(__k)),
_VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
}
_LIBCPP_INLINE_VISIBILITY
iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
"unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
" referring to this unordered_map");
_LIBCPP_INLINE_VISIBILITY
iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
"unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
" referring to this unordered_map");
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
+
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, iterator>
+ find(const _K2& __k) {return __table_.find(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, const_iterator>
+ find(const _K2& __k) const {return __table_.find(__k);}
+ #endif // _LIBCPP_STD_VER > 17
+
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, size_type>
+ count(const _K2& __k) const {return __table_.__count_unique(__k);}
+ #endif // _LIBCPP_STD_VER > 17
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
+
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, bool>
+ contains(const _K2& __k) const {return find(__k) != end();}
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<iterator, iterator>>
+ equal_range(const _K2& __k) {return __table_.__equal_range_unique(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<const_iterator, const_iterator>>
+ equal_range(const _K2& __k) const {return __table_.__equal_range_unique(__k);}
+ #endif // _LIBCPP_STD_VER > 17
mapped_type& operator[](const key_type& __k);
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.reserve(__n);}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
bool __dereferenceable(const const_iterator* __i) const
{return __table_.__dereferenceable(&__i->__i_);}
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
{return __table_.__addable(&__i->__i_, __n);}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
private:
size_type __n, const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const allocator_type& __a)
: __table_(typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
_InputIterator __first, _InputIterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
insert(__first, __last);
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const unordered_map& __u)
: __table_(__u.__table_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__u.bucket_count());
const unordered_map& __u, const allocator_type& __a)
: __table_(__u.__table_, typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__u.bucket_count());
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
: __table_(_VSTD::move(__u.__table_))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
__get_db()->swap(this, &__u);
#endif
unordered_map&& __u, const allocator_type& __a)
: __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__a != __u.get_allocator())
__u.__table_.remove((__i++).__i_)->__value_.__move());
}
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
else
__get_db()->swap(this, &__u);
#endif
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
initializer_list<value_type> __il)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
insert(__il.begin(), __il.end());
const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
{
return __table_.__emplace_unique_key_args(__k,
- std::piecewise_construct, std::forward_as_tuple(__k),
- std::forward_as_tuple()).first->__get_value().second;
+ piecewise_construct, _VSTD::forward_as_tuple(__k),
+ _VSTD::forward_as_tuple()).first->__get_value().second;
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)
{
return __table_.__emplace_unique_key_args(__k,
- std::piecewise_construct, std::forward_as_tuple(std::move(__k)),
- std::forward_as_tuple()).first->__get_value().second;
+ piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__k)),
+ _VSTD::forward_as_tuple()).first->__get_value().second;
}
#else // _LIBCPP_CXX03_LANG
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));
__h.get_deleter().__second_constructed = true;
- return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
+ return __h;
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
return __r.first->second;
}
-#endif // _LIBCPP_CXX03_MODE
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
_Tp&
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type
erase_if(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __c,
_Predicate __pred) {
- return __libcpp_erase_if_container(__c, __pred);
+ return _VSTD::__libcpp_erase_if_container(__c, __pred);
}
#endif
// types
typedef _Key key_type;
typedef _Tp mapped_type;
- typedef typename __identity<_Hash>::type hasher;
- typedef typename __identity<_Pred>::type key_equal;
- typedef typename __identity<_Alloc>::type allocator_type;
+ typedef __identity_t<_Hash> hasher;
+ typedef __identity_t<_Pred> key_equal;
+ typedef __identity_t<_Alloc> allocator_type;
typedef pair<const key_type, mapped_type> value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
"Invalid allocator::value_type");
private:
- typedef __hash_value_type<key_type, mapped_type> __value_type;
- typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;
- typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;
+ typedef __hash_value_type<key_type, mapped_type> __value_type;
+ typedef __unordered_map_hasher<key_type, __value_type, hasher, key_equal> __hasher;
+ typedef __unordered_map_equal<key_type, __value_type, key_equal, hasher> __key_equal;
typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
- __value_type>::type __allocator_type;
+ __value_type>::type __allocator_type;
typedef __hash_table<__value_type, __hasher,
__key_equal, __allocator_type> __table;
unordered_multimap()
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
unordered_multimap(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 11
_LIBCPP_INLINE_VISIBILITY
unordered_multimap(size_type __n, const allocator_type& __a)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
_LIBCPP_INLINE_VISIBILITY
unordered_multimap& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
iterator emplace_hint(const_iterator __p, _Args&&... __args) {
return __table_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_Args>(__args)...);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, iterator>
+ find(const _K2& __k) {return __table_.find(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, const_iterator>
+ find(const _K2& __k) const {return __table_.find(__k);}
+ #endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, size_type>
+ count(const _K2& __k) const {return __table_.__count_multi(__k);}
+ #endif // _LIBCPP_STD_VER > 17
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
+
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, bool>
+ contains(const _K2& __k) const {return find(__k) != end();}
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<iterator, iterator>>
+ equal_range(const _K2& __k) {return __table_.__equal_range_multi(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<const_iterator, const_iterator>>
+ equal_range(const _K2& __k) const {return __table_.__equal_range_multi(__k);}
+ #endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.reserve(__n);}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
bool __dereferenceable(const const_iterator* __i) const
{return __table_.__dereferenceable(&__i->__i_);}
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
{return __table_.__addable(&__i->__i_, __n);}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
};
size_type __n, const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
_InputIterator __first, _InputIterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
insert(__first, __last);
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const allocator_type& __a)
: __table_(typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
const unordered_multimap& __u)
: __table_(__u.__table_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__u.bucket_count());
const unordered_multimap& __u, const allocator_type& __a)
: __table_(__u.__table_, typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__u.bucket_count());
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
: __table_(_VSTD::move(__u.__table_))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
__get_db()->swap(this, &__u);
#endif
unordered_multimap&& __u, const allocator_type& __a)
: __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__a != __u.get_allocator())
__u.__table_.remove((__i++).__i_)->__value_.__move());
}
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
else
__get_db()->swap(this, &__u);
#endif
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
initializer_list<value_type> __il)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
insert(__il.begin(), __il.end());
const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, typename __table::allocator_type(__a))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type
erase_if(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __c,
_Predicate __pred) {
- return __libcpp_erase_if_container(__c, __pred);
+ return _VSTD::__libcpp_erase_if_container(__c, __pred);
}
#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_UNORDERED_MAP
+#endif // _LIBCPP_UNORDERED_MAP
iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
+ template<typename K>
+ iterator find(const K& x); // C++20
+ template<typename K>
+ const_iterator find(const K& x) const; // C++20
size_type count(const key_type& k) const;
+ template<typename K>
+ size_type count(const K& k) const; // C++20
bool contains(const key_type& k) const; // C++20
+ template<typename K>
+ bool contains(const K& k) const; // C++20
pair<iterator, iterator> equal_range(const key_type& k);
pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+ template<typename K>
+ pair<iterator, iterator> equal_range(const K& k); // C++20
+ template<typename K>
+ pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
size_type bucket_count() const noexcept;
size_type max_bucket_count() const noexcept;
iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
+ template<typename K>
+ iterator find(const K& x); // C++20
+ template<typename K>
+ const_iterator find(const K& x) const; // C++20
size_type count(const key_type& k) const;
+ template<typename K>
+ size_type count(const K& k) const; // C++20
bool contains(const key_type& k) const; // C++20
+ template<typename K>
+ bool contains(const K& k) const; // C++20
pair<iterator, iterator> equal_range(const key_type& k);
pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+ template<typename K>
+ pair<iterator, iterator> equal_range(const K& k); // C++20
+ template<typename K>
+ pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
size_type bucket_count() const noexcept;
size_type max_bucket_count() const noexcept;
*/
#include <__config>
+#include <__debug>
+#include <__functional/is_transparent.h>
#include <__hash_table>
#include <__node_handle>
+#include <__utility/forward.h>
+#include <compare>
#include <functional>
+#include <iterator> // __libcpp_erase_if_container
#include <version>
-#include <__debug>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
// types
typedef _Value key_type;
typedef key_type value_type;
- typedef typename __identity<_Hash>::type hasher;
- typedef typename __identity<_Pred>::type key_equal;
- typedef typename __identity<_Alloc>::type allocator_type;
+ typedef __identity_t<_Hash> hasher;
+ typedef __identity_t<_Pred> key_equal;
+ typedef __identity_t<_Alloc> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
unordered_set()
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
const hasher& __hf, const allocator_type& __a)
: unordered_set(__il, __n, __hf, key_equal(), __a) {}
#endif
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
~unordered_set() {
static_assert(sizeof(__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
_LIBCPP_INLINE_VISIBILITY
unordered_set& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
{return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
iterator emplace_hint(const_iterator __p, _Args&&... __args)
{
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
pair<iterator, bool> insert(value_type&& __x)
{return __table_.__insert_unique(_VSTD::move(__x));}
_LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
iterator insert(const_iterator __p, value_type&& __x)
{
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(const value_type& __x)
{return __table_.__insert_unique(__x);}
_LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
iterator insert(const_iterator __p, const value_type& __x)
{
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, iterator>
+ find(const _K2& __k) {return __table_.find(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, const_iterator>
+ find(const _K2& __k) const {return __table_.find(__k);}
+ #endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, size_type>
+ count(const _K2& __k) const {return __table_.__count_unique(__k);}
+ #endif // _LIBCPP_STD_VER > 17
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
+
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, bool>
+ contains(const _K2& __k) const {return find(__k) != end();}
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<iterator, iterator>>
+ equal_range(const _K2& __k) {return __table_.__equal_range_unique(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<const_iterator, const_iterator>>
+ equal_range(const _K2& __k) const {return __table_.__equal_range_unique(__k);}
+ #endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.reserve(__n);}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
bool __dereferenceable(const const_iterator* __i) const
{return __table_.__dereferenceable(__i);}
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
{return __table_.__addable(__i, __n);}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
};
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
_InputIterator __first, _InputIterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
insert(__first, __last);
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const allocator_type& __a)
: __table_(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
const unordered_set& __u)
: __table_(__u.__table_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__u.bucket_count());
const unordered_set& __u, const allocator_type& __a)
: __table_(__u.__table_, __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__u.bucket_count());
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
: __table_(_VSTD::move(__u.__table_))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
__get_db()->swap(this, &__u);
#endif
unordered_set&& __u, const allocator_type& __a)
: __table_(_VSTD::move(__u.__table_), __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__a != __u.get_allocator())
while (__u.size() != 0)
__table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_));
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
else
__get_db()->swap(this, &__u);
#endif
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
initializer_list<value_type> __il)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
insert(__il.begin(), __il.end());
const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
typename unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type
erase_if(unordered_set<_Value, _Hash, _Pred, _Alloc>& __c,
_Predicate __pred) {
- return __libcpp_erase_if_container(__c, __pred);
+ return _VSTD::__libcpp_erase_if_container(__c, __pred);
}
#endif
// types
typedef _Value key_type;
typedef key_type value_type;
- typedef typename __identity<_Hash>::type hasher;
- typedef typename __identity<_Pred>::type key_equal;
- typedef typename __identity<_Alloc>::type allocator_type;
+ typedef __identity_t<_Hash> hasher;
+ typedef __identity_t<_Pred> key_equal;
+ typedef __identity_t<_Alloc> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
unordered_multiset()
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
: unordered_multiset(__il, __n, __hf, key_equal(), __a) {}
#endif
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
~unordered_multiset() {
static_assert(sizeof(__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");
unordered_multiset& operator=(unordered_multiset&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
unordered_multiset& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, iterator>
+ find(const _K2& __k) {return __table_.find(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, const_iterator>
+ find(const _K2& __k) const {return __table_.find(__k);}
+ #endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, size_type>
+ count(const _K2& __k) const {return __table_.__count_multi(__k);}
+ #endif // _LIBCPP_STD_VER > 17
#if _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
+
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, bool>
+ contains(const _K2& __k) const {return find(__k) != end();}
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
+ #if _LIBCPP_STD_VER > 17
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<iterator, iterator>>
+ equal_range(const _K2& __k) {return __table_.__equal_range_multi(__k);}
+ template <typename _K2>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<const_iterator, const_iterator>>
+ equal_range(const _K2& __k) const {return __table_.__equal_range_multi(__k);}
+ #endif // _LIBCPP_STD_VER > 17
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.reserve(__n);}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
bool __dereferenceable(const const_iterator* __i) const
{return __table_.__dereferenceable(__i);}
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
{return __table_.__addable(__i, __n);}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
};
size_type __n, const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
_InputIterator __first, _InputIterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
insert(__first, __last);
const hasher& __hf, const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const allocator_type& __a)
: __table_(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
const unordered_multiset& __u)
: __table_(__u.__table_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__u.bucket_count());
const unordered_multiset& __u, const allocator_type& __a)
: __table_(__u.__table_, __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__u.bucket_count());
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
: __table_(_VSTD::move(__u.__table_))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
__get_db()->swap(this, &__u);
#endif
unordered_multiset&& __u, const allocator_type& __a)
: __table_(_VSTD::move(__u.__table_), __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__a != __u.get_allocator())
while (__u.size() != 0)
__table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_));
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
else
__get_db()->swap(this, &__u);
#endif
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
initializer_list<value_type> __il)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
insert(__il.begin(), __il.end());
const key_equal& __eql)
: __table_(__hf, __eql)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
const key_equal& __eql, const allocator_type& __a)
: __table_(__hf, __eql, __a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
__table_.rehash(__n);
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
typename unordered_multiset<_Value, _Hash, _Pred, _Alloc>::size_type
erase_if(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __c,
_Predicate __pred) {
- return __libcpp_erase_if_container(__c, __pred);
+ return _VSTD::__libcpp_erase_if_container(__c, __pred);
}
#endif
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_UNORDERED_SET
+#endif // _LIBCPP_UNORDERED_SET
template <class T> typename add_rvalue_reference<T>::type declval() noexcept;
+template<class T, class U> constexpr bool cmp_equal(T t, U u) noexcept; // C++20
+template<class T, class U> constexpr bool cmp_not_equal(T t, U u) noexcept; // C++20
+template<class T, class U> constexpr bool cmp_less(T t, U u) noexcept; // C++20
+template<class T, class U> constexpr bool cmp_greater(T t, U u) noexcept; // C++20
+template<class T, class U> constexpr bool cmp_less_equal(T t, U u) noexcept; // C++20
+template<class T, class U> constexpr bool cmp_greater_equal(T t, U u) noexcept; // C++20
+template<class R, class T> constexpr bool in_range(T t) noexcept; // C++20
+
template <class T1, class T2>
struct pair
{
template <class U, class V> explicit(see-below) pair(pair<U, V>&& p); // constexpr in C++14
template <class... Args1, class... Args2>
pair(piecewise_construct_t, tuple<Args1...> first_args,
- tuple<Args2...> second_args);
+ tuple<Args2...> second_args); // constexpr in C++20
- template <class U, class V> pair& operator=(const pair<U, V>& p);
+ template <class U, class V> pair& operator=(const pair<U, V>& p); // constexpr in C++20
pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable<T1>::value &&
- is_nothrow_move_assignable<T2>::value);
- template <class U, class V> pair& operator=(pair<U, V>&& p);
+ is_nothrow_move_assignable<T2>::value); // constexpr in C++20
+ template <class U, class V> pair& operator=(pair<U, V>&& p); // constexpr in C++20
void swap(pair& p) noexcept(is_nothrow_swappable_v<T1> &&
- is_nothrow_swappable_v<T2>);
+ is_nothrow_swappable_v<T2>); // constexpr in C++20
};
template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
-template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&); // constexpr in C++14
+template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&); // constexpr in C++14
template <class T1, class T2>
void
-swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
+swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20
struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
template <size_t I>
inline constexpr in_place_index_t<I> in_place_index{};
+// [utility.underlying], to_underlying
+template <class T>
+ constexpr underlying_type_t<T> to_underlying( T value ) noexcept; // C++2b
+
} // std
*/
#include <__config>
+#include <__debug>
#include <__tuple>
-#include <type_traits>
+#include <__utility/as_const.h>
+#include <__utility/cmp.h>
+#include <__utility/declval.h>
+#include <__utility/exchange.h>
+#include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/integer_sequence.h>
+#include <__utility/move.h>
+#include <__utility/pair.h>
+#include <__utility/piecewise_construct.h>
+#include <__utility/rel_ops.h>
+#include <__utility/swap.h>
+#include <__utility/to_underlying.h>
+#include <compare>
#include <initializer_list>
-#include <cstddef>
-#include <cstring>
-#include <cstdint>
#include <version>
-#include <__debug>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-namespace rel_ops
-{
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const _Tp& __x, const _Tp& __y)
-{
- return !(__x == __y);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator> (const _Tp& __x, const _Tp& __y)
-{
- return __y < __x;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<=(const _Tp& __x, const _Tp& __y)
-{
- return !(__y < __x);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator>=(const _Tp& __x, const _Tp& __y)
-{
- return !(__x < __y);
-}
-
-} // rel_ops
-
-// swap_ranges is defined in <type_traits>`
-
-// swap is defined in <type_traits>
-
-// move_if_noexcept
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-#ifndef _LIBCPP_CXX03_LANG
-typename conditional
-<
- !is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value,
- const _Tp&,
- _Tp&&
->::type
-#else // _LIBCPP_CXX03_LANG
-const _Tp&
-#endif
-move_if_noexcept(_Tp& __x) _NOEXCEPT
-{
- return _VSTD::move(__x);
-}
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp> constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
-template <class _Tp> void as_const(const _Tp&&) = delete;
-#endif
-
-struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-extern _LIBCPP_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
-#else
-/* _LIBCPP_INLINE_VAR */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
-#endif
-
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
-template <class, class>
-struct __non_trivially_copyable_base {
- _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
- __non_trivially_copyable_base() _NOEXCEPT {}
- _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
- __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
-};
-#endif
-
-template <class _T1, class _T2>
-struct _LIBCPP_TEMPLATE_VIS pair
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
-: private __non_trivially_copyable_base<_T1, _T2>
-#endif
-{
- typedef _T1 first_type;
- typedef _T2 second_type;
-
- _T1 first;
- _T2 second;
-
-#if !defined(_LIBCPP_CXX03_LANG)
- pair(pair const&) = default;
- pair(pair&&) = default;
-#else
- // Use the implicitly declared copy constructor in C++03
-#endif
-
-#ifdef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
- pair() : first(), second() {}
-
- _LIBCPP_INLINE_VISIBILITY
- pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
-
- template <class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY
- pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
-
- _LIBCPP_INLINE_VISIBILITY
- pair& operator=(pair const& __p) {
- first = __p.first;
- second = __p.second;
- return *this;
- }
-#else
- template <bool _Val>
- using _EnableB _LIBCPP_NODEBUG_TYPE = typename enable_if<_Val, bool>::type;
-
- struct _CheckArgs {
- template <int&...>
- static constexpr bool __enable_explicit_default() {
- return is_default_constructible<_T1>::value
- && is_default_constructible<_T2>::value
- && !__enable_implicit_default<>();
- }
-
- template <int&...>
- static constexpr bool __enable_implicit_default() {
- return __is_implicitly_default_constructible<_T1>::value
- && __is_implicitly_default_constructible<_T2>::value;
- }
-
- template <class _U1, class _U2>
- static constexpr bool __enable_explicit() {
- return is_constructible<first_type, _U1>::value
- && is_constructible<second_type, _U2>::value
- && (!is_convertible<_U1, first_type>::value
- || !is_convertible<_U2, second_type>::value);
- }
-
- template <class _U1, class _U2>
- static constexpr bool __enable_implicit() {
- return is_constructible<first_type, _U1>::value
- && is_constructible<second_type, _U2>::value
- && is_convertible<_U1, first_type>::value
- && is_convertible<_U2, second_type>::value;
- }
- };
-
- template <bool _MaybeEnable>
- using _CheckArgsDep _LIBCPP_NODEBUG_TYPE = typename conditional<
- _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
-
- struct _CheckTupleLikeConstructor {
- template <class _Tuple>
- static constexpr bool __enable_implicit() {
- return __tuple_convertible<_Tuple, pair>::value;
- }
-
- template <class _Tuple>
- static constexpr bool __enable_explicit() {
- return __tuple_constructible<_Tuple, pair>::value
- && !__tuple_convertible<_Tuple, pair>::value;
- }
-
- template <class _Tuple>
- static constexpr bool __enable_assign() {
- return __tuple_assignable<_Tuple, pair>::value;
- }
- };
-
- template <class _Tuple>
- using _CheckTLC _LIBCPP_NODEBUG_TYPE = typename conditional<
- __tuple_like_with_size<_Tuple, 2>::value
- && !is_same<typename decay<_Tuple>::type, pair>::value,
- _CheckTupleLikeConstructor,
- __check_tuple_constructor_fail
- >::type;
-
- template<bool _Dummy = true, _EnableB<
- _CheckArgsDep<_Dummy>::__enable_explicit_default()
- > = false>
- explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
- is_nothrow_default_constructible<second_type>::value)
- : first(), second() {}
-
- template<bool _Dummy = true, _EnableB<
- _CheckArgsDep<_Dummy>::__enable_implicit_default()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
- is_nothrow_default_constructible<second_type>::value)
- : first(), second() {}
-
- template <bool _Dummy = true, _EnableB<
- _CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit pair(_T1 const& __t1, _T2 const& __t2)
- _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
- is_nothrow_copy_constructible<second_type>::value)
- : first(__t1), second(__t2) {}
-
- template<bool _Dummy = true, _EnableB<
- _CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(_T1 const& __t1, _T2 const& __t2)
- _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
- is_nothrow_copy_constructible<second_type>::value)
- : first(__t1), second(__t2) {}
-
- template<class _U1, class _U2, _EnableB<
- _CheckArgs::template __enable_explicit<_U1, _U2>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit pair(_U1&& __u1, _U2&& __u2)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
- is_nothrow_constructible<second_type, _U2>::value))
- : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
-
- template<class _U1, class _U2, _EnableB<
- _CheckArgs::template __enable_implicit<_U1, _U2>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(_U1&& __u1, _U2&& __u2)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
- is_nothrow_constructible<second_type, _U2>::value))
- : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
-
- template<class _U1, class _U2, _EnableB<
- _CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit pair(pair<_U1, _U2> const& __p)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
- is_nothrow_constructible<second_type, _U2 const&>::value))
- : first(__p.first), second(__p.second) {}
-
- template<class _U1, class _U2, _EnableB<
- _CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(pair<_U1, _U2> const& __p)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
- is_nothrow_constructible<second_type, _U2 const&>::value))
- : first(__p.first), second(__p.second) {}
-
- template<class _U1, class _U2, _EnableB<
- _CheckArgs::template __enable_explicit<_U1, _U2>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit pair(pair<_U1, _U2>&&__p)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
- is_nothrow_constructible<second_type, _U2&&>::value))
- : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
-
- template<class _U1, class _U2, _EnableB<
- _CheckArgs::template __enable_implicit<_U1, _U2>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(pair<_U1, _U2>&& __p)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
- is_nothrow_constructible<second_type, _U2&&>::value))
- : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
-
- template<class _Tuple, _EnableB<
- _CheckTLC<_Tuple>::template __enable_explicit<_Tuple>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit pair(_Tuple&& __p)
- : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
- second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
-
- template<class _Tuple, _EnableB<
- _CheckTLC<_Tuple>::template __enable_implicit<_Tuple>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(_Tuple&& __p)
- : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
- second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
-
- template <class... _Args1, class... _Args2>
- _LIBCPP_INLINE_VISIBILITY
- pair(piecewise_construct_t __pc,
- tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value &&
- is_nothrow_constructible<second_type, _Args2...>::value))
- : pair(__pc, __first_args, __second_args,
- typename __make_tuple_indices<sizeof...(_Args1)>::type(),
- typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- pair& operator=(typename conditional<
- is_copy_assignable<first_type>::value &&
- is_copy_assignable<second_type>::value,
- pair, __nat>::type const& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value &&
- is_nothrow_copy_assignable<second_type>::value)
- {
- first = __p.first;
- second = __p.second;
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- pair& operator=(typename conditional<
- is_move_assignable<first_type>::value &&
- is_move_assignable<second_type>::value,
- pair, __nat>::type&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
- is_nothrow_move_assignable<second_type>::value)
- {
- first = _VSTD::forward<first_type>(__p.first);
- second = _VSTD::forward<second_type>(__p.second);
- return *this;
- }
-
- template <class _Tuple, _EnableB<
- _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
- > = false>
- _LIBCPP_INLINE_VISIBILITY
- pair& operator=(_Tuple&& __p) {
- first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
- second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
- return *this;
- }
-#endif
-
- _LIBCPP_INLINE_VISIBILITY
- void
- swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
- __is_nothrow_swappable<second_type>::value)
- {
- using _VSTD::swap;
- swap(first, __p.first);
- swap(second, __p.second);
- }
-private:
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
- _LIBCPP_INLINE_VISIBILITY
- pair(piecewise_construct_t,
- tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
- __tuple_indices<_I1...>, __tuple_indices<_I2...>);
-#endif
-};
-
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-template<class _T1, class _T2>
-pair(_T1, _T2) -> pair<_T1, _T2>;
-#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-bool
-operator==(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
-{
- return __x.first == __y.first && __x.second == __y.second;
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-bool
-operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
-{
- return !(__x == __y);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-bool
-operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
-{
- return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-bool
-operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
-{
- return __y < __x;
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-bool
-operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
-{
- return !(__x < __y);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-bool
-operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
-{
- return !(__y < __x);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- __is_swappable<_T1>::value &&
- __is_swappable<_T2>::value,
- void
->::type
-swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
- _NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value))
-{
- __x.swap(__y);
-}
-
-template <class _Tp>
-struct __unwrap_reference { typedef _LIBCPP_NODEBUG_TYPE _Tp type; };
-
-template <class _Tp>
-struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _LIBCPP_NODEBUG_TYPE _Tp& type; };
-
-#if _LIBCPP_STD_VER > 17
-template <class _Tp>
-struct unwrap_reference : __unwrap_reference<_Tp> { };
-
-template <class _Tp>
-struct unwrap_ref_decay : unwrap_reference<typename decay<_Tp>::type> { };
-#endif // > C++17
-
-template <class _Tp>
-struct __unwrap_ref_decay
-#if _LIBCPP_STD_VER > 17
- : unwrap_ref_decay<_Tp>
-#else
- : __unwrap_reference<typename decay<_Tp>::type>
-#endif
-{ };
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
-make_pair(_T1&& __t1, _T2&& __t2)
-{
- return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
- (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
-}
-
-#else // _LIBCPP_CXX03_LANG
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-pair<_T1,_T2>
-make_pair(_T1 __x, _T2 __y)
-{
- return pair<_T1, _T2>(__x, __y);
-}
-
-#endif // _LIBCPP_CXX03_LANG
-
-template <class _T1, class _T2>
- struct _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> >
- : public integral_constant<size_t, 2> {};
-
-template <size_t _Ip, class _T1, class _T2>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> >
-{
- static_assert(_Ip < 2, "Index out of bounds in std::tuple_element<std::pair<T1, T2>>");
-};
-
-template <class _T1, class _T2>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> >
-{
- typedef _LIBCPP_NODEBUG_TYPE _T1 type;
-};
-
-template <class _T1, class _T2>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> >
-{
- typedef _LIBCPP_NODEBUG_TYPE _T2 type;
-};
-
-template <size_t _Ip> struct __get_pair;
-
-template <>
-struct __get_pair<0>
-{
- template <class _T1, class _T2>
- static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- _T1&
- get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
-
- template <class _T1, class _T2>
- static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- const _T1&
- get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class _T1, class _T2>
- static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- _T1&&
- get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
-
- template <class _T1, class _T2>
- static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- const _T1&&
- get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
-#endif // _LIBCPP_CXX03_LANG
-};
-
-template <>
-struct __get_pair<1>
-{
- template <class _T1, class _T2>
- static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- _T2&
- get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
-
- template <class _T1, class _T2>
- static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- const _T2&
- get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
-
-#ifndef _LIBCPP_CXX03_LANG
- template <class _T1, class _T2>
- static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- _T2&&
- get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
-
- template <class _T1, class _T2>
- static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- const _T2&&
- get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
-#endif // _LIBCPP_CXX03_LANG
-};
-
-template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-typename tuple_element<_Ip, pair<_T1, _T2> >::type&
-get(pair<_T1, _T2>& __p) _NOEXCEPT
-{
- return __get_pair<_Ip>::get(__p);
-}
-
-template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
-get(const pair<_T1, _T2>& __p) _NOEXCEPT
-{
- return __get_pair<_Ip>::get(__p);
-}
-
-#ifndef _LIBCPP_CXX03_LANG
-template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
-get(pair<_T1, _T2>&& __p) _NOEXCEPT
-{
- return __get_pair<_Ip>::get(_VSTD::move(__p));
-}
-
-template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
-get(const pair<_T1, _T2>&& __p) _NOEXCEPT
-{
- return __get_pair<_Ip>::get(_VSTD::move(__p));
-}
-#endif // _LIBCPP_CXX03_LANG
-
-#if _LIBCPP_STD_VER > 11
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr _T1 & get(pair<_T1, _T2>& __p) _NOEXCEPT
-{
- return __get_pair<0>::get(__p);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr _T1 const & get(pair<_T1, _T2> const& __p) _NOEXCEPT
-{
- return __get_pair<0>::get(__p);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr _T1 && get(pair<_T1, _T2>&& __p) _NOEXCEPT
-{
- return __get_pair<0>::get(_VSTD::move(__p));
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr _T1 const && get(pair<_T1, _T2> const&& __p) _NOEXCEPT
-{
- return __get_pair<0>::get(_VSTD::move(__p));
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr _T1 & get(pair<_T2, _T1>& __p) _NOEXCEPT
-{
- return __get_pair<1>::get(__p);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr _T1 const & get(pair<_T2, _T1> const& __p) _NOEXCEPT
-{
- return __get_pair<1>::get(__p);
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr _T1 && get(pair<_T2, _T1>&& __p) _NOEXCEPT
-{
- return __get_pair<1>::get(_VSTD::move(__p));
-}
-
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr _T1 const && get(pair<_T2, _T1> const&& __p) _NOEXCEPT
-{
- return __get_pair<1>::get(_VSTD::move(__p));
-}
-
-#endif
-
-#if _LIBCPP_STD_VER > 11
-
-template<class _Tp, _Tp... _Ip>
-struct _LIBCPP_TEMPLATE_VIS integer_sequence
-{
- typedef _Tp value_type;
- static_assert( is_integral<_Tp>::value,
- "std::integer_sequence can only be instantiated with an integral type" );
- static
- _LIBCPP_INLINE_VISIBILITY
- constexpr
- size_t
- size() noexcept { return sizeof...(_Ip); }
-};
-
-template<size_t... _Ip>
- using index_sequence = integer_sequence<size_t, _Ip...>;
-
-#if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
-
-template <class _Tp, _Tp _Ep>
-using __make_integer_sequence _LIBCPP_NODEBUG_TYPE = __make_integer_seq<integer_sequence, _Tp, _Ep>;
-
-#else
-
-template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked _LIBCPP_NODEBUG_TYPE =
- typename __detail::__make<_Np>::type::template __convert<integer_sequence, _Tp>;
-
-template <class _Tp, _Tp _Ep>
-struct __make_integer_sequence_checked
-{
- static_assert(is_integral<_Tp>::value,
- "std::make_integer_sequence can only be instantiated with an integral type" );
- static_assert(0 <= _Ep, "std::make_integer_sequence must have a non-negative sequence length");
- // Workaround GCC bug by preventing bad installations when 0 <= _Ep
- // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68929
- typedef _LIBCPP_NODEBUG_TYPE __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type;
-};
-
-template <class _Tp, _Tp _Ep>
-using __make_integer_sequence _LIBCPP_NODEBUG_TYPE = typename __make_integer_sequence_checked<_Tp, _Ep>::type;
-
-#endif
-
-template<class _Tp, _Tp _Np>
- using make_integer_sequence = __make_integer_sequence<_Tp, _Np>;
-
-template<size_t _Np>
- using make_index_sequence = make_integer_sequence<size_t, _Np>;
-
-template<class... _Tp>
- using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
-
-#endif // _LIBCPP_STD_VER > 11
-
-#if _LIBCPP_STD_VER > 11
-template<class _T1, class _T2 = _T1>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_T1 exchange(_T1& __obj, _T2 && __new_value)
-{
- _T1 __old_value = _VSTD::move(__obj);
- __obj = _VSTD::forward<_T2>(__new_value);
- return __old_value;
-}
-#endif // _LIBCPP_STD_VER > 11
-
-#if _LIBCPP_STD_VER > 14
-
-struct _LIBCPP_TYPE_VIS in_place_t {
- explicit in_place_t() = default;
-};
-_LIBCPP_INLINE_VAR constexpr in_place_t in_place{};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS in_place_type_t {
- explicit in_place_type_t() = default;
-};
-template <class _Tp>
-_LIBCPP_INLINE_VAR constexpr in_place_type_t<_Tp> in_place_type{};
-
-template <size_t _Idx>
-struct _LIBCPP_TYPE_VIS in_place_index_t {
- explicit in_place_index_t() = default;
-};
-template <size_t _Idx>
-_LIBCPP_INLINE_VAR constexpr in_place_index_t<_Idx> in_place_index{};
-
-template <class _Tp> struct __is_inplace_type_imp : false_type {};
-template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
-
-template <class _Tp>
-using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>;
-
-template <class _Tp> struct __is_inplace_index_imp : false_type {};
-template <size_t _Idx> struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {};
-
-template <class _Tp>
-using __is_inplace_index = __is_inplace_index_imp<__uncvref_t<_Tp>>;
-
-#endif // _LIBCPP_STD_VER > 14
-
-template <class _Arg, class _Result>
-struct _LIBCPP_TEMPLATE_VIS unary_function
-{
- typedef _Arg argument_type;
- typedef _Result result_type;
-};
-
-template <class _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_Size
-__loadword(const void* __p)
-{
- _Size __r;
- std::memcpy(&__r, __p, sizeof(__r));
- return __r;
-}
-
-// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
-// is 64 bits. This is because cityhash64 uses 64bit x 64bit
-// multiplication, which can be very slow on 32-bit systems.
-template <class _Size, size_t = sizeof(_Size)*__CHAR_BIT__>
-struct __murmur2_or_cityhash;
-
-template <class _Size>
-struct __murmur2_or_cityhash<_Size, 32>
-{
- inline _Size operator()(const void* __key, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
-};
-
-// murmur2
-template <class _Size>
-_Size
-__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
-{
- const _Size __m = 0x5bd1e995;
- const _Size __r = 24;
- _Size __h = __len;
- const unsigned char* __data = static_cast<const unsigned char*>(__key);
- for (; __len >= 4; __data += 4, __len -= 4)
- {
- _Size __k = __loadword<_Size>(__data);
- __k *= __m;
- __k ^= __k >> __r;
- __k *= __m;
- __h *= __m;
- __h ^= __k;
- }
- switch (__len)
- {
- case 3:
- __h ^= __data[2] << 16;
- _LIBCPP_FALLTHROUGH();
- case 2:
- __h ^= __data[1] << 8;
- _LIBCPP_FALLTHROUGH();
- case 1:
- __h ^= __data[0];
- __h *= __m;
- }
- __h ^= __h >> 13;
- __h *= __m;
- __h ^= __h >> 15;
- return __h;
-}
-
-template <class _Size>
-struct __murmur2_or_cityhash<_Size, 64>
-{
- inline _Size operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
-
- private:
- // Some primes between 2^63 and 2^64.
- static const _Size __k0 = 0xc3a5c85c97cb3127ULL;
- static const _Size __k1 = 0xb492b66fbe98f273ULL;
- static const _Size __k2 = 0x9ae16a3b2f90404fULL;
- static const _Size __k3 = 0xc949d7c7509e6557ULL;
-
- static _Size __rotate(_Size __val, int __shift) {
- return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift)));
- }
-
- static _Size __rotate_by_at_least_1(_Size __val, int __shift) {
- return (__val >> __shift) | (__val << (64 - __shift));
- }
-
- static _Size __shift_mix(_Size __val) {
- return __val ^ (__val >> 47);
- }
-
- static _Size __hash_len_16(_Size __u, _Size __v)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
- const _Size __mul = 0x9ddfea08eb382d69ULL;
- _Size __a = (__u ^ __v) * __mul;
- __a ^= (__a >> 47);
- _Size __b = (__v ^ __a) * __mul;
- __b ^= (__b >> 47);
- __b *= __mul;
- return __b;
- }
-
- static _Size __hash_len_0_to_16(const char* __s, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
- if (__len > 8) {
- const _Size __a = __loadword<_Size>(__s);
- const _Size __b = __loadword<_Size>(__s + __len - 8);
- return __hash_len_16(__a, __rotate_by_at_least_1(__b + __len, __len)) ^ __b;
- }
- if (__len >= 4) {
- const uint32_t __a = __loadword<uint32_t>(__s);
- const uint32_t __b = __loadword<uint32_t>(__s + __len - 4);
- return __hash_len_16(__len + (__a << 3), __b);
- }
- if (__len > 0) {
- const unsigned char __a = __s[0];
- const unsigned char __b = __s[__len >> 1];
- const unsigned char __c = __s[__len - 1];
- const uint32_t __y = static_cast<uint32_t>(__a) +
- (static_cast<uint32_t>(__b) << 8);
- const uint32_t __z = __len + (static_cast<uint32_t>(__c) << 2);
- return __shift_mix(__y * __k2 ^ __z * __k3) * __k2;
- }
- return __k2;
- }
-
- static _Size __hash_len_17_to_32(const char *__s, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
- const _Size __a = __loadword<_Size>(__s) * __k1;
- const _Size __b = __loadword<_Size>(__s + 8);
- const _Size __c = __loadword<_Size>(__s + __len - 8) * __k2;
- const _Size __d = __loadword<_Size>(__s + __len - 16) * __k0;
- return __hash_len_16(__rotate(__a - __b, 43) + __rotate(__c, 30) + __d,
- __a + __rotate(__b ^ __k3, 20) - __c + __len);
- }
-
- // Return a 16-byte hash for 48 bytes. Quick and dirty.
- // Callers do best to use "random-looking" values for a and b.
- static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
- _Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
- __a += __w;
- __b = __rotate(__b + __a + __z, 21);
- const _Size __c = __a;
- __a += __x;
- __a += __y;
- __b += __rotate(__a, 44);
- return pair<_Size, _Size>(__a + __z, __b + __c);
- }
-
- // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.
- static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
- const char* __s, _Size __a, _Size __b)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
- return __weak_hash_len_32_with_seeds(__loadword<_Size>(__s),
- __loadword<_Size>(__s + 8),
- __loadword<_Size>(__s + 16),
- __loadword<_Size>(__s + 24),
- __a,
- __b);
- }
-
- // Return an 8-byte hash for 33 to 64 bytes.
- static _Size __hash_len_33_to_64(const char *__s, size_t __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
- _Size __z = __loadword<_Size>(__s + 24);
- _Size __a = __loadword<_Size>(__s) +
- (__len + __loadword<_Size>(__s + __len - 16)) * __k0;
- _Size __b = __rotate(__a + __z, 52);
- _Size __c = __rotate(__a, 37);
- __a += __loadword<_Size>(__s + 8);
- __c += __rotate(__a, 7);
- __a += __loadword<_Size>(__s + 16);
- _Size __vf = __a + __z;
- _Size __vs = __b + __rotate(__a, 31) + __c;
- __a = __loadword<_Size>(__s + 16) + __loadword<_Size>(__s + __len - 32);
- __z += __loadword<_Size>(__s + __len - 8);
- __b = __rotate(__a + __z, 52);
- __c = __rotate(__a, 37);
- __a += __loadword<_Size>(__s + __len - 24);
- __c += __rotate(__a, 7);
- __a += __loadword<_Size>(__s + __len - 16);
- _Size __wf = __a + __z;
- _Size __ws = __b + __rotate(__a, 31) + __c;
- _Size __r = __shift_mix((__vf + __ws) * __k2 + (__wf + __vs) * __k0);
- return __shift_mix(__r * __k0 + __vs) * __k2;
- }
-};
-
-// cityhash64
-template <class _Size>
-_Size
-__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
-{
- const char* __s = static_cast<const char*>(__key);
- if (__len <= 32) {
- if (__len <= 16) {
- return __hash_len_0_to_16(__s, __len);
- } else {
- return __hash_len_17_to_32(__s, __len);
- }
- } else if (__len <= 64) {
- return __hash_len_33_to_64(__s, __len);
- }
-
- // For strings over 64 bytes we hash the end first, and then as we
- // loop we keep 56 bytes of state: v, w, x, y, and z.
- _Size __x = __loadword<_Size>(__s + __len - 40);
- _Size __y = __loadword<_Size>(__s + __len - 16) +
- __loadword<_Size>(__s + __len - 56);
- _Size __z = __hash_len_16(__loadword<_Size>(__s + __len - 48) + __len,
- __loadword<_Size>(__s + __len - 24));
- pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
- pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
- __x = __x * __k1 + __loadword<_Size>(__s);
-
- // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
- __len = (__len - 1) & ~static_cast<_Size>(63);
- do {
- __x = __rotate(__x + __y + __v.first + __loadword<_Size>(__s + 8), 37) * __k1;
- __y = __rotate(__y + __v.second + __loadword<_Size>(__s + 48), 42) * __k1;
- __x ^= __w.second;
- __y += __v.first + __loadword<_Size>(__s + 40);
- __z = __rotate(__z + __w.first, 33) * __k1;
- __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
- __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
- __y + __loadword<_Size>(__s + 16));
- std::swap(__z, __x);
- __s += 64;
- __len -= 64;
- } while (__len != 0);
- return __hash_len_16(
- __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
- __hash_len_16(__v.second, __w.second) + __x);
-}
-
-template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)>
-struct __scalar_hash;
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 0>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- size_t __a;
- } __u;
- __u.__a = 0;
- __u.__t = __v;
- return __u.__a;
- }
-};
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 1>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- size_t __a;
- } __u;
- __u.__t = __v;
- return __u.__a;
- }
-};
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 2>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- struct
- {
- size_t __a;
- size_t __b;
- } __s;
- } __u;
- __u.__t = __v;
- return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
- }
-};
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 3>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- struct
- {
- size_t __a;
- size_t __b;
- size_t __c;
- } __s;
- } __u;
- __u.__t = __v;
- return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
- }
-};
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 4>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- struct
- {
- size_t __a;
- size_t __b;
- size_t __c;
- size_t __d;
- } __s;
- } __u;
- __u.__t = __v;
- return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
- }
-};
-
-struct _PairT {
- size_t first;
- size_t second;
-};
-
-_LIBCPP_INLINE_VISIBILITY
-inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
- typedef __scalar_hash<_PairT> _HashT;
- const _PairT __p = {__lhs, __rhs};
- return _HashT()(__p);
-}
-
-template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS hash<_Tp*>
- : public unary_function<_Tp*, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp* __v) const _NOEXCEPT
- {
- union
- {
- _Tp* __t;
- size_t __a;
- } __u;
- __u.__t = __v;
- return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
- }
-};
-
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<bool>
- : public unary_function<bool, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<char>
- : public unary_function<char, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<signed char>
- : public unary_function<signed char, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
- : public unary_function<unsigned char, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<char16_t>
- : public unary_function<char16_t, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<char32_t>
- : public unary_function<char32_t, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<wchar_t>
- : public unary_function<wchar_t, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<short>
- : public unary_function<short, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned short>
- : public unary_function<unsigned short, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<int>
- : public unary_function<int, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned int>
- : public unary_function<unsigned int, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<long>
- : public unary_function<long, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
- : public unary_function<unsigned long, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<long long>
- : public __scalar_hash<long long>
-{
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned long long>
- : public __scalar_hash<unsigned long long>
-{
-};
-
-#ifndef _LIBCPP_HAS_NO_INT128
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<__int128_t>
- : public __scalar_hash<__int128_t>
-{
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<__uint128_t>
- : public __scalar_hash<__uint128_t>
-{
-};
-
-#endif
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<float>
- : public __scalar_hash<float>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(float __v) const _NOEXCEPT
- {
- // -0.0 and 0.0 should return same hash
- if (__v == 0.0f)
- return 0;
- return __scalar_hash<float>::operator()(__v);
- }
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<double>
- : public __scalar_hash<double>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(double __v) const _NOEXCEPT
- {
- // -0.0 and 0.0 should return same hash
- if (__v == 0.0)
- return 0;
- return __scalar_hash<double>::operator()(__v);
- }
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<long double>
- : public __scalar_hash<long double>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(long double __v) const _NOEXCEPT
- {
- // -0.0 and 0.0 should return same hash
- if (__v == 0.0L)
- return 0;
-#if defined(__i386__)
- // Zero out padding bits
- union
- {
- long double __t;
- struct
- {
- size_t __a;
- size_t __b;
- size_t __c;
- size_t __d;
- } __s;
- } __u;
- __u.__s.__a = 0;
- __u.__s.__b = 0;
- __u.__s.__c = 0;
- __u.__s.__d = 0;
- __u.__t = __v;
- return __u.__s.__a ^ __u.__s.__b ^ __u.__s.__c ^ __u.__s.__d;
-#elif defined(__x86_64__)
- // Zero out padding bits
- union
- {
- long double __t;
- struct
- {
- size_t __a;
- size_t __b;
- } __s;
- } __u;
- __u.__s.__a = 0;
- __u.__s.__b = 0;
- __u.__t = __v;
- return __u.__s.__a ^ __u.__s.__b;
-#else
- return __scalar_hash<long double>::operator()(__v);
-#endif
- }
-};
-
-#if _LIBCPP_STD_VER > 11
-
-template <class _Tp, bool = is_enum<_Tp>::value>
-struct _LIBCPP_TEMPLATE_VIS __enum_hash
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- typedef typename underlying_type<_Tp>::type type;
- return hash<type>{}(static_cast<type>(__v));
- }
-};
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS __enum_hash<_Tp, false> {
- __enum_hash() = delete;
- __enum_hash(__enum_hash const&) = delete;
- __enum_hash& operator=(__enum_hash const&) = delete;
-};
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS hash : public __enum_hash<_Tp>
-{
-};
-#endif
-
-#if _LIBCPP_STD_VER > 14
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
- : public unary_function<nullptr_t, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(nullptr_t) const _NOEXCEPT {
- return 662607004ull;
- }
-};
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Key, class _Hash>
-using __check_hash_requirements _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
- is_copy_constructible<_Hash>::value &&
- is_move_constructible<_Hash>::value &&
- __invokable_r<size_t, _Hash, _Key const&>::value
->;
-
-template <class _Key, class _Hash = std::hash<_Key> >
-using __has_enabled_hash _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
- __check_hash_requirements<_Key, _Hash>::value &&
- is_default_constructible<_Hash>::value
->;
-
-#if _LIBCPP_STD_VER > 14
-template <class _Type, class>
-using __enable_hash_helper_imp _LIBCPP_NODEBUG_TYPE = _Type;
-
-template <class _Type, class ..._Keys>
-using __enable_hash_helper _LIBCPP_NODEBUG_TYPE = __enable_hash_helper_imp<_Type,
- typename enable_if<__all<__has_enabled_hash<_Keys>::value...>::value>::type
->;
-#else
-template <class _Type, class ...>
-using __enable_hash_helper _LIBCPP_NODEBUG_TYPE = _Type;
-#endif
-
-#endif // !_LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_UTILITY
+#endif // _LIBCPP_UTILITY
void operator>>=(const valarray<value_type>& v) const;
void operator=(const value_type& x) const;
+ void operator=(const valarray<T>& val_arr) const;
slice_array() = delete;
};
*/
#include <__config>
-#include <cstddef>
-#include <cmath>
-#include <initializer_list>
#include <algorithm>
+#include <cmath>
+#include <cstddef>
#include <functional>
+#include <initializer_list>
#include <new>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-
_LIBCPP_BEGIN_NAMESPACE_STD
template<class _Tp> class _LIBCPP_TEMPLATE_VIS valarray;
template <class _Op, class _A0>
struct _UnaryOp
{
- typedef typename _Op::result_type result_type;
- typedef typename _A0::value_type value_type;
+ typedef typename _Op::__result_type __result_type;
+ typedef typename decay<__result_type>::type value_type;
_Op __op_;
_A0 __a0_;
_UnaryOp(const _Op& __op, const _A0& __a0) : __op_(__op), __a0_(__a0) {}
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t __i) const {return __op_(__a0_[__i]);}
+ __result_type operator[](size_t __i) const {return __op_(__a0_[__i]);}
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __a0_.size();}
template <class _Op, class _A0, class _A1>
struct _BinaryOp
{
- typedef typename _Op::result_type result_type;
- typedef typename _A0::value_type value_type;
+ typedef typename _Op::__result_type __result_type;
+ typedef typename decay<__result_type>::type value_type;
_Op __op_;
_A0 __a0_;
: __op_(__op), __a0_(__a0), __a1_(__a1) {}
_LIBCPP_INLINE_VISIBILITY
- value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
+ __result_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __a0_.size();}
{
public:
typedef _Tp value_type;
- typedef const _Tp& result_type;
+ typedef const _Tp& __result_type;
private:
const value_type& __t_;
size_t __s_;
explicit __scalar_expr(const value_type& __t, size_t __s) : __t_(__t), __s_(__s) {}
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t) const {return __t_;}
+ __result_type operator[](size_t) const {return __t_;}
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __s_;}
};
template <class _Tp>
-struct __unary_plus : unary_function<_Tp, _Tp>
+struct __unary_plus
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return +__x;}
};
template <class _Tp>
-struct __bit_not : unary_function<_Tp, _Tp>
+struct __bit_not
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return ~__x;}
};
template <class _Tp>
-struct __bit_shift_left : binary_function<_Tp, _Tp, _Tp>
+struct __bit_shift_left
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x << __y;}
};
template <class _Tp>
-struct __bit_shift_right : binary_function<_Tp, _Tp, _Tp>
+struct __bit_shift_right
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
{return __x >> __y;}
};
template <class _Tp, class _Fp>
-struct __apply_expr : unary_function<_Tp, _Tp>
+struct __apply_expr
{
private:
_Fp __f_;
public:
+ typedef _Tp __result_type;
+
_LIBCPP_INLINE_VISIBILITY
explicit __apply_expr(_Fp __f) : __f_(__f) {}
};
template <class _Tp>
-struct __abs_expr : unary_function<_Tp, _Tp>
+struct __abs_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return abs(__x);}
};
template <class _Tp>
-struct __acos_expr : unary_function<_Tp, _Tp>
+struct __acos_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return acos(__x);}
};
template <class _Tp>
-struct __asin_expr : unary_function<_Tp, _Tp>
+struct __asin_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return asin(__x);}
};
template <class _Tp>
-struct __atan_expr : unary_function<_Tp, _Tp>
+struct __atan_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return atan(__x);}
};
template <class _Tp>
-struct __atan2_expr : binary_function<_Tp, _Tp, _Tp>
+struct __atan2_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
{return atan2(__x, __y);}
};
template <class _Tp>
-struct __cos_expr : unary_function<_Tp, _Tp>
+struct __cos_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return cos(__x);}
};
template <class _Tp>
-struct __cosh_expr : unary_function<_Tp, _Tp>
+struct __cosh_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return cosh(__x);}
};
template <class _Tp>
-struct __exp_expr : unary_function<_Tp, _Tp>
+struct __exp_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return exp(__x);}
};
template <class _Tp>
-struct __log_expr : unary_function<_Tp, _Tp>
+struct __log_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return log(__x);}
};
template <class _Tp>
-struct __log10_expr : unary_function<_Tp, _Tp>
+struct __log10_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return log10(__x);}
};
template <class _Tp>
-struct __pow_expr : binary_function<_Tp, _Tp, _Tp>
+struct __pow_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
{return pow(__x, __y);}
};
template <class _Tp>
-struct __sin_expr : unary_function<_Tp, _Tp>
+struct __sin_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return sin(__x);}
};
template <class _Tp>
-struct __sinh_expr : unary_function<_Tp, _Tp>
+struct __sinh_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return sinh(__x);}
};
template <class _Tp>
-struct __sqrt_expr : unary_function<_Tp, _Tp>
+struct __sqrt_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return sqrt(__x);}
};
template <class _Tp>
-struct __tan_expr : unary_function<_Tp, _Tp>
+struct __tan_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return tan(__x);}
};
template <class _Tp>
-struct __tanh_expr : unary_function<_Tp, _Tp>
+struct __tanh_expr
{
+ typedef _Tp __result_type;
_LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
{return tanh(__x);}
typedef typename remove_reference<_ValExpr>::type _RmExpr;
public:
typedef typename _RmExpr::value_type value_type;
- typedef value_type result_type;
+ typedef value_type __result_type;
private:
_ValExpr __expr_;
public:
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t __i) const
+ __result_type operator[](size_t __i) const
{return __expr_[__start_ + __i * __stride_];}
_LIBCPP_INLINE_VISIBILITY
typedef typename remove_reference<_ValExpr>::type _RmExpr;
public:
typedef typename _RmExpr::value_type value_type;
- typedef value_type result_type;
+ typedef value_type __result_type;
private:
_ValExpr __expr_;
public:
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t __j) const
+ __result_type operator[](size_t __j) const
{
ptrdiff_t __i = static_cast<ptrdiff_t>(__j);
ptrdiff_t __m = (__sn_ * __i - __ul_) >> _Np;
typedef typename remove_reference<_ValExpr>::type _RmExpr;
public:
typedef typename _RmExpr::value_type value_type;
- typedef value_type result_type;
+ typedef value_type __result_type;
private:
_ValExpr __expr_;
public:
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t __i) const
+ __result_type operator[](size_t __i) const
{
if (__i < __m_)
return __expr_[__i + __o1_];
{
public:
typedef _Tp value_type;
- typedef _Tp result_type;
+ typedef _Tp __result_type;
private:
value_type* __begin_;
public:
// construct/destroy:
_LIBCPP_INLINE_VISIBILITY
- valarray() : __begin_(0), __end_(0) {}
+ valarray() : __begin_(nullptr), __end_(nullptr) {}
inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
explicit valarray(size_t __n);
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VISIBILITY
valarray(valarray&& __v) _NOEXCEPT;
valarray(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
valarray(const slice_array<value_type>& __sa);
valarray(const gslice_array<value_type>& __ga);
valarray(const mask_array<value_type>& __ma);
valarray& operator=(valarray&& __v) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
valarray& operator=(initializer_list<value_type>);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
valarray& operator=(const value_type& __x);
_LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const;
_LIBCPP_INLINE_VISIBILITY
gslice_array<value_type> operator[](gslice&& __gs);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__val_expr<__mask_expr<const valarray&> > operator[](const valarray<bool>& __vb) const;
_LIBCPP_INLINE_VISIBILITY
__val_expr<__mask_expr<const valarray&> > operator[](valarray<bool>&& __vb) const;
_LIBCPP_INLINE_VISIBILITY
mask_array<value_type> operator[](valarray<bool>&& __vb);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const;
_LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const;
_LIBCPP_INLINE_VISIBILITY
indirect_array<value_type> operator[](valarray<size_t>&& __vs);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
// unary operators:
valarray operator+() const;
template <class _Op, class _Tp>
struct _UnaryOp<_Op, valarray<_Tp> >
{
- typedef typename _Op::result_type result_type;
- typedef _Tp value_type;
+ typedef typename _Op::__result_type __result_type;
+ typedef typename decay<__result_type>::type value_type;
_Op __op_;
const valarray<_Tp>& __a0_;
_UnaryOp(const _Op& __op, const valarray<_Tp>& __a0) : __op_(__op), __a0_(__a0) {}
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t __i) const {return __op_(__a0_[__i]);}
+ __result_type operator[](size_t __i) const {return __op_(__a0_[__i]);}
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __a0_.size();}
template <class _Op, class _Tp, class _A1>
struct _BinaryOp<_Op, valarray<_Tp>, _A1>
{
- typedef typename _Op::result_type result_type;
- typedef _Tp value_type;
+ typedef typename _Op::__result_type __result_type;
+ typedef typename decay<__result_type>::type value_type;
_Op __op_;
const valarray<_Tp>& __a0_;
: __op_(__op), __a0_(__a0), __a1_(__a1) {}
_LIBCPP_INLINE_VISIBILITY
- value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
+ __result_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __a0_.size();}
template <class _Op, class _A0, class _Tp>
struct _BinaryOp<_Op, _A0, valarray<_Tp> >
{
- typedef typename _Op::result_type result_type;
- typedef _Tp value_type;
+ typedef typename _Op::__result_type __result_type;
+ typedef typename decay<__result_type>::type value_type;
_Op __op_;
_A0 __a0_;
: __op_(__op), __a0_(__a0), __a1_(__a1) {}
_LIBCPP_INLINE_VISIBILITY
- value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
+ __result_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __a0_.size();}
template <class _Op, class _Tp>
struct _BinaryOp<_Op, valarray<_Tp>, valarray<_Tp> >
{
- typedef typename _Op::result_type result_type;
- typedef _Tp value_type;
+ typedef typename _Op::__result_type __result_type;
+ typedef typename decay<__result_type>::type value_type;
_Op __op_;
const valarray<_Tp>& __a0_;
: __op_(__op), __a0_(__a0), __a1_(__a1) {}
_LIBCPP_INLINE_VISIBILITY
- value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
+ __result_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __a0_.size();}
_LIBCPP_INLINE_VISIBILITY
void operator=(const value_type& __x) const;
+ _LIBCPP_INLINE_VISIBILITY
+ void operator=(const valarray<value_type>& __va) const;
+
private:
_LIBCPP_INLINE_VISIBILITY
slice_array(const slice& __sl, const valarray<value_type>& __v)
*__t = __v[__i];
}
+template <class _Tp>
+inline void
+slice_array<_Tp>::operator=(const valarray<value_type>& __va) const
+{
+ value_type* __t = __vp_;
+ for (size_t __i = 0; __i < __va.size(); ++__i, __t += __stride_)
+ *__t = __va[__i];
+}
+
template <class _Tp>
template <class _Expr>
inline
__stride_(move(__stride))
{__init(__start);}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
size_t start() const {return __1d_.size() ? __1d_[0] : 0;}
: __vp_(const_cast<value_type*>(__v.__begin_)),
__1d_(move(__gs.__1d_))
{}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class> friend class valarray;
};
typedef typename remove_reference<_ValExpr>::type _RmExpr;
public:
typedef typename _RmExpr::value_type value_type;
- typedef value_type result_type;
+ typedef value_type __result_type;
private:
_ValExpr __expr_;
public:
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t __i) const
+ __result_type operator[](size_t __i) const
{return __expr_[__1d_[__i]];}
_LIBCPP_INLINE_VISIBILITY
__1d_(move(__ia))
{}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class> friend class valarray;
};
typedef typename remove_reference<_ValExpr>::type _RmExpr;
public:
typedef typename _RmExpr::value_type value_type;
- typedef value_type result_type;
+ typedef value_type __result_type;
private:
_ValExpr __expr_;
__1d_(move(__ia))
{}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
public:
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t __i) const
+ __result_type operator[](size_t __i) const
{return __expr_[__1d_[__i]];}
_LIBCPP_INLINE_VISIBILITY
_ValExpr __expr_;
public:
typedef typename _RmExpr::value_type value_type;
- typedef typename _RmExpr::result_type result_type;
+ typedef typename _RmExpr::__result_type __result_type;
_LIBCPP_INLINE_VISIBILITY
explicit __val_expr(const _RmExpr& __e) : __expr_(__e) {}
_LIBCPP_INLINE_VISIBILITY
- result_type operator[](size_t __i) const
+ __result_type operator[](size_t __i) const
{return __expr_[__i];}
_LIBCPP_INLINE_VISIBILITY
return __val_expr<_NewExpr>(_NewExpr(logical_not<value_type>(), __expr_));
}
- operator valarray<result_type>() const;
+ operator valarray<__result_type>() const;
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __expr_.size();}
_LIBCPP_INLINE_VISIBILITY
- result_type sum() const
+ __result_type sum() const
{
size_t __n = __expr_.size();
- result_type __r = __n ? __expr_[0] : result_type();
+ __result_type __r = __n ? __expr_[0] : __result_type();
for (size_t __i = 1; __i < __n; ++__i)
__r += __expr_[__i];
return __r;
}
_LIBCPP_INLINE_VISIBILITY
- result_type min() const
+ __result_type min() const
{
size_t __n = size();
- result_type __r = __n ? (*this)[0] : result_type();
+ __result_type __r = __n ? (*this)[0] : __result_type();
for (size_t __i = 1; __i < __n; ++__i)
{
- result_type __x = __expr_[__i];
+ __result_type __x = __expr_[__i];
if (__x < __r)
__r = __x;
}
}
_LIBCPP_INLINE_VISIBILITY
- result_type max() const
+ __result_type max() const
{
size_t __n = size();
- result_type __r = __n ? (*this)[0] : result_type();
+ __result_type __r = __n ? (*this)[0] : __result_type();
for (size_t __i = 1; __i < __n; ++__i)
{
- result_type __x = __expr_[__i];
+ __result_type __x = __expr_[__i];
if (__r < __x)
__r = __x;
}
};
template<class _ValExpr>
-__val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const
+__val_expr<_ValExpr>::operator valarray<__val_expr::__result_type>() const
{
- valarray<result_type> __r;
+ valarray<__result_type> __r;
size_t __n = __expr_.size();
if (__n)
{
__r.__begin_ =
- __r.__end_ =
- static_cast<result_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(result_type), _LIBCPP_ALIGNOF(result_type)));
+ __r.__end_ = allocator<__result_type>().allocate(__n);
for (size_t __i = 0; __i != __n; ++__r.__end_, ++__i)
- ::new (__r.__end_) result_type(__expr_[__i]);
+ ::new ((void*)__r.__end_) __result_type(__expr_[__i]);
}
return __r;
}
template <class _Tp>
inline
valarray<_Tp>::valarray(size_t __n)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
if (__n)
{
- __begin_ = __end_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
- ::new (__end_) value_type();
+ ::new ((void*)__end_) value_type();
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
template <class _Tp>
inline
valarray<_Tp>::valarray(const value_type& __x, size_t __n)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
resize(__n, __x);
}
template <class _Tp>
valarray<_Tp>::valarray(const value_type* __p, size_t __n)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
if (__n)
{
- __begin_ = __end_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; ++__end_, ++__p, --__n_left)
- ::new (__end_) value_type(*__p);
+ ::new ((void*)__end_) value_type(*__p);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
template <class _Tp>
valarray<_Tp>::valarray(const valarray& __v)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
if (__v.size())
{
- __begin_ = __end_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__v.size() * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__v.size());
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)
- ::new (__end_) value_type(*__p);
+ ::new ((void*)__end_) value_type(*__p);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__v.size());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
template <class _Tp>
valarray<_Tp>::valarray(initializer_list<value_type> __il)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
const size_t __n = __il.size();
if (__n)
{
- __begin_ = __end_ = static_cast<value_type*>(
-_VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
size_t __n_left = __n;
for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)
- ::new (__end_) value_type(*__p);
+ ::new ((void*)__end_) value_type(*__p);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
const size_t __n = __sa.__size_;
if (__n)
{
- __begin_ = __end_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
size_t __n_left = __n;
for (const value_type* __p = __sa.__vp_; __n_left; ++__end_, __p += __sa.__stride_, --__n_left)
- ::new (__end_) value_type(*__p);
+ ::new ((void*)__end_) value_type(*__p);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
template <class _Tp>
valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
const size_t __n = __ga.__1d_.size();
if (__n)
{
- __begin_ = __end_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ga.__vp_;
for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;
__i != __e; ++__i, ++__end_)
- ::new (__end_) value_type(__s[*__i]);
+ ::new ((void*)__end_) value_type(__s[*__i]);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
template <class _Tp>
valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
const size_t __n = __ma.__1d_.size();
if (__n)
{
- __begin_ = __end_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ma.__vp_;
for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;
__i != __e; ++__i, ++__end_)
- ::new (__end_) value_type(__s[*__i]);
+ ::new ((void*)__end_) value_type(__s[*__i]);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
template <class _Tp>
valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
- : __begin_(0),
- __end_(0)
+ : __begin_(nullptr),
+ __end_(nullptr)
{
const size_t __n = __ia.__1d_.size();
if (__n)
{
- __begin_ = __end_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ia.__vp_;
for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;
__i != __e; ++__i, ++__end_)
- ::new (__end_) value_type(__s[*__i]);
+ ::new ((void*)__end_) value_type(__s[*__i]);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
if (size() != __n)
{
__clear(size());
- __begin_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = allocator<value_type>().allocate(__n);
__end_ = __begin_ + __n;
_VSTD::uninitialized_copy(__f, __l, __begin_);
} else {
return __assign_range(__il.begin(), __il.end());
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
inline
resize(__n);
value_type* __t = __begin_;
for (size_t __i = 0; __i != __n; ++__t, ++__i)
- *__t = result_type(__v[__i]);
+ *__t = __result_type(__v[__i]);
return *this;
}
return gslice_array<value_type>(move(__gs), *this);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
inline
return mask_array<value_type>(move(__vb), *this);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
inline
return indirect_array<value_type>(move(__vs), *this);
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
valarray<_Tp>
size_t __n = size();
if (__n)
{
- __r.__begin_ =
- __r.__end_ =
- static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
- ::new (__r.__end_) value_type(+*__p);
+ ::new ((void*)__r.__end_) value_type(+*__p);
}
return __r;
}
size_t __n = size();
if (__n)
{
- __r.__begin_ =
- __r.__end_ =
- static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
- ::new (__r.__end_) value_type(-*__p);
+ ::new ((void*)__r.__end_) value_type(-*__p);
}
return __r;
}
size_t __n = size();
if (__n)
{
- __r.__begin_ =
- __r.__end_ =
- static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
- ::new (__r.__end_) value_type(~*__p);
+ ::new ((void*)__r.__end_) value_type(~*__p);
}
return __r;
}
size_t __n = size();
if (__n)
{
- __r.__begin_ =
- __r.__end_ =
- static_cast<bool*>(_VSTD::__libcpp_allocate(__n * sizeof(bool), _LIBCPP_ALIGNOF(bool)));
+ __r.__begin_ = __r.__end_ = allocator<bool>().allocate(__n);
for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
- ::new (__r.__end_) bool(!*__p);
+ ::new ((void*)__r.__end_) bool(!*__p);
}
return __r;
}
size_t __n = size();
if (__n)
{
- __r.__begin_ =
- __r.__end_ =
- static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
const value_type* __sb;
value_type* __tb;
value_type* __te;
__te = __r.__begin_ + __n;
}
for (; __r.__end_ != __tb; ++__r.__end_)
- ::new (__r.__end_) value_type();
+ ::new ((void*)__r.__end_) value_type();
for (; __r.__end_ != __te; ++__r.__end_, ++__sb)
- ::new (__r.__end_) value_type(*__sb);
+ ::new ((void*)__r.__end_) value_type(*__sb);
for (__te = __r.__begin_ + __n; __r.__end_ != __te; ++__r.__end_)
- ::new (__r.__end_) value_type();
+ ::new ((void*)__r.__end_) value_type();
}
return __r;
}
size_t __n = size();
if (__n)
{
- __r.__begin_ =
- __r.__end_ =
- static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
__i %= static_cast<int>(__n);
const value_type* __m = __i >= 0 ? __begin_ + __i : __end_ + __i;
for (const value_type* __s = __m; __s != __end_; ++__r.__end_, ++__s)
- ::new (__r.__end_) value_type(*__s);
+ ::new ((void*)__r.__end_) value_type(*__s);
for (const value_type* __s = __begin_; __s != __m; ++__r.__end_, ++__s)
- ::new (__r.__end_) value_type(*__s);
+ ::new ((void*)__r.__end_) value_type(*__s);
}
return __r;
}
size_t __n = size();
if (__n)
{
- __r.__begin_ =
- __r.__end_ =
- static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
- ::new (__r.__end_) value_type(__f(*__p));
+ ::new ((void*)__r.__end_) value_type(__f(*__p));
}
return __r;
}
size_t __n = size();
if (__n)
{
- __r.__begin_ =
- __r.__end_ =
- static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
- ::new (__r.__end_) value_type(__f(*__p));
+ ::new ((void*)__r.__end_) value_type(__f(*__p));
}
return __r;
}
{
while (__end_ != __begin_)
(--__end_)->~value_type();
- _VSTD::__libcpp_deallocate(__begin_, __capacity * sizeof(value_type), _LIBCPP_ALIGNOF(value_type));
+ allocator<value_type>().deallocate(__begin_, __capacity);
__begin_ = __end_ = nullptr;
}
}
__clear(size());
if (__n)
{
- __begin_ = __end_ = static_cast<value_type*>(
- _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
+ __begin_ = __end_ = allocator<value_type>().allocate(__n);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
- ::new (__end_) value_type(__x);
+ ::new ((void*)__end_) value_type(__x);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_VALARRAY
+#endif // _LIBCPP_VALARRAY
template <class Visitor, class... Variants>
constexpr see below visit(Visitor&&, Variants&&...);
+ template <class R, class Visitor, class... Variants>
+ constexpr R visit(Visitor&&, Variants&&...); // since C++20
+
// 20.7.7, class monostate
struct monostate;
*/
+#include <__availability>
#include <__config>
+#include <__functional/hash.h>
#include <__tuple>
-#include <array>
+#include <__utility/forward.h>
+#include <__variant/monostate.h>
+#include <compare>
#include <exception>
-#include <functional>
#include <initializer_list>
+#include <limits>
#include <new>
#include <tuple>
#include <type_traits>
#include <utility>
-#include <limits>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+// TODO: GCC 5 lies about its support for C++17 (it says it supports it but it
+// really doesn't). That breaks variant, which uses some C++17 features.
+// Remove this once we drop support for GCC 5.
+#if _LIBCPP_STD_VER > 14 && !(defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER_NEW < 6000)
+
+// Light N-dimensional array of function pointers. Used in place of std::array to avoid
+// adding a dependency.
+template<class _Tp, size_t _Size>
+struct __farray {
+ static_assert(_Size > 0, "N-dimensional array should never be empty in std::visit");
+ _Tp __buf_[_Size] = {};
+
+ _LIBCPP_INLINE_VISIBILITY constexpr
+ const _Tp &operator[](size_t __n) const noexcept {
+ return __buf_[__n];
+ }
+};
_LIBCPP_NORETURN
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_INLINE_VAR constexpr size_t variant_npos = static_cast<size_t>(-1);
constexpr int __choose_index_type(unsigned int __num_elem) {
- if (__num_elem < std::numeric_limits<unsigned char>::max())
+ if (__num_elem < numeric_limits<unsigned char>::max())
return 0;
- if (__num_elem < std::numeric_limits<unsigned short>::max())
+ if (__num_elem < numeric_limits<unsigned short>::max())
return 1;
return 2;
}
template <class _IndexType>
constexpr _IndexType __variant_npos = static_cast<_IndexType>(-1);
+template <class... _Types>
+class _LIBCPP_TEMPLATE_VIS variant;
+
+template <class... _Types>
+_LIBCPP_INLINE_VISIBILITY constexpr variant<_Types...>&
+__as_variant(variant<_Types...>& __vs) noexcept {
+ return __vs;
+}
+
+template <class... _Types>
+_LIBCPP_INLINE_VISIBILITY constexpr const variant<_Types...>&
+__as_variant(const variant<_Types...>& __vs) noexcept {
+ return __vs;
+}
+
+template <class... _Types>
+_LIBCPP_INLINE_VISIBILITY constexpr variant<_Types...>&&
+__as_variant(variant<_Types...>&& __vs) noexcept {
+ return _VSTD::move(__vs);
+}
+
+template <class... _Types>
+_LIBCPP_INLINE_VISIBILITY constexpr const variant<_Types...>&&
+__as_variant(const variant<_Types...>&& __vs) noexcept {
+ return _VSTD::move(__vs);
+}
+
namespace __find_detail {
template <class _Tp, class... _Types>
template <class _Tp, size_t _Np, typename... _Indices>
inline _LIBCPP_INLINE_VISIBILITY
- static constexpr auto&& __at(const array<_Tp, _Np>& __elems,
+ static constexpr auto&& __at(const __farray<_Tp, _Np>& __elems,
size_t __index, _Indices... __indices) {
return __at(__elems[__index], __indices...);
}
inline _LIBCPP_INLINE_VISIBILITY
static constexpr auto __make_farray(_Fs&&... __fs) {
__std_visit_visitor_return_type_check<__uncvref_t<_Fs>...>();
- using __result = array<common_type_t<__uncvref_t<_Fs>...>, sizeof...(_Fs)>;
+ using __result = __farray<common_type_t<__uncvref_t<_Fs>...>, sizeof...(_Fs)>;
return __result{{_VSTD::forward<_Fs>(__fs)...}};
}
- template <std::size_t... _Is>
+ template <size_t... _Is>
struct __dispatcher {
template <class _Fp, class... _Vs>
inline _LIBCPP_INLINE_VISIBILITY
static constexpr decltype(auto) __dispatch(_Fp __f, _Vs... __vs) {
- return __invoke_constexpr(
+ return _VSTD::__invoke_constexpr(
static_cast<_Fp>(__f),
__access::__base::__get_alt<_Is>(static_cast<_Vs>(__vs))...);
}
inline _LIBCPP_INLINE_VISIBILITY
static constexpr decltype(auto) __visit_alt(_Visitor&& __visitor,
_Vs&&... __vs) {
- return __base::__visit_alt(_VSTD::forward<_Visitor>(__visitor),
- _VSTD::forward<_Vs>(__vs).__impl...);
+ return __base::__visit_alt(
+ _VSTD::forward<_Visitor>(__visitor),
+ _VSTD::__as_variant(_VSTD::forward<_Vs>(__vs)).__impl...);
}
template <class _Visitor, class... _Vs>
_VSTD::forward<_Vs>(__vs)...);
}
+#if _LIBCPP_STD_VER > 17
+ template <class _Rp, class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr _Rp __visit_value(_Visitor&& __visitor,
+ _Vs&&... __vs) {
+ return __visit_alt(
+ __make_value_visitor<_Rp>(_VSTD::forward<_Visitor>(__visitor)),
+ _VSTD::forward<_Vs>(__vs)...);
+ }
+#endif
+
private:
template <class _Visitor, class... _Values>
static constexpr void __std_visit_exhaustive_visitor_check() {
__std_visit_exhaustive_visitor_check<
_Visitor,
decltype((_VSTD::forward<_Alts>(__alts).__value))...>();
- return __invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
+ return _VSTD::__invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
_VSTD::forward<_Alts>(__alts).__value...);
}
_Visitor&& __visitor;
};
+#if _LIBCPP_STD_VER > 17
+ template <class _Rp, class _Visitor>
+ struct __value_visitor_return_type {
+ template <class... _Alts>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr _Rp operator()(_Alts&&... __alts) const {
+ __std_visit_exhaustive_visitor_check<
+ _Visitor,
+ decltype((_VSTD::forward<_Alts>(__alts).__value))...>();
+ if constexpr (is_void_v<_Rp>) {
+ _VSTD::__invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Alts>(__alts).__value...);
+ }
+ else {
+ return _VSTD::__invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Alts>(__alts).__value...);
+ }
+ }
+
+ _Visitor&& __visitor;
+ };
+#endif
+
template <class _Visitor>
inline _LIBCPP_INLINE_VISIBILITY
static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
return __value_visitor<_Visitor>{_VSTD::forward<_Visitor>(__visitor)};
}
+
+#if _LIBCPP_STD_VER > 17
+ template <class _Rp, class _Visitor>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
+ return __value_visitor_return_type<_Rp, _Visitor>{_VSTD::forward<_Visitor>(__visitor)};
+ }
+#endif
};
} // namespace __visitation
};
template <class _Traits, _Trait = _Traits::__destructible_trait>
-class _LIBCPP_TEMPLATE_VIS __destructor;
+class _LIBCPP_TEMPLATE_VIS __dtor;
#define _LIBCPP_VARIANT_DESTRUCTOR(destructible_trait, destructor, destroy) \
template <class... _Types> \
- class _LIBCPP_TEMPLATE_VIS __destructor<__traits<_Types...>, \
- destructible_trait> \
+ class _LIBCPP_TEMPLATE_VIS __dtor<__traits<_Types...>, \
+ destructible_trait> \
: public __base<destructible_trait, _Types...> { \
using __base_type = __base<destructible_trait, _Types...>; \
using __index_t = typename __base_type::__index_t; \
using __base_type::__base_type; \
using __base_type::operator=; \
\
- __destructor(const __destructor&) = default; \
- __destructor(__destructor&&) = default; \
+ __dtor(const __dtor&) = default; \
+ __dtor(__dtor&&) = default; \
destructor \
- __destructor& operator=(const __destructor&) = default; \
- __destructor& operator=(__destructor&&) = default; \
+ __dtor& operator=(const __dtor&) = default; \
+ __dtor& operator=(__dtor&&) = default; \
\
protected: \
inline _LIBCPP_INLINE_VISIBILITY \
_LIBCPP_VARIANT_DESTRUCTOR(
_Trait::_TriviallyAvailable,
- ~__destructor() = default;,
+ ~__dtor() = default;,
void __destroy() noexcept { this->__index = __variant_npos<__index_t>; });
_LIBCPP_VARIANT_DESTRUCTOR(
_Trait::_Available,
- ~__destructor() { __destroy(); },
+ ~__dtor() { __destroy(); },
void __destroy() noexcept {
if (!this->valueless_by_exception()) {
__visitation::__base::__visit_alt(
_LIBCPP_VARIANT_DESTRUCTOR(
_Trait::_Unavailable,
- ~__destructor() = delete;,
+ ~__dtor() = delete;,
void __destroy() noexcept = delete;);
#undef _LIBCPP_VARIANT_DESTRUCTOR
template <class _Traits>
-class _LIBCPP_TEMPLATE_VIS __constructor : public __destructor<_Traits> {
- using __base_type = __destructor<_Traits>;
+class _LIBCPP_TEMPLATE_VIS __ctor : public __dtor<_Traits> {
+ using __base_type = __dtor<_Traits>;
public:
using __base_type::__base_type;
template <class _Rhs>
inline _LIBCPP_INLINE_VISIBILITY
- static void __generic_construct(__constructor& __lhs, _Rhs&& __rhs) {
+ static void __generic_construct(__ctor& __lhs, _Rhs&& __rhs) {
__lhs.__destroy();
if (!__rhs.valueless_by_exception()) {
__visitation::__base::__visit_alt_at(
#define _LIBCPP_VARIANT_MOVE_CONSTRUCTOR(move_constructible_trait, \
move_constructor) \
template <class... _Types> \
- class _LIBCPP_TEMPLATE_VIS __move_constructor<__traits<_Types...>, \
- move_constructible_trait> \
- : public __constructor<__traits<_Types...>> { \
- using __base_type = __constructor<__traits<_Types...>>; \
+ class _LIBCPP_TEMPLATE_VIS __move_constructor<__traits<_Types...>, \
+ move_constructible_trait> \
+ : public __ctor<__traits<_Types...>> { \
+ using __base_type = __ctor<__traits<_Types...>>; \
\
public: \
using __base_type::__base_type; \
template <class _Dest>
static auto __test_impl(_Dest (&&)[1]) -> __identity<_Dest>;
template <class _Dest, class _Source>
- using _Apply _LIBCPP_NODEBUG_TYPE = decltype(__test_impl<_Dest>({std::declval<_Source>()}));
+ using _Apply _LIBCPP_NODEBUG_TYPE = decltype(__test_impl<_Dest>({declval<_Source>()}));
};
template <class _Dest, class _Source>
struct __convert_to_bool {
template <class _T1, class _T2>
_LIBCPP_INLINE_VISIBILITY constexpr bool operator()(_T1 && __t1, _T2&& __t2) const {
- static_assert(std::is_convertible<decltype(_Operator{}(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2))), bool>::value,
+ static_assert(is_convertible<decltype(_Operator{}(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2))), bool>::value,
"the relational operator does not return a type which is implicitly convertible to bool");
return _Operator{}(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
}
__lhs.index(), __convert_to_bool<greater_equal<>>{}, __lhs, __rhs);
}
-template <class _Visitor, class... _Vs>
+template <class... _Vs>
inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
-constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
- using __variant_detail::__visitation::__variant;
- bool __results[] = {__vs.valueless_by_exception()...};
- for (bool __result : __results) {
- if (__result) {
- __throw_bad_variant_access();
- }
+ _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr void
+ __throw_if_valueless(_Vs&&... __vs) {
+ const bool __valueless =
+ (... || _VSTD::__as_variant(__vs).valueless_by_exception());
+ if (__valueless) {
+ __throw_bad_variant_access();
}
- return __variant::__visit_value(_VSTD::forward<_Visitor>(__visitor),
- _VSTD::forward<_Vs>(__vs)...);
}
-struct _LIBCPP_TEMPLATE_VIS monostate {};
-
+template <
+ class _Visitor, class... _Vs,
+ typename = void_t<decltype(_VSTD::__as_variant(declval<_Vs>()))...> >
inline _LIBCPP_INLINE_VISIBILITY
-constexpr bool operator<(monostate, monostate) noexcept { return false; }
-
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr bool operator>(monostate, monostate) noexcept { return false; }
-
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr bool operator<=(monostate, monostate) noexcept { return true; }
-
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr bool operator>=(monostate, monostate) noexcept { return true; }
-
-inline _LIBCPP_INLINE_VISIBILITY
-constexpr bool operator==(monostate, monostate) noexcept { return true; }
+ _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr
+ decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
+ using __variant_detail::__visitation::__variant;
+ _VSTD::__throw_if_valueless(_VSTD::forward<_Vs>(__vs)...);
+ return __variant::__visit_value(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs)...);
+}
+#if _LIBCPP_STD_VER > 17
+template <
+ class _Rp, class _Visitor, class... _Vs,
+ typename = void_t<decltype(_VSTD::__as_variant(declval<_Vs>()))...> >
inline _LIBCPP_INLINE_VISIBILITY
-constexpr bool operator!=(monostate, monostate) noexcept { return false; }
+ _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Rp
+ visit(_Visitor&& __visitor, _Vs&&... __vs) {
+ using __variant_detail::__visitation::__variant;
+ _VSTD::__throw_if_valueless(_VSTD::forward<_Vs>(__vs)...);
+ return __variant::__visit_value<_Rp>(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs)...);
+}
+#endif
template <class... _Types>
inline _LIBCPP_INLINE_VISIBILITY
}
};
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
- using argument_type = monostate;
- using result_type = size_t;
+// __unchecked_get is the same as std::get, except, it is UB to use it with the wrong
+// type whereas std::get will throw or returning nullptr. This makes it faster than
+// std::get.
+template <size_t _Ip, class _Vp>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr auto&& __unchecked_get(_Vp&& __v) noexcept {
+ using __variant_detail::__access::__variant;
+ return __variant::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v)).__value;
+}
- inline _LIBCPP_INLINE_VISIBILITY
- result_type operator()(const argument_type&) const _NOEXCEPT {
- return 66740831; // return a fundamentally attractive random value.
- }
-};
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr auto&& __unchecked_get(const variant<_Types...>& __v) noexcept {
+ return __unchecked_get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr auto&& __unchecked_get(variant<_Types...>& __v) noexcept {
+ return __unchecked_get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER > 14
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_VARIANT
+#endif // _LIBCPP_VARIANT
public:
reference(const reference&) noexcept;
operator bool() const noexcept;
- reference& operator=(const bool x) noexcept;
+ reference& operator=(bool x) noexcept;
reference& operator=(const reference& x) noexcept;
iterator operator&() const noexcept;
void flip() noexcept;
*/
#include <__config>
-#include <iosfwd> // for forward declaration of vector
#include <__bit_reference>
-#include <type_traits>
+#include <__debug>
+#include <__functional_base>
+#include <__iterator/wrap_iter.h>
+#include <__split_buffer>
+#include <__utility/forward.h>
+#include <algorithm>
#include <climits>
-#include <limits>
+#include <compare>
+#include <cstdlib>
+#include <cstring>
#include <initializer_list>
+#include <iosfwd> // for forward declaration of vector
+#include <limits>
#include <memory>
#include <stdexcept>
-#include <algorithm>
-#include <cstring>
+#include <type_traits>
#include <version>
-#include <__split_buffer>
-#include <__functional_base>
-
-#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
is_nothrow_move_assignable<allocator_type>::value)
{__move_assign_alloc(__c, integral_constant<bool,
__alloc_traits::propagate_on_container_move_assignment::value>());}
+
+ _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
+ void __throw_length_error() const {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ __vector_base_common<true>::__throw_length_error();
+#else
+ _VSTD::abort();
+#endif
+ }
+
+ _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
+ void __throw_out_of_range() const {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ __vector_base_common<true>::__throw_out_of_range();
+#else
+ _VSTD::abort();
+#endif
+ }
+
private:
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __vector_base& __c, true_type)
__vector_base<_Tp, _Allocator>::__vector_base(allocator_type&& __a) _NOEXCEPT
: __begin_(nullptr),
__end_(nullptr),
- __end_cap_(nullptr, std::move(__a)) {}
+ __end_cap_(nullptr, _VSTD::move(__a)) {}
#endif
template <class _Tp, class _Allocator>
_LIBCPP_INLINE_VISIBILITY
vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
#endif
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
}
~vector()
{
__annotate_delete();
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__erase_c(this);
#endif
}
vector(const vector& __x);
- vector(const vector& __x, const allocator_type& __a);
+ vector(const vector& __x, const __identity_t<allocator_type>& __a);
_LIBCPP_INLINE_VISIBILITY
vector& operator=(const vector& __x);
#endif
_LIBCPP_INLINE_VISIBILITY
- vector(vector&& __x, const allocator_type& __a);
+ vector(vector&& __x, const __identity_t<allocator_type>& __a);
_LIBCPP_INLINE_VISIBILITY
vector& operator=(vector&& __x)
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
vector& operator=(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end()); return *this;}
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCPP_CXX03_LANG
template <class _InputIterator>
typename enable_if
_LIBCPP_INLINE_VISIBILITY reference front() _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "front() called for empty vector");
+ _LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
return *this->__begin_;
}
_LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "front() called for empty vector");
+ _LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
return *this->__begin_;
}
_LIBCPP_INLINE_VISIBILITY reference back() _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "back() called for empty vector");
+ _LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
return *(this->__end_ - 1);
}
_LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "back() called for empty vector");
+ _LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
return *(this->__end_ - 1);
}
iterator insert(const_iterator __position, value_type&& __x);
template <class... _Args>
iterator emplace(const_iterator __position, _Args&&... __args);
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCPP_CXX03_LANG
iterator insert(const_iterator __position, size_type __n, const_reference __x);
template <class _InputIterator>
bool __invariants() const;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
bool __dereferenceable(const const_iterator* __i) const;
bool __decrementable(const const_iterator* __i) const;
bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
private:
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template<class _InputIterator,
- class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,
- class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
+ class _Alloc = allocator<__iter_value_type<_InputIterator>>,
+ class = _EnableIf<__is_allocator<_Alloc>::value>
>
vector(_InputIterator, _InputIterator)
- -> vector<typename iterator_traits<_InputIterator>::value_type, _Alloc>;
+ -> vector<__iter_value_type<_InputIterator>, _Alloc>;
template<class _InputIterator,
class _Alloc,
- class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
+ class = _EnableIf<__is_allocator<_Alloc>::value>
>
vector(_InputIterator, _InputIterator, _Alloc)
- -> vector<typename iterator_traits<_InputIterator>::value_type, _Alloc>;
+ -> vector<__iter_value_type<_InputIterator>, _Alloc>;
#endif
template <class _Tp, class _Allocator>
{
__annotate_delete();
- __alloc_traits::__construct_backward_with_exception_guarantees(
- this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
+ _VSTD::__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
_VSTD::swap(this->__begin_, __v.__begin_);
_VSTD::swap(this->__end_, __v.__end_);
_VSTD::swap(this->__end_cap(), __v.__end_cap());
{
__annotate_delete();
pointer __r = __v.__begin_;
- __alloc_traits::__construct_backward_with_exception_guarantees(
- this->__alloc(), this->__begin_, __p, __v.__begin_);
- __alloc_traits::__construct_forward_with_exception_guarantees(
- this->__alloc(), __p, this->__end_, __v.__end_);
+ _VSTD::__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, __p, __v.__begin_);
+ _VSTD::__construct_forward_with_exception_guarantees(this->__alloc(), __p, this->__end_, __v.__end_);
_VSTD::swap(this->__begin_, __v.__begin_);
_VSTD::swap(this->__end_, __v.__end_);
_VSTD::swap(this->__end_cap(), __v.__end_cap());
const size_type __cap = capacity();
if (__cap >= __ms / 2)
return __ms;
- return _VSTD::max<size_type>(2*__cap, __new_size);
+ return _VSTD::max<size_type>(2 * __cap, __new_size);
}
// Default constructs __n objects starting at __end_
vector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)
{
_ConstructTransaction __tx(*this, __n);
- __alloc_traits::__construct_range_forward(this->__alloc(), __first, __last, __tx.__pos_);
+ _VSTD::__construct_range_forward(this->__alloc(), __first, __last, __tx.__pos_);
}
// Default constructs __n objects starting at __end_
template <class _Tp, class _Allocator>
vector<_Tp, _Allocator>::vector(size_type __n)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__n > 0)
vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__n > 0)
template <class _Tp, class _Allocator>
vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__n > 0)
vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__n > 0)
typename iterator_traits<_InputIterator>::reference>::value,
_InputIterator>::type __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (; __first != __last; ++__first)
typename iterator_traits<_InputIterator>::reference>::value>::type*)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
for (; __first != __last; ++__first)
typename iterator_traits<_ForwardIterator>::reference>::value,
_ForwardIterator>::type __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
typename iterator_traits<_ForwardIterator>::reference>::value>::type*)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
vector<_Tp, _Allocator>::vector(const vector& __x)
: __base(__alloc_traits::select_on_container_copy_construction(__x.__alloc()))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
size_type __n = __x.size();
}
template <class _Tp, class _Allocator>
-vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a)
+vector<_Tp, _Allocator>::vector(const vector& __x, const __identity_t<allocator_type>& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
size_type __n = __x.size();
#endif
: __base(_VSTD::move(__x.__alloc()))
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
__get_db()->swap(this, &__x);
#endif
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)
+vector<_Tp, _Allocator>::vector(vector&& __x, const __identity_t<allocator_type>& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__a == __x.__alloc())
this->__end_ = __x.__end_;
this->__end_cap() = __x.__end_cap();
__x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->swap(this, &__x);
#endif
}
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__il.size() > 0)
vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocator_type& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__insert_c(this);
#endif
if (__il.size() > 0)
this->__end_ = __c.__end_;
this->__end_cap() = __c.__end_cap();
__c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->swap(this, &__c);
#endif
}
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::__make_iter(pointer __p) _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return iterator(this, __p);
#else
return iterator(__p);
typename vector<_Tp, _Allocator>::const_iterator
vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
return const_iterator(this, __p);
#else
return const_iterator(__p);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
allocator_type& __a = this->__alloc();
__split_buffer<value_type, allocator_type&> __v(size(), size(), __a);
__swap_out_circular_buffer(__v);
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
#endif
}
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
inline
void
vector<_Tp, _Allocator>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "vector::pop_back called for empty vector");
+ _LIBCPP_ASSERT(!empty(), "vector::pop_back called on an empty vector");
this->__destruct_at_end(this->__end_ - 1);
}
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::erase(const_iterator __position)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
"vector::erase(iterator) called with an iterator not"
" referring to this vector");
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
"vector::erase(iterator, iterator) called with an iterator not"
" referring to this vector");
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
"vector::insert(iterator, x) called with an iterator not"
" referring to this vector");
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
"vector::insert(iterator, x) called with an iterator not"
" referring to this vector");
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
"vector::emplace(iterator, x) called with an iterator not"
" referring to this vector");
return __make_iter(__p);
}
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
"vector::insert(iterator, n, x) called with an iterator not"
" referring to this vector");
>::type
vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
"vector::insert(iterator, range) called with an iterator not"
" referring to this vector");
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__v.__construct_at_end(__first, __last);
difference_type __old_size = __old_last - this->__begin_;
difference_type __old_p = __p - this->__begin_;
erase(__make_iter(__old_last), end());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
__p = _VSTD::rotate(__p, __old_last, this->__end_);
insert(__make_iter(__p), _VSTD::make_move_iterator(__v.begin()),
>::type
vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
"vector::insert(iterator, range) called with an iterator not"
" referring to this vector");
_VSTD::swap(this->__begin_, __x.__begin_);
_VSTD::swap(this->__end_, __x.__end_);
_VSTD::swap(this->__end_cap(), __x.__end_cap());
- __swap_allocator(this->__alloc(), __x.__alloc(),
+ _VSTD::__swap_allocator(this->__alloc(), __x.__alloc(),
integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->swap(this, &__x);
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif
}
template <class _Tp, class _Allocator>
return true;
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
template <class _Tp, class _Allocator>
bool
return this->__begin_ <= __p && __p < this->__end_;
}
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif // _LIBCPP_DEBUG_LEVEL == 2
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
vector<_Tp, _Allocator>::__invalidate_all_iterators()
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->__invalidate_all(this);
-#endif // _LIBCPP_DEBUG_LEVEL >= 2
+#endif
}
inline _LIBCPP_INLINE_VISIBILITY
void
vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL == 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __p = __c->end_; __p != __c->beg_; ) {
--__p;
if (__i->base() > __new_last) {
(*__p)->__c_ = nullptr;
if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
}
}
__get_db()->unlock();
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
#endif
- vector(vector&& __v, const allocator_type& __a);
+ vector(vector&& __v, const __identity_t<allocator_type>& __a);
_LIBCPP_INLINE_VISIBILITY
vector& operator=(vector&& __v)
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
vector& operator=(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end()); return *this;}
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCPP_CXX03_LANG
template <class _InputIterator>
typename enable_if
const size_type __cap = capacity();
if (__cap >= __ms / 2)
return __ms;
- return _VSTD::max(2*__cap, __align_it(__new_size));
+ return _VSTD::max(2 * __cap, __align_it(__new_size));
}
// Default constructs __n objects starting at __end_
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
#ifndef _LIBCPP_NO_EXCEPTIONS
__invalidate_all_iterators();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template <class _Allocator>
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
#ifndef _LIBCPP_NO_EXCEPTIONS
__invalidate_all_iterators();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template <class _Allocator>
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_CXX03_LANG
template <class _Allocator>
vector<bool, _Allocator>::~vector()
#endif
: __begin_(__v.__begin_),
__size_(__v.__size_),
- __cap_alloc_(std::move(__v.__cap_alloc_)) {
+ __cap_alloc_(_VSTD::move(__v.__cap_alloc_)) {
__v.__begin_ = nullptr;
__v.__size_ = 0;
__v.__cap() = 0;
}
template <class _Allocator>
-vector<bool, _Allocator>::vector(vector&& __v, const allocator_type& __a)
+vector<bool, _Allocator>::vector(vector&& __v, const __identity_t<allocator_type>& __a)
: __begin_(nullptr),
__size_(0),
__cap_alloc_(0, __a)
__c.__cap() = __c.__size_ = 0;
}
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCPP_CXX03_LANG
template <class _Allocator>
void
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
vector(*this, allocator_type(__alloc())).swap(*this);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
}
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__v.assign(__first, __last);
difference_type __old_size = static_cast<difference_type>(__old_end - begin());
difference_type __old_p = __p - begin();
erase(__old_end, end());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
__p = _VSTD::rotate(__p, __old_end, end());
insert(__p, __v.begin(), __v.end());
_VSTD::swap(this->__begin_, __x.__begin_);
_VSTD::swap(this->__size_, __x.__size_);
_VSTD::swap(this->__cap(), __x.__cap());
- __swap_allocator(this->__alloc(), __x.__alloc(),
+ _VSTD::__swap_allocator(this->__alloc(), __x.__alloc(),
integral_constant<bool, __alloc_traits::propagate_on_container_swap::value>());
}
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_VECTOR
+#endif // _LIBCPP_VECTOR
Macro name Value Headers
__cpp_lib_addressof_constexpr 201603L <memory>
-__cpp_lib_allocator_traits_is_always_equal 201411L <memory> <scoped_allocator> <string>
- <deque> <forward_list> <list>
- <vector> <map> <set>
- <unordered_map> <unordered_set>
+__cpp_lib_allocator_traits_is_always_equal 201411L <deque> <forward_list> <list>
+ <map> <memory> <scoped_allocator>
+ <set> <string> <unordered_map>
+ <unordered_set> <vector>
__cpp_lib_any 201606L <any>
__cpp_lib_apply 201603L <tuple>
-__cpp_lib_array_constexpr 201811L <iterator> <array>
+__cpp_lib_array_constexpr 201811L <array> <iterator>
201603L // C++17
__cpp_lib_as_const 201510L <utility>
+__cpp_lib_assume_aligned 201811L <memory>
+__cpp_lib_atomic_flag_test 201907L <atomic>
+__cpp_lib_atomic_float 201711L <atomic>
__cpp_lib_atomic_is_always_lock_free 201603L <atomic>
+__cpp_lib_atomic_lock_free_type_aliases 201907L <atomic>
__cpp_lib_atomic_ref 201806L <atomic>
-__cpp_lib_bind_front 201811L <functional>
+__cpp_lib_atomic_shared_ptr 201711L <atomic>
+__cpp_lib_atomic_value_initialization 201911L <atomic> <memory>
+__cpp_lib_atomic_wait 201907L <atomic>
+__cpp_lib_barrier 201907L <barrier>
+__cpp_lib_bind_front 201907L <functional>
__cpp_lib_bit_cast 201806L <bit>
+__cpp_lib_bitops 201907L <bit>
__cpp_lib_bool_constant 201505L <type_traits>
+__cpp_lib_bounded_array_traits 201902L <type_traits>
__cpp_lib_boyer_moore_searcher 201603L <functional>
__cpp_lib_byte 201603L <cstddef>
__cpp_lib_char8_t 201811L <atomic> <filesystem> <istream>
__cpp_lib_chrono_udls 201304L <chrono>
__cpp_lib_clamp 201603L <algorithm>
__cpp_lib_complex_udls 201309L <complex>
-__cpp_lib_concepts 201806L <concepts>
-__cpp_lib_constexpr_misc 201811L <array> <functional> <iterator>
- <string_view> <tuple> <utility>
-__cpp_lib_constexpr_swap_algorithms 201806L <algorithm>
+__cpp_lib_concepts 202002L <concepts>
+__cpp_lib_constexpr_algorithms 201806L <algorithm>
+__cpp_lib_constexpr_complex 201711L <complex>
+__cpp_lib_constexpr_dynamic_alloc 201907L <memory>
+__cpp_lib_constexpr_functional 201907L <functional>
+__cpp_lib_constexpr_iterator 201811L <iterator>
+__cpp_lib_constexpr_memory 201811L <memory>
+__cpp_lib_constexpr_numeric 201911L <numeric>
+__cpp_lib_constexpr_string 201811L <string>
+__cpp_lib_constexpr_string_view 201811L <string_view>
+__cpp_lib_constexpr_tuple 201811L <tuple>
+__cpp_lib_constexpr_utility 201811L <utility>
+__cpp_lib_constexpr_vector 201907L <vector>
+__cpp_lib_coroutine 201902L <coroutine>
__cpp_lib_destroying_delete 201806L <new>
__cpp_lib_enable_shared_from_this 201603L <memory>
__cpp_lib_endian 201907L <bit>
-__cpp_lib_erase_if 202002L <string> <deque> <forward_list>
- <list> <vector> <map>
- <set> <unordered_map> <unordered_set>
+__cpp_lib_erase_if 202002L <deque> <forward_list> <list>
+ <map> <set> <string>
+ <unordered_map> <unordered_set> <vector>
__cpp_lib_exchange_function 201304L <utility>
-__cpp_lib_execution 201603L <execution>
+__cpp_lib_execution 201902L <execution>
+ 201603L // C++17
__cpp_lib_filesystem 201703L <filesystem>
+__cpp_lib_format 201907L <format>
__cpp_lib_gcd_lcm 201606L <numeric>
__cpp_lib_generic_associative_lookup 201304L <map> <set>
__cpp_lib_generic_unordered_lookup 201811L <unordered_map> <unordered_set>
__cpp_lib_has_unique_object_representations 201606L <type_traits>
__cpp_lib_hypot 201603L <cmath>
__cpp_lib_incomplete_container_elements 201505L <forward_list> <list> <vector>
+__cpp_lib_int_pow2 202002L <bit>
+__cpp_lib_integer_comparison_functions 202002L <utility>
__cpp_lib_integer_sequence 201304L <utility>
__cpp_lib_integral_constant_callable 201304L <type_traits>
-__cpp_lib_interpolate 201902L <numeric>
+__cpp_lib_interpolate 201902L <cmath> <numeric>
__cpp_lib_invoke 201411L <functional>
__cpp_lib_is_aggregate 201703L <type_traits>
__cpp_lib_is_constant_evaluated 201811L <type_traits>
__cpp_lib_is_final 201402L <type_traits>
__cpp_lib_is_invocable 201703L <type_traits>
+__cpp_lib_is_layout_compatible 201907L <type_traits>
+__cpp_lib_is_nothrow_convertible 201806L <type_traits>
__cpp_lib_is_null_pointer 201309L <type_traits>
+__cpp_lib_is_pointer_interconvertible 201907L <type_traits>
+__cpp_lib_is_scoped_enum 202011L <type_traits>
__cpp_lib_is_swappable 201603L <type_traits>
+__cpp_lib_jthread 201911L <stop_token> <thread>
+__cpp_lib_latch 201907L <latch>
__cpp_lib_launder 201606L <new>
__cpp_lib_list_remove_return_type 201806L <forward_list> <list>
__cpp_lib_logical_traits 201510L <type_traits>
__cpp_lib_memory_resource 201603L <memory_resource>
__cpp_lib_node_extract 201606L <map> <set> <unordered_map>
<unordered_set>
-__cpp_lib_nonmember_container_access 201411L <iterator> <array> <deque>
- <forward_list> <list> <map>
+__cpp_lib_nonmember_container_access 201411L <array> <deque> <forward_list>
+ <iterator> <list> <map>
<regex> <set> <string>
<unordered_map> <unordered_set> <vector>
__cpp_lib_not_fn 201603L <functional>
__cpp_lib_null_iterators 201304L <iterator>
__cpp_lib_optional 201606L <optional>
__cpp_lib_parallel_algorithm 201603L <algorithm> <numeric>
+__cpp_lib_polymorphic_allocator 201902L <memory>
__cpp_lib_quoted_string_io 201304L <iomanip>
__cpp_lib_ranges 201811L <algorithm> <functional> <iterator>
<memory> <ranges>
__cpp_lib_raw_memory_algorithms 201606L <memory>
+__cpp_lib_remove_cvref 201711L <type_traits>
__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>
__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm>
__cpp_lib_sample 201603L <algorithm>
__cpp_lib_scoped_lock 201703L <mutex>
+__cpp_lib_semaphore 201907L <semaphore>
__cpp_lib_shared_mutex 201505L <shared_mutex>
__cpp_lib_shared_ptr_arrays 201611L <memory>
__cpp_lib_shared_ptr_weak_type 201606L <memory>
__cpp_lib_shared_timed_mutex 201402L <shared_mutex>
+__cpp_lib_shift 201806L <algorithm>
+__cpp_lib_smart_ptr_for_overwrite 202002L <memory>
+__cpp_lib_source_location 201907L <source_location>
__cpp_lib_span 202002L <span>
+__cpp_lib_ssize 201902L <iterator>
+__cpp_lib_stacktrace 202011L <stacktrace>
+__cpp_lib_starts_ends_with 201711L <string> <string_view>
+__cpp_lib_stdatomic_h 202011L <stdatomic.h>
+__cpp_lib_string_contains 202011L <string> <string_view>
__cpp_lib_string_udls 201304L <string>
-__cpp_lib_string_view 201606L <string> <string_view>
-__cpp_lib_three_way_comparison 201711L <compare>
+__cpp_lib_string_view 201803L <string> <string_view>
+ 201606L // C++17
+__cpp_lib_syncbuf 201803L <syncstream>
+__cpp_lib_three_way_comparison 201907L <compare>
+__cpp_lib_to_address 201711L <memory>
__cpp_lib_to_array 201907L <array>
__cpp_lib_to_chars 201611L <utility>
+__cpp_lib_to_underlying 202102L <utility>
__cpp_lib_transformation_trait_aliases 201304L <type_traits>
-__cpp_lib_transparent_operators 201510L <functional>
+__cpp_lib_transparent_operators 201510L <functional> <memory>
201210L // C++14
__cpp_lib_tuple_element_t 201402L <tuple>
-__cpp_lib_tuples_by_type 201304L <utility> <tuple>
+__cpp_lib_tuples_by_type 201304L <tuple> <utility>
__cpp_lib_type_trait_variable_templates 201510L <type_traits>
__cpp_lib_uncaught_exceptions 201411L <exception>
__cpp_lib_unordered_map_try_emplace 201411L <unordered_map>
-__cpp_lib_variant 201606L <variant>
+__cpp_lib_unwrap_ref 201811L <functional>
+__cpp_lib_variant 202102L <variant>
__cpp_lib_void_t 201411L <type_traits>
*/
#pragma GCC system_header
#endif
+// clang-format off
+
#if _LIBCPP_STD_VER > 11
# define __cpp_lib_chrono_udls 201304L
# define __cpp_lib_complex_udls 201309L
# define __cpp_lib_quoted_string_io 201304L
# define __cpp_lib_result_of_sfinae 201210L
# define __cpp_lib_robust_nonmodifying_seq_ops 201304L
-# if !defined(_LIBCPP_HAS_NO_THREADS)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
# define __cpp_lib_shared_timed_mutex 201402L
# endif
# define __cpp_lib_string_udls 201304L
# define __cpp_lib_clamp 201603L
# define __cpp_lib_enable_shared_from_this 201603L
// # define __cpp_lib_execution 201603L
-# define __cpp_lib_filesystem 201703L
+# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# define __cpp_lib_filesystem 201703L
+# endif
# define __cpp_lib_gcd_lcm 201606L
// # define __cpp_lib_hardware_interference_size 201703L
# if defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS)
# define __cpp_lib_raw_memory_algorithms 201606L
# define __cpp_lib_sample 201603L
# define __cpp_lib_scoped_lock 201703L
-# if !defined(_LIBCPP_HAS_NO_THREADS)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
# define __cpp_lib_shared_mutex 201505L
# endif
-// # define __cpp_lib_shared_ptr_arrays 201611L
+# define __cpp_lib_shared_ptr_arrays 201611L
# define __cpp_lib_shared_ptr_weak_type 201606L
# define __cpp_lib_string_view 201606L
// # define __cpp_lib_to_chars 201611L
# define __cpp_lib_type_trait_variable_templates 201510L
# define __cpp_lib_uncaught_exceptions 201411L
# define __cpp_lib_unordered_map_try_emplace 201411L
-# define __cpp_lib_variant 201606L
+# define __cpp_lib_variant 202102L
# define __cpp_lib_void_t 201411L
#endif
#if _LIBCPP_STD_VER > 17
# undef __cpp_lib_array_constexpr
# define __cpp_lib_array_constexpr 201811L
+// # define __cpp_lib_assume_aligned 201811L
+# if !defined(_LIBCPP_HAS_NO_THREADS)
+# define __cpp_lib_atomic_flag_test 201907L
+# endif
+# if !defined(_LIBCPP_HAS_NO_THREADS)
+// # define __cpp_lib_atomic_float 201711L
+# endif
+# if !defined(_LIBCPP_HAS_NO_THREADS)
+# define __cpp_lib_atomic_lock_free_type_aliases 201907L
+# endif
# if !defined(_LIBCPP_HAS_NO_THREADS)
// # define __cpp_lib_atomic_ref 201806L
# endif
-// # define __cpp_lib_bind_front 201811L
+# if !defined(_LIBCPP_HAS_NO_THREADS)
+// # define __cpp_lib_atomic_shared_ptr 201711L
+# endif
+# if !defined(_LIBCPP_HAS_NO_THREADS)
+# define __cpp_lib_atomic_value_initialization 201911L
+# endif
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)
+# define __cpp_lib_atomic_wait 201907L
+# endif
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)
+# define __cpp_lib_barrier 201907L
+# endif
+# define __cpp_lib_bind_front 201907L
// # define __cpp_lib_bit_cast 201806L
-# if !defined(_LIBCPP_NO_HAS_CHAR8_T)
+// # define __cpp_lib_bitops 201907L
+# define __cpp_lib_bounded_array_traits 201902L
+# if !defined(_LIBCPP_HAS_NO_CHAR8_T)
# define __cpp_lib_char8_t 201811L
# endif
-// # define __cpp_lib_concepts 201806L
-// # define __cpp_lib_constexpr_misc 201811L
-// # define __cpp_lib_constexpr_swap_algorithms 201806L
+# define __cpp_lib_concepts 202002L
+# define __cpp_lib_constexpr_algorithms 201806L
+// # define __cpp_lib_constexpr_complex 201711L
+# define __cpp_lib_constexpr_dynamic_alloc 201907L
+# define __cpp_lib_constexpr_functional 201907L
+# define __cpp_lib_constexpr_iterator 201811L
+# define __cpp_lib_constexpr_memory 201811L
+# define __cpp_lib_constexpr_numeric 201911L
+# define __cpp_lib_constexpr_string 201811L
+# define __cpp_lib_constexpr_string_view 201811L
+# define __cpp_lib_constexpr_tuple 201811L
+# define __cpp_lib_constexpr_utility 201811L
+// # define __cpp_lib_constexpr_vector 201907L
+// # define __cpp_lib_coroutine 201902L
# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
# define __cpp_lib_destroying_delete 201806L
# endif
# define __cpp_lib_endian 201907L
# define __cpp_lib_erase_if 202002L
-// # define __cpp_lib_generic_unordered_lookup 201811L
+# undef __cpp_lib_execution
+// # define __cpp_lib_execution 201902L
+# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format)
+// # define __cpp_lib_format 201907L
+# endif
+# define __cpp_lib_generic_unordered_lookup 201811L
+# define __cpp_lib_int_pow2 202002L
+# if !defined(_LIBCPP_HAS_NO_CONCEPTS)
+# define __cpp_lib_integer_comparison_functions 202002L
+# endif
# define __cpp_lib_interpolate 201902L
# if !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
# define __cpp_lib_is_constant_evaluated 201811L
# endif
+// # define __cpp_lib_is_layout_compatible 201907L
+# define __cpp_lib_is_nothrow_convertible 201806L
+// # define __cpp_lib_is_pointer_interconvertible 201907L
+# if !defined(_LIBCPP_HAS_NO_THREADS)
+// # define __cpp_lib_jthread 201911L
+# endif
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)
+# define __cpp_lib_latch 201907L
+# endif
# define __cpp_lib_list_remove_return_type 201806L
-# if defined(__cpp_concepts) && __cpp_concepts >= 201811L
+# if !defined(_LIBCPP_HAS_NO_CONCEPTS)
# define __cpp_lib_math_constants 201907L
# endif
+// # define __cpp_lib_polymorphic_allocator 201902L
// # define __cpp_lib_ranges 201811L
+# define __cpp_lib_remove_cvref 201711L
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)
+# define __cpp_lib_semaphore 201907L
+# endif
+# define __cpp_lib_shift 201806L
+// # define __cpp_lib_smart_ptr_for_overwrite 202002L
+// # define __cpp_lib_source_location 201907L
# define __cpp_lib_span 202002L
-// # define __cpp_lib_three_way_comparison 201711L
+# define __cpp_lib_ssize 201902L
+# define __cpp_lib_starts_ends_with 201711L
+# undef __cpp_lib_string_view
+# define __cpp_lib_string_view 201803L
+// # define __cpp_lib_syncbuf 201803L
+// # define __cpp_lib_three_way_comparison 201907L
+# define __cpp_lib_to_address 201711L
# define __cpp_lib_to_array 201907L
+# define __cpp_lib_unwrap_ref 201811L
#endif
+#if _LIBCPP_STD_VER > 20
+# define __cpp_lib_is_scoped_enum 202011L
+// # define __cpp_lib_stacktrace 202011L
+// # define __cpp_lib_stdatomic_h 202011L
+# define __cpp_lib_string_contains 202011L
+# define __cpp_lib_to_underlying 202102L
+#endif
+
+// clang-format on
+
#endif // _LIBCPP_VERSIONH
size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
size_t nwc, size_t len, mbstate_t *__restrict ps);
} // extern "C++"
-#endif // __cplusplus && _LIBCPP_MSVCRT
+#endif // __cplusplus && _LIBCPP_MSVCRT
-#endif // _LIBCPP_WCHAR_H
+#endif // _LIBCPP_WCHAR_H
#pragma GCC system_header
#endif
-#include_next <wctype.h>
+// TODO:
+// In the future, we should unconditionally include_next <wctype.h> here and instead
+// have a mode under which the library does not need libc++'s <wctype.h> or <cwctype>
+// at all (i.e. a mode without wchar_t). As it stands, we need to do that to completely
+// bypass the using declarations in <cwctype> when we did not include <wctype.h>.
+// Otherwise, a using declaration like `using ::wint_t` in <cwctype> will refer to
+// nothing (with using_if_exists), and if we include another header that defines one
+// of these declarations (e.g. <wchar.h>), the second `using ::wint_t` with using_if_exists
+// will fail because it does not refer to the same declaration.
+#if __has_include_next(<wctype.h>)
+# include_next <wctype.h>
+# define _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
+#endif
#ifdef __cplusplus
#undef towctrans
#undef wctrans
-#endif // __cplusplus
+#endif // __cplusplus
-#endif // _LIBCPP_WCTYPE_H
+#endif // _LIBCPP_WCTYPE_H
the change. The entry should contain a summary of the ABI changes made,
including what symbols were added, removed, or changed.
-To generate a summary use "sym_diff.py" diffing against the appropriate ABI list.
-Afterwards the ABI list should be updated to include the new changes.
+To generate a summary, re-generate the new ABI list using the
+`generate-cxx-abilist` target, and look at the diff.
New entries should be added directly below the "Version" header.
+------------
+Version 12.0
+------------
+
+* a984dcaf7c21 - [libc++] [P0482] [C++20] Implement missing bits for codecvt and codecvt_byname.
+
+ This commit added new instantiations with char8_t for classes codecvt and
+ codecvt_byname in <locale> in the library.
+
+ x86_64-apple-apple-darwin
+ -------------------------
+ Symbol added: __ZNKSt3__17codecvtIDiDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_
+ Symbol added: __ZNKSt3__17codecvtIDiDu11__mbstate_tE11do_encodingEv
+ Symbol added: __ZNKSt3__17codecvtIDiDu11__mbstate_tE13do_max_lengthEv
+ Symbol added: __ZNKSt3__17codecvtIDiDu11__mbstate_tE16do_always_noconvEv
+ Symbol added: __ZNKSt3__17codecvtIDiDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDiS7_RS7_
+ Symbol added: __ZNKSt3__17codecvtIDiDu11__mbstate_tE6do_outERS1_PKDiS5_RS5_PDuS7_RS7_
+ Symbol added: __ZNKSt3__17codecvtIDiDu11__mbstate_tE9do_lengthERS1_PKDuS5_m
+ Symbol added: __ZNKSt3__17codecvtIDsDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_
+ Symbol added: __ZNKSt3__17codecvtIDsDu11__mbstate_tE11do_encodingEv
+ Symbol added: __ZNKSt3__17codecvtIDsDu11__mbstate_tE13do_max_lengthEv
+ Symbol added: __ZNKSt3__17codecvtIDsDu11__mbstate_tE16do_always_noconvEv
+ Symbol added: __ZNKSt3__17codecvtIDsDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDsS7_RS7_
+ Symbol added: __ZNKSt3__17codecvtIDsDu11__mbstate_tE6do_outERS1_PKDsS5_RS5_PDuS7_RS7_
+ Symbol added: __ZNKSt3__17codecvtIDsDu11__mbstate_tE9do_lengthERS1_PKDuS5_m
+ Symbol added: __ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED0Ev
+ Symbol added: __ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED1Ev
+ Symbol added: __ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED2Ev
+ Symbol added: __ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED0Ev
+ Symbol added: __ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED1Ev
+ Symbol added: __ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED2Ev
+ Symbol added: __ZNSt3__17codecvtIDiDu11__mbstate_tE2idE
+ Symbol added: __ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev
+ Symbol added: __ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev
+ Symbol added: __ZNSt3__17codecvtIDiDu11__mbstate_tED2Ev
+ Symbol added: __ZNSt3__17codecvtIDsDu11__mbstate_tE2idE
+ Symbol added: __ZNSt3__17codecvtIDsDu11__mbstate_tED0Ev
+ Symbol added: __ZNSt3__17codecvtIDsDu11__mbstate_tED1Ev
+ Symbol added: __ZNSt3__17codecvtIDsDu11__mbstate_tED2Ev
+ Symbol added: __ZTINSt3__114codecvt_bynameIDiDu11__mbstate_tEE
+ Symbol added: __ZTINSt3__114codecvt_bynameIDsDu11__mbstate_tEE
+ Symbol added: __ZTINSt3__17codecvtIDiDu11__mbstate_tEE
+ Symbol added: __ZTINSt3__17codecvtIDsDu11__mbstate_tEE
+ Symbol added: __ZTSNSt3__17codecvtIDiDu11__mbstate_tEE
+ Symbol added: __ZTSNSt3__17codecvtIDsDu11__mbstate_tEE
+ Symbol added: __ZTVNSt3__114codecvt_bynameIDiDu11__mbstate_tEE
+ Symbol added: __ZTVNSt3__114codecvt_bynameIDsDu11__mbstate_tEE
+ Symbol added: __ZTVNSt3__17codecvtIDiDu11__mbstate_tEE
+ Symbol added: __ZTVNSt3__17codecvtIDsDu11__mbstate_tEE
+
+ x86_64-unknown-linux-gnu
+ ------------------------
+ Symbol added: _ZTINSt3__17codecvtIDsDu11__mbstate_tEE
+ Symbol added: _ZTINSt3__114codecvt_bynameIDsDu11__mbstate_tEE
+ Symbol added: _ZTINSt3__17codecvtIDiDu11__mbstate_tEE
+ Symbol added: _ZTINSt3__114codecvt_bynameIDiDu11__mbstate_tEE
+ Symbol added: _ZNKSt3__17codecvtIDsDu11__mbstate_tE9do_lengthERS1_PKDuS5_m
+ Symbol added: _ZNKSt3__17codecvtIDiDu11__mbstate_tE13do_max_lengthEv
+ Symbol added: _ZNSt3__17codecvtIDiDu11__mbstate_tE2idE
+ Symbol added: _ZNKSt3__17codecvtIDsDu11__mbstate_tE16do_always_noconvEv
+ Symbol added: _ZNKSt3__17codecvtIDsDu11__mbstate_tE13do_max_lengthEv
+ Symbol added: _ZNSt3__17codecvtIDsDu11__mbstate_tE2idE
+ Symbol added: _ZNKSt3__17codecvtIDsDu11__mbstate_tE6do_outERS1_PKDsS5_RS5_PDuS7_RS7_
+ Symbol added: _ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev
+ Symbol added: _ZNKSt3__17codecvtIDiDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDiS7_RS7_
+ Symbol added: _ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED0Ev
+ Symbol added: _ZTSNSt3__17codecvtIDiDu11__mbstate_tEE
+ Symbol added: _ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev
+ Symbol added: _ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED1Ev
+ Symbol added: _ZTVNSt3__17codecvtIDiDu11__mbstate_tEE
+ Symbol added: _ZNSt3__17codecvtIDiDu11__mbstate_tED2Ev
+ Symbol added: _ZNSt3__17codecvtIDsDu11__mbstate_tED0Ev
+ Symbol added: _ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED2Ev
+ Symbol added: _ZTVNSt3__114codecvt_bynameIDsDu11__mbstate_tEE
+ Symbol added: _ZNKSt3__17codecvtIDiDu11__mbstate_tE16do_always_noconvEv
+ Symbol added: _ZNSt3__17codecvtIDsDu11__mbstate_tED1Ev
+ Symbol added: _ZTVNSt3__114codecvt_bynameIDiDu11__mbstate_tEE
+ Symbol added: _ZNKSt3__17codecvtIDiDu11__mbstate_tE11do_encodingEv
+ Symbol added: _ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED0Ev
+ Symbol added: _ZNSt3__17codecvtIDsDu11__mbstate_tED2Ev
+ Symbol added: _ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED1Ev
+ Symbol added: _ZNKSt3__17codecvtIDiDu11__mbstate_tE9do_lengthERS1_PKDuS5_m
+ Symbol added: _ZNKSt3__17codecvtIDsDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_
+ Symbol added: _ZTSNSt3__17codecvtIDsDu11__mbstate_tEE
+ Symbol added: _ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED2Ev
+ Symbol added: _ZTVNSt3__17codecvtIDsDu11__mbstate_tEE
+ Symbol added: _ZNKSt3__17codecvtIDiDu11__mbstate_tE6do_outERS1_PKDiS5_RS5_PDuS7_RS7_
+ Symbol added: _ZTSNSt3__114codecvt_bynameIDsDu11__mbstate_tEE
+ Symbol added: _ZNKSt3__17codecvtIDsDu11__mbstate_tE11do_encodingEv
+ Symbol added: _ZNKSt3__17codecvtIDiDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_
+ Symbol added: _ZNKSt3__17codecvtIDsDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDsS7_RS7_
+ Symbol added: _ZTSNSt3__114codecvt_bynameIDiDu11__mbstate_tEE
+
+* 997d41cdec53 - [libc++] Instantiate additional <iostream> members in the dylib
+
+ This commit added new explicit instantiations for classes in <iostream> in
+ the library. This was done after noticing that many programs that used streams
+ ended up containing weak definitions of these classes, which has a negative
+ impact on both code size and load times. This change is not an ABI break,
+ since we are just adding additional symbols.
+
+ x86_64-apple-apple-darwin
+ -------------------------
+ Symbol added: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE11__read_modeEv
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE12__write_modeEv
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4swapERS3_
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4syncEv
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5closeEv
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE8overflowEi
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9pbackfailEi
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9underflowEv
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1EOS3_
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1Ev
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2EOS3_
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2Ev
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED0Ev
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED1Ev
+ Symbol added: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED2Ev
+ Symbol added: __ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openEPKcj
+ Symbol added: __ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj
+ Symbol added: __ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openEPKcj
+ Symbol added: __ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strERKNS_12basic_stringIcS2_S4_EE
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE4swapERS5_
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE7seekoffExNS_8ios_base7seekdirEj
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE8overflowEi
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9pbackfailEi
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9underflowEv
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC1EOS5_
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EOS5_
+ Symbol added: __ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_
+ Symbol added: __ZNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_
+ Symbol added: __ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_
+ Symbol added: __ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_
+ Symbol added: __ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE
+ Symbol added: __ZTCNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE0_NS_13basic_ostreamIcS2_EE
+ Symbol added: __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
+ Symbol added: __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE
+ Symbol added: __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE
+ Symbol added: __ZTCNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
+ Symbol added: __ZTCNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_ostreamIcS2_EE
+ Symbol added: __ZTINSt3__113basic_filebufIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTINSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTINSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTINSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTINSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTINSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTINSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTSNSt3__113basic_filebufIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTSNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTSNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTSNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTSNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTSNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTSNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTTNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTTNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTTNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTTNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTVNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTVNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE
+ Symbol added: __ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTVNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: __ZTVNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+
+ x86_64-unknown-linux-gnu
+ ------------------------
+ Symbol added: _ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE11__read_modeEv
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE12__write_modeEv
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4swapERS3_
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4syncEv
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5closeEv
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE8overflowEi
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9pbackfailEi
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9underflowEv
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1EOS3_
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1Ev
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2EOS3_
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2Ev
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED0Ev
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED1Ev
+ Symbol added: _ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED2Ev
+ Symbol added: _ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openEPKcj
+ Symbol added: _ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj
+ Symbol added: _ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openEPKcj
+ Symbol added: _ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strERKNS_12basic_stringIcS2_S4_EE
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE4swapERS5_
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE7seekoffExNS_8ios_base7seekdirEj
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE8overflowEi
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9pbackfailEi
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9underflowEv
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC1EOS5_
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EOS5_
+ Symbol added: _ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_
+ Symbol added: _ZNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_
+ Symbol added: _ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_
+ Symbol added: _ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_
+ Symbol added: _ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE
+ Symbol added: _ZTCNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE0_NS_13basic_ostreamIcS2_EE
+ Symbol added: _ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
+ Symbol added: _ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE
+ Symbol added: _ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE
+ Symbol added: _ZTCNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
+ Symbol added: _ZTCNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_ostreamIcS2_EE
+ Symbol added: _ZTINSt3__113basic_filebufIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTINSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTINSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTINSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTINSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTINSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTINSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTSNSt3__113basic_filebufIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTSNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTSNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTSNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTSNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTSNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTSNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTTNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTTNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTTNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTTNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTVNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTVNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE
+ Symbol added: _ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTVNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+ Symbol added: _ZTVNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
+
+* 9b40ee8eb0c1 - [libc++] Define new/delete in libc++abi only by default
+
+ By default, libc++ does not include the definition for new and delete anymore.
+ Those were previously defined in both libc++ and libc++abi, which was an
+ ODR violation.
+
+ x86_64-apple-apple-darwin
+ -------------------------
+ The following symbols are now re-exported from libc++abi instead of exported
+ by libc++ directly (this should not be an ABI break):
+
+ Symbol moved: __ZdaPv
+ Symbol moved: __ZdaPvm
+ Symbol moved: __ZdaPvmSt11align_val_t
+ Symbol moved: __ZdaPvRKSt9nothrow_t
+ Symbol moved: __ZdaPvSt11align_val_t
+ Symbol moved: __ZdaPvSt11align_val_tRKSt9nothrow_t
+ Symbol moved: __ZdlPv
+ Symbol moved: __ZdlPvm
+ Symbol moved: __ZdlPvmSt11align_val_t
+ Symbol moved: __ZdlPvRKSt9nothrow_t
+ Symbol moved: __ZdlPvSt11align_val_t
+ Symbol moved: __ZdlPvSt11align_val_tRKSt9nothrow_t
+ Symbol moved: __Znam
+ Symbol moved: __ZnamRKSt9nothrow_t
+ Symbol moved: __ZnamSt11align_val_t
+ Symbol moved: __ZnamSt11align_val_tRKSt9nothrow_t
+ Symbol moved: __Znwm
+ Symbol moved: __ZnwmRKSt9nothrow_t
+ Symbol moved: __ZnwmSt11align_val_t
+ Symbol moved: __ZnwmSt11align_val_tRKSt9nothrow_t
+
+ x86_64-unknown-linux-gnu
+ ------------------------
+ The following symbols were moved to libc++abi, but are NOT being re-exported
+ by libc++. This constitutes an ABI break if one links against libc++ but
+ not libc++abi.
+
+ Symbol moved: _ZdaPv
+ Symbol moved: _ZdaPvm
+ Symbol moved: _ZdaPvmSt11align_val_t
+ Symbol moved: _ZdaPvRKSt9nothrow_t
+ Symbol moved: _ZdaPvSt11align_val_t
+ Symbol moved: _ZdaPvSt11align_val_tRKSt9nothrow_t
+ Symbol moved: _ZdlPv
+ Symbol moved: _ZdlPvm
+ Symbol moved: _ZdlPvmSt11align_val_t
+ Symbol moved: _ZdlPvRKSt9nothrow_t
+ Symbol moved: _ZdlPvSt11align_val_t
+ Symbol moved: _ZdlPvSt11align_val_tRKSt9nothrow_t
+ Symbol moved: _Znam
+ Symbol moved: _ZnamRKSt9nothrow_t
+ Symbol moved: _ZnamSt11align_val_t
+ Symbol moved: _ZnamSt11align_val_tRKSt9nothrow_t
+ Symbol moved: _Znwm
+ Symbol moved: _ZnwmRKSt9nothrow_t
+ Symbol moved: _ZnwmSt11align_val_t
+ Symbol moved: _ZnwmSt11align_val_tRKSt9nothrow_t
+
+* 4f13b9992971 - [libc++] Simplify how we re-export symbols from libc++abi
+
+ We re-export some symbols that were exported from libc++abi but not from
+ libc++. Exporting new symbols is not an ABI break.
+
+ x86_64-apple-apple-darwin
+ -------------------------
+ Symbol added: ___cxa_allocate_dependent_exception
+ Symbol added: ___cxa_free_dependent_exception
+
------------
Version 10.0
------------
x86_64-linux-gnu
----------------
- Symbol added: posix_memalign@GLIBC_2.2.5
Symbol added: _ZdaPvSt11align_val_t
Symbol added: _ZdlPvSt11align_val_t
Symbol added: _ZnamSt11align_val_t
-if (DEFINED TARGET_TRIPLE)
- if (TARGET_TRIPLE MATCHES "darwin")
- # Ignore the major, minor, and patchlevel versions of darwin targets.
- string(REGEX REPLACE "darwin[0-9]+\\.[0-9]+\\.[0-9]+" "darwin"
- GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}")
- elseif(TARGET_TRIPLE MATCHES "freebsd")
- # Ignore the major and minor versions of freebsd targets.
- string(REGEX REPLACE "freebsd[0-9]+\\.[0-9]+" "freebsd"
- GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}")
- else()
- set(GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}")
- endif()
-endif()
+# This function generates a "unique" identifier based on various properties
+# given as arguments. The idea is to encode all ABI-affecting properties
+# in that identifier, so that we can store ABI information and associate it
+# to a specific ABI configuration.
+#
+# Right now, this is done by using the ABI identifier as the filename containing
+# the list of symbols exported by libc++ for that configuration, however we could
+# make it more sophisticated if the number of ABI-affecting parameters grew.
+function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx)
+ set(abi_properties)
+
+ if ("${triple}" MATCHES "darwin")
+ # Ignore the major, minor, and patchlevel versions of darwin targets.
+ string(REGEX REPLACE "darwin[0-9]+\\.[0-9]+\\.[0-9]+" "darwin" triple "${triple}")
+ elseif("${triple}" MATCHES "freebsd")
+ # Ignore the major and minor versions of freebsd targets.
+ string(REGEX REPLACE "freebsd[0-9]+\\.[0-9]+" "freebsd" triple "${triple}")
+ endif()
+ list(APPEND abi_properties "${triple}")
+ list(APPEND abi_properties "${abi_library}")
+ list(APPEND abi_properties "v${abi_version}")
+ if (${unstable})
+ list(APPEND abi_properties "unstable")
+ else()
+ list(APPEND abi_properties "stable")
+ endif()
+ if (${exceptions})
+ list(APPEND abi_properties "exceptions")
+ else()
+ list(APPEND abi_properties "noexceptions")
+ endif()
+ if (${new_delete_in_libcxx})
+ list(APPEND abi_properties "new_in_libcxx")
+ else()
+ list(APPEND abi_properties "no_new_in_libcxx")
+ endif()
+
+ list(JOIN abi_properties "." tmp)
+ set(${result} "${tmp}" PARENT_SCOPE)
+endfunction()
-# Detect if we are building in the same configuration used to generate
-# the abilist files.
-set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.v${LIBCXX_ABI_VERSION}.abilist")
-set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_diff.py")
-if (EXISTS "${ABILIST_FILE}"
- AND TARGET cxx_shared
- AND ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi" OR
- (APPLE AND "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "default"))
- AND NOT LIBCXX_ABI_UNSTABLE
- AND LIBCXX_ENABLE_EXCEPTIONS)
+cxx_abi_list_identifier(abi_list_identifier
+ "${LIBCXX_TARGET_TRIPLE}"
+ "${LIBCXX_CXX_ABI_LIBNAME}"
+ "${LIBCXX_ABI_VERSION}"
+ "${LIBCXX_ABI_UNSTABLE}"
+ "${LIBCXX_ENABLE_EXCEPTIONS}"
+ "${LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS}"
+)
+
+if (TARGET cxx_shared)
+ set(abi_list_file "${CMAKE_CURRENT_SOURCE_DIR}/${abi_list_identifier}.abilist")
+
+ if (EXISTS "${abi_list_file}")
add_custom_target(check-cxx-abilist
- ${SYMDIFF_EXE} --only-stdlib-symbols --strict ${ABILIST_FILE}
- $<TARGET_SONAME_FILE:cxx_shared>
- DEPENDS cxx_shared
- COMMENT "Testing ABI compatibility...")
+ "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/sym_diff.py"
+ --only-stdlib-symbols
+ --strict "${abi_list_file}"
+ $<TARGET_FILE:cxx_shared>
+ DEPENDS cxx_shared
+ COMMENT "Testing libc++'s exported symbols against the ABI list")
+ else()
+ message(STATUS "ABI list file not generated for configuration ${abi_list_identifier}, `check-cxx-abilist` will not be available.")
+ endif()
+
+ add_custom_target(generate-cxx-abilist
+ COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_abi_list.py"
+ --output "${abi_list_file}"
+ "$<TARGET_FILE:cxx_shared>"
+ DEPENDS cxx_shared
+ COMMENT "Generating the ABI list file for configuration ${abi_list_identifier}")
else()
- message(STATUS "there is no pre-generated ABI list for the requested libc++ configuration. "
- "check-cxx-abilist target is not supported")
+ message(STATUS "Not building a shared library for libc++ -- the ABI list targets will not be available.")
endif()
This directory contains abi lists representing the symbols exported
-by the libc++ library. The lists are generated using sym_extract.py.
+by the libc++ library. The lists are generated using libcxx/utils/generate_abi_list.py.
-Every time a symbol is added or removed from the libc++ library each of the
-lists *MUST* be updated to reflect the changes.
+Every time a symbol is added or removed from the libc++ library, each of the
+lists *MUST* be updated to reflect the changes. This can be done by using the
+`generate-cxx-abilist` CMake target.
-TODO Add more documentation about generating and using the lists.
-TODO Add more documentation about the build configuration the lists are generated against.
+We do not keep an up-to-date ABI list for all the build configurations of libc++.
+Currently, only the default configuration on MacOS and Linux are supported.
--- /dev/null
+{'is_defined': False, 'name': '__ZNKSt10bad_typeid4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt11logic_error4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt13bad_exception4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt20bad_array_new_length4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt8bad_cast4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt9bad_alloc4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt9exception4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidC1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidC2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11logic_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11logic_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11logic_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11range_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11range_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11range_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12domain_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12domain_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12domain_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12length_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12length_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12length_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12out_of_rangeD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12out_of_rangeD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12out_of_rangeD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13bad_exceptionD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13bad_exceptionD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13bad_exceptionD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13runtime_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13runtime_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13runtime_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt14overflow_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt14overflow_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt14overflow_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt15underflow_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt15underflow_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt16invalid_argumentD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castC1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castC2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocC1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocC2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9exceptionD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9exceptionD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9exceptionD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9type_infoD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9type_infoD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9type_infoD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt10unexpectedv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt13get_terminatev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt13set_terminatePFvvE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt14get_unexpectedv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt14set_unexpectedPFvvE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt15get_new_handlerv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt15set_new_handlerPFvvE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt9terminatev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt10bad_typeid', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt11logic_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt11range_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt12domain_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt12length_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt12out_of_range', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt13bad_exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt13runtime_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt14overflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt15underflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt16invalid_argument', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt20bad_array_new_length', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt8bad_cast', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt9bad_alloc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt9exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt9type_info', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTId', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv117__array_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv117__class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv120__function_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt10bad_typeid', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt11logic_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt11range_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt12domain_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt12length_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt12out_of_range', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt13bad_exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt13runtime_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt14overflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt15underflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt16invalid_argument', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt20bad_array_new_length', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt8bad_cast', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt9bad_alloc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt9exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt9type_info', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv117__array_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv117__class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv120__function_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt10bad_typeid', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt11logic_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt11range_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt12domain_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt12length_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt12out_of_range', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt13bad_exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt13runtime_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt14overflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt15underflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt16invalid_argument', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt20bad_array_new_length', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt8bad_cast', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt9bad_alloc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt9exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt9type_info', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvmSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvmSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__Znam', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnamRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnamSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__Znwm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnwmRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnwmSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_allocate_dependent_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_allocate_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_atexit', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_bad_cast', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_bad_typeid', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_begin_catch', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_call_unexpected', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_current_exception_type', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_current_primary_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_decrement_exception_refcount', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_deleted_virtual', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_demangle', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_end_catch', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_free_dependent_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_free_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_get_exception_ptr', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_get_globals', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_get_globals_fast', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_guard_abort', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_guard_acquire', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_guard_release', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_increment_exception_refcount', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_pure_virtual', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_rethrow', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_rethrow_primary_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_throw', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_throw_bad_array_new_length', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_uncaught_exceptions', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_cctor', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_cleanup', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_ctor', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_delete', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_delete2', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_delete3', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_dtor', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_new', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_new2', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_new3', 'type': 'U'}
+{'is_defined': False, 'name': '___dynamic_cast', 'type': 'U'}
+{'is_defined': False, 'name': '___gxx_personality_v0', 'type': 'U'}
+{'is_defined': True, 'name': '__ZNKSt10bad_typeid4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt11logic_error4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt12bad_any_cast4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt16nested_exception14rethrow_nestedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt18bad_variant_access4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt19bad_optional_access4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt20bad_array_new_length4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110error_code7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__decrementableEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__find_c_from_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__subscriptableEPKvl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__dereferenceableEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__find_c_and_lockEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db8__find_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db9__addableEPKvl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112bad_weak_ptr4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEjw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEwc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112strstreambuf6pcountEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__113random_device7entropyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114error_category23default_error_conditionEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115error_condition7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__119__libcpp_debug_info4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__XEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__cEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__rEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__xEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__weeksEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE8__monthsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__XEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__cEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__rEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__xEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__weeksEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE8__monthsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem18directory_iterator13__dereferenceEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem28recursive_directory_iterator13__dereferenceEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem28recursive_directory_iterator5depthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem28recursive_directory_iterator7optionsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path10__filenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path11__extensionEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path11__root_nameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path13__parent_pathEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path15__relative_pathEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path15__root_path_rawEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path16__root_directoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path16lexically_normalEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path18lexically_relativeERKS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path3endEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path5beginEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path6__stemEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path9__compareENS_17basic_string_viewIcNS_11char_traitsIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEjw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEwc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__16locale4nameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__16locale9has_facetERNS0_2idE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__16locale9use_facetERNS0_2idE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__16localeeqERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE6do_outERS1_PKDiS5_RS5_PDuS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE9do_lengthERS1_PKDuS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE6do_outERS1_PKDsS5_RS5_PDuS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE9do_lengthERS1_PKDuS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIcE12do_transformEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIcE7do_hashEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIwE12do_transformEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIwE7do_hashEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18ios_base6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIcE8do_closeEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIwE8do_closeEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_truenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE12do_falsenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_truenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE12do_falsenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt8bad_cast4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt9bad_alloc4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt9exception4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidC1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidC2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11logic_erroraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11range_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11range_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11range_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12domain_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12domain_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12domain_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt12length_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12length_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12length_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12out_of_rangeD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12out_of_rangeD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12out_of_rangeD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptrD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13runtime_erroraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt14overflow_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt14overflow_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt14overflow_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt15underflow_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt16invalid_argumentD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt16invalid_argumentD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt19bad_optional_accessD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt19bad_optional_accessD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt19bad_optional_accessD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110adopt_lockE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5alnumE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5alphaE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5blankE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5cntrlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5digitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5graphE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5lowerE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5printE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5punctE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5spaceE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5upperE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base6xdigitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110defer_lockE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110istrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110istrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110istrstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ostrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110ostrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110ostrstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__call_onceERVmPvPFvS2_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_cEPvPFPNS_8__c_nodeES1_S1_S3_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db11__insert_icEPvPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db15__iterator_copyEPvPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db16__invalidate_allEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db4swapEPvS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111try_to_lockE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112__do_nothingEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__get_sp_mutEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__next_primeEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultclEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112format_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112format_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112format_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorC1ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorC2ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_1E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_2E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_3E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_4E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_5E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_6E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_7E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_8E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_9E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders3_10E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf3strEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf4swapERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf6__initEPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf6freezeEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPFPvmEPFvS1_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKal', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKhl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPalS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPhlS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1El', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPFPvmEPFvS1_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKal', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKhl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPalS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPhlS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2El', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113allocator_argE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE11__read_modeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE12__write_modeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5closeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1EOS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2EOS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreEli', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceclEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113shared_futureIvEaSERKS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__get_const_dbEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_put_base14__format_floatEPcPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_count12__add_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_count16__release_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_countD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_countD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114error_categoryC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114error_categoryD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114error_categoryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114error_categoryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__get_classnameEPKcb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_structC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_structC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_structD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_structD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strERKNS_12basic_stringIcS2_S4_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE4swapERS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC1EOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115future_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcE6__initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwE6__initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115system_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116generic_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state12__make_readyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state16__on_zero_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4copyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4waitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9__executeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9set_valueEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117declare_reachableEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117iostream_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_allEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_oneEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variableD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variableD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex11lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex13unlock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex15try_lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base11lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base13unlock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base15try_lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count10__add_weakEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count12__add_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count14__release_weakEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count16__release_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__thread_local_dataEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119declare_no_pointersEPcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119piecewise_constructE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__120__get_collation_nameEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__120__libcpp_atomic_waitEPVKvx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121__undeclare_reachableEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121undeclare_no_pointersEPcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__cxx_atomic_notify_allEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__cxx_atomic_notify_allEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__cxx_atomic_notify_oneEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__cxx_atomic_notify_oneEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__libcpp_debug_functionE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__134__construct_barrier_algorithm_baseERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__13cinE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem10__absoluteERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem10hash_valueERKNS1_4pathE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem11__canonicalERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem11__copy_fileERKNS1_4pathES4_NS1_12copy_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem11__file_sizeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem12__equivalentERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem12__remove_allERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem13__fs_is_emptyERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem13__permissionsERKNS1_4pathENS1_5permsENS1_12perm_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem13__resize_fileERKNS1_4pathEmPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem14__copy_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem14__current_pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem14__current_pathERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem14__read_symlinkERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem15directory_entry12__do_refreshEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16_FilesystemClock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16_FilesystemClock9is_steadyE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16__create_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16__symlink_statusERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16filesystem_error13__create_whatEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16filesystem_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16filesystem_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16filesystem_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem17__hard_link_countERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem17__last_write_timeERKNS1_4pathENS_6chrono10time_pointINS1_16_FilesystemClockENS5_8durationInNS_5ratioILl1ELl1000000000EEEEEEEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem17__last_write_timeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18__create_directoryERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18__create_directoryERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18__create_hard_linkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18__weakly_canonicalERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18directory_iterator11__incrementEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18directory_iteratorC1ERKNS1_4pathEPNS_10error_codeENS1_17directory_optionsE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18directory_iteratorC2ERKNS1_4pathEPNS_10error_codeENS1_17directory_optionsE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem20__create_directoriesERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem21__temp_directory_pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem26__create_directory_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iterator11__incrementEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iterator15__try_recursionEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iterator5__popEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iterator9__advanceEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iteratorC1ERKNS1_4pathENS1_17directory_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iteratorC2ERKNS1_4pathENS1_17directory_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem4path17replace_extensionERKS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem4path19preferred_separatorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem4path8iterator11__decrementEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem4path8iterator11__incrementEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem6__copyERKNS1_4pathES4_NS1_12copy_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem7__spaceERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem8__removeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem8__renameERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem8__statusERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14cerrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14clogE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14coutE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC1EPKjbm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC2EPKjbm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15wcerrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15wclogE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15wcoutE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16__itoa8__u32toaEjPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__itoa8__u64toaEyPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16gslice6__initEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale2id5__getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale2id6__initEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale2id9__next_idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale3allE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale4noneE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale4timeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5ctypeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5facet16__on_zero_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5facetD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5facetD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5facetD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale6globalERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale7classicEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale7collateE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale7numericE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale8__globalEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale8messagesE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale8monetaryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_PKci', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_S2_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_PKci', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_S2_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeaSERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16thread20hardware_concurrencyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16thread4joinEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16thread6detachEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16threadD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16threadD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsDu11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIcE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIwE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE10get_futureEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE24set_value_at_thread_exitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE9set_valueEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__c_node5__addEPNS_8__i_nodeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__c_nodeD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__c_nodeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__c_nodeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__get_dbEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__i_nodeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__i_nodeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__rs_getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__sp_mut4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__sp_mut6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base10floatfieldE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base10scientificE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base11adjustfieldE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base15sync_with_stdioEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base16__call_callbacksENS0_5eventE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base2inE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3appE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3ateE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3decE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3hexE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3octE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3outE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4initEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4leftE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4moveERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4swapERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5clearEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5iwordEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5pwordEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5rightE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5truncE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6badbitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6binaryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6eofbitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6skipwsE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6xallocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7copyfmtERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7goodbitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7showposE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base8internalE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9uppercaseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_baseD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_baseD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_baseD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18messagesIcE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18messagesIwE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImE6resizeEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19strstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt8bad_castC1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt8bad_castC2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt8bad_castD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt8bad_castD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt8bad_castD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocC1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocC2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9exceptionD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9exceptionD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9exceptionD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9type_infoD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9type_infoD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9type_infoD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt10unexpectedv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt13get_terminatev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt13set_terminatePFvvE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt14get_unexpectedv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt14set_unexpectedPFvvE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt15get_new_handlerv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt15set_new_handlerPFvvE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt17__throw_bad_allocv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt17current_exceptionv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt17rethrow_exceptionSt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt18uncaught_exceptionv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt19uncaught_exceptionsv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt7nothrow', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZSt9terminatev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE0_NS_13basic_ostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_ostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTIDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt12experimental19bad_optional_accessE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110istrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110ostrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__111regex_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112bad_weak_ptrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112format_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112future_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112strstreambufE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112system_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDiEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDsEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__shared_countE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114error_categoryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117__assoc_sub_stateE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__119__shared_weak_countE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__14__fs10filesystem16filesystem_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__15ctypeIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__15ctypeIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__16locale5facetE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17collateIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17collateIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18__c_nodeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18ios_base7failureE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18ios_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18messagesIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18messagesIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18numpunctIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18numpunctIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19strstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTIPDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt10bad_typeid', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt11logic_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt11range_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt12bad_any_cast', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTISt12domain_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt12length_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt12out_of_range', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt13bad_exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt13runtime_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt14overflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt15underflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt16invalid_argument', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt16nested_exception', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTISt18bad_variant_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTISt19bad_optional_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTISt20bad_array_new_length', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt8bad_cast', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt9bad_alloc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt9exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt9type_info', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTId', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv117__array_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv117__class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv120__function_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt12experimental19bad_optional_accessE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110istrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110ostrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__111regex_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112bad_weak_ptrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112format_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112future_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112strstreambufE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112system_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114error_categoryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__14__fs10filesystem16filesystem_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__15ctypeIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__15ctypeIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__16locale5facetE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17collateIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17collateIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18__c_nodeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18ios_base7failureE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18ios_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18messagesIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18messagesIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18numpunctIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18numpunctIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19strstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSPDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt10bad_typeid', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt11logic_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt11range_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt12bad_any_cast', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSSt12domain_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt12length_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt12out_of_range', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt13bad_exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt13runtime_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt14overflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt15underflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt16invalid_argument', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt16nested_exception', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSSt18bad_variant_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSSt19bad_optional_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSSt20bad_array_new_length', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt8bad_cast', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt9bad_alloc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt9exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt9type_info', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTTNSt3__110istrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__110ostrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__19strstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv117__array_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv117__class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv120__function_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt12experimental19bad_optional_accessE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110istrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110ostrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__111regex_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112bad_weak_ptrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112format_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112future_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112strstreambufE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112system_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114__shared_countE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114error_categoryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117__assoc_sub_stateE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__119__shared_weak_countE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__14__fs10filesystem16filesystem_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__15ctypeIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__15ctypeIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__16locale5facetE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17collateIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17collateIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18__c_nodeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18ios_base7failureE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18ios_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18messagesIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18messagesIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18numpunctIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18numpunctIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19strstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt10bad_typeid', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt11logic_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt11range_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt12bad_any_cast', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt12domain_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt12length_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt12out_of_range', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt13bad_exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt13runtime_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt14overflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt15underflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt16invalid_argument', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt16nested_exception', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt18bad_variant_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt19bad_optional_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt20bad_array_new_length', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt8bad_cast', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt9bad_alloc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt9exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt9type_info', 'type': 'I'}
+{'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZdaPv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvmSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvmSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__Znam', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnamRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnamSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__Znwm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnwmRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnwmSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_allocate_dependent_exception', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_allocate_exception', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_bad_cast', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_bad_typeid', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_begin_catch', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_call_unexpected', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_current_exception_type', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_deleted_virtual', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_demangle', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_end_catch', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_free_dependent_exception', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_free_exception', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_get_exception_ptr', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_get_globals', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_get_globals_fast', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_guard_abort', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_guard_acquire', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_guard_release', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_pure_virtual', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_rethrow', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_throw', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_throw_bad_array_new_length', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_uncaught_exceptions', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_cctor', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_cleanup', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_ctor', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_delete', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_delete2', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_delete3', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_dtor', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_new', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_new2', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_new3', 'type': 'I'}
+{'is_defined': True, 'name': '___dynamic_cast', 'type': 'I'}
+{'is_defined': True, 'name': '___gxx_personality_v0', 'type': 'I'}
\ No newline at end of file
--- /dev/null
+{'is_defined': False, 'name': '__ZNKSt10bad_typeid4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt11logic_error4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt13bad_exception4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt20bad_array_new_length4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt8bad_cast4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt9bad_alloc4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNKSt9exception4whatEv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidC1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidC2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt10bad_typeidD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11logic_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11logic_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11logic_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11range_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11range_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt11range_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12domain_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12domain_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12domain_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12length_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12length_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12length_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12out_of_rangeD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12out_of_rangeD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt12out_of_rangeD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13bad_exceptionD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13bad_exceptionD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13bad_exceptionD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13runtime_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13runtime_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt13runtime_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt14overflow_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt14overflow_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt14overflow_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt15underflow_errorD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt15underflow_errorD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt16invalid_argumentD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castC1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castC2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt8bad_castD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocC1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocC2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9bad_allocD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9exceptionD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9exceptionD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9exceptionD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9type_infoD0Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9type_infoD1Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZNSt9type_infoD2Ev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt10unexpectedv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt13get_terminatev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt13set_terminatePFvvE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt14get_unexpectedv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt14set_unexpectedPFvvE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt15get_new_handlerv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt15set_new_handlerPFvvE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZSt9terminatev', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPKy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIPy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt10bad_typeid', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt11logic_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt11range_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt12domain_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt12length_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt12out_of_range', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt13bad_exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt13runtime_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt14overflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt15underflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt16invalid_argument', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt20bad_array_new_length', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt8bad_cast', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt9bad_alloc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt9exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTISt9type_info', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTId', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTIy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv117__array_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv117__class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv120__function_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKDi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKDn', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKDs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPKy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSPy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt10bad_typeid', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt11logic_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt11range_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt12domain_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt12length_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt12out_of_range', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt13bad_exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt13runtime_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt14overflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt15underflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt16invalid_argument', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt20bad_array_new_length', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt8bad_cast', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt9bad_alloc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt9exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSSt9type_info', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSa', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSb', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSd', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSe', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSf', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSh', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSi', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSj', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSl', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSs', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSt', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSw', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSx', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTSy', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv117__array_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv117__class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv120__function_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt10bad_typeid', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt11logic_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt11range_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt12domain_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt12length_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt12out_of_range', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt13bad_exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt13runtime_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt14overflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt15underflow_error', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt16invalid_argument', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt20bad_array_new_length', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt8bad_cast', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt9bad_alloc', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt9exception', 'type': 'U'}
+{'is_defined': False, 'name': '__ZTVSt9type_info', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdaPvmSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPv', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZdlPvmSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__Znam', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnamRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnamSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__Znwm', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnwmRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnwmSt11align_val_t', 'type': 'U'}
+{'is_defined': False, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_allocate_dependent_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_allocate_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_atexit', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_bad_cast', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_bad_typeid', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_begin_catch', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_call_unexpected', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_current_exception_type', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_current_primary_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_decrement_exception_refcount', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_deleted_virtual', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_demangle', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_end_catch', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_free_dependent_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_free_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_get_exception_ptr', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_get_globals', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_get_globals_fast', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_guard_abort', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_guard_acquire', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_guard_release', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_increment_exception_refcount', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_pure_virtual', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_rethrow', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_rethrow_primary_exception', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_throw', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_throw_bad_array_new_length', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_uncaught_exceptions', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_cctor', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_cleanup', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_ctor', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_delete', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_delete2', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_delete3', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_dtor', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_new', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_new2', 'type': 'U'}
+{'is_defined': False, 'name': '___cxa_vec_new3', 'type': 'U'}
+{'is_defined': False, 'name': '___dynamic_cast', 'type': 'U'}
+{'is_defined': False, 'name': '___gxx_personality_v0', 'type': 'U'}
+{'is_defined': True, 'name': '__ZNKSt10bad_typeid4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt11logic_error4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt12bad_any_cast4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt16nested_exception14rethrow_nestedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt18bad_variant_access4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt19bad_optional_access4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt20bad_array_new_length4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110error_code7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__decrementableEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__find_c_from_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__subscriptableEPKvl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__dereferenceableEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__find_c_and_lockEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db8__find_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db9__addableEPKvl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112bad_weak_ptr4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEjw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEwc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__112strstreambuf6pcountEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__113random_device7entropyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__114error_category23default_error_conditionEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__115error_condition7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__119__libcpp_debug_info4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__XEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__cEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__rEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__xEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__weeksEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE8__monthsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__XEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__cEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__rEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__xEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__weeksEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE8__monthsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem18directory_iterator13__dereferenceEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem28recursive_directory_iterator13__dereferenceEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem28recursive_directory_iterator5depthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem28recursive_directory_iterator7optionsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path10__filenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path11__extensionEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path11__root_nameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path13__parent_pathEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path15__relative_pathEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path15__root_path_rawEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path16__root_directoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path16lexically_normalEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path18lexically_relativeERKS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path3endEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path5beginEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path6__stemEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__14__fs10filesystem4path9__compareENS_17basic_string_viewIcNS_11char_traitsIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEjw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEwc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__16locale4nameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__16locale9has_facetERNS0_2idE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__16locale9use_facetERNS0_2idE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__16localeeqERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE6do_outERS1_PKDiS5_RS5_PDuS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDiDu11__mbstate_tE9do_lengthERS1_PKDuS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE6do_outERS1_PKDsS5_RS5_PDuS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsDu11__mbstate_tE9do_lengthERS1_PKDuS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIcE12do_transformEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIcE7do_hashEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIwE12do_transformEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17collateIwE7do_hashEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18ios_base6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIcE8do_closeEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18messagesIwE8do_closeEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_truenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE12do_falsenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_truenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE12do_falsenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNKSt8bad_cast4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt9bad_alloc4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNKSt9exception4whatEv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidC1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidC2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt10bad_typeidD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11logic_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11logic_erroraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt11range_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11range_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt11range_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12domain_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12domain_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12domain_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt12length_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12length_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12length_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12out_of_rangeD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12out_of_rangeD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt12out_of_rangeD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptrD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13exception_ptraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13runtime_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt13runtime_erroraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt14overflow_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt14overflow_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt14overflow_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt15underflow_errorD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt16invalid_argumentD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt16invalid_argumentD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt16nested_exceptionD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt19bad_optional_accessD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt19bad_optional_accessD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt19bad_optional_accessD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_getD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110__time_putD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110adopt_lockE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5alnumE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5alphaE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5blankE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5cntrlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5digitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5graphE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5lowerE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5printE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5punctE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5spaceE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base5upperE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ctype_base6xdigitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110defer_lockE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110istrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110istrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110istrstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__110ostrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110ostrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110ostrstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__110to_wstringEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__call_onceERVmPvPFvS2_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_cEPvPFPNS_8__c_nodeES1_S1_S3_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db11__insert_icEPvPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db15__iterator_copyEPvPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db16__invalidate_allEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db4swapEPvS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111regex_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111timed_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__111try_to_lockE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112__do_nothingEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__get_sp_mutEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__next_primeEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112__rs_defaultclEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112format_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112format_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112format_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorC1ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorC2ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112future_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_1E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_2E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_3E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_4E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_5E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_6E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_7E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_8E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders2_9E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112placeholders3_10E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf3strEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf4swapERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf6__initEPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf6freezeEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambuf9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPFPvmEPFvS1_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKal', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKhl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPalS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPhlS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC1El', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPFPvmEPFvS1_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKal', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKhl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPalS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPhlS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufC2El', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112strstreambufD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__112system_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113allocator_argE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE11__read_modeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE12__write_modeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5closeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1EOS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2EOS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreEli', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113random_deviceclEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__113shared_futureIvEaSERKS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__get_const_dbEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_put_base14__format_floatEPcPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_count12__add_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_count16__release_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_countD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_countD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114__shared_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114error_categoryC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114error_categoryD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114error_categoryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__114error_categoryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__get_classnameEPKcb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_structC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_structC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_structD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115__thread_structD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strERKNS_12basic_stringIcS2_S4_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE4swapERS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC1EOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115future_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcE6__initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwE6__initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__115system_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__116generic_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state12__make_readyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state16__on_zero_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4copyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4waitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9__executeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9set_valueEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117declare_reachableEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117iostream_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_allEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_oneEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variableD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118condition_variableD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex11lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex13unlock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex15try_lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base11lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base13unlock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base15try_lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count10__add_weakEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count12__add_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count14__release_weakEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count16__release_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__thread_local_dataEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119declare_no_pointersEPcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119piecewise_constructE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__120__get_collation_nameEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__120__libcpp_atomic_waitEPVKvx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121__undeclare_reachableEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__121undeclare_no_pointersEPcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__cxx_atomic_notify_allEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__cxx_atomic_notify_allEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__cxx_atomic_notify_oneEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__cxx_atomic_notify_oneEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__123__libcpp_debug_functionE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__134__construct_barrier_algorithm_baseERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__13cinE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem10__absoluteERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem10hash_valueERKNS1_4pathE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem11__canonicalERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem11__copy_fileERKNS1_4pathES4_NS1_12copy_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem11__file_sizeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem12__equivalentERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem12__remove_allERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem13__fs_is_emptyERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem13__permissionsERKNS1_4pathENS1_5permsENS1_12perm_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem13__resize_fileERKNS1_4pathEmPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem14__copy_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem14__current_pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem14__current_pathERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem14__read_symlinkERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem15directory_entry12__do_refreshEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16_FilesystemClock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16_FilesystemClock9is_steadyE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16__create_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16__symlink_statusERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16filesystem_error13__create_whatEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16filesystem_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16filesystem_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem16filesystem_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem17__hard_link_countERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem17__last_write_timeERKNS1_4pathENS_6chrono10time_pointINS1_16_FilesystemClockENS5_8durationInNS_5ratioILl1ELl1000000000EEEEEEEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem17__last_write_timeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18__create_directoryERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18__create_directoryERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18__create_hard_linkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18__weakly_canonicalERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18directory_iterator11__incrementEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18directory_iteratorC1ERKNS1_4pathEPNS_10error_codeENS1_17directory_optionsE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem18directory_iteratorC2ERKNS1_4pathEPNS_10error_codeENS1_17directory_optionsE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem20__create_directoriesERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem21__temp_directory_pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem26__create_directory_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iterator11__incrementEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iterator15__try_recursionEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iterator5__popEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iterator9__advanceEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iteratorC1ERKNS1_4pathENS1_17directory_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem28recursive_directory_iteratorC2ERKNS1_4pathENS1_17directory_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem4path17replace_extensionERKS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem4path19preferred_separatorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem4path8iterator11__decrementEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem4path8iterator11__incrementEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem6__copyERKNS1_4pathES4_NS1_12copy_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem7__spaceERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem8__removeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem8__renameERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14__fs10filesystem8__statusERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14cerrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14clogE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14coutE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC1EPKjbm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC2EPKjbm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__15wcerrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15wclogE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__15wcoutE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16__itoa8__u32toaEjPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__itoa8__u64toaEyPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16futureIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16gslice6__initEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale2id5__getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale2id6__initEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale2id9__next_idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale3allE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale4noneE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale4timeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5ctypeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5facet16__on_zero_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5facetD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5facetD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale5facetD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale6globalERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale7classicEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale7collateE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale7numericE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale8__globalEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16locale8messagesE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16locale8monetaryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_PKci', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_S2_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_PKci', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_S2_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16localeaSERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16thread20hardware_concurrencyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16thread4joinEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16thread6detachEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16threadD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__16threadD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsDu11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIcE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIwE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17collateIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE10get_futureEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE24set_value_at_thread_exitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvE9set_valueEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__17promiseIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__c_node5__addEPNS_8__i_nodeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__c_nodeD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__c_nodeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__c_nodeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__get_dbEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__i_nodeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__i_nodeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__rs_getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__sp_mut4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18__sp_mut6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base10floatfieldE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base10scientificE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base11adjustfieldE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base15sync_with_stdioEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base16__call_callbacksENS0_5eventE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base2inE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3appE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3ateE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3decE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3hexE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3octE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base3outE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4initEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4leftE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4moveERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base4swapERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5clearEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5iwordEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5pwordEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5rightE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base5truncE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6badbitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6binaryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6eofbitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6skipwsE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base6xallocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7copyfmtERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7goodbitE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7showposE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base8internalE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_base9uppercaseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_baseD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_baseD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18ios_baseD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18messagesIcE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18messagesIwE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18numpunctIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImE6resizeEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__18valarrayImED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZNSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19strstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__19to_stringEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt8bad_castC1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt8bad_castC2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt8bad_castD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt8bad_castD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt8bad_castD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocC1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocC2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9bad_allocD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9exceptionD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9exceptionD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9exceptionD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9type_infoD0Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9type_infoD1Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZNSt9type_infoD2Ev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt10unexpectedv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt13get_terminatev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt13set_terminatePFvvE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt14get_unexpectedv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt14set_unexpectedPFvvE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt15get_new_handlerv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt15set_new_handlerPFvvE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZSt17__throw_bad_allocv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt17current_exceptionv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt17rethrow_exceptionSt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt18uncaught_exceptionv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt19uncaught_exceptionsv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZSt7nothrow', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZSt9terminatev', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE0_NS_13basic_ostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_ostreamIcS2_EE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTIDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt12experimental19bad_optional_accessE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110__time_getE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110__time_putE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110ctype_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110istrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110money_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__110ostrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__111__money_getIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__111__money_getIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__111__money_putIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__111__money_putIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__111regex_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112bad_weak_ptrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112codecvt_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112format_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112future_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112strstreambufE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__112system_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__113messages_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDiEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDsEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__num_get_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__num_put_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114__shared_countE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__114error_categoryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117__assoc_sub_stateE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__118__time_get_storageIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__118__time_get_storageIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__119__shared_weak_countE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__120__time_get_c_storageIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__120__time_get_c_storageIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__14__fs10filesystem16filesystem_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__15ctypeIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__15ctypeIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__16locale5facetE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17collateIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17collateIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18__c_nodeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18ios_base7failureE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18ios_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18messagesIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18messagesIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18numpunctIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18numpunctIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19__num_getIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19__num_getIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19__num_putIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19__num_putIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19strstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTINSt3__19time_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTIPDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPKy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIPy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt10bad_typeid', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt11logic_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt11range_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt12bad_any_cast', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTISt12domain_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt12length_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt12out_of_range', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt13bad_exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt13runtime_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt14overflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt15underflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt16invalid_argument', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt16nested_exception', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTISt18bad_variant_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTISt19bad_optional_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTISt20bad_array_new_length', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt8bad_cast', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt9bad_alloc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt9exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTISt9type_info', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTId', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTIy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv117__array_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv117__class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv120__function_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt12experimental19bad_optional_accessE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110ctype_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110istrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110money_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__110ostrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__111regex_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112bad_weak_ptrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112codecvt_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112format_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112future_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112strstreambufE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__112system_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__113messages_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__114error_categoryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__14__fs10filesystem16filesystem_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__15ctypeIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__15ctypeIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__16locale5facetE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17collateIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17collateIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18__c_nodeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18ios_base7failureE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18ios_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18messagesIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18messagesIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18numpunctIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18numpunctIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19__num_getIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19__num_getIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19__num_putIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19__num_putIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19strstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSNSt3__19time_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSPDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKDi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKDn', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKDs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPKy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSPy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt10bad_typeid', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt11logic_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt11range_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt12bad_any_cast', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSSt12domain_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt12length_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt12out_of_range', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt13bad_exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt13runtime_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt14overflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt15underflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt16invalid_argument', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt16nested_exception', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSSt18bad_variant_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSSt19bad_optional_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTSSt20bad_array_new_length', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt8bad_cast', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt9bad_alloc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt9exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSSt9type_info', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSa', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSb', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSd', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSe', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSf', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSh', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSi', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSj', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSl', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSs', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSt', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSw', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSx', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTSy', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTTNSt3__110istrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__110ostrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTTNSt3__19strstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv117__array_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv117__class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv120__function_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt12experimental19bad_optional_accessE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110istrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__110ostrstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__111regex_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112bad_weak_ptrE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112format_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112future_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112strstreambufE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__112system_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114__shared_countE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__114error_categoryE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117__assoc_sub_stateE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__119__shared_weak_countE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__14__fs10filesystem16filesystem_errorE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__15ctypeIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__15ctypeIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__16locale5facetE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17collateIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17collateIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18__c_nodeE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18ios_base7failureE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18ios_baseE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18messagesIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18messagesIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18numpunctIcEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18numpunctIwEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVNSt3__19strstreamE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt10bad_typeid', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt11logic_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt11range_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt12bad_any_cast', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt12domain_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt12length_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt12out_of_range', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt13bad_exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt13runtime_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt14overflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt15underflow_error', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt16invalid_argument', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt16nested_exception', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt18bad_variant_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt19bad_optional_access', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '__ZTVSt20bad_array_new_length', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt8bad_cast', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt9bad_alloc', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt9exception', 'type': 'I'}
+{'is_defined': True, 'name': '__ZTVSt9type_info', 'type': 'I'}
+{'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZdaPv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdaPvmSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPv', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZdlPvmSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__Znam', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnamRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnamSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__Znwm', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnwmRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnwmSt11align_val_t', 'type': 'I'}
+{'is_defined': True, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_allocate_dependent_exception', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_allocate_exception', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_bad_cast', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_bad_typeid', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_begin_catch', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_call_unexpected', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_current_exception_type', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_deleted_virtual', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_demangle', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_end_catch', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_free_dependent_exception', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_free_exception', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_get_exception_ptr', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_get_globals', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_get_globals_fast', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_guard_abort', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_guard_acquire', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_guard_release', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_pure_virtual', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_rethrow', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_throw', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_throw_bad_array_new_length', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_uncaught_exceptions', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_cctor', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_cleanup', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_ctor', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_delete', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_delete2', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_delete3', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_dtor', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_new', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_new2', 'type': 'I'}
+{'is_defined': True, 'name': '___cxa_vec_new3', 'type': 'I'}
+{'is_defined': True, 'name': '___dynamic_cast', 'type': 'I'}
+{'is_defined': True, 'name': '___gxx_personality_v0', 'type': 'I'}
\ No newline at end of file
--- /dev/null
+{'is_defined': False, 'name': '_ZNKSt11logic_error4whatEv', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNKSt13runtime_error4whatEv', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt11logic_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt12length_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt12out_of_rangeD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt13runtime_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt13runtime_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt14overflow_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt16invalid_argumentD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt8bad_castC1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt8bad_castD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt8bad_castD2Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt9bad_allocC1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt9bad_allocD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt9exceptionD2Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZSt9terminatev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZTISt11logic_error', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTISt12length_error', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTISt12out_of_range', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTISt13runtime_error', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTISt14overflow_error', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTISt16invalid_argument', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTISt8bad_cast', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTISt9bad_alloc', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTISt9exception', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVN10__cxxabiv117__class_type_infoE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVN10__cxxabiv120__si_class_type_infoE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVN10__cxxabiv121__vmi_class_type_infoE', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVSt11logic_error', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVSt12length_error', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVSt12out_of_range', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVSt13runtime_error', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVSt14overflow_error', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVSt16invalid_argument', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZdaPv', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZdaPvSt11align_val_t', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZdlPv', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_Znam', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZnamSt11align_val_t', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_Znwm', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_allocate_exception', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_begin_catch', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_current_primary_exception', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_decrement_exception_refcount', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_end_catch', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_free_exception', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_guard_abort', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_guard_acquire', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_guard_release', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_increment_exception_refcount', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_pure_virtual', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_rethrow', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_rethrow_primary_exception', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_throw', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_uncaught_exceptions', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt12bad_any_cast4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt16nested_exception14rethrow_nestedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt18bad_variant_access4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt19bad_optional_access4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110error_code7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db15__decrementableEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db15__find_c_from_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db15__subscriptableEPKvl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db17__dereferenceableEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db17__find_c_and_lockEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db8__find_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db9__addableEPKvl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112bad_weak_ptr4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_scan_isEtPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE11do_scan_notEtPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEtw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEwc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112strstreambuf6pcountEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__113random_device7entropyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114error_category10equivalentERKNS_10error_codeEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114error_category23default_error_conditionEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115error_condition7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__119__libcpp_debug_info4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE3__XEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE3__cEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE3__rEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE3__xEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE7__am_pmEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE7__weeksEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE8__monthsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE3__XEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE3__cEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE3__rEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE3__xEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE7__am_pmEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE7__weeksEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE8__monthsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem18directory_iterator13__dereferenceEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem28recursive_directory_iterator13__dereferenceEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem28recursive_directory_iterator5depthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem28recursive_directory_iterator7optionsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path10__filenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path11__extensionEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path11__root_nameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path13__parent_pathEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path15__relative_pathEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path15__root_path_rawEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path16__root_directoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path16lexically_normalEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path18lexically_relativeERKS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path3endEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path5beginEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path6__stemEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__14__fs10filesystem4path9__compareENS_17basic_string_viewIcNS_11char_traitsIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE10do_toupperEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE10do_toupperEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE9do_narrowEcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_scan_isEtPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_toupperEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_toupperEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE11do_scan_notEtPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE5do_isEPKwS3_Pt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE5do_isEtw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE9do_narrowEwc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__16locale4nameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__16locale9has_facetERNS0_2idE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__16locale9use_facetERNS0_2idE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__16localeeqERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDiDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDiDu11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDiDu11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDiDu11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDiDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDiDu11__mbstate_tE6do_outERS1_PKDiS5_RS5_PDuS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDiDu11__mbstate_tE9do_lengthERS1_PKDuS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsDu11__mbstate_tE10do_unshiftERS1_PDuS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsDu11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsDu11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsDu11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsDu11__mbstate_tE5do_inERS1_PKDuS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsDu11__mbstate_tE6do_outERS1_PKDsS5_RS5_PDuS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsDu11__mbstate_tE9do_lengthERS1_PKDuS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIcE12do_transformEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIcE7do_hashEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIwE12do_transformEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIwE7do_hashEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18ios_base6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIcE8do_closeEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIwE8do_closeEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE11do_truenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE12do_falsenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE11do_truenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE12do_falsenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_erroraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptrD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_erroraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt19bad_optional_accessD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt19bad_optional_accessD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt19bad_optional_accessD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110adopt_lockE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5alnumE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5alphaE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5blankE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5cntrlE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5digitE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5graphE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5lowerE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5printE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5punctE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5spaceE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base5upperE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ctype_base6xdigitE', 'size': 2, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110defer_lockE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110istrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110istrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110istrstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb0EE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb1EE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb0EE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb1EE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ostrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110ostrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110ostrstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__call_onceERVmPvPFvS2_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db10__insert_cEPvPFPNS_8__c_nodeES1_S1_S3_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db10__insert_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db11__insert_icEPvPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db15__iterator_copyEPvPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db16__invalidate_allEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db4swapEPvS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db9__erase_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db9__erase_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_dbC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_dbC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_dbD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_dbD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111try_to_lockE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112__do_nothingEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__get_sp_mutEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__next_primeEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_default4__c_E', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultclEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 8, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 8, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112format_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112format_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112format_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorC1ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorC2ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_1E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_2E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_3E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_4E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_5E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_6E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_7E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_8E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders2_9E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112placeholders3_10E', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf3strEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf4swapERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf6__initEPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf6freezeEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPFPvmEPFvS1_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPKal', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPKhl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPalS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPhlS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1El', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPFPvmEPFvS1_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPKal', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPKhl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPalS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPhlS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2El', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1ENS_10error_codeEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2ENS_10error_codeEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113allocator_argE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE11__read_modeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE12__write_modeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5closeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1EOS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2EOS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreElj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceclEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvEaSERKS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__get_const_dbEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_get_base5__srcE', 'size': 33, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_put_base14__format_floatEPcPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_count12__add_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_count16__release_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_countD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_countD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_ifstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_ofstreamIcNS_11char_traitsIcEEE4openERKNS_12basic_stringIcS2_NS_9allocatorIcEEEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDiDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114error_categoryC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114error_categoryD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114error_categoryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114error_categoryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__get_classnameEPKcb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_structC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_structC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_structD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_structD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strERKNS_12basic_stringIcS2_S4_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE4swapERS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC1EOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115future_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcE6__initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwE6__initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115system_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116generic_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state12__make_readyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state16__on_zero_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state4copyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state4waitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state9__executeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state9set_valueEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm16EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm16EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm16EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117declare_reachableEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117iostream_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcEC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcEC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwEC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwEC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variable10notify_allEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variable10notify_oneEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variableD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variableD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex11lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex13unlock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex15try_lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base11lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base13unlock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base15try_lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_baseC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_baseC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count10__add_weakEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count12__add_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count14__release_weakEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count16__release_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__thread_local_dataEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119declare_no_pointersEPcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119piecewise_constructE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__120__get_collation_nameEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121__undeclare_reachableEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121undeclare_no_pointersEPcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__123__cxx_atomic_notify_allEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__123__cxx_atomic_notify_allEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__123__cxx_atomic_notify_oneEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__123__cxx_atomic_notify_oneEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__123__libcpp_debug_functionE', 'size': 8, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__134__construct_barrier_algorithm_baseERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__13cinE', 'size': 168, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem10__absoluteERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem10hash_valueERKNS1_4pathE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem11__canonicalERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem11__copy_fileERKNS1_4pathES4_NS1_12copy_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem11__file_sizeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem12__equivalentERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem12__remove_allERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem13__fs_is_emptyERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem13__permissionsERKNS1_4pathENS1_5permsENS1_12perm_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem13__resize_fileERKNS1_4pathEmPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem14__copy_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem14__current_pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem14__current_pathERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem14__read_symlinkERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem15directory_entry12__do_refreshEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16_FilesystemClock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16_FilesystemClock9is_steadyE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16__create_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16__symlink_statusERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16filesystem_error13__create_whatEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16filesystem_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16filesystem_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16filesystem_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem17__hard_link_countERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem17__last_write_timeERKNS1_4pathENS_6chrono10time_pointINS1_16_FilesystemClockENS5_8durationInNS_5ratioILl1ELl1000000000EEEEEEEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem17__last_write_timeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem18__create_directoryERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem18__create_directoryERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem18__create_hard_linkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem18__weakly_canonicalERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem18directory_iterator11__incrementEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem18directory_iteratorC1ERKNS1_4pathEPNS_10error_codeENS1_17directory_optionsE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem18directory_iteratorC2ERKNS1_4pathEPNS_10error_codeENS1_17directory_optionsE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem20__create_directoriesERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem21__temp_directory_pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem26__create_directory_symlinkERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem28recursive_directory_iterator11__incrementEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem28recursive_directory_iterator15__try_recursionEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem28recursive_directory_iterator5__popEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem28recursive_directory_iterator9__advanceEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem28recursive_directory_iteratorC1ERKNS1_4pathENS1_17directory_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem28recursive_directory_iteratorC2ERKNS1_4pathENS1_17directory_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem4path17replace_extensionERKS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem4path19preferred_separatorE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem4path8iterator11__decrementEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem4path8iterator11__incrementEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem6__copyERKNS1_4pathES4_NS1_12copy_optionsEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem7__spaceERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem8__removeERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem8__renameERKNS1_4pathES4_PNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem8__statusERKNS1_4pathEPNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14cerrE', 'size': 160, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__14clogE', 'size': 160, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__14coutE', 'size': 160, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14wcinE', 'size': 168, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__15alignEmmRPvRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcE13classic_tableEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcE21__classic_lower_tableEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcE21__classic_upper_tableEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcEC1EPKtbm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcEC2EPKtbm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIwE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15wcerrE', 'size': 160, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__15wclogE', 'size': 160, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__15wcoutE', 'size': 160, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16__clocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__itoa8__u32toaEjPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__itoa8__u64toaEmPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12steady_clock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock11from_time_tEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock3nowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16gslice6__initEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale2id5__getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale2id6__initEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale2id9__next_idE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale3allE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale4noneE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale4timeE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5ctypeE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5facet16__on_zero_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5facetD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5facetD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5facetD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale6globalERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale7classicEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale7collateE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale7numericE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale8__globalEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale8messagesE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale8monetaryE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKS0_PKci', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKS0_S2_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKS0_PKci', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKS0_S2_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeaSERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16thread20hardware_concurrencyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16thread4joinEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16thread6detachEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16threadD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16threadD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsDu11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsDu11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsDu11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsDu11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIcE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIwE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE10get_futureEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE24set_value_at_thread_exitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE9set_valueEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__c_node5__addEPNS_8__i_nodeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__c_nodeD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__c_nodeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__c_nodeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__get_dbEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__i_nodeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__i_nodeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__rs_getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__sp_mut4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__sp_mut6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base10floatfieldE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base10scientificE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base11adjustfieldE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base15sync_with_stdioEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base16__call_callbacksENS0_5eventE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base2inE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base3appE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base3ateE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base3decE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base3hexE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base3octE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base3outE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4InitC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4InitC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4InitD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4InitD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4initEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4leftE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4moveERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4swapERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5clearEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5fixedE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5iwordEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5pwordEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5rightE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5truncE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base6badbitE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base6binaryE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base6eofbitE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base6skipwsE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base6xallocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7copyfmtERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failbitE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7goodbitE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7showposE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7unitbufE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base8internalE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base8showbaseE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base9__xindex_E', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base9basefieldE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base9boolalphaE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base9showpointE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base9uppercaseE', 'size': 4, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_baseD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_baseD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_baseD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18messagesIcE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18messagesIwE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImE6resizeEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19strstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt17__throw_bad_allocv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt17current_exceptionv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt17rethrow_exceptionSt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt18uncaught_exceptionv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt19uncaught_exceptionsv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt7nothrow', 'size': 1, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE0_NS_13basic_ostreamIcS2_EE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE', 'size': 120, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_ostreamIcS2_EE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt12experimental19bad_optional_accessE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110__time_getE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110__time_putE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110ctype_baseE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110istrstreamE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110money_baseE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110moneypunctIcLb0EEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110moneypunctIcLb1EEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110moneypunctIwLb0EEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110moneypunctIwLb1EEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__110ostrstreamE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__111__money_getIcEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__111__money_getIwEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__111__money_putIcEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__111__money_putIwEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__111regex_errorE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__112bad_weak_ptrE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__112codecvt_baseE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__112ctype_bynameIcEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__112ctype_bynameIwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__112format_errorE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__112future_errorE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__112strstreambufE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__112system_errorE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__113messages_baseE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IDiEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IDsEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114__num_get_baseE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114__num_put_baseE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114__shared_countE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114collate_bynameIcEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114collate_bynameIwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__114error_categoryE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115messages_bynameIcEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115messages_bynameIwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115numpunct_bynameIcEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115numpunct_bynameIwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__117__assoc_sub_stateE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__118__time_get_storageIcEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__118__time_get_storageIwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__119__shared_weak_countE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__120__time_get_c_storageIcEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__120__time_get_c_storageIwEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__14__fs10filesystem16filesystem_errorE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__15ctypeIcEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__15ctypeIwEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__16locale5facetE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17collateIcEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17collateIwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18__c_nodeE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18ios_base7failureE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18ios_baseE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18messagesIcEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18messagesIwEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18numpunctIcEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18numpunctIwEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 72, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 72, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19__num_getIcEE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19__num_getIwEE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19__num_putIcEE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19__num_putIwEE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19strstreamE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTINSt3__19time_baseE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTISt12bad_any_cast', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTISt16nested_exception', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTISt18bad_variant_access', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTISt19bad_optional_access', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 50, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt12experimental19bad_optional_accessE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110__time_getE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110__time_putE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110ctype_baseE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110istrstreamE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110money_baseE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIcLb0EEE', 'size': 28, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIcLb1EEE', 'size': 28, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIwLb0EEE', 'size': 28, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIwLb1EEE', 'size': 28, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__110ostrstreamE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__111__money_getIcEE', 'size': 25, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__111__money_getIwEE', 'size': 25, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__111__money_putIcEE', 'size': 25, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__111__money_putIwEE', 'size': 25, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__111regex_errorE', 'size': 22, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__112bad_weak_ptrE', 'size': 23, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__112codecvt_baseE', 'size': 23, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__112ctype_bynameIcEE', 'size': 26, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__112ctype_bynameIwEE', 'size': 26, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__112format_errorE', 'size': 23, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__112future_errorE', 'size': 23, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__112strstreambufE', 'size': 23, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__112system_errorE', 'size': 23, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 47, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 47, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 47, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 47, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 47, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__113messages_baseE', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IDiEE', 'size': 29, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IDsEE', 'size': 29, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IwEE', 'size': 28, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114__num_get_baseE', 'size': 25, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114__num_put_baseE', 'size': 25, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114__shared_countE', 'size': 25, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 48, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 48, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 48, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 44, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 43, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 44, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 43, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 42, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 42, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114collate_bynameIcEE', 'size': 28, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114collate_bynameIwEE', 'size': 28, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__114error_categoryE', 'size': 25, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'size': 33, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'size': 33, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 49, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 49, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 66, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115messages_bynameIcEE', 'size': 29, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115messages_bynameIwEE', 'size': 29, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115numpunct_bynameIcEE', 'size': 29, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115numpunct_bynameIwEE', 'size': 29, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__117__assoc_sub_stateE', 'size': 28, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__118__time_get_storageIcEE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__118__time_get_storageIwEE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 69, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__119__shared_weak_countE', 'size': 30, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 70, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 70, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__120__time_get_c_storageIcEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__120__time_get_c_storageIwEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__14__fs10filesystem16filesystem_errorE', 'size': 44, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__15ctypeIcEE', 'size': 18, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__15ctypeIwEE', 'size': 18, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__16locale5facetE', 'size': 22, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 36, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 36, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 35, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 34, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17collateIcEE', 'size': 20, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17collateIwEE', 'size': 20, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18__c_nodeE', 'size': 18, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18ios_base7failureE', 'size': 26, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18ios_baseE', 'size': 18, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18messagesIcEE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18messagesIwEE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18numpunctIcEE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18numpunctIwEE', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19__num_getIcEE', 'size': 22, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19__num_getIwEE', 'size': 22, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19__num_putIcEE', 'size': 22, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19__num_putIwEE', 'size': 22, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 42, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 42, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19strstreamE', 'size': 19, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSNSt3__19time_baseE', 'size': 19, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSSt12bad_any_cast', 'size': 17, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSSt16nested_exception', 'size': 21, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSSt18bad_variant_access', 'size': 23, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTSSt19bad_optional_access', 'size': 24, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__110istrstreamE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__110ostrstreamE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 16, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTTNSt3__19strstreamE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt12experimental19bad_optional_accessE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__110istrstreamE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIcLb0EEE', 'size': 112, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIcLb1EEE', 'size': 112, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIwLb0EEE', 'size': 112, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIwLb1EEE', 'size': 112, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__110ostrstreamE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__111regex_errorE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__112bad_weak_ptrE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__112ctype_bynameIcEE', 'size': 104, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__112ctype_bynameIwEE', 'size': 136, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__112format_errorE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__112future_errorE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__112strstreambufE', 'size': 128, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__112system_errorE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE', 'size': 128, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IwEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114__shared_countE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114collate_bynameIcEE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114collate_bynameIwEE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__114error_categoryE', 'size': 72, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 128, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 128, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 128, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115messages_bynameIcEE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115messages_bynameIwEE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115numpunct_bynameIcEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115numpunct_bynameIwEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 224, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 224, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__117__assoc_sub_stateE', 'size': 48, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 112, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 112, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 112, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 112, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 120, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__119__shared_weak_countE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__14__fs10filesystem16filesystem_errorE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__15ctypeIcEE', 'size': 104, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__15ctypeIwEE', 'size': 136, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__16locale5facetE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17codecvtIDiDu11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17codecvtIDsDu11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17collateIcEE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17collateIwEE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 128, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 128, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 104, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 104, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18__c_nodeE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18ios_base7failureE', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18ios_baseE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18messagesIcEE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18messagesIwEE', 'size': 64, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18numpunctIcEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18numpunctIwEE', 'size': 80, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 168, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 168, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__19strstreamE', 'size': 120, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVSt12bad_any_cast', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVSt16nested_exception', 'size': 32, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVSt18bad_variant_access', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVSt19bad_optional_access', 'size': 40, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZThn16_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZThn16_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__110istrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__110istrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__110ostrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__110ostrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
\ No newline at end of file
chrono.cpp
condition_variable.cpp
condition_variable_destructor.cpp
- debug.cpp
exception.cpp
functional.cpp
future.cpp
include/atomic_support.h
include/config_elast.h
include/refstring.h
- ios.cpp
- iostream.cpp
- locale.cpp
memory.cpp
mutex.cpp
mutex_destructor.cpp
new.cpp
optional.cpp
- random.cpp
random_shuffle.cpp
- regex.cpp
shared_mutex.cpp
stdexcept.cpp
string.cpp
- strstream.cpp
support/runtime/exception_fallback.ipp
support/runtime/exception_glibcxx.ipp
support/runtime/exception_libcxxabi.ipp
vector.cpp
)
+if (LIBCXX_ENABLE_DEBUG_MODE_SUPPORT)
+ list(APPEND LIBCXX_SOURCES
+ debug.cpp
+ )
+endif()
+
+if (LIBCXX_ENABLE_RANDOM_DEVICE)
+ list(APPEND LIBCXX_SOURCES
+ random.cpp
+ )
+endif()
+
+if (LIBCXX_ENABLE_LOCALIZATION)
+ list(APPEND LIBCXX_SOURCES
+ include/sso_allocator.h
+ ios.cpp
+ ios.instantiations.cpp
+ iostream.cpp
+ locale.cpp
+ regex.cpp
+ strstream.cpp
+ )
+endif()
+
+if(LIBCXX_ENABLE_INCOMPLETE_FEATURES)
+ list(APPEND LIBCXX_SOURCES
+ format.cpp
+ )
+endif()
+
if(WIN32)
list(APPEND LIBCXX_SOURCES
support/win32/locale_win32.cpp
support/win32/support.cpp
- support/win32/thread_win32.cpp
)
+
+ if (NOT LIBCXX_HAS_PTHREAD_API)
+ list(APPEND LIBCXX_SOURCES
+ support/win32/thread_win32.cpp
+ )
+ endif()
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
list(APPEND LIBCXX_SOURCES
support/solaris/mbsnrtowcs.inc
support/solaris/wcsnrtombs.inc
support/solaris/xlocale.cpp
)
+elseif(ZOS)
+ list(APPEND LIBCXX_SOURCES
+ support/ibm/xlocale_zos.cpp
+ )
endif()
if (LIBCXX_ENABLE_FILESYSTEM)
filesystem/filesystem_common.h
filesystem/operations.cpp
filesystem/directory_iterator.cpp
+ filesystem/posix_compat.h
)
# Filesystem uses __int128_t, which requires a definition of __muloi4 when
# compiled with UBSAN. This definition is not provided by libgcc_s, but is
if (LIBCXX_CONFIGURE_IDE)
file(GLOB_RECURSE LIBCXX_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/*)
if(WIN32)
- file( GLOB LIBCXX_WIN32_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/support/win32/*.h)
+ file( GLOB LIBCXX_WIN32_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/__support/win32/*.h)
list(APPEND LIBCXX_HEADERS ${LIBCXX_WIN32_HEADERS})
endif()
# Force them all into the headers dir on MSVC, otherwise they end up at
# Build the shared library.
if (LIBCXX_ENABLE_SHARED)
add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
- if(COMMAND llvm_setup_rpath)
- llvm_setup_rpath(cxx_shared)
- endif()
target_link_libraries(cxx_shared PUBLIC cxx-headers
PRIVATE ${LIBCXX_LIBRARIES})
set_target_properties(cxx_shared
VERSION "${LIBCXX_ABI_VERSION}.0"
SOVERSION "${LIBCXX_ABI_VERSION}"
DEFINE_SYMBOL ""
+ POSITION_INDEPENDENT_CODE ON
)
cxx_add_common_build_flags(cxx_shared)
cxx_set_common_defines(cxx_shared)
endif()
# Maybe re-export symbols from libc++abi
+ # In particular, we don't re-export the symbols if libc++abi is merged statically
+ # into libc++ because in that case there's no dylib to re-export from.
if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
LIBCXX_CXX_ABI_LIBNAME STREQUAL "default")
- AND NOT DEFINED LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
+ AND NOT DEFINED LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS
+ AND NOT LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
set(LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS ON)
endif()
"-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp"
"-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/weak.exp")
- if (LIBCXX_ENABLE_EXCEPTIONS)
- if ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "^(armv6|armv7|armv7s)$")
- target_link_libraries(cxx_shared PRIVATE "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi-exceptions.sjlj.exp")
- else()
- target_link_libraries(cxx_shared PRIVATE "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi-exceptions.exp")
- endif()
- endif()
-
- if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
- target_link_libraries(cxx_shared PRIVATE "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi-new-delete.exp")
- endif()
+ target_link_libraries(cxx_shared PRIVATE $<TARGET_NAME_IF_EXISTS:cxxabi-reexports>)
endif()
# Generate a linker script in place of a libc++.so symlink.
endif()
endif()
+set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+
# Build the static library.
if (LIBCXX_ENABLE_STATIC)
add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
target_link_libraries(cxx_static PUBLIC cxx-headers
PRIVATE ${LIBCXX_LIBRARIES})
- set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
set_target_properties(cxx_static
PROPERTIES
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
OUTPUT_NAME "c++"
+ POSITION_INDEPENDENT_CODE ON
)
cxx_add_common_build_flags(cxx_static)
cxx_set_common_defines(cxx_static)
else()
set(MERGE_ARCHIVES_ABI_TARGET
"${CMAKE_STATIC_LIBRARY_PREFIX}${LIBCXX_CXX_STATIC_ABI_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ if (LIBCXX_CXX_ABI_LIBRARY_PATH)
+ set(MERGE_ARCHIVES_ABI_TARGET "${LIBCXX_CXX_ABI_LIBRARY_PATH}/${MERGE_ARCHIVES_ABI_TARGET}")
+ endif ()
endif()
if (APPLE)
set(MERGE_ARCHIVES_LIBTOOL "--use-libtool" "--libtool" "${CMAKE_LIBTOOL}")
"${MERGE_ARCHIVES_ABI_TARGET}"
"${MERGE_ARCHIVES_SEARCH_PATHS}"
WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
+ DEPENDS ${MERGE_ARCHIVES_ABI_TARGET}
)
endif()
endif()
if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
- file(GLOB LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES ../test/support/external_threads.cpp)
+ set(LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES
+ "${CMAKE_CURRENT_SOURCE_DIR}/../test/support/external_threads.cpp")
if (LIBCXX_ENABLE_SHARED)
add_library(cxx_external_threads SHARED ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES})
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
OUTPUT_NAME "c++external_threads"
)
+
+ target_link_libraries(cxx_external_threads PRIVATE cxx-headers)
endif()
-if (LIBCXX_INSTALL_LIBRARY)
- if (LIBCXX_INSTALL_SHARED_LIBRARY)
- install(TARGETS cxx_shared
- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
- endif()
+if (LIBCXX_INSTALL_SHARED_LIBRARY)
+ install(TARGETS cxx_shared
+ ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
+ LIBRARY DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
+ RUNTIME DESTINATION bin COMPONENT cxx)
+endif()
- if (LIBCXX_INSTALL_STATIC_LIBRARY)
- install(TARGETS cxx_static
- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
- endif()
+if (LIBCXX_INSTALL_STATIC_LIBRARY)
+ install(TARGETS cxx_static
+ ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
+ LIBRARY DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
+ RUNTIME DESTINATION bin COMPONENT cxx)
+endif()
- if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
- install(TARGETS cxx_experimental
- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
- endif()
+if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+ install(TARGETS cxx_experimental
+ LIBRARY DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
+ ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
+ RUNTIME DESTINATION bin COMPONENT cxx)
+endif()
- # NOTE: This install command must go after the cxx install command otherwise
- # it will not be executed after the library symlinks are installed.
- if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
- # Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
- # after we required CMake 3.0.
- install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
- DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR}
- COMPONENT libcxx)
- endif()
+# NOTE: This install command must go after the cxx install command otherwise
+# it will not be executed after the library symlinks are installed.
+if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ install(FILES "$<TARGET_LINKER_FILE:cxx_shared>"
+ DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR}
+ COMPONENT libcxx)
endif()
-if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR
- LIBCXX_INSTALL_HEADERS))
+if (NOT CMAKE_CONFIGURATION_TYPES)
if(LIBCXX_INSTALL_LIBRARY)
set(lib_install_target cxx)
endif()
#include "any"
namespace std {
-const char* bad_any_cast::what() const _NOEXCEPT {
+const char* bad_any_cast::what() const noexcept {
return "bad any cast";
}
}
class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
{
public:
- virtual const char* what() const _NOEXCEPT;
+ virtual const char* what() const noexcept;
};
-const char* bad_any_cast::what() const _NOEXCEPT {
+const char* bad_any_cast::what() const noexcept {
return "bad any cast";
}
#include <atomic>
#include <functional>
-#include <iostream>
-
#ifdef __linux__
#include <unistd.h>
#include <linux/futex.h>
#include <sys/syscall.h>
+// libc++ uses SYS_futex as a universal syscall name. However, on 32 bit architectures
+// with a 64 bit time_t, we need to specify SYS_futex_time64.
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+# define SYS_futex SYS_futex_time64
+#endif
+
#else // <- Add other operating systems here
// Baseline needs no new headers
} __tickets[64];
};
- ptrdiff_t& __expected;
- unique_ptr<char[]> __state_allocation;
- __state_t* __state;
+ ptrdiff_t& __expected;
+ unique_ptr<__state_t[]> __state;
_LIBCPP_HIDDEN
__barrier_algorithm_base(ptrdiff_t& __expected)
: __expected(__expected)
{
size_t const __count = (__expected + 1) >> 1;
- size_t const __size = sizeof(__state_t) * __count;
- size_t __allocation_size = __size + alignof(__state_t);
- __state_allocation = unique_ptr<char[]>(new char[__allocation_size]);
- void* __allocation = __state_allocation.get();
- void* const __state_ = align(alignof(__state_t), __size, __allocation, __allocation_size);
- __state = new (__state_) __barrier_algorithm_base::__state_t[__count];
+ __state = unique_ptr<__state_t[]>(new __state_t[__count]);
}
_LIBCPP_HIDDEN
bool __arrive(__barrier_phase_t __old_phase)
}
char*
-__u32toa(uint32_t value, char* buffer) _NOEXCEPT
+__u32toa(uint32_t value, char* buffer) noexcept
{
if (value < 100000000)
{
}
char*
-__u64toa(uint64_t value, char* buffer) _NOEXCEPT
+__u64toa(uint64_t value, char* buffer) noexcept
{
if (value < 100000000)
{
//
//===----------------------------------------------------------------------===//
+#if defined(__MVS__)
+// As part of monotonic clock support on z/OS we need macro _LARGE_TIME_API
+// to be defined before any system header to include definition of struct timespec64.
+#define _LARGE_TIME_API
+#endif
+
#include "chrono"
#include "cerrno" // errno
#include "system_error" // __throw_system_error
+
+#if defined(__MVS__)
+#include <__support/ibm/gettod_zos.h> // gettimeofdayMonotonic
+#endif
+
#include <time.h> // clock_gettime and CLOCK_{MONOTONIC,REALTIME,MONOTONIC_RAW}
#include "include/apple_availability.h"
#if __has_include(<unistd.h>)
-#include <unistd.h>
+# include <unistd.h>
#endif
-#if !defined(__APPLE__) && _POSIX_TIMERS > 0
-#define _LIBCPP_USE_CLOCK_GETTIME
+#if __has_include(<sys/time.h>)
+# include <sys/time.h> // for gettimeofday and timeval
+#endif
+
+#if !defined(__APPLE__) && defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
+# define _LIBCPP_USE_CLOCK_GETTIME
#endif
#if defined(_LIBCPP_WIN32API)
# if _WIN32_WINNT >= _WIN32_WINNT_WIN8
# include <winapifamily.h>
# endif
-#else
-# if !defined(CLOCK_REALTIME)
-# include <sys/time.h> // for gettimeofday and timeval
-# endif // !defined(CLOCK_REALTIME)
#endif // defined(_LIBCPP_WIN32API)
+#if __has_include(<mach/mach_time.h>)
+# include <mach/mach_time.h>
+#endif
+
#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
# pragma comment(lib, "rt")
#endif
namespace chrono
{
+//
// system_clock
+//
-const bool system_clock::is_steady;
-
-system_clock::time_point
-system_clock::now() _NOEXCEPT
-{
#if defined(_LIBCPP_WIN32API)
+
+static system_clock::time_point __libcpp_system_clock_now() {
// FILETIME is in 100ns units
using filetime_duration =
_VSTD::chrono::duration<__int64,
static _LIBCPP_CONSTEXPR const seconds nt_to_unix_epoch{11644473600};
FILETIME ft;
-#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#if _WIN32_WINNT >= _WIN32_WINNT_WIN8 && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
GetSystemTimePreciseAsFileTime(&ft);
-#else
- GetSystemTimeAsFileTime(&ft);
-#endif
#else
GetSystemTimeAsFileTime(&ft);
#endif
filetime_duration d{(static_cast<__int64>(ft.dwHighDateTime) << 32) |
static_cast<__int64>(ft.dwLowDateTime)};
- return time_point(duration_cast<duration>(d - nt_to_unix_epoch));
-#else
-#if defined(CLOCK_REALTIME)
+ return system_clock::time_point(duration_cast<system_clock::duration>(d - nt_to_unix_epoch));
+}
+
+#elif defined(CLOCK_REALTIME) && defined(_LIBCPP_USE_CLOCK_GETTIME)
+
+static system_clock::time_point __libcpp_system_clock_now() {
struct timespec tp;
if (0 != clock_gettime(CLOCK_REALTIME, &tp))
__throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");
- return time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000));
+ return system_clock::time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000));
+}
+
#else
+
+static system_clock::time_point __libcpp_system_clock_now() {
timeval tv;
gettimeofday(&tv, 0);
- return time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));
-#endif // CLOCK_REALTIME
+ return system_clock::time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));
+}
+
#endif
+
+const bool system_clock::is_steady;
+
+system_clock::time_point
+system_clock::now() noexcept
+{
+ return __libcpp_system_clock_now();
}
time_t
-system_clock::to_time_t(const time_point& t) _NOEXCEPT
+system_clock::to_time_t(const time_point& t) noexcept
{
return time_t(duration_cast<seconds>(t.time_since_epoch()).count());
}
system_clock::time_point
-system_clock::from_time_t(time_t t) _NOEXCEPT
+system_clock::from_time_t(time_t t) noexcept
{
return system_clock::time_point(seconds(t));
}
-#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
+//
// steady_clock
//
// Warning: If this is not truly steady, then it is non-conforming. It is
// better for it to not exist and have the rest of libc++ use system_clock
// instead.
+//
-const bool steady_clock::is_steady;
+#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
#if defined(__APPLE__)
-#if !defined(CLOCK_MONOTONIC_RAW)
-# error "Building libc++ on Apple platforms requires CLOCK_MONOTONIC_RAW"
+// TODO(ldionne):
+// This old implementation of steady_clock is retained until Chrome drops supports
+// for macOS < 10.12. The issue is that they link libc++ statically into their
+// application, which means that libc++ must support being built for such deployment
+// targets. See https://llvm.org/D74489 for details.
+#if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
+# define _LIBCPP_USE_OLD_MACH_ABSOLUTE_TIME
#endif
+#if defined(_LIBCPP_USE_OLD_MACH_ABSOLUTE_TIME)
+
+// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
+// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
+// are run time constants supplied by the OS. This clock has no relationship
+// to the Gregorian calendar. It's main use is as a high resolution timer.
+
+// MachInfo.numer / MachInfo.denom is often 1 on the latest equipment. Specialize
+// for that case as an optimization.
+
+static steady_clock::rep steady_simplified() {
+ return static_cast<steady_clock::rep>(mach_absolute_time());
+}
+static double compute_steady_factor() {
+ mach_timebase_info_data_t MachInfo;
+ mach_timebase_info(&MachInfo);
+ return static_cast<double>(MachInfo.numer) / MachInfo.denom;
+}
+
+static steady_clock::rep steady_full() {
+ static const double factor = compute_steady_factor();
+ return static_cast<steady_clock::rep>(mach_absolute_time() * factor);
+}
+
+typedef steady_clock::rep (*FP)();
+
+static FP init_steady_clock() {
+ mach_timebase_info_data_t MachInfo;
+ mach_timebase_info(&MachInfo);
+ if (MachInfo.numer == MachInfo.denom)
+ return &steady_simplified;
+ return &steady_full;
+}
+
+static steady_clock::time_point __libcpp_steady_clock_now() {
+ static FP fp = init_steady_clock();
+ return steady_clock::time_point(steady_clock::duration(fp()));
+}
+
+#else // vvvvv default behavior for Apple platforms vvvvv
+
// On Apple platforms, only CLOCK_UPTIME_RAW, CLOCK_MONOTONIC_RAW or
// mach_absolute_time are able to time functions in the nanosecond range.
// Furthermore, only CLOCK_MONOTONIC_RAW is truly monotonic, because it
// also counts cycles when the system is asleep. Thus, it is the only
// acceptable implementation of steady_clock.
-steady_clock::time_point
-steady_clock::now() _NOEXCEPT
-{
+static steady_clock::time_point __libcpp_steady_clock_now() {
struct timespec tp;
if (0 != clock_gettime(CLOCK_MONOTONIC_RAW, &tp))
__throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC_RAW) failed");
- return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
+ return steady_clock::time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
}
+#endif
+
#elif defined(_LIBCPP_WIN32API)
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx says:
static LARGE_INTEGER
__QueryPerformanceFrequency()
{
- LARGE_INTEGER val;
- (void) QueryPerformanceFrequency(&val);
- return val;
+ LARGE_INTEGER val;
+ (void) QueryPerformanceFrequency(&val);
+ return val;
}
-steady_clock::time_point
-steady_clock::now() _NOEXCEPT
-{
+static steady_clock::time_point __libcpp_steady_clock_now() {
static const LARGE_INTEGER freq = __QueryPerformanceFrequency();
LARGE_INTEGER counter;
(void) QueryPerformanceCounter(&counter);
- return time_point(duration(counter.QuadPart * nano::den / freq.QuadPart));
+ auto seconds = counter.QuadPart / freq.QuadPart;
+ auto fractions = counter.QuadPart % freq.QuadPart;
+ auto dur = seconds * nano::den + fractions * nano::den / freq.QuadPart;
+ return steady_clock::time_point(steady_clock::duration(dur));
+}
+
+#elif defined(__MVS__)
+
+static steady_clock::time_point __libcpp_steady_clock_now() {
+ struct timespec64 ts;
+ if (0 != gettimeofdayMonotonic(&ts))
+ __throw_system_error(errno, "failed to obtain time of day");
+
+ return steady_clock::time_point(seconds(ts.tv_sec) + nanoseconds(ts.tv_nsec));
}
#elif defined(CLOCK_MONOTONIC)
-steady_clock::time_point
-steady_clock::now() _NOEXCEPT
-{
+static steady_clock::time_point __libcpp_steady_clock_now() {
struct timespec tp;
if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
__throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed");
- return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
+ return steady_clock::time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
}
#else
-# error "Monotonic clock not implemented"
+# error "Monotonic clock not implemented on this platform"
#endif
+const bool steady_clock::is_steady;
+
+steady_clock::time_point
+steady_clock::now() noexcept
+{
+ return __libcpp_steady_clock_now();
+}
+
#endif // !_LIBCPP_HAS_NO_MONOTONIC_CLOCK
}
// ~condition_variable is defined elsewhere.
void
-condition_variable::notify_one() _NOEXCEPT
+condition_variable::notify_one() noexcept
{
__libcpp_condvar_signal(&__cv_);
}
void
-condition_variable::notify_all() _NOEXCEPT
+condition_variable::notify_all() noexcept
{
__libcpp_condvar_broadcast(&__cv_);
}
void
-condition_variable::wait(unique_lock<mutex>& lk) _NOEXCEPT
+condition_variable::wait(unique_lock<mutex>& lk) noexcept
{
if (!lk.owns_lock())
__throw_system_error(EPERM,
void
condition_variable::__do_timed_wait(unique_lock<mutex>& lk,
- chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp) _NOEXCEPT
+ chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp) noexcept
{
using namespace chrono;
if (!lk.owns_lock())
__i_node* j = __find_iterator(__j);
__c_node* ci = i != nullptr ? i->__c_ : nullptr;
__c_node* cj = j != nullptr ? j->__c_ : nullptr;
- return ci != nullptr && ci == cj;
+ return ci == cj;
}
void
_VSTD::__libcpp_deallocate(p, n, align);
}
- bool do_is_equal(memory_resource const & other) const _NOEXCEPT override
+ bool do_is_equal(memory_resource const & other) const noexcept override
{ return &other == this; }
public:
__throw_bad_alloc();
}
virtual void do_deallocate(void *, size_t, size_t) {}
- virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT
+ virtual bool do_is_equal(memory_resource const & __other) const noexcept
{ return &__other == this; }
};
~ResourceInitHelper() {}
};
-// Detect if the init_priority attribute is supported.
-#if (defined(_LIBCPP_COMPILER_GCC) && defined(__APPLE__)) \
- || defined(_LIBCPP_COMPILER_MSVC)
-// GCC on Apple doesn't support the init priority attribute,
-// and MSVC doesn't support any GCC attributes.
-# define _LIBCPP_INIT_PRIORITY_MAX
-#else
-# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(101)))
-#endif
-
-// When compiled in C++14 this initialization should be a constant expression.
-// Only in C++11 is "init_priority" needed to ensure initialization order.
-#if _LIBCPP_STD_VER > 11
-_LIBCPP_SAFE_STATIC
-#endif
-ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
+_LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
} // end namespace
-memory_resource * new_delete_resource() _NOEXCEPT {
+memory_resource * new_delete_resource() noexcept {
return &res_init.resources.new_delete_res;
}
-memory_resource * null_memory_resource() _NOEXCEPT {
+memory_resource * null_memory_resource() noexcept {
return &res_init.resources.null_res;
}
// default_memory_resource()
static memory_resource *
-__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) _NOEXCEPT
+__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) noexcept
{
#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
_LIBCPP_SAFE_STATIC static atomic<memory_resource*> __res =
#endif
}
-memory_resource * get_default_resource() _NOEXCEPT
+memory_resource * get_default_resource() noexcept
{
return __default_memory_resource();
}
-memory_resource * set_default_resource(memory_resource * __new_res) _NOEXCEPT
+memory_resource * set_default_resource(memory_resource * __new_res) noexcept
{
return __default_memory_resource(true, __new_res);
}
#include "__config"
#if defined(_LIBCPP_WIN32API)
#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
#include <windows.h>
#else
#include <dirent.h>
}
}
#else
+// defined(_LIBCPP_WIN32API)
-static file_type get_file_type(const WIN32_FIND_DATA& data) {
- //auto attrs = data.dwFileAttributes;
- // FIXME(EricWF)
- return file_type::unknown;
+static file_type get_file_type(const WIN32_FIND_DATAW& data) {
+ if (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT &&
+ data.dwReserved0 == IO_REPARSE_TAG_SYMLINK)
+ return file_type::symlink;
+ if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ return file_type::directory;
+ return file_type::regular;
}
-static uintmax_t get_file_size(const WIN32_FIND_DATA& data) {
- return (data.nFileSizeHigh * (MAXDWORD + 1)) + data.nFileSizeLow;
+static uintmax_t get_file_size(const WIN32_FIND_DATAW& data) {
+ return (static_cast<uint64_t>(data.nFileSizeHigh) << 32) + data.nFileSizeLow;
}
-static file_time_type get_write_time(const WIN32_FIND_DATA& data) {
+static file_time_type get_write_time(const WIN32_FIND_DATAW& data) {
ULARGE_INTEGER tmp;
const FILETIME& time = data.ftLastWriteTime;
tmp.u.LowPart = time.dwLowDateTime;
__dir_stream(const path& root, directory_options opts, error_code& ec)
: __stream_(INVALID_HANDLE_VALUE), __root_(root) {
- __stream_ = ::FindFirstFile(root.c_str(), &__data_);
+ if (root.native().empty()) {
+ ec = make_error_code(errc::no_such_file_or_directory);
+ return;
+ }
+ __stream_ = ::FindFirstFileW((root / "*").c_str(), &__data_);
if (__stream_ == INVALID_HANDLE_VALUE) {
- ec = error_code(::GetLastError(), generic_category());
+ ec = detail::make_windows_error(GetLastError());
const bool ignore_permission_denied =
bool(opts & directory_options::skip_permission_denied);
- if (ignore_permission_denied && ec.value() == ERROR_ACCESS_DENIED)
+ if (ignore_permission_denied &&
+ ec.value() == static_cast<int>(errc::permission_denied))
ec.clear();
return;
}
+ if (!assign())
+ advance(ec);
}
~__dir_stream() noexcept {
bool good() const noexcept { return __stream_ != INVALID_HANDLE_VALUE; }
bool advance(error_code& ec) {
- while (::FindNextFile(__stream_, &__data_)) {
- if (!strcmp(__data_.cFileName, ".") || strcmp(__data_.cFileName, ".."))
- continue;
- // FIXME: Cache more of this
- //directory_entry::__cached_data cdata;
- //cdata.__type_ = get_file_type(__data_);
- //cdata.__size_ = get_file_size(__data_);
- //cdata.__write_time_ = get_write_time(__data_);
- __entry_.__assign_iter_entry(
- __root_ / __data_.cFileName,
- directory_entry::__create_iter_result(detail::get_file_type(__data)));
- return true;
+ while (::FindNextFileW(__stream_, &__data_)) {
+ if (assign())
+ return true;
}
- ec = error_code(::GetLastError(), generic_category());
close();
return false;
}
+ bool assign() {
+ if (!wcscmp(__data_.cFileName, L".") || !wcscmp(__data_.cFileName, L".."))
+ return false;
+ // FIXME: Cache more of this
+ //directory_entry::__cached_data cdata;
+ //cdata.__type_ = get_file_type(__data_);
+ //cdata.__size_ = get_file_size(__data_);
+ //cdata.__write_time_ = get_write_time(__data_);
+ __entry_.__assign_iter_entry(
+ __root_ / __data_.cFileName,
+ directory_entry::__create_iter_result(detail::get_file_type(__data_)));
+ return true;
+ }
+
private:
error_code close() noexcept {
error_code ec;
if (!::FindClose(__stream_))
- ec = error_code(::GetLastError(), generic_category());
+ ec = detail::make_windows_error(GetLastError());
__stream_ = INVALID_HANDLE_VALUE;
return ec;
}
HANDLE __stream_{INVALID_HANDLE_VALUE};
- WIN32_FIND_DATA __data_;
+ WIN32_FIND_DATAW __data_;
public:
path __root_;
path root = move(__imp_->__root_);
__imp_.reset();
if (m_ec)
- err.report(m_ec, "at root \"%s\"", root);
+ err.report(m_ec, "at root " PATH_CSTR_FMT, root.c_str());
}
return *this;
}
if (m_ec) {
path root = move(stack.top().__root_);
__imp_.reset();
- err.report(m_ec, "at root \"%s\"", root);
+ err.report(m_ec, "at root " PATH_CSTR_FMT, root.c_str());
} else {
__imp_.reset();
}
} else {
path at_ent = move(curr_it.__entry_.__p_);
__imp_.reset();
- err.report(m_ec, "attempting recursion into \"%s\"", at_ent);
+ err.report(m_ec, "attempting recursion into " PATH_CSTR_FMT,
+ at_ent.c_str());
}
}
return false;
#include "filesystem"
#include "array"
#include "chrono"
-#include "cstdlib"
#include "climits"
-
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/statvfs.h>
-#include <sys/time.h> // for ::utimes as used in __last_write_time
-#include <fcntl.h> /* values for fchmodat */
+#include "cstdlib"
+#include "ctime"
+
+#if !defined(_LIBCPP_WIN32API)
+# include <unistd.h>
+# include <sys/stat.h>
+# include <sys/statvfs.h>
+# include <sys/time.h> // for ::utimes as used in __last_write_time
+# include <fcntl.h> /* values for fchmodat */
+#endif
#include "../include/apple_availability.h"
#endif
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
+#if defined(_LIBCPP_WIN32API)
+#define PS(x) (L##x)
+#define PATH_CSTR_FMT "\"%ls\""
+#else
+#define PS(x) (x)
+#define PATH_CSTR_FMT "\"%s\""
+#endif
+
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
namespace detail {
-namespace {
-
-static string format_string_imp(const char* msg, ...) {
- // we might need a second shot at this, so pre-emptivly make a copy
- struct GuardVAList {
- va_list& target;
- bool active = true;
- GuardVAList(va_list& target) : target(target), active(true) {}
- void clear() {
- if (active)
- va_end(target);
- active = false;
- }
- ~GuardVAList() {
- if (active)
- va_end(target);
- }
- };
- va_list args;
- va_start(args, msg);
- GuardVAList args_guard(args);
-
- va_list args_cp;
- va_copy(args_cp, args);
- GuardVAList args_copy_guard(args_cp);
- std::string result;
-
- array<char, 256> local_buff;
- size_t size_with_null = local_buff.size();
- auto ret = ::vsnprintf(local_buff.data(), size_with_null, msg, args_cp);
+#if defined(_LIBCPP_WIN32API)
+// Non anonymous, to allow access from two translation units.
+errc __win_err_to_errc(int err);
+#endif
- args_copy_guard.clear();
+namespace {
- // handle empty expansion
- if (ret == 0)
- return result;
- if (static_cast<size_t>(ret) < size_with_null) {
- result.assign(local_buff.data(), static_cast<size_t>(ret));
- return result;
+static _LIBCPP_FORMAT_PRINTF(1, 0) string
+format_string_impl(const char* msg, va_list ap) {
+ array<char, 256> buf;
+
+ va_list apcopy;
+ va_copy(apcopy, ap);
+ int ret = ::vsnprintf(buf.data(), buf.size(), msg, apcopy);
+ va_end(apcopy);
+
+ string result;
+ if (static_cast<size_t>(ret) < buf.size()) {
+ result.assign(buf.data(), static_cast<size_t>(ret));
+ } else {
+ // we did not provide a long enough buffer on our first attempt. The
+ // return value is the number of bytes (excluding the null byte) that are
+ // needed for formatting.
+ size_t size_with_null = static_cast<size_t>(ret) + 1;
+ result.__resize_default_init(size_with_null - 1);
+ ret = ::vsnprintf(&result[0], size_with_null, msg, ap);
+ _LIBCPP_ASSERT(static_cast<size_t>(ret) == (size_with_null - 1), "TODO");
}
-
- // we did not provide a long enough buffer on our first attempt. The
- // return value is the number of bytes (excluding the null byte) that are
- // needed for formatting.
- size_with_null = static_cast<size_t>(ret) + 1;
- result.__resize_default_init(size_with_null - 1);
- ret = ::vsnprintf(&result[0], size_with_null, msg, args);
- _LIBCPP_ASSERT(static_cast<size_t>(ret) == (size_with_null - 1), "TODO");
-
return result;
}
-const char* unwrap(string const& s) { return s.c_str(); }
-const char* unwrap(path const& p) { return p.native().c_str(); }
-template <class Arg>
-Arg const& unwrap(Arg const& a) {
- static_assert(!is_class<Arg>::value, "cannot pass class here");
- return a;
-}
-
-template <class... Args>
-string format_string(const char* fmt, Args const&... args) {
- return format_string_imp(fmt, unwrap(args)...);
+static _LIBCPP_FORMAT_PRINTF(1, 2) string
+format_string(const char* msg, ...) {
+ string ret;
+ va_list ap;
+ va_start(ap, msg);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ ret = format_string_impl(msg, ap);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ va_end(ap);
+ throw;
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+ va_end(ap);
+ return ret;
}
error_code capture_errno() {
return error_code(errno, generic_category());
}
+#if defined(_LIBCPP_WIN32API)
+error_code make_windows_error(int err) {
+ return make_error_code(__win_err_to_errc(err));
+}
+#endif
+
template <class T>
T error_value();
template <>
bool error_value<bool>() {
return false;
}
+#if __SIZEOF_SIZE_T__ != __SIZEOF_LONG_LONG__
+template <>
+size_t error_value<size_t>() {
+ return size_t(-1);
+}
+#endif
template <>
uintmax_t error_value<uintmax_t>() {
return uintmax_t(-1);
template <class T>
struct ErrorHandler {
- const char* func_name;
- error_code* ec = nullptr;
- const path* p1 = nullptr;
- const path* p2 = nullptr;
+ const char* func_name_;
+ error_code* ec_ = nullptr;
+ const path* p1_ = nullptr;
+ const path* p2_ = nullptr;
ErrorHandler(const char* fname, error_code* ec, const path* p1 = nullptr,
const path* p2 = nullptr)
- : func_name(fname), ec(ec), p1(p1), p2(p2) {
- if (ec)
- ec->clear();
+ : func_name_(fname), ec_(ec), p1_(p1), p2_(p2) {
+ if (ec_)
+ ec_->clear();
}
- T report(const error_code& m_ec) const {
- if (ec) {
- *ec = m_ec;
+ T report(const error_code& ec) const {
+ if (ec_) {
+ *ec_ = ec;
return error_value<T>();
}
- string what = string("in ") + func_name;
- switch (bool(p1) + bool(p2)) {
+ string what = string("in ") + func_name_;
+ switch (bool(p1_) + bool(p2_)) {
case 0:
- __throw_filesystem_error(what, m_ec);
+ __throw_filesystem_error(what, ec);
case 1:
- __throw_filesystem_error(what, *p1, m_ec);
+ __throw_filesystem_error(what, *p1_, ec);
case 2:
- __throw_filesystem_error(what, *p1, *p2, m_ec);
+ __throw_filesystem_error(what, *p1_, *p2_, ec);
}
_LIBCPP_UNREACHABLE();
}
- template <class... Args>
- T report(const error_code& m_ec, const char* msg, Args const&... args) const {
- if (ec) {
- *ec = m_ec;
- return error_value<T>();
+ _LIBCPP_FORMAT_PRINTF(3, 0)
+ void report_impl(const error_code& ec, const char* msg, va_list ap) const {
+ if (ec_) {
+ *ec_ = ec;
+ return;
}
string what =
- string("in ") + func_name + ": " + format_string(msg, args...);
- switch (bool(p1) + bool(p2)) {
+ string("in ") + func_name_ + ": " + format_string_impl(msg, ap);
+ switch (bool(p1_) + bool(p2_)) {
case 0:
- __throw_filesystem_error(what, m_ec);
+ __throw_filesystem_error(what, ec);
case 1:
- __throw_filesystem_error(what, *p1, m_ec);
+ __throw_filesystem_error(what, *p1_, ec);
case 2:
- __throw_filesystem_error(what, *p1, *p2, m_ec);
+ __throw_filesystem_error(what, *p1_, *p2_, ec);
}
_LIBCPP_UNREACHABLE();
}
- T report(errc const& err) const { return report(make_error_code(err)); }
+ _LIBCPP_FORMAT_PRINTF(3, 4)
+ T report(const error_code& ec, const char* msg, ...) const {
+ va_list ap;
+ va_start(ap, msg);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ report_impl(ec, msg, ap);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ va_end(ap);
+ throw;
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+ va_end(ap);
+ return error_value<T>();
+ }
- template <class... Args>
- T report(errc const& err, const char* msg, Args const&... args) const {
- return report(make_error_code(err), msg, args...);
+ T report(errc const& err) const {
+ return report(make_error_code(err));
+ }
+
+ _LIBCPP_FORMAT_PRINTF(3, 4)
+ T report(errc const& err, const char* msg, ...) const {
+ va_list ap;
+ va_start(ap, msg);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ report_impl(make_error_code(err), msg, ap);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ va_end(ap);
+ throw;
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+ va_end(ap);
+ return error_value<T>();
}
private:
using chrono::duration;
using chrono::duration_cast;
-using TimeSpec = struct ::timespec;
-using StatT = struct ::stat;
+#if defined(_LIBCPP_WIN32API)
+// Various C runtime versions (UCRT, or the legacy msvcrt.dll used by
+// some mingw toolchains) provide different stat function implementations,
+// with a number of limitations with respect to what we want from the
+// stat function. Instead provide our own (in the anonymous detail namespace
+// in posix_compat.h) which does exactly what we want, along with our own
+// stat structure and flag macros.
+
+struct TimeSpec {
+ int64_t tv_sec;
+ int64_t tv_nsec;
+};
+struct StatT {
+ unsigned st_mode;
+ TimeSpec st_atim;
+ TimeSpec st_mtim;
+ uint64_t st_dev; // FILE_ID_INFO::VolumeSerialNumber
+ struct FileIdStruct {
+ unsigned char id[16]; // FILE_ID_INFO::FileId
+ bool operator==(const FileIdStruct &other) const {
+ for (int i = 0; i < 16; i++)
+ if (id[i] != other.id[i])
+ return false;
+ return true;
+ }
+ } st_ino;
+ uint32_t st_nlink;
+ uintmax_t st_size;
+};
+
+#else
+using TimeSpec = struct timespec;
+using TimeVal = struct timeval;
+using StatT = struct stat;
+#endif
template <class FileTimeT, class TimeT,
bool IsFloat = is_floating_point<typename FileTimeT::rep>::value>
.count();
private:
-#if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
- static constexpr fs_duration get_min_nsecs() {
+ static _LIBCPP_CONSTEXPR_AFTER_CXX11 fs_duration get_min_nsecs() {
return duration_cast<fs_duration>(
fs_nanoseconds(min_nsec_timespec) -
duration_cast<fs_nanoseconds>(fs_seconds(1)));
FileTimeT::duration::min(),
"value doesn't roundtrip");
- static constexpr bool check_range() {
+ static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool check_range() {
// This kinda sucks, but it's what happens when we don't have __int128_t.
if (sizeof(TimeT) == sizeof(rep)) {
typedef duration<long long, ratio<3600 * 24 * 365> > Years;
min_seconds <= numeric_limits<TimeT>::min();
}
static_assert(check_range(), "the representable range is unacceptable small");
-#endif
};
template <class FileTimeT, class TimeT>
}
};
+#if defined(_LIBCPP_WIN32API)
+using fs_time = time_util<file_time_type, int64_t, TimeSpec>;
+#else
using fs_time = time_util<file_time_type, time_t, TimeSpec>;
+#endif
#if defined(__APPLE__)
-TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
-TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
+inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
+inline TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
+#elif defined(__MVS__)
+inline TimeSpec extract_mtime(StatT const& st) {
+ TimeSpec TS = {st.st_mtime, 0};
+ return TS;
+}
+inline TimeSpec extract_atime(StatT const& st) {
+ TimeSpec TS = {st.st_atime, 0};
+ return TS;
+}
+#elif defined(_AIX)
+inline TimeSpec extract_mtime(StatT const& st) {
+ TimeSpec TS = {st.st_mtime, st.st_mtime_n};
+ return TS;
+}
+inline TimeSpec extract_atime(StatT const& st) {
+ TimeSpec TS = {st.st_atime, st.st_atime_n};
+ return TS;
+}
#else
-TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
-TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
+inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
+inline TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
#endif
-// allow the utimes implementation to compile even it we're not going
-// to use it.
-
-bool posix_utimes(const path& p, std::array<TimeSpec, 2> const& TS,
- error_code& ec) {
+#if !defined(_LIBCPP_WIN32API)
+inline TimeVal make_timeval(TimeSpec const& ts) {
using namespace chrono;
auto Convert = [](long nsec) {
- using int_type = decltype(std::declval< ::timeval>().tv_usec);
+ using int_type = decltype(std::declval<TimeVal>().tv_usec);
auto dur = duration_cast<microseconds>(nanoseconds(nsec)).count();
return static_cast<int_type>(dur);
};
- struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)},
- {TS[1].tv_sec, Convert(TS[1].tv_nsec)}};
+ TimeVal TV = {};
+ TV.tv_sec = ts.tv_sec;
+ TV.tv_usec = Convert(ts.tv_nsec);
+ return TV;
+}
+
+inline bool posix_utimes(const path& p, std::array<TimeSpec, 2> const& TS,
+ error_code& ec) {
+ TimeVal ConvertedTS[2] = {make_timeval(TS[0]), make_timeval(TS[1])};
if (::utimes(p.c_str(), ConvertedTS) == -1) {
ec = capture_errno();
return true;
return posix_utimensat(p, TS, ec);
#endif
}
+#endif /* !_LIBCPP_WIN32API */
} // namespace
} // end namespace detail
#include "filesystem"
#include "array"
#include "iterator"
-#include "fstream"
-#include "random" /* for unique_path */
#include "string_view"
#include "type_traits"
#include "vector"
#include "filesystem_common.h"
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/statvfs.h>
+#include "posix_compat.h"
+
+#if defined(_LIBCPP_WIN32API)
+# define WIN32_LEAN_AND_MEAN
+# define NOMINMAX
+# include <windows.h>
+#else
+# include <unistd.h>
+# include <sys/stat.h>
+# include <sys/statvfs.h>
+#endif
#include <time.h>
#include <fcntl.h> /* values for fchmodat */
-#if defined(__linux__)
-#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
-#include <sys/sendfile.h>
-#define _LIBCPP_USE_SENDFILE
-#endif
+#if __has_include(<sys/sendfile.h>)
+# include <sys/sendfile.h>
+# define _LIBCPP_FILESYSTEM_USE_SENDFILE
#elif defined(__APPLE__) || __has_include(<copyfile.h>)
-#include <copyfile.h>
-#define _LIBCPP_USE_COPYFILE
+# include <copyfile.h>
+# define _LIBCPP_FILESYSTEM_USE_COPYFILE
+#else
+# include "fstream"
+# define _LIBCPP_FILESYSTEM_USE_FSTREAM
#endif
-#if !defined(CLOCK_REALTIME)
-#include <sys/time.h> // for gettimeofday and timeval
-#endif // !defined(CLOCK_REALTIME)
-
-#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
-#pragma comment(lib, "rt")
+#if !defined(CLOCK_REALTIME) && !defined(_LIBCPP_WIN32API)
+# include <sys/time.h> // for gettimeofday and timeval
#endif
-#if defined(_LIBCPP_COMPILER_GCC)
-#if _GNUC_VER < 500
-#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-#endif
+#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
+# pragma comment(lib, "rt")
#endif
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
namespace {
+
+bool isSeparator(path::value_type C) {
+ if (C == '/')
+ return true;
+#if defined(_LIBCPP_WIN32API)
+ if (C == '\\')
+ return true;
+#endif
+ return false;
+}
+
+bool isDriveLetter(path::value_type C) {
+ return (C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z');
+}
+
namespace parser {
using string_view_t = path::__string_view;
switch (State) {
case PS_BeforeBegin: {
- PosPtr TkEnd = consumeSeparator(Start, End);
+ PosPtr TkEnd = consumeRootName(Start, End);
+ if (TkEnd)
+ return makeState(PS_InRootName, Start, TkEnd);
+ }
+ _LIBCPP_FALLTHROUGH();
+ case PS_InRootName: {
+ PosPtr TkEnd = consumeAllSeparators(Start, End);
if (TkEnd)
return makeState(PS_InRootDir, Start, TkEnd);
else
return makeState(PS_InFilenames, Start, consumeName(Start, End));
case PS_InFilenames: {
- PosPtr SepEnd = consumeSeparator(Start, End);
+ PosPtr SepEnd = consumeAllSeparators(Start, End);
if (SepEnd != End) {
PosPtr TkEnd = consumeName(SepEnd, End);
if (TkEnd)
case PS_InTrailingSep:
return makeState(PS_AtEnd);
- case PS_InRootName:
case PS_AtEnd:
_LIBCPP_UNREACHABLE();
}
switch (State) {
case PS_AtEnd: {
// Try to consume a trailing separator or root directory first.
- if (PosPtr SepEnd = consumeSeparator(RStart, REnd)) {
+ if (PosPtr SepEnd = consumeAllSeparators(RStart, REnd)) {
if (SepEnd == REnd)
return makeState(PS_InRootDir, Path.data(), RStart + 1);
+ PosPtr TkStart = consumeRootName(SepEnd, REnd);
+ if (TkStart == REnd)
+ return makeState(PS_InRootDir, RStart, RStart + 1);
return makeState(PS_InTrailingSep, SepEnd + 1, RStart + 1);
} else {
- PosPtr TkStart = consumeName(RStart, REnd);
+ PosPtr TkStart = consumeRootName(RStart, REnd);
+ if (TkStart == REnd)
+ return makeState(PS_InRootName, TkStart + 1, RStart + 1);
+ TkStart = consumeName(RStart, REnd);
return makeState(PS_InFilenames, TkStart + 1, RStart + 1);
}
}
return makeState(PS_InFilenames, consumeName(RStart, REnd) + 1,
RStart + 1);
case PS_InFilenames: {
- PosPtr SepEnd = consumeSeparator(RStart, REnd);
+ PosPtr SepEnd = consumeAllSeparators(RStart, REnd);
if (SepEnd == REnd)
return makeState(PS_InRootDir, Path.data(), RStart + 1);
- PosPtr TkEnd = consumeName(SepEnd, REnd);
- return makeState(PS_InFilenames, TkEnd + 1, SepEnd + 1);
+ PosPtr TkStart = consumeRootName(SepEnd ? SepEnd : RStart, REnd);
+ if (TkStart == REnd) {
+ if (SepEnd)
+ return makeState(PS_InRootDir, SepEnd + 1, RStart + 1);
+ return makeState(PS_InRootName, TkStart + 1, RStart + 1);
+ }
+ TkStart = consumeName(SepEnd, REnd);
+ return makeState(PS_InFilenames, TkStart + 1, SepEnd + 1);
}
case PS_InRootDir:
- // return makeState(PS_InRootName, Path.data(), RStart + 1);
+ return makeState(PS_InRootName, Path.data(), RStart + 1);
case PS_InRootName:
case PS_BeforeBegin:
_LIBCPP_UNREACHABLE();
switch (State) {
case PS_BeforeBegin:
case PS_AtEnd:
- return "";
+ return PS("");
case PS_InRootDir:
- return "/";
+ if (RawEntry[0] == '\\')
+ return PS("\\");
+ else
+ return PS("/");
case PS_InTrailingSep:
- return "";
+ return PS("");
case PS_InRootName:
case PS_InFilenames:
return RawEntry;
_LIBCPP_UNREACHABLE();
}
- PosPtr consumeSeparator(PosPtr P, PosPtr End) const noexcept {
- if (P == End || *P != '/')
+ // Consume all consecutive separators.
+ PosPtr consumeAllSeparators(PosPtr P, PosPtr End) const noexcept {
+ if (P == nullptr || P == End || !isSeparator(*P))
return nullptr;
const int Inc = P < End ? 1 : -1;
P += Inc;
- while (P != End && *P == '/')
+ while (P != End && isSeparator(*P))
P += Inc;
return P;
}
+ // Consume exactly N separators, or return nullptr.
+ PosPtr consumeNSeparators(PosPtr P, PosPtr End, int N) const noexcept {
+ PosPtr Ret = consumeAllSeparators(P, End);
+ if (Ret == nullptr)
+ return nullptr;
+ if (P < End) {
+ if (Ret == P + N)
+ return Ret;
+ } else {
+ if (Ret == P - N)
+ return Ret;
+ }
+ return nullptr;
+ }
+
PosPtr consumeName(PosPtr P, PosPtr End) const noexcept {
- if (P == End || *P == '/')
+ PosPtr Start = P;
+ if (P == nullptr || P == End || isSeparator(*P))
return nullptr;
const int Inc = P < End ? 1 : -1;
P += Inc;
- while (P != End && *P != '/')
+ while (P != End && !isSeparator(*P))
P += Inc;
+ if (P == End && Inc < 0) {
+ // Iterating backwards and consumed all the rest of the input.
+ // Check if the start of the string would have been considered
+ // a root name.
+ PosPtr RootEnd = consumeRootName(End + 1, Start);
+ if (RootEnd)
+ return RootEnd - 1;
+ }
return P;
}
+
+ PosPtr consumeDriveLetter(PosPtr P, PosPtr End) const noexcept {
+ if (P == End)
+ return nullptr;
+ if (P < End) {
+ if (P + 1 == End || !isDriveLetter(P[0]) || P[1] != ':')
+ return nullptr;
+ return P + 2;
+ } else {
+ if (P - 1 == End || !isDriveLetter(P[-1]) || P[0] != ':')
+ return nullptr;
+ return P - 2;
+ }
+ }
+
+ PosPtr consumeNetworkRoot(PosPtr P, PosPtr End) const noexcept {
+ if (P == End)
+ return nullptr;
+ if (P < End)
+ return consumeName(consumeNSeparators(P, End, 2), End);
+ else
+ return consumeNSeparators(consumeName(P, End), End, 2);
+ }
+
+ PosPtr consumeRootName(PosPtr P, PosPtr End) const noexcept {
+#if defined(_LIBCPP_WIN32API)
+ if (PosPtr Ret = consumeDriveLetter(P, End))
+ return Ret;
+ if (PosPtr Ret = consumeNetworkRoot(P, End))
+ return Ret;
+#endif
+ return nullptr;
+ }
};
string_view_pair separate_filename(string_view_t const& s) {
- if (s == "." || s == ".." || s.empty())
- return string_view_pair{s, ""};
+ if (s == PS(".") || s == PS("..") || s.empty())
+ return string_view_pair{s, PS("")};
auto pos = s.find_last_of('.');
if (pos == string_view_t::npos || pos == 0)
return string_view_pair{s, string_view_t{}};
// POSIX HELPERS
+#if defined(_LIBCPP_WIN32API)
+namespace detail {
+
+errc __win_err_to_errc(int err) {
+ constexpr struct {
+ DWORD win;
+ errc errc;
+ } win_error_mapping[] = {
+ {ERROR_ACCESS_DENIED, errc::permission_denied},
+ {ERROR_ALREADY_EXISTS, errc::file_exists},
+ {ERROR_BAD_NETPATH, errc::no_such_file_or_directory},
+ {ERROR_BAD_PATHNAME, errc::no_such_file_or_directory},
+ {ERROR_BAD_UNIT, errc::no_such_device},
+ {ERROR_BROKEN_PIPE, errc::broken_pipe},
+ {ERROR_BUFFER_OVERFLOW, errc::filename_too_long},
+ {ERROR_BUSY, errc::device_or_resource_busy},
+ {ERROR_BUSY_DRIVE, errc::device_or_resource_busy},
+ {ERROR_CANNOT_MAKE, errc::permission_denied},
+ {ERROR_CANTOPEN, errc::io_error},
+ {ERROR_CANTREAD, errc::io_error},
+ {ERROR_CANTWRITE, errc::io_error},
+ {ERROR_CURRENT_DIRECTORY, errc::permission_denied},
+ {ERROR_DEV_NOT_EXIST, errc::no_such_device},
+ {ERROR_DEVICE_IN_USE, errc::device_or_resource_busy},
+ {ERROR_DIR_NOT_EMPTY, errc::directory_not_empty},
+ {ERROR_DIRECTORY, errc::invalid_argument},
+ {ERROR_DISK_FULL, errc::no_space_on_device},
+ {ERROR_FILE_EXISTS, errc::file_exists},
+ {ERROR_FILE_NOT_FOUND, errc::no_such_file_or_directory},
+ {ERROR_HANDLE_DISK_FULL, errc::no_space_on_device},
+ {ERROR_INVALID_ACCESS, errc::permission_denied},
+ {ERROR_INVALID_DRIVE, errc::no_such_device},
+ {ERROR_INVALID_FUNCTION, errc::function_not_supported},
+ {ERROR_INVALID_HANDLE, errc::invalid_argument},
+ {ERROR_INVALID_NAME, errc::no_such_file_or_directory},
+ {ERROR_INVALID_PARAMETER, errc::invalid_argument},
+ {ERROR_LOCK_VIOLATION, errc::no_lock_available},
+ {ERROR_LOCKED, errc::no_lock_available},
+ {ERROR_NEGATIVE_SEEK, errc::invalid_argument},
+ {ERROR_NOACCESS, errc::permission_denied},
+ {ERROR_NOT_ENOUGH_MEMORY, errc::not_enough_memory},
+ {ERROR_NOT_READY, errc::resource_unavailable_try_again},
+ {ERROR_NOT_SAME_DEVICE, errc::cross_device_link},
+ {ERROR_NOT_SUPPORTED, errc::not_supported},
+ {ERROR_OPEN_FAILED, errc::io_error},
+ {ERROR_OPEN_FILES, errc::device_or_resource_busy},
+ {ERROR_OPERATION_ABORTED, errc::operation_canceled},
+ {ERROR_OUTOFMEMORY, errc::not_enough_memory},
+ {ERROR_PATH_NOT_FOUND, errc::no_such_file_or_directory},
+ {ERROR_READ_FAULT, errc::io_error},
+ {ERROR_REPARSE_TAG_INVALID, errc::invalid_argument},
+ {ERROR_RETRY, errc::resource_unavailable_try_again},
+ {ERROR_SEEK, errc::io_error},
+ {ERROR_SHARING_VIOLATION, errc::permission_denied},
+ {ERROR_TOO_MANY_OPEN_FILES, errc::too_many_files_open},
+ {ERROR_WRITE_FAULT, errc::io_error},
+ {ERROR_WRITE_PROTECT, errc::permission_denied},
+ };
+
+ for (const auto &pair : win_error_mapping)
+ if (pair.win == static_cast<DWORD>(err))
+ return pair.errc;
+ return errc::invalid_argument;
+}
+
+} // namespace detail
+#endif
+
namespace detail {
namespace {
static FileDescriptor create(const path* p, error_code& ec, Args... args) {
ec.clear();
int fd;
- if ((fd = ::open(p->c_str(), args...)) == -1) {
+ if ((fd = detail::open(p->c_str(), args...)) == -1) {
ec = capture_errno();
return FileDescriptor{p};
}
void close() noexcept {
if (fd != -1)
- ::close(fd);
+ detail::close(fd);
fd = -1;
}
return static_cast<perms>(st.st_mode) & perms::mask;
}
-::mode_t posix_convert_perms(perms prms) {
- return static_cast< ::mode_t>(prms & perms::mask);
-}
-
file_status create_file_status(error_code& m_ec, path const& p,
const StatT& path_stat, error_code* ec) {
if (ec)
file_status posix_stat(path const& p, StatT& path_stat, error_code* ec) {
error_code m_ec;
- if (::stat(p.c_str(), &path_stat) == -1)
+ if (detail::stat(p.c_str(), &path_stat) == -1)
m_ec = detail::capture_errno();
return create_file_status(m_ec, p, path_stat, ec);
}
file_status posix_lstat(path const& p, StatT& path_stat, error_code* ec) {
error_code m_ec;
- if (::lstat(p.c_str(), &path_stat) == -1)
+ if (detail::lstat(p.c_str(), &path_stat) == -1)
m_ec = detail::capture_errno();
return create_file_status(m_ec, p, path_stat, ec);
}
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html
bool posix_ftruncate(const FileDescriptor& fd, off_t to_size, error_code& ec) {
- if (::ftruncate(fd.fd, to_size) == -1) {
+ if (detail::ftruncate(fd.fd, to_size) == -1) {
ec = capture_errno();
return true;
}
}
bool posix_fchmod(const FileDescriptor& fd, const StatT& st, error_code& ec) {
- if (::fchmod(fd.fd, st.st_mode) == -1) {
+ if (detail::fchmod(fd.fd, st.st_mode) == -1) {
ec = capture_errno();
return true;
}
m_status = file_status{};
m_stat = {};
error_code m_ec;
- if (::fstat(fd, &m_stat) == -1)
+ if (detail::fstat(fd, &m_stat) == -1)
m_ec = capture_errno();
m_status = create_file_status(m_ec, name, m_stat, &ec);
return m_status;
_FilesystemClock::time_point _FilesystemClock::now() noexcept {
typedef chrono::duration<rep> __secs;
-#if defined(CLOCK_REALTIME)
+#if defined(_LIBCPP_WIN32API)
+ typedef chrono::duration<rep, nano> __nsecs;
+ FILETIME time;
+ GetSystemTimeAsFileTime(&time);
+ TimeSpec tp = detail::filetime_to_timespec(time);
+ return time_point(__secs(tp.tv_sec) +
+ chrono::duration_cast<duration>(__nsecs(tp.tv_nsec)));
+#elif defined(CLOCK_REALTIME)
typedef chrono::duration<rep, nano> __nsecs;
struct timespec tp;
if (0 != clock_gettime(CLOCK_REALTIME, &tp))
void filesystem_error::__create_what(int __num_paths) {
const char* derived_what = system_error::what();
__storage_->__what_ = [&]() -> string {
- const char* p1 = path1().native().empty() ? "\"\"" : path1().c_str();
- const char* p2 = path2().native().empty() ? "\"\"" : path2().c_str();
switch (__num_paths) {
- default:
+ case 0:
return detail::format_string("filesystem error: %s", derived_what);
case 1:
- return detail::format_string("filesystem error: %s [%s]", derived_what,
- p1);
+ return detail::format_string("filesystem error: %s [" PATH_CSTR_FMT "]",
+ derived_what, path1().c_str());
case 2:
- return detail::format_string("filesystem error: %s [%s] [%s]",
- derived_what, p1, p2);
+ return detail::format_string("filesystem error: %s [" PATH_CSTR_FMT "] [" PATH_CSTR_FMT "]",
+ derived_what, path1().c_str(), path2().c_str());
}
+ _LIBCPP_UNREACHABLE();
}();
}
ErrorHandler<path> err("canonical", ec, &orig_p, &cwd);
path p = __do_absolute(orig_p, &cwd, ec);
-#if _POSIX_VERSION >= 200112
- std::unique_ptr<char, decltype(&::free)>
- hold(::realpath(p.c_str(), nullptr), &::free);
+#if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112) || defined(_LIBCPP_WIN32API)
+ std::unique_ptr<path::value_type, decltype(&::free)>
+ hold(detail::realpath(p.c_str(), nullptr), &::free);
if (hold.get() == nullptr)
return err.report(capture_errno());
return {hold.get()};
#else
- char buff[PATH_MAX + 1];
- char* ret;
- if ((ret = ::realpath(p.c_str(), buff)) == nullptr)
+ #if defined(__MVS__) && !defined(PATH_MAX)
+ path::value_type buff[ _XOPEN_PATH_MAX + 1 ];
+ #else
+ path::value_type buff[PATH_MAX + 1];
+ #endif
+ path::value_type* ret;
+ if ((ret = detail::realpath(p.c_str(), buff)) == nullptr)
return err.report(capture_errno());
return {ret};
#endif
namespace detail {
namespace {
-#ifdef _LIBCPP_USE_SENDFILE
-bool copy_file_impl_sendfile(FileDescriptor& read_fd, FileDescriptor& write_fd,
- error_code& ec) {
-
- size_t count = read_fd.get_stat().st_size;
- do {
- ssize_t res;
- if ((res = ::sendfile(write_fd.fd, read_fd.fd, nullptr, count)) == -1) {
- ec = capture_errno();
- return false;
- }
- count -= res;
- } while (count > 0);
-
- ec.clear();
+#if defined(_LIBCPP_FILESYSTEM_USE_SENDFILE)
+ bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
+ size_t count = read_fd.get_stat().st_size;
+ do {
+ ssize_t res;
+ if ((res = ::sendfile(write_fd.fd, read_fd.fd, nullptr, count)) == -1) {
+ ec = capture_errno();
+ return false;
+ }
+ count -= res;
+ } while (count > 0);
- return true;
-}
-#elif defined(_LIBCPP_USE_COPYFILE)
-bool copy_file_impl_copyfile(FileDescriptor& read_fd, FileDescriptor& write_fd,
- error_code& ec) {
- struct CopyFileState {
- copyfile_state_t state;
- CopyFileState() { state = copyfile_state_alloc(); }
- ~CopyFileState() { copyfile_state_free(state); }
-
- private:
- CopyFileState(CopyFileState const&) = delete;
- CopyFileState& operator=(CopyFileState const&) = delete;
- };
+ ec.clear();
- CopyFileState cfs;
- if (fcopyfile(read_fd.fd, write_fd.fd, cfs.state, COPYFILE_DATA) < 0) {
- ec = capture_errno();
- return false;
+ return true;
}
+#elif defined(_LIBCPP_FILESYSTEM_USE_COPYFILE)
+ bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
+ struct CopyFileState {
+ copyfile_state_t state;
+ CopyFileState() { state = copyfile_state_alloc(); }
+ ~CopyFileState() { copyfile_state_free(state); }
- ec.clear();
- return true;
-}
-#endif
+ private:
+ CopyFileState(CopyFileState const&) = delete;
+ CopyFileState& operator=(CopyFileState const&) = delete;
+ };
-// Note: This function isn't guarded by ifdef's even though it may be unused
-// in order to assure it still compiles.
-__attribute__((unused)) bool copy_file_impl_default(FileDescriptor& read_fd,
- FileDescriptor& write_fd,
- error_code& ec) {
- ifstream in;
- in.__open(read_fd.fd, ios::binary);
- if (!in.is_open()) {
- // This assumes that __open didn't reset the error code.
- ec = capture_errno();
- return false;
- }
- ofstream out;
- out.__open(write_fd.fd, ios::binary);
- if (!out.is_open()) {
- ec = capture_errno();
- return false;
- }
+ CopyFileState cfs;
+ if (fcopyfile(read_fd.fd, write_fd.fd, cfs.state, COPYFILE_DATA) < 0) {
+ ec = capture_errno();
+ return false;
+ }
- if (in.good() && out.good()) {
- using InIt = istreambuf_iterator<char>;
- using OutIt = ostreambuf_iterator<char>;
- InIt bin(in);
- InIt ein;
- OutIt bout(out);
- copy(bin, ein, bout);
- }
- if (out.fail() || in.fail()) {
- ec = make_error_code(errc::io_error);
- return false;
+ ec.clear();
+ return true;
}
+#elif defined(_LIBCPP_FILESYSTEM_USE_FSTREAM)
+ bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
+ ifstream in;
+ in.__open(read_fd.fd, ios::binary);
+ if (!in.is_open()) {
+ // This assumes that __open didn't reset the error code.
+ ec = capture_errno();
+ return false;
+ }
+ read_fd.fd = -1;
+ ofstream out;
+ out.__open(write_fd.fd, ios::binary);
+ if (!out.is_open()) {
+ ec = capture_errno();
+ return false;
+ }
+ write_fd.fd = -1;
+
+ if (in.good() && out.good()) {
+ using InIt = istreambuf_iterator<char>;
+ using OutIt = ostreambuf_iterator<char>;
+ InIt bin(in);
+ InIt ein;
+ OutIt bout(out);
+ copy(bin, ein, bout);
+ }
+ if (out.fail() || in.fail()) {
+ ec = make_error_code(errc::io_error);
+ return false;
+ }
- ec.clear();
- return true;
-}
-
-bool copy_file_impl(FileDescriptor& from, FileDescriptor& to, error_code& ec) {
-#if defined(_LIBCPP_USE_SENDFILE)
- return copy_file_impl_sendfile(from, to, ec);
-#elif defined(_LIBCPP_USE_COPYFILE)
- return copy_file_impl_copyfile(from, to, ec);
+ ec.clear();
+ return true;
+ }
#else
- return copy_file_impl_default(from, to, ec);
-#endif
-}
+# error "Unknown implementation for copy_file_impl"
+#endif // copy_file_impl implementation
-} // namespace
-} // namespace detail
+} // end anonymous namespace
+} // end namespace detail
bool __copy_file(const path& from, const path& to, copy_options options,
error_code* ec) {
ErrorHandler<bool> err("copy_file", ec, &to, &from);
error_code m_ec;
- FileDescriptor from_fd =
- FileDescriptor::create_with_status(&from, m_ec, O_RDONLY | O_NONBLOCK);
+ FileDescriptor from_fd = FileDescriptor::create_with_status(
+ &from, m_ec, O_RDONLY | O_NONBLOCK | O_BINARY);
if (m_ec)
return err.report(m_ec);
// Don't truncate right away. We may not be opening the file we originally
// looked at; we'll check this later.
- int to_open_flags = O_WRONLY;
+ int to_open_flags = O_WRONLY | O_BINARY;
if (!to_exists)
to_open_flags |= O_CREAT;
FileDescriptor to_fd = FileDescriptor::create_with_status(
if (ec && *ec) {
return;
}
- // NOTE: proposal says you should detect if you should call
- // create_symlink or create_directory_symlink. I don't think this
- // is needed with POSIX
- __create_symlink(real_path, new_symlink, ec);
+#if defined(_LIBCPP_WIN32API)
+ error_code local_ec;
+ if (is_directory(real_path, local_ec))
+ __create_directory_symlink(real_path, new_symlink, ec);
+ else
+#endif
+ __create_symlink(real_path, new_symlink, ec);
}
bool __create_directories(const path& p, error_code* ec) {
if (not status_known(parent_st))
return err.report(m_ec);
if (not exists(parent_st)) {
+ if (parent == p)
+ return err.report(errc::invalid_argument);
__create_directories(parent, ec);
if (ec && *ec) {
return false;
}
- }
+ } else if (not is_directory(parent_st))
+ return err.report(errc::not_a_directory);
}
- return __create_directory(p, ec);
+ bool ret = __create_directory(p, &m_ec);
+ if (m_ec)
+ return err.report(m_ec);
+ return ret;
}
bool __create_directory(const path& p, error_code* ec) {
ErrorHandler<bool> err("create_directory", ec, &p);
- if (::mkdir(p.c_str(), static_cast<int>(perms::all)) == 0)
+ if (detail::mkdir(p.c_str(), static_cast<int>(perms::all)) == 0)
return true;
+
if (errno != EEXIST)
- err.report(capture_errno());
+ return err.report(capture_errno());
+ error_code mec = capture_errno();
+ error_code ignored_ec;
+ const file_status st = status(p, ignored_ec);
+ if (!is_directory(st))
+ return err.report(mec);
return false;
}
StatT attr_stat;
error_code mec;
- auto st = detail::posix_stat(attributes, attr_stat, &mec);
+ file_status st = detail::posix_stat(attributes, attr_stat, &mec);
if (!status_known(st))
return err.report(mec);
if (!is_directory(st))
return err.report(errc::not_a_directory,
"the specified attribute path is invalid");
- if (::mkdir(p.c_str(), attr_stat.st_mode) == 0)
+ if (detail::mkdir(p.c_str(), attr_stat.st_mode) == 0)
return true;
+
if (errno != EEXIST)
- err.report(capture_errno());
+ return err.report(capture_errno());
+
+ mec = capture_errno();
+ error_code ignored_ec;
+ st = status(p, ignored_ec);
+ if (!is_directory(st))
+ return err.report(mec);
return false;
}
void __create_directory_symlink(path const& from, path const& to,
error_code* ec) {
ErrorHandler<void> err("create_directory_symlink", ec, &from, &to);
- if (::symlink(from.c_str(), to.c_str()) != 0)
+ if (detail::symlink_dir(from.c_str(), to.c_str()) == -1)
return err.report(capture_errno());
}
void __create_hard_link(const path& from, const path& to, error_code* ec) {
ErrorHandler<void> err("create_hard_link", ec, &from, &to);
- if (::link(from.c_str(), to.c_str()) == -1)
+ if (detail::link(from.c_str(), to.c_str()) == -1)
return err.report(capture_errno());
}
void __create_symlink(path const& from, path const& to, error_code* ec) {
ErrorHandler<void> err("create_symlink", ec, &from, &to);
- if (::symlink(from.c_str(), to.c_str()) == -1)
+ if (detail::symlink_file(from.c_str(), to.c_str()) == -1)
return err.report(capture_errno());
}
path __current_path(error_code* ec) {
ErrorHandler<path> err("current_path", ec);
+#if defined(_LIBCPP_WIN32API) || defined(__GLIBC__) || defined(__APPLE__)
+ // Common extension outside of POSIX getcwd() spec, without needing to
+ // preallocate a buffer. Also supported by a number of other POSIX libcs.
+ int size = 0;
+ path::value_type* ptr = nullptr;
+ typedef decltype(&::free) Deleter;
+ Deleter deleter = &::free;
+#else
auto size = ::pathconf(".", _PC_PATH_MAX);
_LIBCPP_ASSERT(size >= 0, "pathconf returned a 0 as max size");
- auto buff = unique_ptr<char[]>(new char[size + 1]);
- char* ret;
- if ((ret = ::getcwd(buff.get(), static_cast<size_t>(size))) == nullptr)
+ auto buff = unique_ptr<path::value_type[]>(new path::value_type[size + 1]);
+ path::value_type* ptr = buff.get();
+
+ // Preallocated buffer, don't free the buffer in the second unique_ptr
+ // below.
+ struct Deleter { void operator()(void*) const {} };
+ Deleter deleter;
+#endif
+
+ unique_ptr<path::value_type, Deleter> hold(detail::getcwd(ptr, size),
+ deleter);
+ if (hold.get() == nullptr)
return err.report(capture_errno(), "call to getcwd failed");
- return {buff.get()};
+ return {hold.get()};
}
void __current_path(const path& p, error_code* ec) {
ErrorHandler<void> err("current_path", ec, &p);
- if (::chdir(p.c_str()) == -1)
+ if (detail::chdir(p.c_str()) == -1)
err.report(capture_errno());
}
using detail::fs_time;
ErrorHandler<void> err("last_write_time", ec, &p);
+#if defined(_LIBCPP_WIN32API)
+ TimeSpec ts;
+ if (!fs_time::convert_to_timespec(ts, new_time))
+ return err.report(errc::value_too_large);
+ detail::WinHandle h(p.c_str(), FILE_WRITE_ATTRIBUTES, 0);
+ if (!h)
+ return err.report(detail::make_windows_error(GetLastError()));
+ FILETIME last_write = timespec_to_filetime(ts);
+ if (!SetFileTime(h, nullptr, nullptr, &last_write))
+ return err.report(detail::make_windows_error(GetLastError()));
+#else
error_code m_ec;
array<TimeSpec, 2> tbuf;
#if !defined(_LIBCPP_USE_UTIMENSAT)
detail::set_file_times(p, tbuf, m_ec);
if (m_ec)
return err.report(m_ec);
+#endif
}
void __permissions(const path& p, perms prms, perm_options opts,
else if (remove_perms)
prms = st.permissions() & ~prms;
}
- const auto real_perms = detail::posix_convert_perms(prms);
+ const auto real_perms = static_cast<detail::ModeT>(prms & perms::mask);
#if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_FDCWD)
const int flags = set_sym_perms ? AT_SYMLINK_NOFOLLOW : 0;
- if (::fchmodat(AT_FDCWD, p.c_str(), real_perms, flags) == -1) {
+ if (detail::fchmodat(AT_FDCWD, p.c_str(), real_perms, flags) == -1) {
return err.report(capture_errno());
}
#else
path __read_symlink(const path& p, error_code* ec) {
ErrorHandler<path> err("read_symlink", ec, &p);
-#ifdef PATH_MAX
+#if defined(PATH_MAX) || defined(MAX_SYMLINK_SIZE)
struct NullDeleter { void operator()(void*) const {} };
+#ifdef MAX_SYMLINK_SIZE
+ const size_t size = MAX_SYMLINK_SIZE + 1;
+#else
const size_t size = PATH_MAX + 1;
- char stack_buff[size];
- auto buff = std::unique_ptr<char[], NullDeleter>(stack_buff);
+#endif
+ path::value_type stack_buff[size];
+ auto buff = std::unique_ptr<path::value_type[], NullDeleter>(stack_buff);
#else
StatT sb;
- if (::lstat(p.c_str(), &sb) == -1) {
+ if (detail::lstat(p.c_str(), &sb) == -1) {
return err.report(capture_errno());
}
const size_t size = sb.st_size + 1;
- auto buff = unique_ptr<char[]>(new char[size]);
+ auto buff = unique_ptr<path::value_type[]>(new path::value_type[size]);
#endif
- ::ssize_t ret;
- if ((ret = ::readlink(p.c_str(), buff.get(), size)) == -1)
+ detail::SSizeT ret;
+ if ((ret = detail::readlink(p.c_str(), buff.get(), size)) == -1)
return err.report(capture_errno());
_LIBCPP_ASSERT(ret > 0, "TODO");
if (static_cast<size_t>(ret) >= size)
bool __remove(const path& p, error_code* ec) {
ErrorHandler<bool> err("remove", ec, &p);
- if (::remove(p.c_str()) == -1) {
+ if (detail::remove(p.c_str()) == -1) {
if (errno != ENOENT)
err.report(capture_errno());
return false;
void __rename(const path& from, const path& to, error_code* ec) {
ErrorHandler<void> err("rename", ec, &from, &to);
- if (::rename(from.c_str(), to.c_str()) == -1)
+ if (detail::rename(from.c_str(), to.c_str()) == -1)
err.report(capture_errno());
}
void __resize_file(const path& p, uintmax_t size, error_code* ec) {
ErrorHandler<void> err("resize_file", ec, &p);
- if (::truncate(p.c_str(), static_cast< ::off_t>(size)) == -1)
+ if (detail::truncate(p.c_str(), static_cast< ::off_t>(size)) == -1)
return err.report(capture_errno());
}
space_info __space(const path& p, error_code* ec) {
ErrorHandler<void> err("space", ec, &p);
space_info si;
- struct statvfs m_svfs = {};
- if (::statvfs(p.c_str(), &m_svfs) == -1) {
+ detail::StatVFS m_svfs = {};
+ if (detail::statvfs(p.c_str(), &m_svfs) == -1) {
err.report(capture_errno());
si.capacity = si.free = si.available = static_cast<uintmax_t>(-1);
return si;
path __temp_directory_path(error_code* ec) {
ErrorHandler<path> err("temp_directory_path", ec);
+#if defined(_LIBCPP_WIN32API)
+ wchar_t buf[MAX_PATH];
+ DWORD retval = GetTempPathW(MAX_PATH, buf);
+ if (!retval)
+ return err.report(detail::make_windows_error(GetLastError()));
+ if (retval > MAX_PATH)
+ return err.report(errc::filename_too_long);
+ // GetTempPathW returns a path with a trailing slash, which we
+ // shouldn't include for consistency.
+ if (buf[retval-1] == L'\\')
+ buf[retval-1] = L'\0';
+ path p(buf);
+#else
const char* env_paths[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"};
const char* ret = nullptr;
ret = "/tmp";
path p(ret);
+#endif
error_code m_ec;
file_status st = detail::posix_stat(p, &m_ec);
if (!status_known(st))
- return err.report(m_ec, "cannot access path \"%s\"", p);
+ return err.report(m_ec, "cannot access path " PATH_CSTR_FMT, p.c_str());
if (!exists(st) || !is_directory(st))
- return err.report(errc::not_a_directory, "path \"%s\" is not a directory",
- p);
+ return err.report(errc::not_a_directory,
+ "path " PATH_CSTR_FMT " is not a directory", p.c_str());
return p;
}
}
if (!replacement.empty()) {
if (replacement.native()[0] != '.') {
- __pn_ += ".";
+ __pn_ += PS(".");
}
__pn_.append(replacement.__pn_);
}
auto PP = PathParser::CreateBegin(__pn_);
if (PP.State == PathParser::PS_InRootName) {
auto NextCh = PP.peek();
- if (NextCh && *NextCh == '/') {
+ if (NextCh && isSeparator(*NextCh)) {
++PP;
return createView(__pn_.data(), &PP.RawEntry.back());
}
static PathPartKind ClassifyPathPart(string_view_t Part) {
if (Part.empty())
return PK_TrailingSep;
- if (Part == ".")
+ if (Part == PS("."))
return PK_Dot;
- if (Part == "..")
+ if (Part == PS(".."))
return PK_DotDot;
- if (Part == "/")
+ if (Part == PS("/"))
return PK_RootSep;
+#if defined(_LIBCPP_WIN32API)
+ if (Part == PS("\\"))
+ return PK_RootSep;
+#endif
return PK_Filename;
}
NewPathSize -= Parts.back().first.size();
Parts.pop_back();
} else if (LastKind != PK_RootSep)
- AddPart(PK_DotDot, "..");
+ AddPart(PK_DotDot, PS(".."));
MaybeNeedTrailingSep = LastKind == PK_Filename;
break;
}
}
// [fs.path.generic]p6.8: If the path is empty, add a dot.
if (Parts.empty())
- return ".";
+ return PS(".");
// [fs.path.generic]p6.7: If the last filename is dot-dot, remove any
// trailing directory-separator.
Result /= PK.first;
if (NeedTrailingSep)
- Result /= "";
+ Result /= PS("");
+ Result.make_preferred();
return Result;
}
int Count = 0;
for (; PP; ++PP) {
auto Elem = *PP;
- if (Elem == "..")
+ if (Elem == PS(".."))
--Count;
- else if (Elem != "." && Elem != "")
+ else if (Elem != PS(".") && Elem != PS(""))
++Count;
}
return Count;
return {};
// if n == 0 and (a == end() || a->empty()), returns path("."); otherwise
- if (ElemCount == 0 && (PP.atEnd() || *PP == ""))
- return ".";
+ if (ElemCount == 0 && (PP.atEnd() || *PP == PS("")))
+ return PS(".");
// return a path constructed with 'n' dot-dot elements, followed by the the
// elements of '*this' after the mismatch.
path Result;
// FIXME: Reserve enough room in Result that it won't have to re-allocate.
while (ElemCount--)
- Result /= "..";
+ Result /= PS("..");
for (; PP; ++PP)
Result /= *PP;
return Result;
return 0;
auto GetRootName = [](PathParser *Parser) -> string_view_t {
- return Parser->inRootName() ? **Parser : "";
+ return Parser->inRootName() ? **Parser : PS("");
};
int res = GetRootName(LHS).compare(GetRootName(RHS));
ConsumeRootName(LHS);
return *this;
}
+#if defined(_LIBCPP_WIN32API)
+////////////////////////////////////////////////////////////////////////////
+// Windows path conversions
+size_t __wide_to_char(const wstring &str, char *out, size_t outlen) {
+ if (str.empty())
+ return 0;
+ ErrorHandler<size_t> err("__wide_to_char", nullptr);
+ UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
+ BOOL used_default = FALSE;
+ int ret = WideCharToMultiByte(codepage, 0, str.data(), str.size(), out,
+ outlen, nullptr, &used_default);
+ if (ret <= 0 || used_default)
+ return err.report(errc::illegal_byte_sequence);
+ return ret;
+}
+
+size_t __char_to_wide(const string &str, wchar_t *out, size_t outlen) {
+ if (str.empty())
+ return 0;
+ ErrorHandler<size_t> err("__char_to_wide", nullptr);
+ UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
+ int ret = MultiByteToWideChar(codepage, MB_ERR_INVALID_CHARS, str.data(),
+ str.size(), out, outlen);
+ if (ret <= 0)
+ return err.report(errc::illegal_byte_sequence);
+ return ret;
+}
+#endif
+
+
///////////////////////////////////////////////////////////////////////////////
// directory entry definitions
///////////////////////////////////////////////////////////////////////////////
-#ifndef _LIBCPP_WIN32API
error_code directory_entry::__do_refresh() noexcept {
__data_.__reset();
error_code failure_ec;
return failure_ec;
}
-#else
-error_code directory_entry::__do_refresh() noexcept {
- __data_.__reset();
- error_code failure_ec;
-
- file_status st = _VSTD_FS::symlink_status(__p_, failure_ec);
- if (!status_known(st)) {
- __data_.__reset();
- return failure_ec;
- }
-
- if (!_VSTD_FS::exists(st) || !_VSTD_FS::is_symlink(st)) {
- __data_.__cache_type_ = directory_entry::_RefreshNonSymlink;
- __data_.__type_ = st.type();
- __data_.__non_sym_perms_ = st.permissions();
- } else { // we have a symlink
- __data_.__sym_perms_ = st.permissions();
- // Get the information about the linked entity.
- // Ignore errors from stat, since we don't want errors regarding symlink
- // resolution to be reported to the user.
- error_code ignored_ec;
- st = _VSTD_FS::status(__p_, ignored_ec);
-
- __data_.__type_ = st.type();
- __data_.__non_sym_perms_ = st.permissions();
-
- // If we failed to resolve the link, then only partially populate the
- // cache.
- if (!status_known(st)) {
- __data_.__cache_type_ = directory_entry::_RefreshSymlinkUnresolved;
- return error_code{};
- }
- __data_.__cache_type_ = directory_entry::_RefreshSymlink;
- }
-
- // FIXME: This is currently broken, and the implementation only a placeholder.
- // We need to cache last_write_time, file_size, and hard_link_count here before
- // the implementation actually works.
-
- return failure_ec;
-}
-#endif
_LIBCPP_END_NAMESPACE_FILESYSTEM
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+//
+// POSIX-like portability helper functions.
+//
+// These generally behave like the proper posix functions, with these
+// exceptions:
+// On Windows, they take paths in wchar_t* form, instead of char* form.
+// The symlink() function is split into two frontends, symlink_file()
+// and symlink_dir().
+//
+// These are provided within an anonymous namespace within the detail
+// namespace - callers need to include this header and call them as
+// detail::function(), regardless of platform.
+//
+
+#ifndef POSIX_COMPAT_H
+#define POSIX_COMPAT_H
+
+#include "filesystem"
+
+#include "filesystem_common.h"
+
+#if defined(_LIBCPP_WIN32API)
+# define WIN32_LEAN_AND_MEAN
+# define NOMINMAX
+# include <windows.h>
+# include <io.h>
+# include <winioctl.h>
+#else
+# include <unistd.h>
+# include <sys/stat.h>
+# include <sys/statvfs.h>
+#endif
+#include <time.h>
+
+#if defined(_LIBCPP_WIN32API)
+// This struct isn't defined in the normal Windows SDK, but only in the
+// Windows Driver Kit.
+struct LIBCPP_REPARSE_DATA_BUFFER {
+ unsigned long ReparseTag;
+ unsigned short ReparseDataLength;
+ unsigned short Reserved;
+ union {
+ struct {
+ unsigned short SubstituteNameOffset;
+ unsigned short SubstituteNameLength;
+ unsigned short PrintNameOffset;
+ unsigned short PrintNameLength;
+ unsigned long Flags;
+ wchar_t PathBuffer[1];
+ } SymbolicLinkReparseBuffer;
+ struct {
+ unsigned short SubstituteNameOffset;
+ unsigned short SubstituteNameLength;
+ unsigned short PrintNameOffset;
+ unsigned short PrintNameLength;
+ wchar_t PathBuffer[1];
+ } MountPointReparseBuffer;
+ struct {
+ unsigned char DataBuffer[1];
+ } GenericReparseBuffer;
+ };
+};
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+
+namespace detail {
+namespace {
+
+#if defined(_LIBCPP_WIN32API)
+
+// Various C runtime header sets provide more or less of these. As we
+// provide our own implementation, undef all potential defines from the
+// C runtime headers and provide a complete set of macros of our own.
+
+#undef _S_IFMT
+#undef _S_IFDIR
+#undef _S_IFCHR
+#undef _S_IFIFO
+#undef _S_IFREG
+#undef _S_IFBLK
+#undef _S_IFLNK
+#undef _S_IFSOCK
+
+#define _S_IFMT 0xF000
+#define _S_IFDIR 0x4000
+#define _S_IFCHR 0x2000
+#define _S_IFIFO 0x1000
+#define _S_IFREG 0x8000
+#define _S_IFBLK 0x6000
+#define _S_IFLNK 0xA000
+#define _S_IFSOCK 0xC000
+
+#undef S_ISDIR
+#undef S_ISFIFO
+#undef S_ISCHR
+#undef S_ISREG
+#undef S_ISLNK
+#undef S_ISBLK
+#undef S_ISSOCK
+
+#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
+#define S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR)
+#define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)
+#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
+#define S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK)
+#define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
+#define S_ISSOCK(m) (((m) & _S_IFMT) == _S_IFSOCK)
+
+#define O_NONBLOCK 0
+
+
+// There were 369 years and 89 leap days from the Windows epoch
+// (1601) to the Unix epoch (1970).
+#define FILE_TIME_OFFSET_SECS (uint64_t(369 * 365 + 89) * (24 * 60 * 60))
+
+TimeSpec filetime_to_timespec(LARGE_INTEGER li) {
+ TimeSpec ret;
+ ret.tv_sec = li.QuadPart / 10000000 - FILE_TIME_OFFSET_SECS;
+ ret.tv_nsec = (li.QuadPart % 10000000) * 100;
+ return ret;
+}
+
+TimeSpec filetime_to_timespec(FILETIME ft) {
+ LARGE_INTEGER li;
+ li.LowPart = ft.dwLowDateTime;
+ li.HighPart = ft.dwHighDateTime;
+ return filetime_to_timespec(li);
+}
+
+FILETIME timespec_to_filetime(TimeSpec ts) {
+ LARGE_INTEGER li;
+ li.QuadPart =
+ ts.tv_nsec / 100 + (ts.tv_sec + FILE_TIME_OFFSET_SECS) * 10000000;
+ FILETIME ft;
+ ft.dwLowDateTime = li.LowPart;
+ ft.dwHighDateTime = li.HighPart;
+ return ft;
+}
+
+int set_errno(int e = GetLastError()) {
+ errno = static_cast<int>(__win_err_to_errc(e));
+ return -1;
+}
+
+class WinHandle {
+public:
+ WinHandle(const wchar_t *p, DWORD access, DWORD flags) {
+ h = CreateFileW(
+ p, access, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | flags, nullptr);
+ }
+ ~WinHandle() {
+ if (h != INVALID_HANDLE_VALUE)
+ CloseHandle(h);
+ }
+ operator HANDLE() const { return h; }
+ operator bool() const { return h != INVALID_HANDLE_VALUE; }
+
+private:
+ HANDLE h;
+};
+
+int stat_handle(HANDLE h, StatT *buf) {
+ FILE_BASIC_INFO basic;
+ if (!GetFileInformationByHandleEx(h, FileBasicInfo, &basic, sizeof(basic)))
+ return set_errno();
+ memset(buf, 0, sizeof(*buf));
+ buf->st_mtim = filetime_to_timespec(basic.LastWriteTime);
+ buf->st_atim = filetime_to_timespec(basic.LastAccessTime);
+ buf->st_mode = 0555; // Read-only
+ if (!(basic.FileAttributes & FILE_ATTRIBUTE_READONLY))
+ buf->st_mode |= 0222; // Write
+ if (basic.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ buf->st_mode |= _S_IFDIR;
+ } else {
+ buf->st_mode |= _S_IFREG;
+ }
+ if (basic.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ FILE_ATTRIBUTE_TAG_INFO tag;
+ if (!GetFileInformationByHandleEx(h, FileAttributeTagInfo, &tag,
+ sizeof(tag)))
+ return set_errno();
+ if (tag.ReparseTag == IO_REPARSE_TAG_SYMLINK)
+ buf->st_mode = (buf->st_mode & ~_S_IFMT) | _S_IFLNK;
+ }
+ FILE_STANDARD_INFO standard;
+ if (!GetFileInformationByHandleEx(h, FileStandardInfo, &standard,
+ sizeof(standard)))
+ return set_errno();
+ buf->st_nlink = standard.NumberOfLinks;
+ buf->st_size = standard.EndOfFile.QuadPart;
+ BY_HANDLE_FILE_INFORMATION info;
+ if (!GetFileInformationByHandle(h, &info))
+ return set_errno();
+ buf->st_dev = info.dwVolumeSerialNumber;
+ memcpy(&buf->st_ino.id[0], &info.nFileIndexHigh, 4);
+ memcpy(&buf->st_ino.id[4], &info.nFileIndexLow, 4);
+ return 0;
+}
+
+int stat_file(const wchar_t *path, StatT *buf, DWORD flags) {
+ WinHandle h(path, FILE_READ_ATTRIBUTES, flags);
+ if (!h)
+ return set_errno();
+ int ret = stat_handle(h, buf);
+ return ret;
+}
+
+int stat(const wchar_t *path, StatT *buf) { return stat_file(path, buf, 0); }
+
+int lstat(const wchar_t *path, StatT *buf) {
+ return stat_file(path, buf, FILE_FLAG_OPEN_REPARSE_POINT);
+}
+
+int fstat(int fd, StatT *buf) {
+ HANDLE h = reinterpret_cast<HANDLE>(_get_osfhandle(fd));
+ return stat_handle(h, buf);
+}
+
+int mkdir(const wchar_t *path, int permissions) {
+ (void)permissions;
+ return _wmkdir(path);
+}
+
+int symlink_file_dir(const wchar_t *oldname, const wchar_t *newname,
+ bool is_dir) {
+ path dest(oldname);
+ dest.make_preferred();
+ oldname = dest.c_str();
+ DWORD flags = is_dir ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0;
+ if (CreateSymbolicLinkW(newname, oldname,
+ flags | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE))
+ return 0;
+ int e = GetLastError();
+ if (e != ERROR_INVALID_PARAMETER)
+ return set_errno(e);
+ if (CreateSymbolicLinkW(newname, oldname, flags))
+ return 0;
+ return set_errno();
+}
+
+int symlink_file(const wchar_t *oldname, const wchar_t *newname) {
+ return symlink_file_dir(oldname, newname, false);
+}
+
+int symlink_dir(const wchar_t *oldname, const wchar_t *newname) {
+ return symlink_file_dir(oldname, newname, true);
+}
+
+int link(const wchar_t *oldname, const wchar_t *newname) {
+ if (CreateHardLinkW(newname, oldname, nullptr))
+ return 0;
+ return set_errno();
+}
+
+int remove(const wchar_t *path) {
+ detail::WinHandle h(path, DELETE, FILE_FLAG_OPEN_REPARSE_POINT);
+ if (!h)
+ return set_errno();
+ FILE_DISPOSITION_INFO info;
+ info.DeleteFile = TRUE;
+ if (!SetFileInformationByHandle(h, FileDispositionInfo, &info, sizeof(info)))
+ return set_errno();
+ return 0;
+}
+
+int truncate_handle(HANDLE h, off_t length) {
+ LARGE_INTEGER size_param;
+ size_param.QuadPart = length;
+ if (!SetFilePointerEx(h, size_param, 0, FILE_BEGIN))
+ return set_errno();
+ if (!SetEndOfFile(h))
+ return set_errno();
+ return 0;
+}
+
+int ftruncate(int fd, off_t length) {
+ HANDLE h = reinterpret_cast<HANDLE>(_get_osfhandle(fd));
+ return truncate_handle(h, length);
+}
+
+int truncate(const wchar_t *path, off_t length) {
+ detail::WinHandle h(path, GENERIC_WRITE, 0);
+ if (!h)
+ return set_errno();
+ return truncate_handle(h, length);
+}
+
+int rename(const wchar_t *from, const wchar_t *to) {
+ if (!(MoveFileExW(from, to,
+ MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING |
+ MOVEFILE_WRITE_THROUGH)))
+ return set_errno();
+ return 0;
+}
+
+template <class... Args> int open(const wchar_t *filename, Args... args) {
+ return _wopen(filename, args...);
+}
+int close(int fd) { return _close(fd); }
+int chdir(const wchar_t *path) { return _wchdir(path); }
+
+struct StatVFS {
+ uint64_t f_frsize;
+ uint64_t f_blocks;
+ uint64_t f_bfree;
+ uint64_t f_bavail;
+};
+
+int statvfs(const wchar_t *p, StatVFS *buf) {
+ path dir = p;
+ while (true) {
+ error_code local_ec;
+ const file_status st = status(dir, local_ec);
+ if (!exists(st) || is_directory(st))
+ break;
+ path parent = dir.parent_path();
+ if (parent == dir) {
+ errno = ENOENT;
+ return -1;
+ }
+ dir = parent;
+ }
+ ULARGE_INTEGER free_bytes_available_to_caller, total_number_of_bytes,
+ total_number_of_free_bytes;
+ if (!GetDiskFreeSpaceExW(dir.c_str(), &free_bytes_available_to_caller,
+ &total_number_of_bytes, &total_number_of_free_bytes))
+ return set_errno();
+ buf->f_frsize = 1;
+ buf->f_blocks = total_number_of_bytes.QuadPart;
+ buf->f_bfree = total_number_of_free_bytes.QuadPart;
+ buf->f_bavail = free_bytes_available_to_caller.QuadPart;
+ return 0;
+}
+
+wchar_t *getcwd(wchar_t *buff, size_t size) { return _wgetcwd(buff, size); }
+
+wchar_t *realpath(const wchar_t *path, wchar_t *resolved_name) {
+ // Only expected to be used with us allocating the buffer.
+ _LIBCPP_ASSERT(resolved_name == nullptr,
+ "Windows realpath() assumes a null resolved_name");
+
+ WinHandle h(path, FILE_READ_ATTRIBUTES, 0);
+ if (!h) {
+ set_errno();
+ return nullptr;
+ }
+ size_t buff_size = MAX_PATH + 10;
+ std::unique_ptr<wchar_t, decltype(&::free)> buff(
+ static_cast<wchar_t *>(malloc(buff_size * sizeof(wchar_t))), &::free);
+ DWORD retval = GetFinalPathNameByHandleW(
+ h, buff.get(), buff_size, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
+ if (retval > buff_size) {
+ buff_size = retval;
+ buff.reset(static_cast<wchar_t *>(malloc(buff_size * sizeof(wchar_t))));
+ retval = GetFinalPathNameByHandleW(h, buff.get(), buff_size,
+ FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
+ }
+ if (!retval) {
+ set_errno();
+ return nullptr;
+ }
+ wchar_t *ptr = buff.get();
+ if (!wcsncmp(ptr, L"\\\\?\\", 4)) {
+ if (ptr[5] == ':') { // \\?\X: -> X:
+ memmove(&ptr[0], &ptr[4], (wcslen(&ptr[4]) + 1) * sizeof(wchar_t));
+ } else if (!wcsncmp(&ptr[4], L"UNC\\", 4)) { // \\?\UNC\server -> \\server
+ wcscpy(&ptr[0], L"\\\\");
+ memmove(&ptr[2], &ptr[8], (wcslen(&ptr[8]) + 1) * sizeof(wchar_t));
+ }
+ }
+ return buff.release();
+}
+
+#define AT_FDCWD -1
+#define AT_SYMLINK_NOFOLLOW 1
+using ModeT = int;
+
+int fchmod_handle(HANDLE h, int perms) {
+ FILE_BASIC_INFO basic;
+ if (!GetFileInformationByHandleEx(h, FileBasicInfo, &basic, sizeof(basic)))
+ return set_errno();
+ DWORD orig_attributes = basic.FileAttributes;
+ basic.FileAttributes &= ~FILE_ATTRIBUTE_READONLY;
+ if ((perms & 0222) == 0)
+ basic.FileAttributes |= FILE_ATTRIBUTE_READONLY;
+ if (basic.FileAttributes != orig_attributes &&
+ !SetFileInformationByHandle(h, FileBasicInfo, &basic, sizeof(basic)))
+ return set_errno();
+ return 0;
+}
+
+int fchmodat(int fd, const wchar_t *path, int perms, int flag) {
+ DWORD attributes = GetFileAttributesW(path);
+ if (attributes == INVALID_FILE_ATTRIBUTES)
+ return set_errno();
+ if (attributes & FILE_ATTRIBUTE_REPARSE_POINT &&
+ !(flag & AT_SYMLINK_NOFOLLOW)) {
+ // If the file is a symlink, and we are supposed to operate on the target
+ // of the symlink, we need to open a handle to it, without the
+ // FILE_FLAG_OPEN_REPARSE_POINT flag, to open the destination of the
+ // symlink, and operate on it via the handle.
+ detail::WinHandle h(path, FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES, 0);
+ if (!h)
+ return set_errno();
+ return fchmod_handle(h, perms);
+ } else {
+ // For a non-symlink, or if operating on the symlink itself instead of
+ // its target, we can use SetFileAttributesW, saving a few calls.
+ DWORD orig_attributes = attributes;
+ attributes &= ~FILE_ATTRIBUTE_READONLY;
+ if ((perms & 0222) == 0)
+ attributes |= FILE_ATTRIBUTE_READONLY;
+ if (attributes != orig_attributes && !SetFileAttributesW(path, attributes))
+ return set_errno();
+ }
+ return 0;
+}
+
+int fchmod(int fd, int perms) {
+ HANDLE h = reinterpret_cast<HANDLE>(_get_osfhandle(fd));
+ return fchmod_handle(h, perms);
+}
+
+#define MAX_SYMLINK_SIZE MAXIMUM_REPARSE_DATA_BUFFER_SIZE
+using SSizeT = ::int64_t;
+
+SSizeT readlink(const wchar_t *path, wchar_t *ret_buf, size_t bufsize) {
+ uint8_t buf[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
+ detail::WinHandle h(path, FILE_READ_ATTRIBUTES, FILE_FLAG_OPEN_REPARSE_POINT);
+ if (!h)
+ return set_errno();
+ DWORD out;
+ if (!DeviceIoControl(h, FSCTL_GET_REPARSE_POINT, nullptr, 0, buf, sizeof(buf),
+ &out, 0))
+ return set_errno();
+ const auto *reparse = reinterpret_cast<LIBCPP_REPARSE_DATA_BUFFER *>(buf);
+ size_t path_buf_offset = offsetof(LIBCPP_REPARSE_DATA_BUFFER,
+ SymbolicLinkReparseBuffer.PathBuffer[0]);
+ if (out < path_buf_offset) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (reparse->ReparseTag != IO_REPARSE_TAG_SYMLINK) {
+ errno = EINVAL;
+ return -1;
+ }
+ const auto &symlink = reparse->SymbolicLinkReparseBuffer;
+ unsigned short name_offset, name_length;
+ if (symlink.PrintNameLength == 0) {
+ name_offset = symlink.SubstituteNameOffset;
+ name_length = symlink.SubstituteNameLength;
+ } else {
+ name_offset = symlink.PrintNameOffset;
+ name_length = symlink.PrintNameLength;
+ }
+ // name_offset/length are expressed in bytes, not in wchar_t
+ if (path_buf_offset + name_offset + name_length > out) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (name_length / sizeof(wchar_t) > bufsize) {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy(ret_buf, &symlink.PathBuffer[name_offset / sizeof(wchar_t)],
+ name_length);
+ return name_length / sizeof(wchar_t);
+}
+
+#else
+int symlink_file(const char *oldname, const char *newname) {
+ return ::symlink(oldname, newname);
+}
+int symlink_dir(const char *oldname, const char *newname) {
+ return ::symlink(oldname, newname);
+}
+using ::chdir;
+using ::close;
+using ::fchmod;
+#if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_FDCWD)
+using ::fchmodat;
+#endif
+using ::fstat;
+using ::ftruncate;
+using ::getcwd;
+using ::link;
+using ::lstat;
+using ::mkdir;
+using ::open;
+using ::readlink;
+using ::realpath;
+using ::remove;
+using ::rename;
+using ::stat;
+using ::statvfs;
+using ::truncate;
+
+#define O_BINARY 0
+
+using StatVFS = struct statvfs;
+using ModeT = ::mode_t;
+using SSizeT = ::ssize_t;
+
+#endif
+
+} // namespace
+} // end namespace detail
+
+_LIBCPP_END_NAMESPACE_FILESYSTEM
+
+#endif // POSIX_COMPAT_H
--- /dev/null
+//===------------------------- format.cpp ---------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "format"
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 17
+
+format_error::~format_error() noexcept = default;
+
+#endif //_LIBCPP_STD_VER > 17
+
+_LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
-bad_function_call::~bad_function_call() _NOEXCEPT
+bad_function_call::~bad_function_call() noexcept
{
}
const char*
-bad_function_call::what() const _NOEXCEPT
+bad_function_call::what() const noexcept
{
return "std::bad_function_call";
}
: public __do_message
{
public:
- virtual const char* name() const _NOEXCEPT;
+ virtual const char* name() const noexcept;
virtual string message(int ev) const;
};
const char*
-__future_error_category::name() const _NOEXCEPT
+__future_error_category::name() const noexcept
{
return "future";
}
#endif
const error_category&
-future_category() _NOEXCEPT
+future_category() noexcept
{
static __future_error_category __f;
return __f;
{
}
-future_error::~future_error() _NOEXCEPT
+future_error::~future_error() noexcept
{
}
void
-__assoc_sub_state::__on_zero_shared() _NOEXCEPT
+__assoc_sub_state::__on_zero_shared() noexcept
{
delete this;
}
#include <errno.h>
#endif
+// Note: _LIBCPP_ELAST needs to be defined only on platforms
+// where strerror/strerror_r can't handle out-of-range errno values.
#if defined(ELAST)
#define _LIBCPP_ELAST ELAST
#elif defined(_NEWLIB_VERSION)
#define _LIBCPP_ELAST __ELASTERROR
+#elif defined(__NuttX__)
+// No _LIBCPP_ELAST needed on NuttX
#elif defined(__Fuchsia__)
// No _LIBCPP_ELAST needed on Fuchsia
#elif defined(__wasi__)
// No _LIBCPP_ELAST needed on Apple
#elif defined(__sun__)
#define _LIBCPP_ELAST ESTALE
+#elif defined(__MVS__)
+#define _LIBCPP_ELAST 1160
#elif defined(_LIBCPP_MSVCRT_LIKE)
#define _LIBCPP_ELAST (_sys_nerr - 1)
+#elif defined(_AIX)
+#define _LIBCPP_ELAST 127
#else
// Warn here so that the person doing the libcxx port has an easier time:
#warning ELAST for this platform not yet implemented
#include <stdexcept>
#include <cstddef>
#include <cstring>
-#ifdef __APPLE__
-#include <dlfcn.h>
-#include <mach-o/dyld.h>
-#endif
#include "atomic_support.h"
+// MacOS and iOS used to ship with libstdc++, and still support old applications
+// linking against libstdc++. The libc++ and libstdc++ exceptions are supposed
+// to be ABI compatible, such that they can be thrown from one library and caught
+// in the other.
+//
+// For that reason, we must look for libstdc++ in the same process and if found,
+// check the string stored in the exception object to see if it is the GCC empty
+// string singleton before manipulating the reference count. This is done so that
+// if an exception is created with a zero-length string in libstdc++, libc++abi
+// won't try to delete the memory.
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
+ defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
+# define _LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE
+# include <dlfcn.h>
+# include <mach-o/dyld.h>
+#endif
+
_LIBCPP_BEGIN_NAMESPACE_STD
namespace __refstring_imp { namespace {
return data + sizeof(*rep);
}
-#if defined(__APPLE__)
+#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
inline
-const char* compute_gcc_empty_string_storage() _NOEXCEPT
+const char* compute_gcc_empty_string_storage() noexcept
{
void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD);
if (handle == nullptr)
inline
const char*
-get_gcc_empty_string_storage() _NOEXCEPT
+get_gcc_empty_string_storage() noexcept
{
static const char* p = compute_gcc_empty_string_storage();
return p;
}
inline
-__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT
+__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) noexcept
: __imp_(s.__imp_)
{
if (__uses_refcount())
}
inline
-__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _NOEXCEPT {
+__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) noexcept {
bool adjust_old_count = __uses_refcount();
struct _Rep_base *old_rep = rep_from_data(__imp_);
__imp_ = s.__imp_;
inline
bool __libcpp_refstring::__uses_refcount() const {
-#ifdef __APPLE__
+#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
return __imp_ != get_gcc_empty_string_storage();
#else
return true;
--- /dev/null
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SSO_ALLOCATOR_H
+#define _LIBCPP_SSO_ALLOCATOR_H
+
+#include <__config>
+#include <memory>
+#include <new>
+#include <type_traits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, size_t _Np> class _LIBCPP_HIDDEN __sso_allocator;
+
+template <size_t _Np>
+class _LIBCPP_HIDDEN __sso_allocator<void, _Np>
+{
+public:
+ typedef const void* const_pointer;
+ typedef void value_type;
+};
+
+template <class _Tp, size_t _Np>
+class _LIBCPP_HIDDEN __sso_allocator
+{
+ typename aligned_storage<sizeof(_Tp) * _Np>::type buf_;
+ bool __allocated_;
+public:
+ typedef size_t size_type;
+ typedef _Tp* pointer;
+ typedef _Tp value_type;
+
+ _LIBCPP_INLINE_VISIBILITY __sso_allocator() throw() : __allocated_(false) {}
+ _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator&) throw() : __allocated_(false) {}
+ template <class _Up> _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator<_Up, _Np>&) throw()
+ : __allocated_(false) {}
+private:
+ __sso_allocator& operator=(const __sso_allocator&);
+public:
+ _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator<void, _Np>::const_pointer = nullptr)
+ {
+ if (!__allocated_ && __n <= _Np)
+ {
+ __allocated_ = true;
+ return (pointer)&buf_;
+ }
+ return allocator<_Tp>().allocate(__n);
+ }
+ _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type __n)
+ {
+ if (__p == (pointer)&buf_)
+ __allocated_ = false;
+ else
+ allocator<_Tp>().deallocate(__p, __n);
+ }
+ _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator==(const __sso_allocator& __a) const {return &buf_ == &__a.buf_;}
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator!=(const __sso_allocator& __a) const {return &buf_ != &__a.buf_;}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_SSO_ALLOCATOR_H
#include "__locale"
#include "algorithm"
#include "include/config_elast.h"
-#include "istream"
#include "limits"
#include "memory"
#include "new"
-#include "streambuf"
#include "string"
#include "__undef_macros"
_LIBCPP_BEGIN_NAMESPACE_STD
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
-
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
-
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
-
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
-
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
-
class _LIBCPP_HIDDEN __iostream_category
: public __do_message
{
public:
- virtual const char* name() const _NOEXCEPT;
+ virtual const char* name() const noexcept;
virtual string message(int ev) const;
};
const char*
-__iostream_category::name() const _NOEXCEPT
+__iostream_category::name() const noexcept
{
return "iostream";
}
if (ev != static_cast<int>(io_errc::stream)
#ifdef _LIBCPP_ELAST
&& ev <= _LIBCPP_ELAST
-#endif // _LIBCPP_ELAST
+#endif // _LIBCPP_ELAST
)
return __do_message::message(ev);
return string("unspecified iostream_category error");
}
const error_category&
-iostream_category() _NOEXCEPT
+iostream_category() noexcept
{
static __iostream_category s;
return s;
}
void
-ios_base::swap(ios_base& rhs) _NOEXCEPT
+ios_base::swap(ios_base& rhs) noexcept
{
_VSTD::swap(__fmtflags_, rhs.__fmtflags_);
_VSTD::swap(__precision_, rhs.__precision_);
#ifndef _LIBCPP_NO_EXCEPTIONS
if (__exceptions_ & badbit)
throw;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
void
#ifndef _LIBCPP_NO_EXCEPTIONS
if (__exceptions_ & failbit)
throw;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
bool
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "__config"
+#include "fstream"
+#include "ios"
+#include "istream"
+#include "ostream"
+#include "sstream"
+#include "streambuf"
+
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Original explicit instantiations provided in the library
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
+
+// Additional instantiations added later. Whether programs rely on these being
+// available is protected by _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1.
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringbuf<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringstream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostringstream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istringstream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ifstream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ofstream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf<char>;
+
+// Add more here if needed...
+
+_LIBCPP_END_NAMESPACE_STD
#endif
;
-_LIBCPP_HIDDEN ios_base::Init __start_std_streams;
+_LIBCPP_HIDDEN ios_base::Init __start_std_streams _LIBCPP_INIT_PRIORITY_MAX;
// On Windows the TLS storage for locales needs to be initialized before we create
// the standard streams, otherwise it may not be alive during program termination
#define _CTYPE_DISABLE_MACROS
#endif
#include "cwctype"
-#include "__sso_allocator"
#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
-#include "support/win32/locale_win32.h"
-#elif !defined(__BIONIC__)
+#include "__support/win32/locale_win32.h"
+#elif !defined(__BIONIC__) && !defined(__NuttX__)
#include <langinfo.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include "include/atomic_support.h"
+#include "include/sso_allocator.h"
#include "__undef_macros"
// On Linux, wint_t and wchar_t have different signed-ness, and this causes
class _LIBCPP_HIDDEN locale::__imp
: public facet
{
- enum {N = 28};
+ enum {N = 30};
#if defined(_LIBCPP_COMPILER_MSVC)
// FIXME: MSVC doesn't support aligned parameters by value.
// I can't get the __sso_allocator to work here
install(&make<_VSTD::ctype<wchar_t> >(1u));
install(&make<codecvt<char, char, mbstate_t> >(1u));
install(&make<codecvt<wchar_t, char, mbstate_t> >(1u));
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
install(&make<codecvt<char16_t, char, mbstate_t> >(1u));
install(&make<codecvt<char32_t, char, mbstate_t> >(1u));
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ install(&make<codecvt<char16_t, char8_t, mbstate_t> >(1u));
+ install(&make<codecvt<char32_t, char8_t, mbstate_t> >(1u));
+#endif
install(&make<numpunct<char> >(1u));
install(&make<numpunct<wchar_t> >(1u));
install(&make<num_get<char> >(1u));
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
facets_ = locale::classic().__locale_->facets_;
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
install(new ctype_byname<wchar_t>(name_));
install(new codecvt_byname<char, char, mbstate_t>(name_));
install(new codecvt_byname<wchar_t, char, mbstate_t>(name_));
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
install(new codecvt_byname<char16_t, char, mbstate_t>(name_));
install(new codecvt_byname<char32_t, char, mbstate_t>(name_));
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name_));
+ install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name_));
+#endif
install(new numpunct_byname<char>(name_));
install(new numpunct_byname<wchar_t>(name_));
install(new moneypunct_byname<char, false>(name_));
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
// NOTE avoid the `base class should be explicitly initialized in the
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (c & locale::collate)
{
install(new collate_byname<char>(name));
install(new ctype_byname<wchar_t>(name));
install(new codecvt_byname<char, char, mbstate_t>(name));
install(new codecvt_byname<wchar_t, char, mbstate_t>(name));
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
install(new codecvt_byname<char16_t, char, mbstate_t>(name));
install(new codecvt_byname<char32_t, char, mbstate_t>(name));
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name));
+ install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name));
+#endif
}
if (c & locale::monetary)
{
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
template<class F>
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
if (c & locale::collate)
{
install_from<_VSTD::collate<char> >(one);
install_from<_VSTD::ctype<char> >(one);
install_from<_VSTD::ctype<wchar_t> >(one);
install_from<_VSTD::codecvt<char, char, mbstate_t> >(one);
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
install_from<_VSTD::codecvt<char16_t, char, mbstate_t> >(one);
install_from<_VSTD::codecvt<char32_t, char, mbstate_t> >(one);
+_LIBCPP_SUPPRESS_DEPRECATED_POP
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+ install_from<_VSTD::codecvt<char16_t, char8_t, mbstate_t> >(one);
+ install_from<_VSTD::codecvt<char32_t, char8_t, mbstate_t> >(one);
+#endif
install_from<_VSTD::codecvt<wchar_t, char, mbstate_t> >(one);
}
if (c & locale::monetary)
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
locale::__imp::__imp(const __imp& other, facet* f, long id)
return g;
}
-locale::locale() _NOEXCEPT
+locale::locale() noexcept
: __locale_(__global().__locale_)
{
__locale_->__add_shared();
}
-locale::locale(const locale& l) _NOEXCEPT
+locale::locale(const locale& l) noexcept
: __locale_(l.__locale_)
{
__locale_->__add_shared();
}
const locale&
-locale::operator=(const locale& other) _NOEXCEPT
+locale::operator=(const locale& other) noexcept
{
other.__locale_->__add_shared();
__locale_->__release_shared();
}
void
-locale::facet::__on_zero_shared() _NOEXCEPT
+locale::facet::__on_zero_shared() noexcept
{
delete this;
}
#ifdef _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
const ctype<char>::mask*
-ctype<char>::classic_table() _NOEXCEPT
+ctype<char>::classic_table() noexcept
{
static _LIBCPP_CONSTEXPR const ctype<char>::mask builtin_table[table_size] = {
cntrl, cntrl,
}
#else
const ctype<char>::mask*
-ctype<char>::classic_table() _NOEXCEPT
+ctype<char>::classic_table() noexcept
{
#if defined(__APPLE__) || defined(__FreeBSD__)
return _DefaultRuneLocale.__runetype;
return _C_ctype_tab_ + 1;
#elif defined(__GLIBC__)
return _LIBCPP_GET_C_LOCALE->__ctype_b;
-#elif __sun__
+#elif defined(__sun__)
return __ctype_mask;
#elif defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
return __pctype_func();
#if defined(__GLIBC__)
const int*
-ctype<char>::__classic_lower_table() _NOEXCEPT
+ctype<char>::__classic_lower_table() noexcept
{
return _LIBCPP_GET_C_LOCALE->__ctype_tolower;
}
const int*
-ctype<char>::__classic_upper_table() _NOEXCEPT
+ctype<char>::__classic_upper_table() noexcept
{
return _LIBCPP_GET_C_LOCALE->__ctype_toupper;
}
-#elif __NetBSD__
+#elif defined(__NetBSD__)
const short*
-ctype<char>::__classic_lower_table() _NOEXCEPT
+ctype<char>::__classic_lower_table() noexcept
{
return _C_tolower_tab_ + 1;
}
const short*
-ctype<char>::__classic_upper_table() _NOEXCEPT
+ctype<char>::__classic_upper_table() noexcept
{
return _C_toupper_tab_ + 1;
}
#elif defined(__EMSCRIPTEN__)
const int*
-ctype<char>::__classic_lower_table() _NOEXCEPT
+ctype<char>::__classic_lower_table() noexcept
{
return *__ctype_tolower_loc();
}
const int*
-ctype<char>::__classic_upper_table() _NOEXCEPT
+ctype<char>::__classic_upper_table() noexcept
{
return *__ctype_toupper_loc();
}
}
int
-codecvt<char, char, mbstate_t>::do_encoding() const _NOEXCEPT
+codecvt<char, char, mbstate_t>::do_encoding() const noexcept
{
return 1;
}
bool
-codecvt<char, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
+codecvt<char, char, mbstate_t>::do_always_noconv() const noexcept
{
return true;
}
}
int
-codecvt<char, char, mbstate_t>::do_max_length() const _NOEXCEPT
+codecvt<char, char, mbstate_t>::do_max_length() const noexcept
{
return 1;
}
}
int
-codecvt<wchar_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
+codecvt<wchar_t, char, mbstate_t>::do_encoding() const noexcept
{
if (__libcpp_mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l) != 0)
return -1;
}
bool
-codecvt<wchar_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
+codecvt<wchar_t, char, mbstate_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-codecvt<wchar_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
+codecvt<wchar_t, char, mbstate_t>::do_max_length() const noexcept
{
return __l == 0 ? 1 : static_cast<int>(__libcpp_mb_cur_max_l(__l));
}
}
int
-codecvt<char16_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
+codecvt<char16_t, char, mbstate_t>::do_encoding() const noexcept
{
return 0;
}
bool
-codecvt<char16_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
+codecvt<char16_t, char, mbstate_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-codecvt<char16_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
+codecvt<char16_t, char, mbstate_t>::do_max_length() const noexcept
{
return 4;
}
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+
+// template <> class codecvt<char16_t, char8_t, mbstate_t>
+
+locale::id codecvt<char16_t, char8_t, mbstate_t>::id;
+
+codecvt<char16_t, char8_t, mbstate_t>::~codecvt()
+{
+}
+
+codecvt<char16_t, char8_t, mbstate_t>::result
+codecvt<char16_t, char8_t, mbstate_t>::do_out(state_type&,
+ const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
+ extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
+{
+ const uint16_t* _frm = reinterpret_cast<const uint16_t*>(frm);
+ const uint16_t* _frm_end = reinterpret_cast<const uint16_t*>(frm_end);
+ const uint16_t* _frm_nxt = _frm;
+ uint8_t* _to = reinterpret_cast<uint8_t*>(to);
+ uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
+ uint8_t* _to_nxt = _to;
+ result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt);
+ frm_nxt = frm + (_frm_nxt - _frm);
+ to_nxt = to + (_to_nxt - _to);
+ return r;
+}
+
+codecvt<char16_t, char8_t, mbstate_t>::result
+codecvt<char16_t, char8_t, mbstate_t>::do_in(state_type&,
+ const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt,
+ intern_type* to, intern_type* to_end, intern_type*& to_nxt) const
+{
+ const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
+ const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
+ const uint8_t* _frm_nxt = _frm;
+ uint16_t* _to = reinterpret_cast<uint16_t*>(to);
+ uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
+ uint16_t* _to_nxt = _to;
+ result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt);
+ frm_nxt = frm + (_frm_nxt - _frm);
+ to_nxt = to + (_to_nxt - _to);
+ return r;
+}
+
+codecvt<char16_t, char8_t, mbstate_t>::result
+codecvt<char16_t, char8_t, mbstate_t>::do_unshift(state_type&,
+ extern_type* to, extern_type*, extern_type*& to_nxt) const
+{
+ to_nxt = to;
+ return noconv;
+}
+
+int
+codecvt<char16_t, char8_t, mbstate_t>::do_encoding() const noexcept
+{
+ return 0;
+}
+
+bool
+codecvt<char16_t, char8_t, mbstate_t>::do_always_noconv() const noexcept
+{
+ return false;
+}
+
+int
+codecvt<char16_t, char8_t, mbstate_t>::do_length(state_type&,
+ const extern_type* frm, const extern_type* frm_end, size_t mx) const
+{
+ const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
+ const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
+ return utf8_to_utf16_length(_frm, _frm_end, mx);
+}
+
+int
+codecvt<char16_t, char8_t, mbstate_t>::do_max_length() const noexcept
+{
+ return 4;
+}
+
+#endif
+
// template <> class codecvt<char32_t, char, mbstate_t>
locale::id codecvt<char32_t, char, mbstate_t>::id;
}
int
-codecvt<char32_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
+codecvt<char32_t, char, mbstate_t>::do_encoding() const noexcept
{
return 0;
}
bool
-codecvt<char32_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
+codecvt<char32_t, char, mbstate_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-codecvt<char32_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
+codecvt<char32_t, char, mbstate_t>::do_max_length() const noexcept
{
return 4;
}
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+
+// template <> class codecvt<char32_t, char8_t, mbstate_t>
+
+locale::id codecvt<char32_t, char8_t, mbstate_t>::id;
+
+codecvt<char32_t, char8_t, mbstate_t>::~codecvt()
+{
+}
+
+codecvt<char32_t, char8_t, mbstate_t>::result
+codecvt<char32_t, char8_t, mbstate_t>::do_out(state_type&,
+ const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
+ extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
+{
+ const uint32_t* _frm = reinterpret_cast<const uint32_t*>(frm);
+ const uint32_t* _frm_end = reinterpret_cast<const uint32_t*>(frm_end);
+ const uint32_t* _frm_nxt = _frm;
+ uint8_t* _to = reinterpret_cast<uint8_t*>(to);
+ uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
+ uint8_t* _to_nxt = _to;
+ result r = ucs4_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt);
+ frm_nxt = frm + (_frm_nxt - _frm);
+ to_nxt = to + (_to_nxt - _to);
+ return r;
+}
+
+codecvt<char32_t, char8_t, mbstate_t>::result
+codecvt<char32_t, char8_t, mbstate_t>::do_in(state_type&,
+ const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt,
+ intern_type* to, intern_type* to_end, intern_type*& to_nxt) const
+{
+ const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
+ const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
+ const uint8_t* _frm_nxt = _frm;
+ uint32_t* _to = reinterpret_cast<uint32_t*>(to);
+ uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
+ uint32_t* _to_nxt = _to;
+ result r = utf8_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt);
+ frm_nxt = frm + (_frm_nxt - _frm);
+ to_nxt = to + (_to_nxt - _to);
+ return r;
+}
+
+codecvt<char32_t, char8_t, mbstate_t>::result
+codecvt<char32_t, char8_t, mbstate_t>::do_unshift(state_type&,
+ extern_type* to, extern_type*, extern_type*& to_nxt) const
+{
+ to_nxt = to;
+ return noconv;
+}
+
+int
+codecvt<char32_t, char8_t, mbstate_t>::do_encoding() const noexcept
+{
+ return 0;
+}
+
+bool
+codecvt<char32_t, char8_t, mbstate_t>::do_always_noconv() const noexcept
+{
+ return false;
+}
+
+int
+codecvt<char32_t, char8_t, mbstate_t>::do_length(state_type&,
+ const extern_type* frm, const extern_type* frm_end, size_t mx) const
+{
+ const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
+ const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
+ return utf8_to_ucs4_length(_frm, _frm_end, mx);
+}
+
+int
+codecvt<char32_t, char8_t, mbstate_t>::do_max_length() const noexcept
+{
+ return 4;
+}
+
+#endif
+
// __codecvt_utf8<wchar_t>
__codecvt_utf8<wchar_t>::result
}
int
-__codecvt_utf8<wchar_t>::do_encoding() const _NOEXCEPT
+__codecvt_utf8<wchar_t>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf8<wchar_t>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf8<wchar_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf8<wchar_t>::do_max_length() const _NOEXCEPT
+__codecvt_utf8<wchar_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
}
int
-__codecvt_utf8<char16_t>::do_encoding() const _NOEXCEPT
+__codecvt_utf8<char16_t>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf8<char16_t>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf8<char16_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf8<char16_t>::do_max_length() const _NOEXCEPT
+__codecvt_utf8<char16_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
}
int
-__codecvt_utf8<char32_t>::do_encoding() const _NOEXCEPT
+__codecvt_utf8<char32_t>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf8<char32_t>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf8<char32_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf8<char32_t>::do_max_length() const _NOEXCEPT
+__codecvt_utf8<char32_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
}
int
-__codecvt_utf16<wchar_t, false>::do_encoding() const _NOEXCEPT
+__codecvt_utf16<wchar_t, false>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf16<wchar_t, false>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf16<wchar_t, false>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf16<wchar_t, false>::do_max_length() const _NOEXCEPT
+__codecvt_utf16<wchar_t, false>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
}
int
-__codecvt_utf16<wchar_t, true>::do_encoding() const _NOEXCEPT
+__codecvt_utf16<wchar_t, true>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf16<wchar_t, true>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf16<wchar_t, true>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf16<wchar_t, true>::do_max_length() const _NOEXCEPT
+__codecvt_utf16<wchar_t, true>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
}
int
-__codecvt_utf16<char16_t, false>::do_encoding() const _NOEXCEPT
+__codecvt_utf16<char16_t, false>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf16<char16_t, false>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf16<char16_t, false>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf16<char16_t, false>::do_max_length() const _NOEXCEPT
+__codecvt_utf16<char16_t, false>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 4;
}
int
-__codecvt_utf16<char16_t, true>::do_encoding() const _NOEXCEPT
+__codecvt_utf16<char16_t, true>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf16<char16_t, true>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf16<char16_t, true>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf16<char16_t, true>::do_max_length() const _NOEXCEPT
+__codecvt_utf16<char16_t, true>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 4;
}
int
-__codecvt_utf16<char32_t, false>::do_encoding() const _NOEXCEPT
+__codecvt_utf16<char32_t, false>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf16<char32_t, false>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf16<char32_t, false>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf16<char32_t, false>::do_max_length() const _NOEXCEPT
+__codecvt_utf16<char32_t, false>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
}
int
-__codecvt_utf16<char32_t, true>::do_encoding() const _NOEXCEPT
+__codecvt_utf16<char32_t, true>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf16<char32_t, true>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf16<char32_t, true>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf16<char32_t, true>::do_max_length() const _NOEXCEPT
+__codecvt_utf16<char32_t, true>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
}
int
-__codecvt_utf8_utf16<wchar_t>::do_encoding() const _NOEXCEPT
+__codecvt_utf8_utf16<wchar_t>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf8_utf16<wchar_t>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf8_utf16<wchar_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf8_utf16<wchar_t>::do_max_length() const _NOEXCEPT
+__codecvt_utf8_utf16<wchar_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
}
int
-__codecvt_utf8_utf16<char16_t>::do_encoding() const _NOEXCEPT
+__codecvt_utf8_utf16<char16_t>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf8_utf16<char16_t>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf8_utf16<char16_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf8_utf16<char16_t>::do_max_length() const _NOEXCEPT
+__codecvt_utf8_utf16<char16_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
}
int
-__codecvt_utf8_utf16<char32_t>::do_encoding() const _NOEXCEPT
+__codecvt_utf8_utf16<char32_t>::do_encoding() const noexcept
{
return 0;
}
bool
-__codecvt_utf8_utf16<char32_t>::do_always_noconv() const _NOEXCEPT
+__codecvt_utf8_utf16<char32_t>::do_always_noconv() const noexcept
{
return false;
}
}
int
-__codecvt_utf8_utf16<char32_t>::do_max_length() const _NOEXCEPT
+__codecvt_utf8_utf16<char32_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
__num_put_base::__format_int(char* __fmtp, const char* __len, bool __signd,
ios_base::fmtflags __flags)
{
- if (__flags & ios_base::showpos)
+ if ((__flags & ios_base::showpos) &&
+ (__flags & ios_base::basefield) != ios_base::oct &&
+ (__flags & ios_base::basefield) != ios_base::hex &&
+ __signd)
*__fmtp++ = '+';
if (__flags & ios_base::showbase)
*__fmtp++ = '#';
mb = mbstate_t();
const char* bb = buf;
size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
- if (j == size_t(-1))
+ if (j == size_t(-1) || j == 0)
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
__weeks_[i].assign(wbuf, wbe);
mb = mbstate_t();
bb = buf;
j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
- if (j == size_t(-1))
+ if (j == size_t(-1) || j == 0)
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
__weeks_[i+7].assign(wbuf, wbe);
mb = mbstate_t();
const char* bb = buf;
size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
- if (j == size_t(-1))
+ if (j == size_t(-1) || j == 0)
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
__months_[i].assign(wbuf, wbe);
mb = mbstate_t();
bb = buf;
j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
- if (j == size_t(-1))
+ if (j == size_t(-1) || j == 0)
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
__months_[i+12].assign(wbuf, wbe);
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char, mbstate_t>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, mbstate_t>;
+template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char, mbstate_t>;
+template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, mbstate_t>;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char8_t, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char8_t, mbstate_t>;
+#endif
_LIBCPP_END_NAMESPACE_STD
const allocator_arg_t allocator_arg = allocator_arg_t();
-bad_weak_ptr::~bad_weak_ptr() _NOEXCEPT {}
+bad_weak_ptr::~bad_weak_ptr() noexcept {}
const char*
-bad_weak_ptr::what() const _NOEXCEPT
+bad_weak_ptr::what() const noexcept
{
return "bad_weak_ptr";
}
#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
void
-__shared_count::__add_shared() _NOEXCEPT
+__shared_count::__add_shared() noexcept
{
__libcpp_atomic_refcount_increment(__shared_owners_);
}
bool
-__shared_count::__release_shared() _NOEXCEPT
+__shared_count::__release_shared() noexcept
{
if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1)
{
}
void
-__shared_weak_count::__add_shared() _NOEXCEPT
+__shared_weak_count::__add_shared() noexcept
{
__shared_count::__add_shared();
}
void
-__shared_weak_count::__add_weak() _NOEXCEPT
+__shared_weak_count::__add_weak() noexcept
{
__libcpp_atomic_refcount_increment(__shared_weak_owners_);
}
void
-__shared_weak_count::__release_shared() _NOEXCEPT
+__shared_weak_count::__release_shared() noexcept
{
if (__shared_count::__release_shared())
__release_weak();
#endif // _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
void
-__shared_weak_count::__release_weak() _NOEXCEPT
+__shared_weak_count::__release_weak() noexcept
{
// NOTE: The acquire load here is an optimization of the very
// common case where a shared pointer is being destructed while
}
__shared_weak_count*
-__shared_weak_count::lock() _NOEXCEPT
+__shared_weak_count::lock() noexcept
{
long object_owners = __libcpp_atomic_load(&__shared_owners_);
while (object_owners != -1)
return nullptr;
}
-#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
-
const void*
-__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
+__shared_weak_count::__get_deleter(const type_info&) const noexcept
{
return nullptr;
}
-#endif // _LIBCPP_NO_RTTI
-
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
_LIBCPP_SAFE_STATIC static const std::size_t __sp_mut_count = 16;
_LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER
};
-_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
+_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) noexcept
: __lx(p)
{
}
void
-__sp_mut::lock() _NOEXCEPT
+__sp_mut::lock() noexcept
{
auto m = static_cast<__libcpp_mutex_t*>(__lx);
unsigned count = 0;
}
void
-__sp_mut::unlock() _NOEXCEPT
+__sp_mut::unlock() noexcept
{
__libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx));
}
{
}
-#if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE)
-pointer_safety get_pointer_safety() _NOEXCEPT
-{
- return pointer_safety::relaxed;
-}
-#endif
-
void*
__undeclare_reachable(void* p)
{
}
bool
-mutex::try_lock() _NOEXCEPT
+mutex::try_lock() noexcept
{
return __libcpp_mutex_trylock(&__m_);
}
void
-mutex::unlock() _NOEXCEPT
+mutex::unlock() noexcept
{
int ec = __libcpp_mutex_unlock(&__m_);
(void)ec;
}
void
-recursive_mutex::unlock() _NOEXCEPT
+recursive_mutex::unlock() noexcept
{
int e = __libcpp_recursive_mutex_unlock(&__m_);
(void)e;
}
bool
-recursive_mutex::try_lock() _NOEXCEPT
+recursive_mutex::try_lock() noexcept
{
return __libcpp_recursive_mutex_trylock(&__m_);
}
}
bool
-timed_mutex::try_lock() _NOEXCEPT
+timed_mutex::try_lock() noexcept
{
unique_lock<mutex> lk(__m_, try_to_lock);
if (lk.owns_lock() && !__locked_)
}
void
-timed_mutex::unlock() _NOEXCEPT
+timed_mutex::unlock() noexcept
{
lock_guard<mutex> _(__m_);
__locked_ = false;
}
bool
-recursive_timed_mutex::try_lock() _NOEXCEPT
+recursive_timed_mutex::try_lock() noexcept
{
__thread_id id = this_thread::get_id();
unique_lock<mutex> lk(__m_, try_to_lock);
}
void
-recursive_timed_mutex::unlock() _NOEXCEPT
+recursive_timed_mutex::unlock() noexcept
{
unique_lock<mutex> lk(__m_);
if (--__count_ == 0)
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
flag = 1;
func(arg);
flag = ~once_flag::_State_type(0);
flag = 0;
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
#else // !_LIBCPP_HAS_NO_THREADS
__libcpp_mutex_lock(&mut);
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
__libcpp_relaxed_store(&flag, once_flag::_State_type(1));
__libcpp_mutex_unlock(&mut);
func(arg);
__libcpp_condvar_broadcast(&cv);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
else
__libcpp_mutex_unlock(&mut);
};
-mutex::~mutex() _NOEXCEPT
+mutex::~mutex() noexcept
{
__libcpp_mutex_destroy(&__m_);
}
if (size == 0)
size = 1;
void* p;
- while ((p = ::malloc(size)) == 0)
+ while ((p = ::malloc(size)) == nullptr)
{
// If malloc fails and there is a new_handler,
// call it to try free up memory.
_LIBCPP_WEAK
void*
-operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
+operator new(size_t size, const std::nothrow_t&) noexcept
{
- void* p = 0;
+ void* p = nullptr;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
p = ::operator new(size);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return p;
}
_LIBCPP_WEAK
void*
-operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
+operator new[](size_t size, const std::nothrow_t&) noexcept
{
- void* p = 0;
+ void* p = nullptr;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
p = ::operator new[](size);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return p;
}
_LIBCPP_WEAK
void
-operator delete(void* ptr) _NOEXCEPT
+operator delete(void* ptr) noexcept
{
::free(ptr);
}
_LIBCPP_WEAK
void
-operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
+operator delete(void* ptr, const std::nothrow_t&) noexcept
{
::operator delete(ptr);
}
_LIBCPP_WEAK
void
-operator delete(void* ptr, size_t) _NOEXCEPT
+operator delete(void* ptr, size_t) noexcept
{
::operator delete(ptr);
}
_LIBCPP_WEAK
void
-operator delete[] (void* ptr) _NOEXCEPT
+operator delete[] (void* ptr) noexcept
{
::operator delete(ptr);
}
_LIBCPP_WEAK
void
-operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
+operator delete[] (void* ptr, const std::nothrow_t&) noexcept
{
::operator delete[](ptr);
}
_LIBCPP_WEAK
void
-operator delete[] (void* ptr, size_t) _NOEXCEPT
+operator delete[] (void* ptr, size_t) noexcept
{
::operator delete[](ptr);
}
size = 1;
if (static_cast<size_t>(alignment) < sizeof(void*))
alignment = std::align_val_t(sizeof(void*));
+
+ // Try allocating memory. If allocation fails and there is a new_handler,
+ // call it to try free up memory, and try again until it succeeds, or until
+ // the new_handler decides to terminate.
+ //
+ // If allocation fails and there is no new_handler, we throw bad_alloc
+ // (or return nullptr if exceptions are disabled).
void* p;
-#if defined(_LIBCPP_MSVCRT_LIKE)
- while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
-#else
- while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
-#endif
+ while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr)
{
- // If posix_memalign fails and there is a new_handler,
- // call it to try free up memory.
std::new_handler nh = std::get_new_handler();
if (nh)
nh();
#ifndef _LIBCPP_NO_EXCEPTIONS
throw std::bad_alloc();
#else
- p = nullptr; // posix_memalign doesn't initialize 'p' on failure
break;
#endif
}
_LIBCPP_WEAK
void*
-operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
- void* p = 0;
+ void* p = nullptr;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
p = ::operator new(size, alignment);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return p;
}
_LIBCPP_WEAK
void*
-operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
- void* p = 0;
+ void* p = nullptr;
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
p = ::operator new[](size, alignment);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
return p;
}
_LIBCPP_WEAK
void
-operator delete(void* ptr, std::align_val_t) _NOEXCEPT
+operator delete(void* ptr, std::align_val_t) noexcept
{
-#if defined(_LIBCPP_MSVCRT_LIKE)
- ::_aligned_free(ptr);
-#else
- ::free(ptr);
-#endif
+ std::__libcpp_aligned_free(ptr);
}
_LIBCPP_WEAK
void
-operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
::operator delete(ptr, alignment);
}
_LIBCPP_WEAK
void
-operator delete(void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
+operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept
{
::operator delete(ptr, alignment);
}
_LIBCPP_WEAK
void
-operator delete[] (void* ptr, std::align_val_t alignment) _NOEXCEPT
+operator delete[] (void* ptr, std::align_val_t alignment) noexcept
{
::operator delete(ptr, alignment);
}
_LIBCPP_WEAK
void
-operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
::operator delete[](ptr, alignment);
}
_LIBCPP_WEAK
void
-operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
+operator delete[] (void* ptr, size_t, std::align_val_t alignment) noexcept
{
::operator delete[](ptr, alignment);
}
//===----------------------------------------------------------------------===//
#include "optional"
+#include "__availability"
namespace std
{
-bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
+bad_optional_access::~bad_optional_access() noexcept = default;
-const char* bad_optional_access::what() const _NOEXCEPT {
+const char* bad_optional_access::what() const noexcept {
return "bad_optional_access";
}
bad_optional_access() : std::logic_error("Bad optional Access") {}
// Get the key function ~bad_optional_access() into the dylib
- virtual ~bad_optional_access() _NOEXCEPT;
+ virtual ~bad_optional_access() noexcept;
};
-bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
+bad_optional_access::~bad_optional_access() noexcept = default;
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __basic_string_common<true>;
+#define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template __VA_ARGS__;
#ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char)
_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t)
_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char)
_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t)
#endif
+#undef _LIBCPP_EXTERN_TEMPLATE_DEFINE
-template
- string
- operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
+template string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
namespace
{
}
template <typename S, typename V>
-S i_to_string(const V v)
+S i_to_string(V v)
{
// numeric_limits::digits10 returns value less on 1 than desired for unsigned numbers.
// For example, for 1-byte unsigned value digits10 is 2 (999 can not be represented),
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <__support/ibm/xlocale.h>
+#include <sstream>
+#include <vector>
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+locale_t newlocale(int category_mask, const char* locale, locale_t base) {
+ // Maintain current locale name(s) to restore later.
+ std::string current_loc_name(setlocale(LC_ALL, 0));
+
+ // Check for errors.
+ if (category_mask == LC_ALL_MASK && setlocale(LC_ALL, locale) == NULL) {
+ errno = EINVAL;
+ return (locale_t)0;
+ } else {
+ for (int _Cat = 0; _Cat <= _LC_MAX; ++_Cat) {
+ if ((_CATMASK(_Cat) & category_mask) != 0 && setlocale(_Cat, locale) == NULL) {
+ setlocale(LC_ALL, current_loc_name.c_str());
+ errno = EINVAL;
+ return (locale_t)0;
+ }
+ }
+ }
+
+ // Create new locale.
+ locale_t newloc = new locale_struct();
+
+ if (base) {
+ if (category_mask != LC_ALL_MASK) {
+ // Copy base when it will not be overwritten.
+ memcpy(newloc, base, sizeof (locale_struct));
+ newloc->category_mask = category_mask | base->category_mask;
+ }
+ delete base;
+ } else {
+ newloc->category_mask = category_mask;
+ }
+
+ if (category_mask & LC_COLLATE_MASK)
+ newloc->lc_collate = locale;
+ if (category_mask & LC_CTYPE_MASK)
+ newloc->lc_ctype = locale;
+ if (category_mask & LC_MONETARY_MASK)
+ newloc->lc_monetary = locale;
+ if (category_mask & LC_NUMERIC_MASK)
+ newloc->lc_numeric = locale;
+ if (category_mask & LC_TIME_MASK)
+ newloc->lc_time = locale;
+ if (category_mask & LC_MESSAGES_MASK)
+ newloc->lc_messages = locale;
+
+ // Restore current locale.
+ setlocale(LC_ALL, current_loc_name.c_str());
+ return (locale_t)newloc;
+}
+
+void freelocale(locale_t locobj) {
+ delete locobj;
+}
+
+locale_t uselocale(locale_t newloc) {
+ // Maintain current locale name(s).
+ std::string current_loc_name(setlocale(LC_ALL, 0));
+
+ if (newloc) {
+ // Set locales and check for errors.
+ bool is_error =
+ (newloc->category_mask & LC_COLLATE_MASK &&
+ setlocale(LC_COLLATE, newloc->lc_collate.c_str()) == NULL) ||
+ (newloc->category_mask & LC_CTYPE_MASK &&
+ setlocale(LC_CTYPE, newloc->lc_ctype.c_str()) == NULL) ||
+ (newloc->category_mask & LC_MONETARY_MASK &&
+ setlocale(LC_MONETARY, newloc->lc_monetary.c_str()) == NULL) ||
+ (newloc->category_mask & LC_NUMERIC_MASK &&
+ setlocale(LC_NUMERIC, newloc->lc_numeric.c_str()) == NULL) ||
+ (newloc->category_mask & LC_TIME_MASK &&
+ setlocale(LC_TIME, newloc->lc_time.c_str()) == NULL) ||
+ (newloc->category_mask & LC_MESSAGES_MASK &&
+ setlocale(LC_MESSAGES, newloc->lc_messages.c_str()) == NULL);
+
+ if (is_error) {
+ setlocale(LC_ALL, current_loc_name.c_str());
+ errno = EINVAL;
+ return (locale_t)0;
+ }
+ }
+
+ // Construct and return previous locale.
+ locale_t previous_loc = new locale_struct();
+
+ // current_loc_name might be a comma-separated locale name list.
+ if (current_loc_name.find(',') != std::string::npos) {
+ // Tokenize locale name list.
+ const char delimiter = ',';
+ std::vector<std::string> tokenized;
+ std::stringstream ss(current_loc_name);
+ std::string s;
+
+ while (std::getline(ss, s, delimiter)) {
+ tokenized.push_back(s);
+ }
+
+ _LIBCPP_ASSERT(tokenized.size() >= _NCAT, "locale-name list is too short");
+
+ previous_loc->lc_collate = tokenized[LC_COLLATE];
+ previous_loc->lc_ctype = tokenized[LC_CTYPE];
+ previous_loc->lc_monetary = tokenized[LC_MONETARY];
+ previous_loc->lc_numeric = tokenized[LC_NUMERIC];
+ previous_loc->lc_time = tokenized[LC_TIME];
+ // Skip LC_TOD.
+ previous_loc->lc_messages = tokenized[LC_MESSAGES];
+ } else {
+ previous_loc->lc_collate = current_loc_name;
+ previous_loc->lc_ctype = current_loc_name;
+ previous_loc->lc_monetary = current_loc_name;
+ previous_loc->lc_numeric = current_loc_name;
+ previous_loc->lc_time = current_loc_name;
+ previous_loc->lc_messages = current_loc_name;
+ }
+
+ previous_loc->category_mask = LC_ALL_MASK;
+ return previous_loc;
+}
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
// libcxxrt provides implementations of these functions itself.
unexpected_handler
-set_unexpected(unexpected_handler func) _NOEXCEPT
+set_unexpected(unexpected_handler func) noexcept
{
return __libcpp_atomic_exchange(&__unexpected_handler, func);
}
unexpected_handler
-get_unexpected() _NOEXCEPT
+get_unexpected() noexcept
{
return __libcpp_atomic_load(&__unexpected_handler);
}
terminate_handler
-set_terminate(terminate_handler func) _NOEXCEPT
+set_terminate(terminate_handler func) noexcept
{
return __libcpp_atomic_exchange(&__terminate_handler, func);
}
terminate_handler
-get_terminate() _NOEXCEPT
+get_terminate() noexcept
{
return __libcpp_atomic_load(&__terminate_handler);
}
-#ifndef __EMSCRIPTEN__ // We provide this in JS
_LIBCPP_NORETURN
void
-terminate() _NOEXCEPT
+terminate() noexcept
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
fprintf(stderr, "terminate_handler unexpectedly returned\n");
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
-#endif // !__EMSCRIPTEN__
-#if !defined(__EMSCRIPTEN__)
-bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
+bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
-int uncaught_exceptions() _NOEXCEPT
+int uncaught_exceptions() noexcept
{
#warning uncaught_exception not yet implemented
fprintf(stderr, "uncaught_exceptions not yet implemented\n");
::abort();
}
-#endif // !__EMSCRIPTEN__
-exception::~exception() _NOEXCEPT
+exception::~exception() noexcept
{
}
-const char* exception::what() const _NOEXCEPT
+const char* exception::what() const noexcept
{
return "std::exception";
}
-bad_exception::~bad_exception() _NOEXCEPT
+bad_exception::~bad_exception() noexcept
{
}
-const char* bad_exception::what() const _NOEXCEPT
+const char* bad_exception::what() const noexcept
{
return "std::bad_exception";
}
-bad_alloc::bad_alloc() _NOEXCEPT
+bad_alloc::bad_alloc() noexcept
{
}
-bad_alloc::~bad_alloc() _NOEXCEPT
+bad_alloc::~bad_alloc() noexcept
{
}
const char*
-bad_alloc::what() const _NOEXCEPT
+bad_alloc::what() const noexcept
{
return "std::bad_alloc";
}
-bad_array_new_length::bad_array_new_length() _NOEXCEPT
+bad_array_new_length::bad_array_new_length() noexcept
{
}
-bad_array_new_length::~bad_array_new_length() _NOEXCEPT
+bad_array_new_length::~bad_array_new_length() noexcept
{
}
const char*
-bad_array_new_length::what() const _NOEXCEPT
+bad_array_new_length::what() const noexcept
{
return "bad_array_new_length";
}
-bad_cast::bad_cast() _NOEXCEPT
+bad_cast::bad_cast() noexcept
{
}
-bad_typeid::bad_typeid() _NOEXCEPT
+bad_typeid::bad_typeid() noexcept
{
}
-bad_cast::~bad_cast() _NOEXCEPT
+bad_cast::~bad_cast() noexcept
{
}
const char*
-bad_cast::what() const _NOEXCEPT
+bad_cast::what() const noexcept
{
return "std::bad_cast";
}
-bad_typeid::~bad_typeid() _NOEXCEPT
+bad_typeid::~bad_typeid() noexcept
{
}
const char*
-bad_typeid::what() const _NOEXCEPT
+bad_typeid::what() const noexcept
{
return "std::bad_typeid";
}
namespace std {
-bad_alloc::bad_alloc() _NOEXCEPT
+bad_alloc::bad_alloc() noexcept
{
}
-bad_array_new_length::bad_array_new_length() _NOEXCEPT
+bad_array_new_length::bad_array_new_length() noexcept
{
}
-bad_cast::bad_cast() _NOEXCEPT
+bad_cast::bad_cast() noexcept
{
}
-bad_typeid::bad_typeid() _NOEXCEPT
+bad_typeid::bad_typeid() noexcept
{
}
namespace std {
-bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
+bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
-int uncaught_exceptions() _NOEXCEPT
+int uncaught_exceptions() noexcept
{
# if _LIBCPPABI_VERSION > 1001
return __cxa_uncaught_exceptions();
namespace std {
-bad_exception::~bad_exception() _NOEXCEPT
+bad_exception::~bad_exception() noexcept
{
}
-const char* bad_exception::what() const _NOEXCEPT
+const char* bad_exception::what() const noexcept
{
return "std::bad_exception";
}
namespace std {
unexpected_handler
-set_unexpected(unexpected_handler func) _NOEXCEPT {
+set_unexpected(unexpected_handler func) noexcept {
return ::set_unexpected(func);
}
-unexpected_handler get_unexpected() _NOEXCEPT {
+unexpected_handler get_unexpected() noexcept {
return ::_get_unexpected();
}
terminate();
}
-terminate_handler set_terminate(terminate_handler func) _NOEXCEPT {
+terminate_handler set_terminate(terminate_handler func) noexcept {
return ::set_terminate(func);
}
-terminate_handler get_terminate() _NOEXCEPT {
+terminate_handler get_terminate() noexcept {
return ::_get_terminate();
}
_LIBCPP_NORETURN
-void terminate() _NOEXCEPT
+void terminate() noexcept
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
fprintf(stderr, "terminate_handler unexpectedly returned\n");
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_NO_EXCEPTIONS
}
-bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
+bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
-int uncaught_exceptions() _NOEXCEPT {
+int uncaught_exceptions() noexcept {
return __uncaught_exceptions();
}
#if !defined(_LIBCPP_ABI_VCRUNTIME)
-bad_cast::bad_cast() _NOEXCEPT
+bad_cast::bad_cast() noexcept
{
}
-bad_cast::~bad_cast() _NOEXCEPT
+bad_cast::~bad_cast() noexcept
{
}
const char *
-bad_cast::what() const _NOEXCEPT
+bad_cast::what() const noexcept
{
return "std::bad_cast";
}
-bad_typeid::bad_typeid() _NOEXCEPT
+bad_typeid::bad_typeid() noexcept
{
}
-bad_typeid::~bad_typeid() _NOEXCEPT
+bad_typeid::~bad_typeid() noexcept
{
}
const char *
-bad_typeid::what() const _NOEXCEPT
+bad_typeid::what() const noexcept
{
return "std::bad_typeid";
}
-exception::~exception() _NOEXCEPT
+exception::~exception() noexcept
{
}
-const char* exception::what() const _NOEXCEPT
+const char* exception::what() const noexcept
{
return "std::exception";
}
-bad_exception::~bad_exception() _NOEXCEPT
+bad_exception::~bad_exception() noexcept
{
}
-const char* bad_exception::what() const _NOEXCEPT
+const char* bad_exception::what() const noexcept
{
return "std::bad_exception";
}
-bad_alloc::bad_alloc() _NOEXCEPT
+bad_alloc::bad_alloc() noexcept
{
}
-bad_alloc::~bad_alloc() _NOEXCEPT
+bad_alloc::~bad_alloc() noexcept
{
}
const char*
-bad_alloc::what() const _NOEXCEPT
+bad_alloc::what() const noexcept
{
return "std::bad_alloc";
}
-bad_array_new_length::bad_array_new_length() _NOEXCEPT
+bad_array_new_length::bad_array_new_length() noexcept
{
}
-bad_array_new_length::~bad_array_new_length() _NOEXCEPT
+bad_array_new_length::~bad_array_new_length() noexcept
{
}
const char*
-bad_array_new_length::what() const _NOEXCEPT
+bad_array_new_length::what() const noexcept
{
return "bad_array_new_length";
}
namespace std {
-exception_ptr::~exception_ptr() _NOEXCEPT {
+exception_ptr::~exception_ptr() noexcept {
__cxa_decrement_exception_refcount(__ptr_);
}
-exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
+exception_ptr::exception_ptr(const exception_ptr& other) noexcept
: __ptr_(other.__ptr_)
{
__cxa_increment_exception_refcount(__ptr_);
}
-exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
+exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept
{
if (__ptr_ != other.__ptr_)
{
return *this;
}
-nested_exception::nested_exception() _NOEXCEPT
+nested_exception::nested_exception() noexcept
: __ptr_(current_exception())
{
}
-nested_exception::~nested_exception() _NOEXCEPT
+nested_exception::~nested_exception() noexcept
{
}
rethrow_exception(__ptr_);
}
-exception_ptr current_exception() _NOEXCEPT
+exception_ptr current_exception() noexcept
{
// be nicer if there was a constructor that took a ptr, then
// this whole function would be just:
{
void* __ptr_;
- exception_ptr(const exception_ptr&) _NOEXCEPT;
- exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
- ~exception_ptr() _NOEXCEPT;
+ exception_ptr(const exception_ptr&) noexcept;
+ exception_ptr& operator=(const exception_ptr&) noexcept;
+ ~exception_ptr() noexcept;
};
}
_LIBCPP_NORETURN void rethrow_exception(__exception_ptr::exception_ptr);
-exception_ptr::~exception_ptr() _NOEXCEPT
+exception_ptr::~exception_ptr() noexcept
{
reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr();
}
-exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
+exception_ptr::exception_ptr(const exception_ptr& other) noexcept
: __ptr_(other.__ptr_)
{
new (reinterpret_cast<void*>(this)) __exception_ptr::exception_ptr(
reinterpret_cast<const __exception_ptr::exception_ptr&>(other));
}
-exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
+exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept
{
*reinterpret_cast<__exception_ptr::exception_ptr*>(this) =
reinterpret_cast<const __exception_ptr::exception_ptr&>(other);
return *this;
}
-nested_exception::nested_exception() _NOEXCEPT
+nested_exception::nested_exception() noexcept
: __ptr_(current_exception())
{
}
namespace std {
-exception_ptr::exception_ptr() _NOEXCEPT { __ExceptionPtrCreate(this); }
-exception_ptr::exception_ptr(nullptr_t) _NOEXCEPT { __ExceptionPtrCreate(this); }
+exception_ptr::exception_ptr() noexcept { __ExceptionPtrCreate(this); }
+exception_ptr::exception_ptr(nullptr_t) noexcept { __ExceptionPtrCreate(this); }
-exception_ptr::exception_ptr(const exception_ptr& __other) _NOEXCEPT {
+exception_ptr::exception_ptr(const exception_ptr& __other) noexcept {
__ExceptionPtrCopy(this, &__other);
}
-exception_ptr& exception_ptr::operator=(const exception_ptr& __other) _NOEXCEPT {
+exception_ptr& exception_ptr::operator=(const exception_ptr& __other) noexcept {
__ExceptionPtrAssign(this, &__other);
return *this;
}
-exception_ptr& exception_ptr::operator=(nullptr_t) _NOEXCEPT {
+exception_ptr& exception_ptr::operator=(nullptr_t) noexcept {
exception_ptr dummy;
__ExceptionPtrAssign(this, &dummy);
return *this;
}
-exception_ptr::~exception_ptr() _NOEXCEPT { __ExceptionPtrDestroy(this); }
+exception_ptr::~exception_ptr() noexcept { __ExceptionPtrDestroy(this); }
-exception_ptr::operator bool() const _NOEXCEPT {
+exception_ptr::operator bool() const noexcept {
return __ExceptionPtrToBool(this);
}
-bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
+bool operator==(const exception_ptr& __x, const exception_ptr& __y) noexcept {
return __ExceptionPtrCompare(&__x, &__y);
}
-void swap(exception_ptr& lhs, exception_ptr& rhs) _NOEXCEPT {
+void swap(exception_ptr& lhs, exception_ptr& rhs) noexcept {
__ExceptionPtrSwap(&rhs, &lhs);
}
return __ret;
}
-exception_ptr current_exception() _NOEXCEPT {
+exception_ptr current_exception() noexcept {
exception_ptr __ret;
__ExceptionPtrCurrentException(&__ret);
return __ret;
_LIBCPP_NORETURN
void rethrow_exception(exception_ptr p) { __ExceptionPtrRethrow(&p); }
-nested_exception::nested_exception() _NOEXCEPT : __ptr_(current_exception()) {}
+nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {}
-nested_exception::~nested_exception() _NOEXCEPT {}
+nested_exception::~nested_exception() noexcept {}
_LIBCPP_NORETURN
void nested_exception::rethrow_nested() const {
namespace std {
-exception_ptr::~exception_ptr() _NOEXCEPT
+exception_ptr::~exception_ptr() noexcept
{
# warning exception_ptr not yet implemented
fprintf(stderr, "exception_ptr not yet implemented\n");
::abort();
}
-exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
+exception_ptr::exception_ptr(const exception_ptr& other) noexcept
: __ptr_(other.__ptr_)
{
# warning exception_ptr not yet implemented
::abort();
}
-exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
+exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept
{
# warning exception_ptr not yet implemented
fprintf(stderr, "exception_ptr not yet implemented\n");
::abort();
}
-nested_exception::nested_exception() _NOEXCEPT
+nested_exception::nested_exception() noexcept
: __ptr_(current_exception())
{
}
#if !defined(__GLIBCXX__)
-nested_exception::~nested_exception() _NOEXCEPT
+nested_exception::~nested_exception() noexcept
{
}
#endif // FIXME
}
-exception_ptr current_exception() _NOEXCEPT
+exception_ptr current_exception() noexcept
{
# warning exception_ptr not yet implemented
fprintf(stderr, "exception_ptr not yet implemented\n");
_LIBCPP_SAFE_STATIC static std::new_handler __new_handler;
new_handler
-set_new_handler(new_handler handler) _NOEXCEPT
+set_new_handler(new_handler handler) noexcept
{
return __libcpp_atomic_exchange(&__new_handler, handler);
}
new_handler
-get_new_handler() _NOEXCEPT
+get_new_handler() noexcept
{
return __libcpp_atomic_load(&__new_handler);
}
logic_error::logic_error(const char* msg) : __imp_(msg) {}
-logic_error::logic_error(const logic_error& le) _NOEXCEPT : __imp_(le.__imp_) {}
+logic_error::logic_error(const logic_error& le) noexcept : __imp_(le.__imp_) {}
-logic_error& logic_error::operator=(const logic_error& le) _NOEXCEPT {
+logic_error& logic_error::operator=(const logic_error& le) noexcept {
__imp_ = le.__imp_;
return *this;
}
runtime_error::runtime_error(const char* msg) : __imp_(msg) {}
-runtime_error::runtime_error(const runtime_error& re) _NOEXCEPT
+runtime_error::runtime_error(const runtime_error& re) noexcept
: __imp_(re.__imp_) {}
-runtime_error& runtime_error::operator=(const runtime_error& re) _NOEXCEPT {
+runtime_error& runtime_error::operator=(const runtime_error& re) noexcept {
__imp_ = re.__imp_;
return *this;
}
#if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
-const char* logic_error::what() const _NOEXCEPT { return __imp_.c_str(); }
+const char* logic_error::what() const noexcept { return __imp_.c_str(); }
-const char* runtime_error::what() const _NOEXCEPT { return __imp_.c_str(); }
+const char* runtime_error::what() const noexcept { return __imp_.c_str(); }
-logic_error::~logic_error() _NOEXCEPT {}
-domain_error::~domain_error() _NOEXCEPT {}
-invalid_argument::~invalid_argument() _NOEXCEPT {}
-length_error::~length_error() _NOEXCEPT {}
-out_of_range::~out_of_range() _NOEXCEPT {}
+logic_error::~logic_error() noexcept {}
+domain_error::~domain_error() noexcept {}
+invalid_argument::~invalid_argument() noexcept {}
+length_error::~length_error() noexcept {}
+out_of_range::~out_of_range() noexcept {}
-runtime_error::~runtime_error() _NOEXCEPT {}
-range_error::~range_error() _NOEXCEPT {}
-overflow_error::~overflow_error() _NOEXCEPT {}
-underflow_error::~underflow_error() _NOEXCEPT {}
+runtime_error::~runtime_error() noexcept {}
+range_error::~range_error() noexcept {}
+overflow_error::~overflow_error() noexcept {}
+underflow_error::~underflow_error() noexcept {}
#endif
#ifdef __sun__
-#include "support/solaris/xlocale.h"
+#include "__support/solaris/xlocale.h"
#include <stdarg.h>
#include <stdio.h>
#include <sys/localedef.h>
// -*- C++ -*-
-//===-------------------- support/win32/locale_win32.cpp ------------------===//
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// -*- C++ -*-
-//===----------------------- support/win32/support.h ----------------------===//
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
{
*sptr = NULL;
// Query the count required.
- int count = _vsnprintf( NULL, 0, format, ap );
+ va_list ap_copy;
+ va_copy(ap_copy, ap);
+ int count = _vsnprintf( NULL, 0, format, ap_copy );
+ va_end(ap_copy);
if (count < 0)
return count;
size_t buffer_size = static_cast<size_t>(count) + 1;
// -*- C++ -*-
-//===-------------------- support/win32/thread_win32.cpp ------------------===//
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//===----------------------------------------------------------------------===//
#include <__threading_support>
+#define NOMINMAX
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <process.h>
#include <fibersapi.h>
static_assert(sizeof(__libcpp_tls_key) == sizeof(DWORD), "");
static_assert(alignof(__libcpp_tls_key) == alignof(DWORD), "");
+static_assert(sizeof(__libcpp_semaphore_t) == sizeof(HANDLE), "");
+static_assert(alignof(__libcpp_semaphore_t) == alignof(HANDLE), "");
+
// Mutex
int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
{
void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns)
{
- using namespace chrono;
- // round-up to the nearest milisecond
- milliseconds __ms =
- duration_cast<milliseconds>(__ns + chrono::nanoseconds(999999));
+ // round-up to the nearest millisecond
+ chrono::milliseconds __ms = chrono::ceil<chrono::milliseconds>(__ns);
// FIXME(compnerd) this should be an alertable sleep (WFSO or SleepEx)
Sleep(__ms.count());
}
return 0;
}
+// Semaphores
+bool __libcpp_semaphore_init(__libcpp_semaphore_t* __sem, int __init)
+{
+ *(PHANDLE)__sem = CreateSemaphoreEx(nullptr, __init, _LIBCPP_SEMAPHORE_MAX,
+ nullptr, 0, SEMAPHORE_ALL_ACCESS);
+ return *__sem != nullptr;
+}
+
+bool __libcpp_semaphore_destroy(__libcpp_semaphore_t* __sem)
+{
+ CloseHandle(*(PHANDLE)__sem);
+ return true;
+}
+
+bool __libcpp_semaphore_post(__libcpp_semaphore_t* __sem)
+{
+ return ReleaseSemaphore(*(PHANDLE)__sem, 1, nullptr);
+}
+
+bool __libcpp_semaphore_wait(__libcpp_semaphore_t* __sem)
+{
+ return WaitForSingleObjectEx(*(PHANDLE)__sem, INFINITE, false) ==
+ WAIT_OBJECT_0;
+}
+
+bool __libcpp_semaphore_wait_timed(__libcpp_semaphore_t* __sem,
+ chrono::nanoseconds const& __ns)
+{
+ chrono::milliseconds __ms = chrono::ceil<chrono::milliseconds>(__ns);
+ return WaitForSingleObjectEx(*(PHANDLE)__sem, __ms.count(), false) ==
+ WAIT_OBJECT_0;
+}
+
_LIBCPP_END_NAMESPACE_STD
// class error_category
#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
-error_category::error_category() _NOEXCEPT
+error_category::error_category() noexcept
{
}
#endif
-error_category::~error_category() _NOEXCEPT
+error_category::~error_category() noexcept
{
}
error_condition
-error_category::default_error_condition(int ev) const _NOEXCEPT
+error_category::default_error_condition(int ev) const noexcept
{
return error_condition(ev, *this);
}
bool
-error_category::equivalent(int code, const error_condition& condition) const _NOEXCEPT
+error_category::equivalent(int code, const error_condition& condition) const noexcept
{
return default_error_condition(code) == condition;
}
bool
-error_category::equivalent(const error_code& code, int condition) const _NOEXCEPT
+error_category::equivalent(const error_code& code, int condition) const noexcept
{
return *this == code.category() && code.value() == condition;
}
: public __do_message
{
public:
- virtual const char* name() const _NOEXCEPT;
+ virtual const char* name() const noexcept;
virtual string message(int ev) const;
};
const char*
-__generic_error_category::name() const _NOEXCEPT
+__generic_error_category::name() const noexcept
{
return "generic";
}
#ifdef _LIBCPP_ELAST
if (ev > _LIBCPP_ELAST)
return string("unspecified generic_category error");
-#endif // _LIBCPP_ELAST
+#endif // _LIBCPP_ELAST
return __do_message::message(ev);
}
const error_category&
-generic_category() _NOEXCEPT
+generic_category() noexcept
{
static __generic_error_category s;
return s;
: public __do_message
{
public:
- virtual const char* name() const _NOEXCEPT;
+ virtual const char* name() const noexcept;
virtual string message(int ev) const;
- virtual error_condition default_error_condition(int ev) const _NOEXCEPT;
+ virtual error_condition default_error_condition(int ev) const noexcept;
};
const char*
-__system_error_category::name() const _NOEXCEPT
+__system_error_category::name() const noexcept
{
return "system";
}
#ifdef _LIBCPP_ELAST
if (ev > _LIBCPP_ELAST)
return string("unspecified system_category error");
-#endif // _LIBCPP_ELAST
+#endif // _LIBCPP_ELAST
return __do_message::message(ev);
}
error_condition
-__system_error_category::default_error_condition(int ev) const _NOEXCEPT
+__system_error_category::default_error_condition(int ev) const noexcept
{
#ifdef _LIBCPP_ELAST
if (ev > _LIBCPP_ELAST)
return error_condition(ev, system_category());
-#endif // _LIBCPP_ELAST
+#endif // _LIBCPP_ELAST
return error_condition(ev, generic_category());
}
const error_category&
-system_category() _NOEXCEPT
+system_category() noexcept
{
static __system_error_category s;
return s;
{
}
-system_error::~system_error() _NOEXCEPT
+system_error::~system_error() noexcept
{
}
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_ABI_VCRUNTIME)
#include <string.h>
-int std::type_info::__compare(const type_info &__rhs) const _NOEXCEPT {
+int std::type_info::__compare(const type_info &__rhs) const noexcept {
if (&__data == &__rhs.__data)
return 0;
return strcmp(&__data.__decorated_name[1], &__rhs.__data.__decorated_name[1]);
}
-const char *std::type_info::name() const _NOEXCEPT {
+const char *std::type_info::name() const noexcept {
// TODO(compnerd) cache demangled &__data.__decorated_name[1]
return &__data.__decorated_name[1];
}
-size_t std::type_info::hash_code() const _NOEXCEPT {
+size_t std::type_info::hash_code() const noexcept {
#if defined(_WIN64)
constexpr size_t fnv_offset_basis = 14695981039346656037ull;
constexpr size_t fnv_prime = 10995116282110ull;
--- /dev/null
+
+add_custom_target(libcxx-generate-public-header-transitive-inclusion-tests
+ COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_header_inclusion_tests.py"
+ COMMENT "Generate tests checking for mandated transitive includes in public headers.")
+
+add_custom_target(libcxx-generate-public-header-tests
+ COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_header_tests.py"
+ COMMENT "Generate tests for including public headers.")
+
+add_custom_target(libcxx-generate-feature-test-macros
+ COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_feature_test_macro_components.py"
+ COMMENT "Generate the <version> header and tests for feature test macros.")
+
+add_custom_target(libcxx-generate-private-header-tests
+ COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_private_header_tests.py"
+ COMMENT "Generates tests for ensuring detail headers are private")
+
+add_custom_target(libcxx-generate-files
+ DEPENDS libcxx-generate-public-header-transitive-inclusion-tests
+ libcxx-generate-public-header-tests
+ libcxx-generate-feature-test-macros
+ libcxx-generate-private-header-tests
+ COMMENT "Create all the auto-generated files in libc++ and its tests.")
--- /dev/null
+#===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===----------------------------------------------------------------------===##
+
+#
+# This Dockerfile describes the base image used to run the various libc++
+# build bots. By default, the image runs the Buildkite Agent, however one
+# can also just start the image with a shell to debug CI failures.
+#
+# To start a Buildkite Agent, run it as:
+# $ docker run --env-file <secrets> -it $(docker build -q .)
+#
+# The environment variables in `<secrets>` should be the ones necessary
+# to run a BuildKite agent.
+#
+# If you're only looking to run the Docker image locally for debugging a
+# build bot, see the `run-buildbot-container` script located in this directory.
+#
+# A pre-built version of this image is maintained on DockerHub as ldionne/libcxx-builder.
+# To update the image, rebuild it and push it to ldionne/libcxx-builder (which
+# will obviously only work if you have permission to do so).
+#
+# $ docker build -t ldionne/libcxx-builder .
+# $ docker push ldionne/libcxx-builder
+#
+
+FROM ubuntu:bionic
+
+# Make sure apt-get doesn't try to prompt for stuff like our time zone, etc.
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update && apt-get install -y bash curl
+
+# Install various tools used by the build or the test suite
+RUN apt-get update && apt-get install -y ninja-build python3 python3-sphinx python3-distutils git gdb
+RUN apt-get update && apt-get install -y libc6-dev-i386 # Required to cross-compile to 32 bits
+
+# Install Clang <latest>, <latest-1> and ToT, which are the ones we support.
+ENV LLVM_LATEST_VERSION=12
+RUN apt-get update && apt-get install -y lsb-release wget software-properties-common
+RUN wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
+RUN bash /tmp/llvm.sh $(($LLVM_LATEST_VERSION - 1)) # previous release
+RUN bash /tmp/llvm.sh $LLVM_LATEST_VERSION # latest release
+RUN bash /tmp/llvm.sh $(($LLVM_LATEST_VERSION + 1)) # current ToT
+
+# Make the ToT Clang the "default" compiler on the system
+RUN ln -fs /usr/bin/clang++-$(($LLVM_LATEST_VERSION + 1)) /usr/bin/c++ && [ -e $(readlink /usr/bin/c++) ]
+RUN ln -fs /usr/bin/clang-$(($LLVM_LATEST_VERSION + 1)) /usr/bin/cc && [ -e $(readlink /usr/bin/cc) ]
+
+# Install clang-format
+RUN apt-get install -y clang-format-$LLVM_LATEST_VERSION
+RUN ln -s /usr/bin/clang-format-$LLVM_LATEST_VERSION /usr/bin/clang-format && [ -e $(readlink /usr/bin/clang-format) ]
+RUN ln -s /usr/bin/git-clang-format-$LLVM_LATEST_VERSION /usr/bin/git-clang-format && [ -e $(readlink /usr/bin/git-clang-format) ]
+
+# Install the most recent GCC
+ENV GCC_LATEST_VERSION=11
+RUN add-apt-repository ppa:ubuntu-toolchain-r/test
+RUN apt-get update && apt install -y gcc-$GCC_LATEST_VERSION g++-$GCC_LATEST_VERSION
+
+# Install a recent CMake
+RUN wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.sh -O /tmp/install-cmake.sh
+RUN bash /tmp/install-cmake.sh --prefix=/usr --exclude-subdir --skip-license
+RUN rm /tmp/install-cmake.sh
+
+# Change the user to a non-root user, since some of the libc++ tests
+# (e.g. filesystem) require running as non-root. Also setup passwordless sudo.
+RUN apt-get update && apt-get install -y sudo
+RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
+RUN useradd --create-home libcxx-builder
+USER libcxx-builder
+WORKDIR /home/libcxx-builder
+
+# Install the Buildkite agent and dependencies. This must be done as non-root
+# for the Buildkite agent to be installed in a path where we can find it.
+RUN bash -c "$(curl -sL https://raw.githubusercontent.com/buildkite/agent/master/install.sh)"
+ENV PATH="${PATH}:/home/libcxx-builder/.buildkite-agent/bin"
+RUN echo "tags=\"queue=libcxx-builders,arch=$(uname -m),os=linux\"" >> "/home/libcxx-builder/.buildkite-agent/buildkite-agent.cfg"
+
+# By default, start the Buildkite agent (this requires a token).
+CMD buildkite-agent start
[-h|--help] Display this help and exit.
---llvm-root <DIR> Full path to the root of the LLVM monorepo. Only the libcxx
+--llvm-root <DIR> Path to the root of the LLVM monorepo. Only the libcxx
and libcxxabi directories are required.
---build-dir <DIR> Full path to the directory to use for building. This will
+--build-dir <DIR> Path to the directory to use for building. This will
contain intermediate build products.
---install-dir <DIR> Full path to the directory to install the library to.
+--install-dir <DIR> Path to the directory to install the library to.
---symbols-dir <DIR> Full path to the directory to install the .dSYM bundle to.
+--symbols-dir <DIR> Path to the directory to install the .dSYM bundle to.
--sdk <SDK> SDK used for building the library. This represents
the target platform that the library will run on.
created from that.
--version X[.Y[.Z]] The version of the library to encode in the dylib.
-
---cache <PATH> The CMake cache to use to control how the library gets built.
EOF
}
version="${2}"
shift; shift
;;
- --cache)
- cache="${2}"
- shift; shift
- ;;
*)
error "Unknown argument '${1}'"
;;
esac
done
-for arg in llvm_root build_dir symbols_dir install_dir sdk architectures version cache; do
+for arg in llvm_root build_dir symbols_dir install_dir sdk architectures version; do
if [ -z ${!arg+x} ]; then
error "Missing required argument '--${arg//_/-}'"
elif [ "${!arg}" == "" ]; then
fi
done
+# Allow using relative paths
+function realpath() {
+ if [[ $1 = /* ]]; then echo "$1"; else echo "$(pwd)/${1#./}"; fi
+}
+for arg in llvm_root build_dir symbols_dir install_dir; do
+ path="$(realpath "${!arg}")"
+ eval "${arg}=\"${path}\""
+done
+
function step() {
separator="$(printf "%0.s-" $(seq 1 ${#1}))"
echo
echo "${separator}"
}
-install_name_dir="/usr/lib"
-dylib_name="libc++.1.dylib"
-make_symlink="yes"
-headers_prefix="${install_dir}"
-
for arch in ${architectures}; do
step "Building libc++.dylib and libc++abi.dylib for architecture ${arch}"
mkdir -p "${build_dir}/${arch}"
-GNinja \
-DCMAKE_MAKE_PROGRAM="$(xcrun --sdk "${sdk}" --find ninja)" \
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
- -C "${cache}" \
+ -C "${llvm_root}/libcxx/cmake/caches/Apple.cmake" \
-DCMAKE_INSTALL_PREFIX="${build_dir}/${arch}-install" \
- -DCMAKE_INSTALL_NAME_DIR="${install_name_dir}" \
+ -DCMAKE_INSTALL_NAME_DIR="/usr/lib" \
-DCMAKE_OSX_ARCHITECTURES="${arch}" \
-DLIBCXXABI_LIBRARY_VERSION="${version}" \
- -DLIBCXX_INCLUDE_BENCHMARKS=OFF \
- -DLIBCXX_INCLUDE_TESTS=OFF
+ -DLIBCXX_INCLUDE_BENCHMARKS=OFF
)
xcrun --sdk "${sdk}" cmake --build "${build_dir}/${arch}" --target install-cxx install-cxxabi -- -v
cp "${build_dir}/${dylib}" "${symbols_dir}/${dylib}"
}
-universal_dylib ${dylib_name}
+universal_dylib libc++.1.dylib
universal_dylib libc++abi.dylib
-
-if [[ "${make_symlink}" == "yes" ]]; then
- (cd "${install_dir}/usr/lib" && ln -s "${dylib_name}" libc++.dylib)
-fi
+(cd "${install_dir}/usr/lib" && ln -s "libc++.1.dylib" libc++.dylib)
# Install the headers by copying the headers from one of the built architectures
# into the install directory. Headers from all architectures should be the same.
-step "Installing the libc++ and libc++abi headers to ${headers_prefix}/usr/include"
+step "Installing the libc++ and libc++abi headers to ${install_dir}/usr/include"
any_arch=$(echo ${architectures} | cut -d ' ' -f 1)
-mkdir -p "${headers_prefix}/usr/include"
-ditto "${build_dir}/${any_arch}-install/include" "${headers_prefix}/usr/include"
-ditto "${llvm_root}/libcxxabi/include" "${headers_prefix}/usr/include" # TODO: libcxxabi should install its headers in CMake
+mkdir -p "${install_dir}/usr/include"
+ditto "${build_dir}/${any_arch}-install/include" "${install_dir}/usr/include"
+ditto "${llvm_root}/libcxxabi/include" "${install_dir}/usr/include" # TODO: libcxxabi should install its headers in CMake
if [[ $EUID -eq 0 ]]; then # Only chown if we're running as root
- chown -R root:wheel "${headers_prefix}/usr/include"
+ chown -R root:wheel "${install_dir}/usr/include"
fi
step "Installing the libc++ and libc++abi licenses"
-mkdir -p "${headers_prefix}/usr/local/OpenSourceLicenses"
-cp "${llvm_root}/libcxx/LICENSE.TXT" "${headers_prefix}/usr/local/OpenSourceLicenses/libcxx.txt"
-cp "${llvm_root}/libcxxabi/LICENSE.TXT" "${headers_prefix}/usr/local/OpenSourceLicenses/libcxxabi.txt"
+mkdir -p "${install_dir}/usr/local/OpenSourceLicenses"
+cp "${llvm_root}/libcxx/LICENSE.TXT" "${install_dir}/usr/local/OpenSourceLicenses/libcxx.txt"
+cp "${llvm_root}/libcxxabi/LICENSE.TXT" "${install_dir}/usr/local/OpenSourceLicenses/libcxxabi.txt"
-# Also install a static archive for libc++abi
+# Also install universal static archives for libc++ and libc++abi
+libcxx_archives=$(for arch in ${architectures}; do echo "${build_dir}/${arch}-install/lib/libc++.a"; done)
libcxxabi_archives=$(for arch in ${architectures}; do echo "${build_dir}/${arch}-install/lib/libc++abi.a"; done)
-step "Creating a universal libc++abi static archive from the static archives for each architecture"
+step "Creating universal static archives for libc++ and libc++abi from the static archives for each architecture"
mkdir -p "${install_dir}/usr/local/lib/libcxx"
+xcrun --sdk "${sdk}" libtool -static ${libcxx_archives} -o "${install_dir}/usr/local/lib/libcxx/libc++-static.a"
xcrun --sdk "${sdk}" libtool -static ${libcxxabi_archives} -o "${install_dir}/usr/local/lib/libcxx/libc++abi-static.a"
--- /dev/null
+#!/usr/bin/env bash
+#===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===----------------------------------------------------------------------===##
+
+#
+# This file generates a Buildkite pipeline that triggers the libc++ CI
+# job(s) if needed.
+# See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format.
+#
+# Invoked by CI on pre-merge check for a commit.
+#
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+if ! git diff --name-only HEAD~1 | grep -q -E "libcxx/|libcxxabi/"; then
+ # libcxx is not affected
+ exit 0
+fi
+
+reviewID="$(git log --format=%B -n 1 | sed -nE 's/^Review-ID:[[:space:]]*(.+)$/\1/p')"
+if [[ "${reviewID}" != "" ]]; then
+ buildMessage="https://llvm.org/${reviewID}"
+else
+ buildMessage="Push to branch ${BUILDKITE_BRANCH}"
+fi
+
+
+cat <<EOF
+steps:
+ - trigger: "libcxx-ci"
+ build:
+ message: "${buildMessage}"
+ commit: "${BUILDKITE_COMMIT}"
+ branch: "${BUILDKITE_BRANCH}"
+EOF
+
+
--- /dev/null
+#!/usr/bin/env bash
+#===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===----------------------------------------------------------------------===##
+
+#
+# This file generates a Buildkite pipeline that triggers the libc++ CI jobs.
+# See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format.
+#
+# Invoked by CI on full builds.
+#
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+cat <<EOF
+steps:
+ - trigger: "libcxx-ci"
+ build:
+ message: "${BUILDKITE_MESSAGE}"
+ commit: "${BUILDKITE_COMMIT}"
+ branch: "${BUILDKITE_BRANCH}"
+EOF
--- /dev/null
+#===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===----------------------------------------------------------------------===##
+
+#
+# This file describes the various pre-commit CI bots used to test libc++.
+#
+# This file should never contain logic -- all the logic must be offloaded
+# into scripts. This is critical to being able to reproduce CI issues outside
+# of the CI environment, which is important for debugging.
+#
+# It is also worth noting that this script is split into several sections, the
+# goal being to reduce the load on testers when a commit is known to fail.
+#
+
+steps:
+ #
+ # Light pre-commit tests for things like formatting or when people forget
+ # to update generated files.
+ #
+ - label: "Format"
+ command: "libcxx/utils/ci/run-buildbot check-format"
+ artifact_paths:
+ - "**/clang-format.patch"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+ soft_fail:
+ - exit_status: 1
+
+ - label: "Generated output"
+ command: "libcxx/utils/ci/run-buildbot check-generated-output"
+ artifact_paths:
+ - "**/generated_output.patch"
+ - "**/generated_output.status"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ #
+ # General testing with the default configuration, under all the supported
+ # Standard modes, with Clang and GCC. This catches most issues upfront.
+ # The goal of this step is to catch most issues while being very fast.
+ #
+ - wait
+
+ - label: "C++2b"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx2b"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "C++20"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx20"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "C++17"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx17"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "C++14"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx14"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+ - label: "C++11"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx11"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "C++03"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx03"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "GCC 11 / C++latest"
+ command: "libcxx/utils/ci/run-buildbot generic-gcc"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ #
+ # All other supported configurations of libc++.
+ #
+ - wait
+
+ - label: "GCC 11 / C++11"
+ command: "libcxx/utils/ci/run-buildbot generic-gcc-cxx11"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Clang 11"
+ command: "libcxx/utils/ci/run-buildbot generic-clang-11"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Clang 12"
+ command: "libcxx/utils/ci/run-buildbot generic-clang-12"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "-fno-exceptions"
+ command: "libcxx/utils/ci/run-buildbot generic-noexceptions"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Modular build"
+ command: "libcxx/utils/ci/run-buildbot generic-modules"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Static libraries"
+ command: "libcxx/utils/ci/run-buildbot generic-static"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Assertions enabled"
+ command: "libcxx/utils/ci/run-buildbot generic-assertions"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Debug iterators"
+ command: "libcxx/utils/ci/run-buildbot generic-debug-iterators"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "ASAN"
+ command: "libcxx/utils/ci/run-buildbot generic-asan"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "TSAN"
+ command: "libcxx/utils/ci/run-buildbot generic-tsan"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "UBSAN"
+ command: "libcxx/utils/ci/run-buildbot generic-ubsan"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "With LLVM's libunwind"
+ command: "libcxx/utils/ci/run-buildbot generic-with_llvm_unwinder"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Single-threaded"
+ command: "libcxx/utils/ci/run-buildbot generic-singlethreaded"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "No debug mode"
+ command: "libcxx/utils/ci/run-buildbot generic-no-debug"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "No Filesystem"
+ command: "libcxx/utils/ci/run-buildbot generic-no-filesystem"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "No random device"
+ command: "libcxx/utils/ci/run-buildbot generic-no-random_device"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "No locale"
+ command: "libcxx/utils/ci/run-buildbot generic-no-localization"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Benchmarks"
+ command: "libcxx/utils/ci/run-buildbot benchmarks"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Documentation"
+ command: "libcxx/utils/ci/run-buildbot documentation"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Legacy Lit configuration"
+ command: "libcxx/utils/ci/run-buildbot legacy-test-config"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Legacy standalone build"
+ command: "libcxx/utils/ci/run-buildbot legacy-standalone"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Unified standalone build"
+ command: "libcxx/utils/ci/run-buildbot unified-standalone"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Runtimes build"
+ command: "libcxx/utils/ci/run-buildbot runtimes-build"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Windows (DLL)"
+ command: "bash libcxx/utils/ci/run-buildbot windows-dll"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "windows"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Windows (Static)"
+ command: "bash libcxx/utils/ci/run-buildbot windows-static"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "windows"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "32 bit"
+ command: "libcxx/utils/ci/run-buildbot generic-32bit"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "MacOS x86_64"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx20"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "macos"
+ arch: "x86_64"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "MacOS arm64"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx20"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "macos"
+ arch: "arm64"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ # Build with the configuration we use to generate libc++.dylib on Apple platforms
+ - label: "Apple system"
+ command: "libcxx/utils/ci/run-buildbot x86_64-apple-system"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "macos"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Apple system -fno-exceptions"
+ command: "libcxx/utils/ci/run-buildbot x86_64-apple-system-noexceptions"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "macos"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ # Test back-deployment to older Apple platforms
+ - label: "Apple back-deployment macosx10.9"
+ command: "libcxx/utils/ci/run-buildbot x86_64-apple-system-backdeployment-10.9"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "macos10.15" # TODO: For now, we're running the back-deployment tests for 10.9 on 10.15, because we don't have proper 10.9 machines
+ arch: "x86_64"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Apple back-deployment macosx10.15"
+ command: "libcxx/utils/ci/run-buildbot x86_64-apple-system-backdeployment-10.15"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "macos10.15"
+ arch: "x86_64"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "AArch64"
+ command: "libcxx/utils/ci/run-buildbot aarch64"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders-linaro-arm"
+ arch: "aarch64"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "AArch64 -fno-exceptions"
+ command: "libcxx/utils/ci/run-buildbot aarch64-noexceptions"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders-linaro-arm"
+ arch: "aarch64"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Armv8"
+ command: "libcxx/utils/ci/run-buildbot armv8"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders-linaro-arm"
+ arch: "armv8l"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Armv8 -fno-exceptions"
+ command: "libcxx/utils/ci/run-buildbot armv8-noexceptions"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders-linaro-arm"
+ arch: "armv8l"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Armv7"
+ command: "libcxx/utils/ci/run-buildbot armv7"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders-linaro-arm"
+ arch: "armv8l" # Compiling for v7, running on v8 hardware
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
+ - label: "Armv7 -fno-exceptions"
+ command: "libcxx/utils/ci/run-buildbot armv7-noexceptions"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders-linaro-arm"
+ arch: "armv8l" # Compiling for v7, running on v8 hardware
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
--- /dev/null
+#!/usr/bin/env bash
+
+# This simple script can be used to set up a CI node running MacOS.
+# An additional requirement that is *not* handled by this script is the
+# installation of Xcode, which requires manual intervention.
+#
+# This script should first be run from an administrator account to install
+# the dependencies necessary for running CI. It can be run without having
+# to clone the LLVM repository with:
+#
+# $ /bin/bash -c "$(curl -fsSl https://raw.githubusercontent.com/llvm/llvm-project/main/libcxx/utils/ci/macos-ci-setup)"
+#
+# Once the necessary dependencies have been installed, you can switch
+# to a non-administrator account and run the script again, passing the
+# --setup-launchd argument. That will install a Launchd agent to run the
+# BuildKite agent whenever the current user is logged in. You should enable
+# automatic login for that user, so that if the CI node goes down, the user
+# is logged back in automatically when the node goes up again, and the
+# BuildKite agent starts automatically.
+#
+# Alternatively, you can simply run the BuildKite agent by hand using:
+#
+# $ caffeinate -s buildkite-agent start --build-path /tmp/buildkite-builds
+
+set -e
+
+# Install a Launchd agent that will automatically start the BuildKite agent at login
+if [[ ${1} == "--setup-launchd" ]]; then
+ HOMEBREW_PREFIX="$(brew --prefix)"
+ mkdir -p ~/Library/LaunchAgents
+ cat <<EOF > ~/Library/LaunchAgents/libcxx.buildkite-agent.plist
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>libcxx.buildkite-agent</string>
+
+ <key>ProgramArguments</key>
+ <array>
+ <string>${HOMEBREW_PREFIX}/bin/buildkite-agent</string>
+ <string>start</string>
+ <string>--build-path</string>
+ <string>${HOME}/libcxx.buildkite-agent/builds</string>
+ </array>
+
+ <key>EnvironmentVariables</key>
+ <dict>
+ <key>PATH</key>
+ <string>${HOMEBREW_PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
+ </dict>
+
+ <key>RunAtLoad</key>
+ <true/>
+
+ <key>KeepAlive</key>
+ <dict>
+ <key>SuccessfulExit</key>
+ <false/>
+ </dict>
+
+ <key>ProcessType</key>
+ <string>Interactive</string>
+
+ <key>ThrottleInterval</key>
+ <integer>30</integer>
+
+ <key>StandardOutPath</key>
+ <string>${HOME}/libcxx.buildkite-agent/stdout.log</string>
+
+ <key>StandardErrorPath</key>
+ <string>${HOME}/libcxx.buildkite-agent/stderr.log</string>
+</dict>
+</plist>
+EOF
+
+ echo "Starting BuildKite agent"
+ launchctl load ~/Library/LaunchAgents/libcxx.buildkite-agent.plist
+
+else
+ echo "Installing CI dependencies for macOS"
+
+ if [[ -z "${BUILDKITE_AGENT_TOKEN}" ]]; then
+ echo "The BUILDKITE_AGENT_TOKEN environment variable must be set to a BuildKite Agent token when calling this script."
+ exit 1
+ fi
+
+ # Install Homebrew
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
+ HOMEBREW_PREFIX="$(brew --prefix)"
+
+ # Install the required tools to run CI
+ brew install sphinx-doc python3 ninja cmake clang-format buildkite/buildkite/buildkite-agent
+
+ # Setup BuildKite Agent config
+ version="$(sw_vers -productVersion | sed -E 's/([0-9]+).([0-9]+).[0-9]+/\1.\2/')"
+ arch="$(uname -m)"
+ sed -i '' "s/token=xxx/token=${BUILDKITE_AGENT_TOKEN}/g" "${HOMEBREW_PREFIX}/etc/buildkite-agent/buildkite-agent.cfg"
+ echo "tags=\"queue=libcxx-builders,arch=${arch},os=macos,os=macos${version}\"" >> "${HOMEBREW_PREFIX}/etc/buildkite-agent/buildkite-agent.cfg"
+fi
--- /dev/null
+#!/bin/bash -eu
+
+#
+# This script runs the continuous fuzzing tests on OSS-Fuzz.
+#
+
+if [[ ${SANITIZER} = *undefined* ]]; then
+ CXXFLAGS="${CXXFLAGS} -fsanitize=unsigned-integer-overflow -fsanitize-trap=unsigned-integer-overflow"
+fi
+
+BUILD=cxx_build_dir
+INSTALL=cxx_install_dir
+
+mkdir ${BUILD}
+cmake -S ${PWD} -B ${BUILD} \
+ -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX="${INSTALL}"
+cmake --build ${BUILD} --target install-cxx-headers
+
+for test in libcxx/test/libcxx/fuzzing/*.pass.cpp; do
+ exe="$(basename ${test})"
+ exe="${exe%.pass.cpp}"
+ ${CXX} ${CXXFLAGS} \
+ -std=c++14 \
+ -DLIBCPP_OSS_FUZZ \
+ -D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS \
+ -nostdinc++ -cxx-isystem ${INSTALL}/include/c++/v1 \
+ -lpthread -ldl \
+ -o "${OUT}/${exe}" \
+ ${test} \
+ ${LIB_FUZZING_ENGINE}
+done
--- /dev/null
+#!/usr/bin/env bash
+#===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===----------------------------------------------------------------------===##
+
+set -ex
+set -o pipefail
+unset LANG
+unset LC_ALL
+unset LC_COLLATE
+
+PROGNAME="$(basename "${0}")"
+
+function usage() {
+cat <<EOF
+Usage:
+${PROGNAME} [options] <BUILDER>
+
+[-h|--help] Display this help and exit.
+
+--llvm-root <DIR> Path to the root of the LLVM monorepo. By default, we try
+ to figure it out based on the current working directory.
+
+--build-dir <DIR> The directory to use for building the library. By default,
+ this is '<llvm-root>/build/<builder>'.
+
+--osx-roots <DIR> Path to pre-downloaded macOS dylibs. By default, we download
+ them from Green Dragon. This is only relevant at all when
+ running back-deployment testing if one wants to override
+ the old dylibs we use to run the tests with different ones.
+EOF
+}
+
+while [[ $# -gt 0 ]]; do
+ case ${1} in
+ -h|--help)
+ usage
+ exit 0
+ ;;
+ --llvm-root)
+ MONOREPO_ROOT="${2}"
+ shift; shift
+ ;;
+ --build-dir)
+ BUILD_DIR="${2}"
+ shift; shift
+ ;;
+ --osx-roots)
+ OSX_ROOTS="${2}"
+ shift; shift
+ ;;
+ *)
+ BUILDER="${1}"
+ shift
+ ;;
+ esac
+done
+
+MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
+BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}"
+INSTALL_DIR="${BUILD_DIR}/install"
+
+# If we can find Ninja/CMake provided by Xcode, use those since we know their
+# version will generally work with the Clang shipped in Xcode (e.g. if Clang
+# knows about -std=c++20, the CMake bundled in Xcode will probably know about
+# that flag too).
+if xcrun --find ninja &>/dev/null; then NINJA="$(xcrun --find ninja)"; else NINJA="ninja"; fi
+if xcrun --find cmake &>/dev/null; then CMAKE="$(xcrun --find cmake)"; else CMAKE="cmake"; fi
+
+function clean() {
+ rm -rf "${BUILD_DIR}"
+}
+
+function generate-cmake-base() {
+ echo "--- Generating CMake"
+ ${CMAKE} \
+ -B "${BUILD_DIR}" \
+ -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+ -DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \
+ "${@}"
+}
+
+function generate-cmake() {
+ generate-cmake-base \
+ -S "${MONOREPO_ROOT}/llvm" \
+ -DLLVM_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \
+ -DLIBCXX_CXX_ABI=libcxxabi \
+ "${@}"
+}
+
+function generate-cmake-libcxx-win() {
+ # TODO: Clang-cl in MSVC configurations don't have access to compiler_rt
+ # builtins helpers for int128 division. See
+ # https://reviews.llvm.org/D91139#2429595 for a comment about longterm
+ # intent for handling the issue. In the meantime, define
+ # -D_LIBCPP_HAS_NO_INT128 (both when building the library itself and
+ # when building tests) to allow enabling filesystem for running tests,
+ # even if it uses a non-permanent ABI.
+
+ generate-cmake-base \
+ -S "${MONOREPO_ROOT}/libcxx" \
+ -DCMAKE_C_COMPILER=clang-cl \
+ -DCMAKE_CXX_COMPILER=clang-cl \
+ -DLIBCXX_ENABLE_FILESYSTEM=YES \
+ -DCMAKE_CXX_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
+ -DLIBCXX_TEST_COMPILER_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
+ "${@}"
+}
+
+function check-cxx-cxxabi() {
+ echo "--- Installing libc++ and libc++abi to a fake location"
+ ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi
+
+ echo "+++ Running the libc++ tests"
+ ${NINJA} -vC "${BUILD_DIR}" check-cxx
+
+ echo "+++ Running the libc++abi tests"
+ ${NINJA} -vC "${BUILD_DIR}" check-cxxabi
+}
+
+# TODO: The goal is to test this against all configurations. We should also move
+# this to the Lit test suite instead of being a separate CMake target.
+function check-abi-list() {
+ echo "+++ Running the libc++ ABI list test"
+ ${NINJA} -vC "${BUILD_DIR}" check-cxx-abilist || (
+ echo "+++ Generating the libc++ ABI list after failed check"
+ ${NINJA} -vC "${BUILD_DIR}" generate-cxx-abilist
+ false
+ )
+}
+
+function check-cxx-benchmarks() {
+ echo "--- Running the benchmarks"
+ ${NINJA} -vC "${BUILD_DIR}" check-cxx-benchmarks
+}
+
+# Print the version of a few tools to aid diagnostics in some cases
+${CMAKE} --version
+${NINJA} --version
+
+case "${BUILDER}" in
+check-format)
+ clean
+ echo "+++ Checking formatting"
+ # We need to set --extensions so that clang-format checks extensionless files.
+ mkdir -p ${BUILD_DIR}
+ git-clang-format \
+ --binary /usr/bin/clang-format --diff \
+ --extensions ',h,hh,hpp,hxx,c,cc,cxx,cpp' HEAD~1 \
+ -- \
+ libcxx/{benchmarks,include,src,test} \
+ libcxxabi/{fuzz,include,src,test} \
+ | tee ${BUILD_DIR}/clang-format.patch
+ # Check if the diff is empty, fail otherwise.
+ ! grep -q '^--- a' ${BUILD_DIR}/clang-format.patch
+;;
+check-generated-output)
+ # `! foo` doesn't work properly with `set -e`, use `! foo || false` instead.
+ # https://stackoverflow.com/questions/57681955/set-e-does-not-respect-logical-not
+ clean
+ generate-cmake
+
+ # Reject patches that forgot to re-run the generator scripts.
+ echo "+++ Making sure the generator scripts were run"
+ ${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files
+ git diff | tee ${BUILD_DIR}/generated_output.patch
+ git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status
+ ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
+ if [ -s ${BUILD_DIR}/generated_output.status ]; then
+ echo "It looks like not all the generator scripts were run,"
+ echo "did you forget to build the libcxx-generate-files target?"
+ echo "Did you add all new files it generated?"
+ false
+ fi
+
+ # Reject patches that introduce non-ASCII characters or hard tabs.
+ # Depends on LC_COLLATE set at the top of this script.
+ ! grep -rn '[^ -~]' libcxx/include/ || false
+
+ # Reject patches that introduce dependency cycles in the headers.
+ python3 libcxx/utils/graph_header_deps.py >/dev/null
+;;
+generic-cxx03)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
+ -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
+ check-cxx-cxxabi
+ check-abi-list
+;;
+generic-cxx11)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
+ -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
+ check-cxx-cxxabi
+ check-abi-list
+;;
+generic-cxx14)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \
+ -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
+ check-cxx-cxxabi
+ check-abi-list
+;;
+generic-cxx17)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \
+ -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
+ check-cxx-cxxabi
+ check-abi-list
+;;
+generic-cxx20)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \
+ -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
+ check-cxx-cxxabi
+ check-abi-list
+;;
+generic-cxx2b)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \
+ -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
+ check-cxx-cxxabi
+ check-abi-list
+;;
+generic-assertions)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake"
+ check-cxx-cxxabi
+ check-abi-list
+;;
+generic-debug-iterators)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake"
+ check-cxx-cxxabi
+ check-abi-list
+;;
+generic-noexceptions)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake"
+ check-cxx-cxxabi
+;;
+generic-modules)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake"
+ check-cxx-cxxabi
+;;
+generic-static)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \
+ -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-static.cfg.in"
+ check-cxx-cxxabi
+;;
+generic-32bit)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-32bits.cmake"
+ check-cxx-cxxabi
+;;
+generic-clang-11)
+ export CC=clang-11
+ export CXX=clang++-11
+ clean
+ generate-cmake
+ check-cxx-cxxabi
+;;
+generic-clang-12)
+ export CC=clang-12
+ export CXX=clang++-12
+ clean
+ generate-cmake
+ check-cxx-cxxabi
+;;
+generic-gcc)
+ export CC=gcc-11
+ export CXX=g++-11
+ clean
+ generate-cmake
+ check-cxx-cxxabi
+;;
+generic-gcc-cxx11)
+ export CC=gcc-11
+ export CXX=g++-11
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
+ check-cxx-cxxabi
+;;
+generic-asan)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake"
+ check-cxx-cxxabi
+;;
+generic-msan)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake"
+ check-cxx-cxxabi
+;;
+generic-tsan)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake"
+ check-cxx-cxxabi
+;;
+generic-ubsan)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake"
+ check-cxx-cxxabi
+;;
+generic-with_llvm_unwinder)
+ clean
+ generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON
+ check-cxx-cxxabi
+;;
+generic-singlethreaded)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake"
+ check-cxx-cxxabi
+;;
+generic-no-debug)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake"
+ check-cxx-cxxabi
+;;
+generic-no-filesystem)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake"
+ check-cxx-cxxabi
+;;
+generic-no-random_device)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake"
+ check-cxx-cxxabi
+;;
+generic-no-localization)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake"
+ check-cxx-cxxabi
+;;
+x86_64-apple-system)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake"
+ check-cxx-cxxabi
+;;
+x86_64-apple-system-noexceptions)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
+ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
+ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
+ check-cxx-cxxabi
+;;
+x86_64-apple-system-backdeployment-*)
+ clean
+
+ if [[ "${OSX_ROOTS}" == "" ]]; then
+ echo "--- Downloading previous macOS dylibs"
+ PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/liu4fmc53qzlfly/libcxx-roots.tar.gz"
+ OSX_ROOTS="${BUILD_DIR}/macos-roots"
+ mkdir -p "${OSX_ROOTS}"
+ curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
+ fi
+
+ DEPLOYMENT_TARGET="${BUILDER#x86_64-apple-system-backdeployment-}"
+
+ # TODO: On Apple platforms, we never produce libc++abi.1.dylib, always libc++abi.dylib.
+ # Fix that in the build so that the tests stop searching for @rpath/libc++abi.1.dylib.
+ cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
+ "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
+
+ PARAMS="target_triple=x86_64-apple-macosx${DEPLOYMENT_TARGET}"
+ PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
+ PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
+ PARAMS+=";use_system_cxx_lib=True"
+
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
+ -DLIBCXX_TEST_PARAMS="${PARAMS}" \
+ -DLIBCXXABI_TEST_PARAMS="${PARAMS}"
+
+ check-cxx-cxxabi
+;;
+benchmarks)
+ clean
+ generate-cmake
+ check-cxx-benchmarks
+;;
+documentation)
+ clean
+ generate-cmake -DLLVM_ENABLE_SPHINX=ON
+
+ echo "+++ Generating documentation"
+ ${NINJA} -vC "${BUILD_DIR}" docs-libcxx-html
+;;
+unified-standalone)
+
+ clean
+
+ echo "--- Generating CMake"
+ ${CMAKE} \
+ -S "${MONOREPO_ROOT}/libcxx/utils/ci/runtimes" \
+ -B "${BUILD_DIR}" \
+ -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+ -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind"
+
+ check-cxx-cxxabi
+;;
+runtimes-build)
+ clean
+
+ echo "--- Generating CMake"
+ # TODO: We currently enable modules and assertions in the runtimes build
+ # because that provides coverage for some specific Clang failures
+ # we've been seeing recently, however it would be better to instead
+ # run all CI configurations against a Clang that has assertions enabled.
+ ${CMAKE} \
+ -S "${MONOREPO_ROOT}/llvm" \
+ -B "${BUILD_DIR}" \
+ -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+ -DLLVM_ENABLE_PROJECTS="clang" \
+ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
+ -DLLVM_RUNTIME_TARGETS="x86_64-unknown-linux-gnu" \
+ -DLLVM_ENABLE_ASSERTIONS=ON \
+ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake"
+
+ echo "+++ Running the libc++ and libc++abi tests"
+ ${NINJA} -C "${BUILD_DIR}" check-runtimes
+
+ echo "--- Installing libc++ and libc++abi to a fake location"
+ ${NINJA} -C "${BUILD_DIR}" install-runtimes
+;;
+legacy-test-config)
+ clean
+ generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/legacy.cfg.in"
+ check-cxx-cxxabi
+;;
+legacy-standalone)
+ clean
+
+ echo "--- Generating CMake"
+ ${CMAKE} \
+ -S "${MONOREPO_ROOT}/libcxx" \
+ -B "${BUILD_DIR}/libcxx" \
+ -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+ -DLLVM_PATH="${MONOREPO_ROOT}/llvm" \
+ -DLIBCXX_CXX_ABI=libcxxabi \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${MONOREPO_ROOT}/libcxxabi/include" \
+ -DLIBCXX_CXX_ABI_LIBRARY_PATH="${BUILD_DIR}/libcxxabi/lib"
+
+ ${CMAKE} \
+ -S "${MONOREPO_ROOT}/libcxxabi" \
+ -B "${BUILD_DIR}/libcxxabi" \
+ -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+ -DLLVM_PATH="${MONOREPO_ROOT}/llvm" \
+ -DLIBCXXABI_LIBCXX_PATH="${MONOREPO_ROOT}/libcxx" \
+ -DLIBCXXABI_LIBCXX_INCLUDES="${BUILD_DIR}/libcxx/include/c++/v1" \
+ -DLIBCXXABI_LIBCXX_LIBRARY_PATH="${BUILD_DIR}/libcxx/lib"
+
+ echo "+++ Generating libc++ headers"
+ ${NINJA} -vC "${BUILD_DIR}/libcxx" generate-cxx-headers
+
+ echo "+++ Building libc++abi"
+ ${NINJA} -vC "${BUILD_DIR}/libcxxabi" cxxabi
+
+ echo "+++ Building libc++"
+ ${NINJA} -vC "${BUILD_DIR}/libcxx" cxx
+
+ echo "+++ Running the libc++ tests"
+ ${NINJA} -vC "${BUILD_DIR}/libcxx" check-cxx
+
+ echo "+++ Running the libc++abi tests"
+ ${NINJA} -vC "${BUILD_DIR}/libcxxabi" check-cxxabi
+;;
+aarch64)
+ export CC=/usr/local/bin/cc
+ export CXX=/usr/local/bin/c++
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake"
+ check-cxx-cxxabi
+;;
+aarch64-noexceptions)
+ export CC=/usr/local/bin/cc
+ export CXX=/usr/local/bin/c++
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
+ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
+ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
+ check-cxx-cxxabi
+;;
+# Aka Armv8 32 bit
+armv8)
+ export CC=/usr/local/bin/cc
+ export CXX=/usr/local/bin/c++
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake"
+ check-cxx-cxxabi
+;;
+armv8-noexceptions)
+ export CC=/usr/local/bin/cc
+ export CXX=/usr/local/bin/c++
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake"
+ check-cxx-cxxabi
+;;
+# Armv7 32 bit. One building Arm only one Thumb only code.
+armv7)
+ export CC=/usr/local/bin/cc
+ export CXX=/usr/local/bin/c++
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake"
+ check-cxx-cxxabi
+;;
+armv7-noexceptions)
+ export CC=/usr/local/bin/cc
+ export CXX=/usr/local/bin/c++
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake"
+ check-cxx-cxxabi
+;;
+windows-dll)
+ clean
+ # TODO: Currently, building with the experimental library breaks running
+ # tests (the test linking look for the c++experimental library with the
+ # wrong name, and the statically linked c++experimental can't be linked
+ # correctly when libc++ visibility attributes indicate dllimport linkage
+ # anyway), thus just disable the experimental library. Remove this
+ # setting when cmake and the test driver does the right thing automatically.
+ generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
+ echo "+++ Running the libc++ tests"
+ ${NINJA} -vC "${BUILD_DIR}" check-cxx
+;;
+windows-static)
+ clean
+ generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF
+ echo "+++ Running the libc++ tests"
+ ${NINJA} -vC "${BUILD_DIR}" check-cxx
+;;
+#################################################################
+# Insert vendor-specific internal configurations below.
+#
+# This allows vendors to extend this file with their own internal
+# configurations without running into merge conflicts with upstream.
+#################################################################
+
+#################################################################
+*)
+ echo "${BUILDER} is not a known configuration"
+ exit 1
+;;
+esac
--- /dev/null
+#!/usr/bin/env bash
+
+# This script starts a shell in a container running the libc++ build bot Docker
+# image. That image emulates the environment used by libc++'s Linux builders on
+# BuildKite.
+#
+# Once you're inside the shell, you can run the various build jobs with the
+# `run-buildbot` script.
+#
+# This script must be run from within the LLVM monorepo. Furthermore, the
+# monorepo will be mounted as `/llvm` inside the container. Be careful, the
+# state in `/llvm` is shared between the container and the host machine, which
+# is useful for editing files on the host machine and re-running the build bot
+# in the container.
+
+set -e
+
+MONOREPO_ROOT="$(git rev-parse --show-toplevel)"
+if [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci" ]]; then
+ echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"
+ exit 1
+fi
+docker pull ldionne/libcxx-builder
+docker run -it --volume "${MONOREPO_ROOT}:/llvm" --workdir "/llvm" ldionne/libcxx-builder bash
-cmake_minimum_required(VERSION 3.4.3)
+cmake_minimum_required(VERSION 3.13.4)
+project(LLVM_RUNTIMES C CXX ASM)
-if(POLICY CMP0068)
- cmake_policy(SET CMP0068 NEW)
- set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
-endif()
+find_package(Python3 COMPONENTS Interpreter)
+if(NOT Python3_Interpreter_FOUND)
+ message(WARNING "Python3 not found, using python2 as a fallback")
+ find_package(Python2 COMPONENTS Interpreter REQUIRED)
+ if(Python2_VERSION VERSION_LESS 2.7)
+ message(SEND_ERROR "Python 2.7 or newer is required")
+ endif()
-if(POLICY CMP0075)
- cmake_policy(SET CMP0075 NEW)
+ # Treat python2 as python3
+ add_executable(Python3::Interpreter IMPORTED)
+ set_target_properties(Python3::Interpreter PROPERTIES
+ IMPORTED_LOCATION ${Python2_EXECUTABLE})
+ set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
endif()
-if(POLICY CMP0077)
- cmake_policy(SET CMP0077 NEW)
-endif()
+# This needs to be set before we add any Lit target for `add_lit_target` to
+# select the right Lit to run the tests.
+set(LLVM_LIT_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin")
-set(PACKAGE_VERSION "11.0.0git")
+# Automatically define a few variables that are normally set globally by LLVM.
+# This is to keep some amount of similarity between the global LLVM build and
+# this minimal build.
+set(LLVM_UMBRELLA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../..")
+list(APPEND CMAKE_MODULE_PATH "${LLVM_UMBRELLA_ROOT}/libcxx/cmake/Modules")
+include(HandleOutOfTreeLLVM)
-project(LLVM_RUNTIMES)
+# Override the external Lit to make sure we use the one we generate below.
+# TODO: We can remove this once we start relying on the in-tree version of Lit
+# in HandleOutOfTreeLLVM.
+set(LLVM_DEFAULT_EXTERNAL_LIT "")
-# Include individual projects
+# Include individual runtime projects
set(LLVM_ENABLE_PROJECTS "" CACHE STRING "Semicolon-separated list of runtimes to build.")
-
-set(LLVM_UMBRELLA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../..")
foreach(project IN LISTS LLVM_ENABLE_PROJECTS)
- add_subdirectory("${LLVM_UMBRELLA_ROOT}/${project}" "${CMAKE_CURRENT_BINARY_DIR}/${project}")
+ add_subdirectory("${LLVM_UMBRELLA_ROOT}/${project}" "${CMAKE_CURRENT_BINARY_DIR}/${project}")
endforeach()
+
+# Generate the llvm-lit wrapper, needed for testing. This must be done after
+# the projects have been added, since the wraper is only generated correctly
+# if the test suites have already been added with add_lit_target.
+add_subdirectory("${LLVM_UMBRELLA_ROOT}/llvm/utils/llvm-lit" "${CMAKE_CURRENT_BINARY_DIR}/llvm-lit")
from __future__ import print_function
+import math
import re
import gdb
def __next__(self):
# child_iter raises StopIteration when appropriate.
- field_name = self.child_iter.next()
+ field_name = next(self.child_iter)
child = self.val["__base_"][field_name]["__value_"]
self.count += 1
return ("[%d]" % self.count, child)
return "%s is nullptr" % typename
refcount = self.val["__cntrl_"]
if refcount != 0:
- usecount = refcount["__shared_owners_"] + 1
- weakcount = refcount["__shared_weak_owners_"]
- if usecount == 0:
- state = "expired, weak %d" % weakcount
- else:
- state = "count %d, weak %d" % (usecount, weakcount)
+ try:
+ usecount = refcount["__shared_owners_"] + 1
+ weakcount = refcount["__shared_weak_owners_"]
+ if usecount == 0:
+ state = "expired, weak %d" % weakcount
+ else:
+ state = "count %d, weak %d" % (usecount, weakcount)
+ except:
+ # Debug info for a class with virtual functions is emitted
+ # in the same place as its key function. That means that
+ # for std::shared_ptr, __shared_owners_ is emitted into
+ # into libcxx.[so|a] itself, rather than into the shared_ptr
+ # instantiation point. So if libcxx.so was built without
+ # debug info, these fields will be missing.
+ state = "count ?, weak ? (libc++ missing debug info)"
return "%s<%s> %s containing" % (typename, pointee_type, state)
def __iter__(self):
self.val = val
self.n_words = int(self.val["__n_words"])
self.bits_per_word = int(self.val["__bits_per_word"])
+ self.bit_count = self.val.type.template_argument(0)
if self.n_words == 1:
self.values = [int(self.val["__first_"])]
else:
typename = _prettify_typename(self.val.type)
return "%s" % typename
- def _byte_it(self, value):
- index = -1
- while value:
- index += 1
- will_yield = value % 2
- value /= 2
- if will_yield:
- yield index
-
def _list_it(self):
- for word_index in range(self.n_words):
- current = self.values[word_index]
- if current:
- for n in self._byte_it(current):
- yield ("[%d]" % (word_index * self.bits_per_word + n), 1)
+ for bit in range(self.bit_count):
+ word = bit // self.bits_per_word
+ word_bit = bit % self.bits_per_word
+ if self.values[word] & (1 << word_bit):
+ yield ("[%d]" % bit, 1)
def __iter__(self):
return self._list_it()
--- /dev/null
+#!/usr/bin/env python
+#===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===----------------------------------------------------------------------===##
+
+import argparse
+import io
+import libcxx.sym_check.extract
+import libcxx.sym_check.util
+import pprint
+import sys
+
+def OutputFile(file):
+ if isinstance(file, io.IOBase):
+ return file
+ assert isinstance(file, str), "Got object {} which is not a str".format(file)
+ return open(file, 'w', newline='\n')
+
+def main(argv):
+ parser = argparse.ArgumentParser(
+ description='Extract a list of symbols from a shared library.')
+ parser.add_argument('library', metavar='LIB', type=str,
+ help='The library to extract symbols from.')
+ parser.add_argument('-o', '--output', dest='output', type=OutputFile, default=sys.stdout,
+ help='The output file to write the symbols to. It is overwritten if it already exists. '
+ 'If no file is specified, the results are written to standard output.')
+ args = parser.parse_args(argv)
+
+ symbols = libcxx.sym_check.extract.extract_symbols(args.library)
+ symbols, _ = libcxx.sym_check.util.filter_stdlib_symbols(symbols)
+
+ lines = [pprint.pformat(sym, width=99999) for sym in symbols]
+ args.output.writelines('\n'.join(sorted(lines)))
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
#!/usr/bin/env python
import os
-import tempfile
-from builtins import int, range
+from builtins import range
from functools import reduce
def get_libcxx_paths():
assert os.path.exists(os.path.join(macro_test_path, 'version.version.pass.cpp'))
return script_name, src_root, include_path, docs_path, macro_test_path
-
script_name, source_root, include_path, docs_path, macro_test_path = get_libcxx_paths()
def has_header(h):
return os.path.exists(h_path)
def add_version_header(tc):
- tc["headers"].append("version")
- return tc
-
-feature_test_macros = sorted([ add_version_header(x) for x in [
- # C++14 macros
- {"name": "__cpp_lib_integer_sequence",
- "values": {
- "c++14": int(201304)
- },
+ tc["headers"].append("version")
+ return tc
+
+# ================ ============================================================
+# Field Description
+# ================ ============================================================
+# name The name of the feature-test macro.
+# values A dict whose keys are C++ versions and whose values are the
+# value of the feature-test macro for that C++ version.
+# (TODO: This isn't a very clean model for feature-test
+# macros affected by multiple papers.)
+# headers An array with the headers that should provide the
+# feature-test macro.
+# test_suite_guard An optional string field. When this field is provided,
+# `libcxx_guard` must also be provided. This field is used
+# only to generate the unit tests for the feature-test macros.
+# It can't depend on macros defined in <__config> because the
+# `test/std/` parts of the test suite are intended to be
+# portable to any C++ standard library implementation, not
+# just libc++. It may depend on
+# * macros defined by the compiler itself, or
+# * macros generated by CMake.
+# In some cases we add
+# `&& !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM_...)`
+# in order to make libc++ pass the tests on OSX; see D94983.
+# libcxx_guard An optional string field. When this field is provided,
+# `test_suite_guard` must also be provided. This field is used
+# only to guard the feature-test macro in <version>. It may
+# be the same as `test_suite_guard`, or it may depend on
+# macros defined in <__config>.
+# unimplemented An optional Boolean field with the value `True`. This field
+# is only used when a feature isn't fully implemented. Once
+# you've fully implemented the feature, you should remove
+# this field.
+# ================ ============================================================
+feature_test_macros = [ add_version_header(x) for x in [
+ {
+ "name": "__cpp_lib_addressof_constexpr",
+ "values": { "c++17": 201603 },
+ "headers": ["memory"],
+ "test_suite_guard": "TEST_HAS_BUILTIN(__builtin_addressof) || TEST_GCC_VER >= 700",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_BUILTIN_ADDRESSOF)",
+ }, {
+ "name": "__cpp_lib_allocator_traits_is_always_equal",
+ "values": { "c++17": 201411 },
+ "headers": ["deque", "forward_list", "list", "map", "memory", "scoped_allocator", "set", "string", "unordered_map", "unordered_set", "vector"],
+ }, {
+ "name": "__cpp_lib_any",
+ "values": { "c++17": 201606 },
+ "headers": ["any"],
+ }, {
+ "name": "__cpp_lib_apply",
+ "values": { "c++17": 201603 },
+ "headers": ["tuple"],
+ }, {
+ "name": "__cpp_lib_array_constexpr",
+ "values": { "c++17": 201603, "c++20": 201811 },
+ "headers": ["array", "iterator"],
+ }, {
+ "name": "__cpp_lib_as_const",
+ "values": { "c++17": 201510 },
+ "headers": ["utility"],
+ }, {
+ "name": "__cpp_lib_assume_aligned",
+ "values": { "c++20": 201811 },
+ "headers": ["memory"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_atomic_flag_test",
+ "values": { "c++20": 201907 },
+ "headers": ["atomic"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ }, {
+ "name": "__cpp_lib_atomic_float",
+ "values": { "c++20": 201711 },
+ "headers": ["atomic"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_atomic_is_always_lock_free",
+ "values": { "c++17": 201603 },
+ "headers": ["atomic"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ }, {
+ "name": "__cpp_lib_atomic_lock_free_type_aliases",
+ "values": { "c++20": 201907 },
+ "headers": ["atomic"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ }, {
+ "name": "__cpp_lib_atomic_ref",
+ "values": { "c++20": 201806 },
+ "headers": ["atomic"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_atomic_shared_ptr",
+ "values": { "c++20": 201711 },
+ "headers": ["atomic"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_atomic_value_initialization",
+ "values": { "c++20": 201911 },
+ "headers": ["atomic", "memory"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ }, {
+ "name": "__cpp_lib_atomic_wait",
+ "values": { "c++20": 201907 },
+ "headers": ["atomic"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)",
+ }, {
+ "name": "__cpp_lib_barrier",
+ "values": { "c++20": 201907 },
+ "headers": ["barrier"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)",
+ }, {
+ "name": "__cpp_lib_bind_front",
+ "values": { "c++20": 201907 },
+ "headers": ["functional"],
+ }, {
+ "name": "__cpp_lib_bit_cast",
+ "values": { "c++20": 201806 },
+ "headers": ["bit"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_bitops",
+ "values": { "c++20": 201907 },
+ "headers": ["bit"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_bool_constant",
+ "values": { "c++17": 201505 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_bounded_array_traits",
+ "values": { "c++20": 201902 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_boyer_moore_searcher",
+ "values": { "c++17": 201603 },
+ "headers": ["functional"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_byte",
+ "values": { "c++17": 201603 },
+ "headers": ["cstddef"],
+ }, {
+ "name": "__cpp_lib_char8_t",
+ "values": { "c++20": 201811 },
+ "headers": ["atomic", "filesystem", "istream", "limits", "locale", "ostream", "string", "string_view"],
+ "test_suite_guard": "defined(__cpp_char8_t)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_CHAR8_T)",
+ }, {
+ "name": "__cpp_lib_chrono",
+ "values": { "c++17": 201611 },
+ "headers": ["chrono"],
+ }, {
+ "name": "__cpp_lib_chrono_udls",
+ "values": { "c++14": 201304 },
+ "headers": ["chrono"],
+ }, {
+ "name": "__cpp_lib_clamp",
+ "values": { "c++17": 201603 },
+ "headers": ["algorithm"],
+ }, {
+ "name": "__cpp_lib_complex_udls",
+ "values": { "c++14": 201309 },
+ "headers": ["complex"],
+ }, {
+ "name": "__cpp_lib_concepts",
+ "values": { "c++20": 202002 },
+ "headers": ["concepts"],
+ }, {
+ "name": "__cpp_lib_constexpr_algorithms",
+ "values": { "c++20": 201806 },
+ "headers": ["algorithm"],
+ }, {
+ "name": "__cpp_lib_constexpr_complex",
+ "values": { "c++20": 201711 },
+ "headers": ["complex"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_constexpr_dynamic_alloc",
+ "values": { "c++20": 201907 },
+ "headers": ["memory"],
+ }, {
+ "name": "__cpp_lib_constexpr_functional",
+ "values": { "c++20": 201907 },
+ "headers": ["functional"],
+ }, {
+ "name": "__cpp_lib_constexpr_iterator",
+ "values": { "c++20": 201811 },
+ "headers": ["iterator"],
+ }, {
+ "name": "__cpp_lib_constexpr_memory",
+ "values": { "c++20": 201811 },
+ "headers": ["memory"],
+ }, {
+ "name": "__cpp_lib_constexpr_numeric",
+ "values": { "c++20": 201911 },
+ "headers": ["numeric"],
+ }, {
+ "name": "__cpp_lib_constexpr_string",
+ "values": { "c++20": 201811 }, # because P1032R1 is implemented; but should become 201907 after P0980R1
+ "headers": ["string"],
+ }, {
+ "name": "__cpp_lib_constexpr_string_view",
+ "values": { "c++20": 201811 },
+ "headers": ["string_view"],
+ }, {
+ "name": "__cpp_lib_constexpr_tuple",
+ "values": { "c++20": 201811 },
+ "headers": ["tuple"],
+ }, {
+ "name": "__cpp_lib_constexpr_utility",
+ "values": { "c++20": 201811 },
+ "headers": ["utility"],
+ }, {
+ "name": "__cpp_lib_constexpr_vector",
+ "values": { "c++20": 201907 },
+ "headers": ["vector"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_coroutine",
+ "values": { "c++20": 201902 },
+ "headers": ["coroutine"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_destroying_delete",
+ "values": { "c++20": 201806 },
+ "headers": ["new"],
+ "test_suite_guard": "TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L",
+ "libcxx_guard": "_LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L",
+ }, {
+ "name": "__cpp_lib_enable_shared_from_this",
+ "values": { "c++17": 201603 },
+ "headers": ["memory"],
+ }, {
+ "name": "__cpp_lib_endian",
+ "values": { "c++20": 201907 },
+ "headers": ["bit"],
+ }, {
+ "name": "__cpp_lib_erase_if",
+ "values": { "c++20": 202002 },
+ "headers": ["deque", "forward_list", "list", "map", "set", "string", "unordered_map", "unordered_set", "vector"],
+ }, {
+ "name": "__cpp_lib_exchange_function",
+ "values": { "c++14": 201304 },
+ "headers": ["utility"],
+ }, {
+ "name": "__cpp_lib_execution",
+ "values": { "c++17": 201603, "c++20": 201902 },
+ "headers": ["execution"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_filesystem",
+ "values": { "c++17": 201703 },
+ "headers": ["filesystem"],
+ "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)",
+ "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)"
+ }, {
+ "name": "__cpp_lib_format",
+ "values": { "c++20": 201907 },
+ "headers": ["format"],
+ "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format)",
+ "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format)",
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_gcd_lcm",
+ "values": { "c++17": 201606 },
+ "headers": ["numeric"],
+ }, {
+ "name": "__cpp_lib_generic_associative_lookup",
+ "values": { "c++14": 201304 },
+ "headers": ["map", "set"],
+ }, {
+ "name": "__cpp_lib_generic_unordered_lookup",
+ "values": { "c++20": 201811 },
+ "headers": ["unordered_map", "unordered_set"],
+ }, {
+ "name": "__cpp_lib_hardware_interference_size",
+ "values": { "c++17": 201703 },
+ "headers": ["new"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_has_unique_object_representations",
+ "values": { "c++17": 201606 },
+ "headers": ["type_traits"],
+ "test_suite_guard": "TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700",
+ "libcxx_guard": "defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS)",
+ }, {
+ "name": "__cpp_lib_hypot",
+ "values": { "c++17": 201603 },
+ "headers": ["cmath"],
+ }, {
+ "name": "__cpp_lib_incomplete_container_elements",
+ "values": { "c++17": 201505 },
+ "headers": ["forward_list", "list", "vector"],
+ }, {
+ "name": "__cpp_lib_int_pow2",
+ "values": { "c++20": 202002 },
+ "headers": ["bit"],
+ }, {
+ "name": "__cpp_lib_integer_comparison_functions",
+ "values": { "c++20": 202002 },
+ "headers": ["utility"],
+ "test_suite_guard": "defined(__cpp_concepts) && __cpp_concepts >= 201907L",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_CONCEPTS)",
+ }, {
+ "name": "__cpp_lib_integer_sequence",
+ "values": { "c++14": 201304 },
+ "headers": ["utility"],
+ }, {
+ "name": "__cpp_lib_integral_constant_callable",
+ "values": { "c++14": 201304 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_interpolate",
+ "values": { "c++20": 201902 },
+ "headers": ["cmath", "numeric"],
+ }, {
+ "name": "__cpp_lib_invoke",
+ "values": { "c++17": 201411 },
+ "headers": ["functional"],
+ }, {
+ "name": "__cpp_lib_is_aggregate",
+ "values": { "c++17": 201703 },
+ "headers": ["type_traits"],
+ "test_suite_guard": "TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_IS_AGGREGATE)",
+ }, {
+ "name": "__cpp_lib_is_constant_evaluated",
+ "values": { "c++20": 201811 },
+ "headers": ["type_traits"],
+ "test_suite_guard": "TEST_HAS_BUILTIN(__builtin_is_constant_evaluated) || TEST_GCC_VER >= 900",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)",
+ }, {
+ "name": "__cpp_lib_is_final",
+ "values": { "c++14": 201402 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_is_invocable",
+ "values": { "c++17": 201703 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_is_layout_compatible",
+ "values": { "c++20": 201907 },
+ "headers": ["type_traits"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_is_nothrow_convertible",
+ "values": { "c++20": 201806 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_is_null_pointer",
+ "values": { "c++14": 201309 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_is_pointer_interconvertible",
+ "values": { "c++20": 201907 },
+ "headers": ["type_traits"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_is_scoped_enum",
+ "values": { "c++2b": 202011 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_is_swappable",
+ "values": { "c++17": 201603 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_jthread",
+ "values": { "c++20": 201911 },
+ "headers": ["stop_token", "thread"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_latch",
+ "values": { "c++20": 201907 },
+ "headers": ["latch"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)",
+ }, {
+ "name": "__cpp_lib_launder",
+ "values": { "c++17": 201606 },
+ "headers": ["new"],
+ }, {
+ "name": "__cpp_lib_list_remove_return_type",
+ "values": { "c++20": 201806 },
+ "headers": ["forward_list", "list"],
+ }, {
+ "name": "__cpp_lib_logical_traits",
+ "values": { "c++17": 201510 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_make_from_tuple",
+ "values": { "c++17": 201606 },
+ "headers": ["tuple"],
+ }, {
+ "name": "__cpp_lib_make_reverse_iterator",
+ "values": { "c++14": 201402 },
+ "headers": ["iterator"],
+ }, {
+ "name": "__cpp_lib_make_unique",
+ "values": { "c++14": 201304 },
+ "headers": ["memory"],
+ }, {
+ "name": "__cpp_lib_map_try_emplace",
+ "values": { "c++17": 201411 },
+ "headers": ["map"],
+ }, {
+ "name": "__cpp_lib_math_constants",
+ "values": { "c++20": 201907 },
+ "headers": ["numbers"],
+ "test_suite_guard": "defined(__cpp_concepts) && __cpp_concepts >= 201907L",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_CONCEPTS)",
+ }, {
+ "name": "__cpp_lib_math_special_functions",
+ "values": { "c++17": 201603 },
+ "headers": ["cmath"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_memory_resource",
+ "values": { "c++17": 201603 },
+ "headers": ["memory_resource"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_node_extract",
+ "values": { "c++17": 201606 },
+ "headers": ["map", "set", "unordered_map", "unordered_set"],
+ }, {
+ "name": "__cpp_lib_nonmember_container_access",
+ "values": { "c++17": 201411 },
+ "headers": ["array", "deque", "forward_list", "iterator", "list", "map", "regex", "set", "string", "unordered_map", "unordered_set", "vector"],
+ }, {
+ "name": "__cpp_lib_not_fn",
+ "values": { "c++17": 201603 },
+ "headers": ["functional"],
+ }, {
+ "name": "__cpp_lib_null_iterators",
+ "values": { "c++14": 201304 },
+ "headers": ["iterator"],
+ }, {
+ "name": "__cpp_lib_optional",
+ "values": { "c++17": 201606 },
+ "headers": ["optional"],
+ }, {
+ "name": "__cpp_lib_parallel_algorithm",
+ "values": { "c++17": 201603 },
+ "headers": ["algorithm", "numeric"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_polymorphic_allocator",
+ "values": { "c++20": 201902 },
+ "headers": ["memory"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_quoted_string_io",
+ "values": { "c++14": 201304 },
+ "headers": ["iomanip"],
+ }, {
+ "name": "__cpp_lib_ranges",
+ "values": { "c++20": 201811 },
+ "headers": ["algorithm", "functional", "iterator", "memory", "ranges"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_raw_memory_algorithms",
+ "values": { "c++17": 201606 },
+ "headers": ["memory"],
+ }, {
+ "name": "__cpp_lib_remove_cvref",
+ "values": { "c++20": 201711 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_result_of_sfinae",
+ "values": { "c++14": 201210 },
+ "headers": ["functional", "type_traits"],
+ }, {
+ "name": "__cpp_lib_robust_nonmodifying_seq_ops",
+ "values": { "c++14": 201304 },
+ "headers": ["algorithm"],
+ }, {
+ "name": "__cpp_lib_sample",
+ "values": { "c++17": 201603 },
+ "headers": ["algorithm"],
+ }, {
+ "name": "__cpp_lib_scoped_lock",
+ "values": { "c++17": 201703 },
+ "headers": ["mutex"],
+ }, {
+ "name": "__cpp_lib_semaphore",
+ "values": { "c++20": 201907 },
+ "headers": ["semaphore"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)",
+ }, {
+ "name": "__cpp_lib_shared_mutex",
+ "values": { "c++17": 201505 },
+ "headers": ["shared_mutex"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)",
+ }, {
+ "name": "__cpp_lib_shared_ptr_arrays",
+ "values": { "c++17": 201611 },
+ "headers": ["memory"],
+ }, {
+ "name": "__cpp_lib_shared_ptr_weak_type",
+ "values": { "c++17": 201606 },
+ "headers": ["memory"],
+ }, {
+ "name": "__cpp_lib_shared_timed_mutex",
+ "values": { "c++14": 201402 },
+ "headers": ["shared_mutex"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)",
+ }, {
+ "name": "__cpp_lib_shift",
+ "values": { "c++20": 201806 },
+ "headers": ["algorithm"],
+ }, {
+ "name": "__cpp_lib_smart_ptr_for_overwrite",
+ "values": { "c++20": 202002 },
+ "headers": ["memory"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_source_location",
+ "values": { "c++20": 201907 },
+ "headers": ["source_location"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_span",
+ "values": { "c++20": 202002 },
+ "headers": ["span"],
+ }, {
+ "name": "__cpp_lib_ssize",
+ "values": { "c++20": 201902 },
+ "headers": ["iterator"],
+ }, {
+ "name": "__cpp_lib_stacktrace",
+ "values": { "c++2b": 202011 },
+ "headers": ["stacktrace"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_starts_ends_with",
+ "values": { "c++20": 201711 },
+ "headers": ["string", "string_view"],
+ }, {
+ "name": "__cpp_lib_stdatomic_h",
+ "values": { "c++2b": 202011 },
+ "headers": ["stdatomic.h"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_string_contains",
+ "values": { "c++2b": 202011 },
+ "headers": ["string", "string_view"],
+ }, {
+ "name": "__cpp_lib_string_udls",
+ "values": { "c++14": 201304 },
+ "headers": ["string"],
+ }, {
+ "name": "__cpp_lib_string_view",
+ "values": { "c++17": 201606, "c++20": 201803 },
+ "headers": ["string", "string_view"],
+ }, {
+ "name": "__cpp_lib_syncbuf",
+ "values": { "c++20": 201803 },
+ "headers": ["syncstream"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_three_way_comparison",
+ "values": { "c++20": 201907 },
+ "headers": ["compare"],
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_to_address",
+ "values": { "c++20": 201711 },
+ "headers": ["memory"],
+ }, {
+ "name": "__cpp_lib_to_array",
+ "values": { "c++20": 201907 },
+ "headers": ["array"],
+ }, {
+ "name": "__cpp_lib_to_chars",
+ "values": { "c++17": 201611 },
"headers": ["utility"],
- },
- {"name": "__cpp_lib_exchange_function",
- "values": {
- "c++14": int(201304)
- },
- "headers": ["utility"],
- },
- {"name": "__cpp_lib_tuples_by_type",
- "values": {
- "c++14": int(201304)
- },
- "headers": ["utility", "tuple"],
- },
- {"name": "__cpp_lib_tuple_element_t",
- "values": {
- "c++14": int(201402)
- },
- "headers": ["tuple"],
- },
- {"name": "__cpp_lib_make_unique",
- "values": {
- "c++14": int(201304)
- },
- "headers": ["memory"],
- },
- {"name": "__cpp_lib_transparent_operators",
- "values": {
- "c++14": int(201210),
- "c++17": int(201510),
- },
- "headers": ["functional"],
- },
- {"name": "__cpp_lib_integral_constant_callable",
- "values": {
- "c++14": int(201304)
- },
- "headers": ["type_traits"],
- },
- {"name": "__cpp_lib_transformation_trait_aliases",
- "values": {
- "c++14": int(201304),
- },
- "headers": ["type_traits"]
- },
- {"name": "__cpp_lib_result_of_sfinae",
- "values": {
- "c++14": int(201210),
- },
- "headers": ["functional", "type_traits"]
- },
- {"name": "__cpp_lib_is_final",
- "values": {
- "c++14": int(201402),
- },
- "headers": ["type_traits"]
- },
- {"name": "__cpp_lib_is_null_pointer",
- "values": {
- "c++14": int(201309),
- },
- "headers": ["type_traits"]
- },
- {"name": "__cpp_lib_chrono_udls",
- "values": {
- "c++14": int(201304),
- },
- "headers": ["chrono"]
- },
- {"name": "__cpp_lib_string_udls",
- "values": {
- "c++14": int(201304),
- },
- "headers": ["string"]
- },
- {"name": "__cpp_lib_generic_associative_lookup",
- "values": {
- "c++14": int(201304),
- },
- "headers": ["map", "set"]
- },
- {"name": "__cpp_lib_null_iterators",
- "values": {
- "c++14": int(201304),
- },
- "headers": ["iterator"]
- },
- {"name": "__cpp_lib_make_reverse_iterator",
- "values": {
- "c++14": int(201402),
- },
- "headers": ["iterator"]
- },
- {"name": "__cpp_lib_robust_nonmodifying_seq_ops",
- "values": {
- "c++14": int(201304),
- },
- "headers": ["algorithm"]
- },
- {"name": "__cpp_lib_complex_udls",
- "values": {
- "c++14": int(201309),
- },
- "headers": ["complex"]
- },
- {"name": "__cpp_lib_quoted_string_io",
- "values": {
- "c++14": int(201304),
- },
- "headers": ["iomanip"]
- },
- {"name": "__cpp_lib_shared_timed_mutex",
- "values": {
- "c++14": int(201402),
- },
- "headers": ["shared_mutex"],
- "depends": "!defined(_LIBCPP_HAS_NO_THREADS)",
- "internal_depends": "!defined(_LIBCPP_HAS_NO_THREADS)",
- },
- # C++17 macros
- {"name": "__cpp_lib_atomic_is_always_lock_free",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["atomic"],
- "depends": "!defined(_LIBCPP_HAS_NO_THREADS)",
- "internal_depends": "!defined(_LIBCPP_HAS_NO_THREADS)",
- },
- {"name": "__cpp_lib_filesystem",
- "values": {
- "c++17": int(201703),
- },
- "headers": ["filesystem"]
- },
- {"name": "__cpp_lib_invoke",
- "values": {
- "c++17": int(201411),
- },
- "headers": ["functional"]
- },
- {"name": "__cpp_lib_void_t",
- "values": {
- "c++17": int(201411),
- },
- "headers": ["type_traits"]
- },
- {"name": "__cpp_lib_node_extract",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["map", "set", "unordered_map", "unordered_set"]
- },
- {"name": "__cpp_lib_byte",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["cstddef"],
- },
- {"name": "__cpp_lib_hardware_interference_size",
- "values": {
- "c++17": int(201703),
- },
- "headers": ["new"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_launder",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["new"],
- },
- {"name": "__cpp_lib_uncaught_exceptions",
- "values": {
- "c++17": int(201411),
- },
- "headers": ["exception"],
- },
- {"name": "__cpp_lib_as_const",
- "values": {
- "c++17": int(201510),
- },
- "headers": ["utility"],
- },
- {"name": "__cpp_lib_make_from_tuple",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["tuple"],
- },
- {"name": "__cpp_lib_apply",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["tuple"],
- },
- {"name": "__cpp_lib_optional",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["optional"],
- },
- {"name": "__cpp_lib_variant",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["variant"],
- },
- {"name": "__cpp_lib_any",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["any"],
- },
- {"name": "__cpp_lib_addressof_constexpr",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["memory"],
- "depends": "TEST_HAS_BUILTIN(__builtin_addressof) || TEST_GCC_VER >= 700",
- "internal_depends": "!defined(_LIBCPP_HAS_NO_BUILTIN_ADDRESSOF)",
- },
- {"name": "__cpp_lib_raw_memory_algorithms",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["memory"],
- },
- {"name": "__cpp_lib_enable_shared_from_this",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["memory"],
- },
- {"name": "__cpp_lib_shared_ptr_weak_type",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["memory"],
- },
- {"name": "__cpp_lib_shared_ptr_arrays",
- "values": {
- "c++17": int(201611),
- },
- "headers": ["memory"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_memory_resource",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["memory_resource"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_boyer_moore_searcher",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["functional"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_not_fn",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["functional"],
- },
- {"name": "__cpp_lib_bool_constant",
- "values": {
- "c++17": int(201505),
- },
- "headers": ["type_traits"],
- },
- {"name": "__cpp_lib_type_trait_variable_templates",
- "values": {
- "c++17": int(201510),
- },
- "headers": ["type_traits"],
- },
- {"name": "__cpp_lib_logical_traits",
- "values": {
- "c++17": int(201510),
- },
- "headers": ["type_traits"],
- },
- {"name": "__cpp_lib_is_swappable",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["type_traits"],
- },
- {"name": "__cpp_lib_is_invocable",
- "values": {
- "c++17": int(201703),
- },
- "headers": ["type_traits"],
- },
- {"name": "__cpp_lib_has_unique_object_representations",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["type_traits"],
- "depends": "TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700",
- "internal_depends": "defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS)",
- },
- {"name": "__cpp_lib_is_aggregate",
- "values": {
- "c++17": int(201703),
- },
- "headers": ["type_traits"],
- "depends": "TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001",
- "internal_depends": "!defined(_LIBCPP_HAS_NO_IS_AGGREGATE)",
- },
- {"name": "__cpp_lib_chrono",
- "values": {
- "c++17": int(201611),
- },
- "headers": ["chrono"],
- },
- {"name": "__cpp_lib_execution",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["execution"],
- "unimplemented": True
- },
- {"name": "__cpp_lib_parallel_algorithm",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["algorithm", "numeric"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_to_chars",
- "values": {
- "c++17": int(201611),
- },
- "headers": ["utility"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_string_view",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["string", "string_view"],
- },
- {"name": "__cpp_lib_allocator_traits_is_always_equal",
- "values": {
- "c++17": int(201411),
- },
- "headers": ["memory", "scoped_allocator", "string", "deque", "forward_list", "list", "vector", "map", "set", "unordered_map", "unordered_set"],
- },
- {"name": "__cpp_lib_incomplete_container_elements",
- "values": {
- "c++17": int(201505),
- },
- "headers": ["forward_list", "list", "vector"],
- },
- {"name": "__cpp_lib_map_try_emplace",
- "values": {
- "c++17": int(201411),
- },
- "headers": ["map"],
- },
- {"name": "__cpp_lib_unordered_map_try_emplace",
- "values": {
- "c++17": int(201411),
- },
- "headers": ["unordered_map"],
- },
- {"name": "__cpp_lib_array_constexpr",
- "values": {
- "c++17": int(201603),
- "c++2a": int(201811),
- },
- "headers": ["iterator", "array"],
- },
- {"name": "__cpp_lib_nonmember_container_access",
- "values": {
- "c++17": int(201411),
- },
- "headers": ["iterator", "array", "deque", "forward_list", "list", "map", "regex",
- "set", "string", "unordered_map", "unordered_set", "vector"],
- },
- {"name": "__cpp_lib_sample",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["algorithm"],
- },
- {"name": "__cpp_lib_clamp",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["algorithm"],
- },
- {"name": "__cpp_lib_gcd_lcm",
- "values": {
- "c++17": int(201606),
- },
- "headers": ["numeric"],
- },
- {"name": "__cpp_lib_hypot",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["cmath"],
- },
- {"name": "__cpp_lib_math_special_functions",
- "values": {
- "c++17": int(201603),
- },
- "headers": ["cmath"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_shared_mutex",
- "values": {
- "c++17": int(201505),
- },
- "headers": ["shared_mutex"],
- "depends": "!defined(_LIBCPP_HAS_NO_THREADS)",
- "internal_depends": "!defined(_LIBCPP_HAS_NO_THREADS)",
- },
- {"name": "__cpp_lib_scoped_lock",
- "values": {
- "c++17": int(201703),
- },
- "headers": ["mutex"],
- },
- # C++2a
- {"name": "__cpp_lib_char8_t",
- "values": {
- "c++2a": int(201811),
- },
- "headers": ["atomic", "filesystem", "istream", "limits", "locale", "ostream",
- "string", "string_view"],
- "depends": "defined(__cpp_char8_t)",
- "internal_depends": "!defined(_LIBCPP_NO_HAS_CHAR8_T)",
- },
- {"name": "__cpp_lib_erase_if",
- "values": {
- "c++2a": int(202002),
- },
- "headers": ["string", "deque", "forward_list", "list", "vector", "map",
- "set", "unordered_map", "unordered_set"]
- },
- {"name": "__cpp_lib_destroying_delete",
- "values": {
- "c++2a": int(201806),
- },
- "headers": ["new"],
- "depends":
- "TEST_STD_VER > 17"
- " && defined(__cpp_impl_destroying_delete)"
- " && __cpp_impl_destroying_delete >= 201806L",
- "internal_depends":
- "_LIBCPP_STD_VER > 17"
- " && defined(__cpp_impl_destroying_delete)"
- " && __cpp_impl_destroying_delete >= 201806L",
- },
- {"name": "__cpp_lib_three_way_comparison",
- "values": {
- "c++2a": int(201711),
- },
- "headers": ["compare"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_concepts",
- "values": {
- "c++2a": int(201806),
- },
- "headers": ["concepts"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_constexpr_swap_algorithms",
- "values": {
- "c++2a": int(201806),
- },
- "headers": ["algorithm"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_constexpr_misc",
- "values": {
- "c++2a": int(201811),
- },
- "headers": ["array", "functional", "iterator", "string_view", "tuple", "utility"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_bind_front",
- "values": {
- "c++2a": int(201811),
- },
- "headers": ["functional"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_is_constant_evaluated",
- "values": {
- "c++2a": int(201811),
- },
- "headers": ["type_traits"],
- "depends": "TEST_HAS_BUILTIN(__builtin_is_constant_evaluated) || TEST_GCC_VER >= 900",
- "internal_depends": "!defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)",
- },
- {"name": "__cpp_lib_list_remove_return_type",
- "values": {
- "c++2a": int(201806),
- },
- "headers": ["forward_list", "list"],
- },
- {"name": "__cpp_lib_generic_unordered_lookup",
- "values": {
- "c++2a": int(201811),
- },
- "headers": ["unordered_map", "unordered_set"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_ranges",
- "values": {
- "c++2a": int(201811),
- },
- "headers": ["algorithm", "functional", "iterator", "memory", "ranges"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_bit_cast",
- "values": {
- "c++2a": int(201806),
- },
- "headers": ["bit"],
- "unimplemented": True,
- },
- {"name": "__cpp_lib_atomic_ref",
- "values": {
- "c++2a": int(201806),
- },
- "headers": ["atomic"],
- "unimplemented": True,
- "depends": "!defined(_LIBCPP_HAS_NO_THREADS)",
- "internal_depends": "!defined(_LIBCPP_HAS_NO_THREADS)",
- },
- {"name": "__cpp_lib_interpolate",
- "values": {
- "c++2a": int(201902),
- },
- "headers": ["numeric"],
- },
- {"name": "__cpp_lib_endian",
- "values": {
- "c++2a": int(201907),
- },
- "headers": ["bit"],
- },
- {"name": "__cpp_lib_to_array",
- "values": {
- "c++2a": int(201907),
- },
- "headers": ["array"],
- },
- {"name": "__cpp_lib_span",
- "values": {
- "c++2a": int(202002),
- },
- "headers": ["span"],
- },
- {"name": "__cpp_lib_math_constants",
- "values": {
- "c++2a": int(201907),
- },
- "headers": ["numbers"],
- "depends": "defined(__cpp_concepts) && __cpp_concepts >= 201811L",
- "internal_depends": "defined(__cpp_concepts) && __cpp_concepts >= 201811L",
- },
-]], key=lambda tc: tc["name"])
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_to_underlying",
+ "values": { "c++2b": 202102 },
+ "headers": ["utility"],
+ }, {
+ "name": "__cpp_lib_transformation_trait_aliases",
+ "values": { "c++14": 201304 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_transparent_operators",
+ "values": { "c++14": 201210, "c++17": 201510 },
+ "headers": ["functional", "memory"],
+ }, {
+ "name": "__cpp_lib_tuple_element_t",
+ "values": { "c++14": 201402 },
+ "headers": ["tuple"],
+ }, {
+ "name": "__cpp_lib_tuples_by_type",
+ "values": { "c++14": 201304 },
+ "headers": ["tuple", "utility"],
+ }, {
+ "name": "__cpp_lib_type_trait_variable_templates",
+ "values": { "c++17": 201510 },
+ "headers": ["type_traits"],
+ }, {
+ "name": "__cpp_lib_uncaught_exceptions",
+ "values": { "c++17": 201411 },
+ "headers": ["exception"],
+ }, {
+ "name": "__cpp_lib_unordered_map_try_emplace",
+ "values": { "c++17": 201411 },
+ "headers": ["unordered_map"],
+ }, {
+ "name": "__cpp_lib_unwrap_ref",
+ "values": { "c++20": 201811 },
+ "headers": ["functional"],
+ }, {
+ "name": "__cpp_lib_variant",
+ "values": { "c++17": 202102 },
+ "headers": ["variant"],
+ }, {
+ "name": "__cpp_lib_void_t",
+ "values": { "c++17": 201411 },
+ "headers": ["type_traits"],
+ }
+]]
+
+assert feature_test_macros == sorted(feature_test_macros, key=lambda tc: tc["name"])
+assert all(tc["headers"] == sorted(tc["headers"]) for tc in feature_test_macros)
+assert all(("libcxx_guard" in tc) == ("test_suite_guard" in tc) for tc in feature_test_macros)
+assert all(all(key in ["name", "values", "headers", "libcxx_guard", "test_suite_guard", "unimplemented"] for key in tc.keys()) for tc in feature_test_macros)
+
+# Map from each header to the Lit annotations that should be used for
+# tests that include that header.
+#
+# For example, when threads are not supported, any feature-test-macro test
+# that includes <thread> should be marked as UNSUPPORTED, because including
+# <thread> is a hard error in that case.
+lit_markup = {
+ "atomic": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "barrier": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "filesystem": ["UNSUPPORTED: libcpp-has-no-filesystem-library"],
+ "format": ["UNSUPPORTED: libcpp-has-no-incomplete-format"],
+ "iomanip": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "istream": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "latch": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "locale": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "ostream": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "ranges": ["UNSUPPORTED: libcpp-has-no-incomplete-ranges"],
+ "regex": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "semaphore": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "shared_mutex": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "thread": ["UNSUPPORTED: libcpp-has-no-threads"],
+}
def get_std_dialects():
- std_dialects = ['c++14', 'c++17', 'c++2a']
+ std_dialects = ['c++14', 'c++17', 'c++20', 'c++2b']
return list(std_dialects)
def get_first_std(d):
return d[s]
return None
+def get_std_number(std):
+ return std.replace('c++', '')
"""
Functions to produce the <version> header
def produce_macros_definition_for_std(std):
result = ""
- indent = 56
+ indent = 55
for tc in feature_test_macros:
if std not in tc["values"]:
continue
inner_indent = 1
- if 'depends' in tc.keys():
- assert 'internal_depends' in tc.keys()
- result += "# if %s\n" % tc["internal_depends"]
+ if 'test_suite_guard' in tc.keys():
+ result += "# if %s\n" % tc["libcxx_guard"]
inner_indent += 2
if get_value_before(tc["values"], std) is not None:
- assert 'depends' not in tc.keys()
+ assert 'test_suite_guard' not in tc.keys()
result += "# undef %s\n" % tc["name"]
line = "#%sdefine %s" % ((" " * inner_indent), tc["name"])
line += " " * (indent - len(line))
- line += "%sL" % tc["values"][std]
+ line += " %sL" % tc["values"][std]
if 'unimplemented' in tc.keys():
line = "// " + line
result += line
result += "\n"
- if 'depends' in tc.keys():
+ if 'test_suite_guard' in tc.keys():
result += "# endif\n"
- return result
+ return result.strip()
+
+def produce_macros_definitions():
+ macro_definition_template = """#if _LIBCPP_STD_VER > {previous_std_number}
+{macro_definition}
+#endif"""
+
+ macros_definitions = []
+ previous_std_number = '11'
+ for std in get_std_dialects():
+ macros_definitions.append(
+ macro_definition_template.format(previous_std_number=previous_std_number,
+ macro_definition=produce_macros_definition_for_std(std)))
+ previous_std_number = get_std_number(std)
+
+ return '\n\n'.join(macros_definitions)
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
#pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 11
-{cxx14_macros}
-#endif
+// clang-format off
-#if _LIBCPP_STD_VER > 14
-{cxx17_macros}
-#endif
+{cxx_macros}
-#if _LIBCPP_STD_VER > 17
-{cxx2a_macros}
-#endif
+// clang-format on
#endif // _LIBCPP_VERSIONH
"""
- return template.format(
+
+ version_str = template.format(
synopsis=produce_version_synopsis().strip(),
- cxx14_macros=produce_macros_definition_for_std('c++14').strip(),
- cxx17_macros=produce_macros_definition_for_std('c++17').strip(),
- cxx2a_macros=produce_macros_definition_for_std('c++2a').strip())
+ cxx_macros=produce_macros_definitions())
+ version_header_path = os.path.join(include_path, 'version')
+ with open(version_header_path, 'w', newline='\n') as f:
+ f.write(version_str)
+
"""
Functions to produce test files
# endif
""",
- "depends": """
-# if {depends}
+ "test_suite_guard": """
+# if {test_suite_guard}
# ifndef {name}
# error "{name} should be defined in {std}"
# endif
# endif
# else
# ifdef {name}
-# error "{name} should not be defined when {depends} is not defined!"
+# error "{name} should not be defined when {test_suite_guard} is not defined!"
# endif
# endif
""",
# endif
""",
- "defined":"""
+ "defined": """
# ifndef {name}
# error "{name} should be defined in {std}"
# endif
result += test_types["undefined"].format(name=tc["name"], std_first=get_first_std(tc["values"]))
elif 'unimplemented' in tc.keys():
result += test_types["unimplemented"].format(name=tc["name"], value=val, std=std)
- elif "depends" in tc.keys():
- result += test_types["depends"].format(name=tc["name"], value=val, std=std, depends=tc["depends"])
+ elif "test_suite_guard" in tc.keys():
+ result += test_types["test_suite_guard"].format(name=tc["name"], value=val, std=std, test_suite_guard=tc["test_suite_guard"])
else:
result += test_types["defined"].format(name=tc["name"], value=val, std=std)
- return result
+ return result.strip()
+
+def generate_std_tests(test_list):
+ std_tests_template = """#if TEST_STD_VER < {first_std_number}
+
+{pre_std_test}
+
+{other_std_tests}
+
+#elif TEST_STD_VER > {penultimate_std_number}
+
+{last_std_test}
+
+#endif // TEST_STD_VER > {penultimate_std_number}"""
+
+ std_dialects = get_std_dialects()
+ assert not get_std_number(std_dialects[-1]).isnumeric()
+
+ other_std_tests = []
+ for std in std_dialects[:-1]:
+ other_std_tests.append('#elif TEST_STD_VER == ' + get_std_number(std))
+ other_std_tests.append(generate_std_test(test_list, std))
+
+ std_tests = std_tests_template.format(first_std_number=get_std_number(std_dialects[0]),
+ pre_std_test=generate_std_test(test_list, 'c++11'),
+ other_std_tests='\n\n'.join(other_std_tests),
+ penultimate_std_number=get_std_number(std_dialects[-2]),
+ last_std_test=generate_std_test(test_list, std_dialects[-1]))
+
+ return std_tests
def generate_synopsis(test_list):
max_name_len = max([len(tc["name"]) for tc in test_list])
result += "*/"
return result
-def is_threading_header_unsafe_to_include(h):
- # NOTE: "<mutex>" does not blow up when included without threads.
- return h in ['atomic', 'shared_mutex']
-
def produce_tests():
headers = set([h for tc in feature_test_macros for h in tc["headers"]])
for h in headers:
for tc in test_list:
assert 'unimplemented' in tc.keys()
continue
- test_tags = ""
- if is_threading_header_unsafe_to_include(h):
- test_tags += '\n// UNSUPPORTED: libcpp-has-no-threads\n'
+ markup = '\n'.join('// ' + tag for tag in lit_markup.get(h, []))
test_body = \
"""//===----------------------------------------------------------------------===//
//
//
// WARNING: This test was generated by {script_name}
// and should not be edited manually.
-{test_tags}
+//
+// clang-format off
+{markup}
// <{header}>
// Test the feature test macros defined by <{header}>
#include <{header}>
#include "test_macros.h"
-#if TEST_STD_VER < 14
-
-{cxx11_tests}
-
-#elif TEST_STD_VER == 14
-
-{cxx14_tests}
-
-#elif TEST_STD_VER == 17
-
-{cxx17_tests}
-
-#elif TEST_STD_VER > 17
-
-{cxx2a_tests}
-
-#endif // TEST_STD_VER > 17
+{cxx_tests}
int main(int, char**) {{ return 0; }}
""".format(script_name=script_name,
header=h,
- test_tags=test_tags,
+ markup=('\n{}\n'.format(markup) if markup else ''),
synopsis=generate_synopsis(test_list),
- cxx11_tests=generate_std_test(test_list, 'c++11').strip(),
- cxx14_tests=generate_std_test(test_list, 'c++14').strip(),
- cxx17_tests=generate_std_test(test_list, 'c++17').strip(),
- cxx2a_tests=generate_std_test(test_list, 'c++2a').strip())
+ cxx_tests=generate_std_tests(test_list))
test_name = "{header}.version.pass.cpp".format(header=h)
out_path = os.path.join(macro_test_path, test_name)
- with open(out_path, 'w') as f:
+ with open(out_path, 'w', newline='\n') as f:
f.write(test_body)
"""
def create_table(grid, indent):
indent_str = ' '*indent
col_widths = make_widths(grid)
- num_cols = len(grid[0])
- result = indent_str + add_divider(col_widths, 2)
+ result = [indent_str + add_divider(col_widths, 2)]
header_flag = 2
for row_i in range(0, len(grid)):
row = grid[row_i]
- result = result + indent_str + ' '.join([pad_cell(row[i], col_widths[i]) for i in range(0, len(row))]) + '\n'
+ line = indent_str + ' '.join([pad_cell(row[i], col_widths[i]) for i in range(0, len(row))])
+ result.append(line.rstrip())
is_cxx_header = row[0].startswith('**')
if row_i == len(grid) - 1:
header_flag = 2
- result = result + indent_str + add_divider(col_widths, 1 if is_cxx_header else header_flag)
+ separator = indent_str + add_divider(col_widths, 1 if is_cxx_header else header_flag)
+ result.append(separator.rstrip())
header_flag = 0
- return result
+ return '\n'.join(result)
def add_divider(widths, header_flag):
if header_flag == 2:
- return ' '.join(['='*w for w in widths]) + '\n'
+ return ' '.join(['='*w for w in widths])
if header_flag == 1:
- return '-'.join(['-'*w for w in widths]) + '\n'
+ return '-'.join(['-'*w for w in widths])
else:
- return ' '.join(['-'*w for w in widths]) + '\n'
+ return ' '.join(['-'*w for w in widths])
def pad_cell(s, length, left_align=True):
padding = ((length - len(s)) * ' ')
""".format(status_tables=create_table(get_status_table(), 4))
table_doc_path = os.path.join(docs_path, 'FeatureTestMacroTable.rst')
- with open(table_doc_path, 'w') as f:
+ with open(table_doc_path, 'w', newline='\n') as f:
f.write(doc_str)
def main():
- with tempfile.NamedTemporaryFile(mode='w', prefix='version.', delete=False) as tmp_file:
- print("producing new <version> header as %s" % tmp_file.name)
- tmp_file.write(produce_version_header())
+ produce_version_header()
produce_tests()
produce_docs()
--- /dev/null
+#!/usr/bin/env python
+
+import os
+
+
+def get_libcxx_paths():
+ utils_path = os.path.dirname(os.path.abspath(__file__))
+ script_name = os.path.basename(__file__)
+ assert os.path.exists(utils_path)
+ src_root = os.path.dirname(utils_path)
+ test_path = os.path.join(src_root, 'test', 'libcxx', 'inclusions')
+ assert os.path.exists(test_path)
+ assert os.path.exists(os.path.join(test_path, 'algorithm.inclusions.compile.pass.cpp'))
+ return script_name, src_root, test_path
+
+
+script_name, source_root, test_path = get_libcxx_paths()
+
+
+# This table was produced manually, by grepping the TeX source of the Standard's
+# library clauses for the string "#include". Each header's synopsis contains
+# explicit "#include" directives for its mandatory inclusions.
+# For example, [algorithm.syn] contains "#include <initializer_list>".
+#
+mandatory_inclusions = {
+ "algorithm": ["initializer_list"],
+ "array": ["compare", "initializer_list"],
+ "bitset": ["iosfwd", "string"],
+ "chrono": ["compare"],
+ "cinttypes": ["cstdint"],
+ "complex.h": ["complex"],
+ # TODO "coroutine": ["compare"],
+ "deque": ["compare", "initializer_list"],
+ "filesystem": ["compare"],
+ "forward_list": ["compare", "initializer_list"],
+ "ios": ["iosfwd"],
+ "iostream": ["ios", "istream", "ostream", "streambuf"],
+ "iterator": ["compare", "concepts"],
+ "list": ["compare", "initializer_list"],
+ "map": ["compare", "initializer_list"],
+ "memory": ["compare"],
+ "optional": ["compare"],
+ "queue": ["compare", "initializer_list"],
+ "random": ["initializer_list"],
+ "ranges": ["compare", "initializer_list", "iterator"],
+ "regex": ["compare", "initializer_list"],
+ "set": ["compare", "initializer_list"],
+ "stack": ["compare", "initializer_list"],
+ "string_view": ["compare"],
+ "string": ["compare", "initializer_list"],
+ # TODO "syncstream": ["ostream"],
+ "system_error": ["compare"],
+ "tgmath.h": ["cmath", "complex"],
+ "thread": ["compare"],
+ "tuple": ["compare"],
+ "typeindex": ["compare"],
+ "unordered_map": ["compare", "initializer_list"],
+ "unordered_set": ["compare", "initializer_list"],
+ "utility": ["compare", "initializer_list"],
+ "valarray": ["initializer_list"],
+ "variant": ["compare"],
+ "vector": ["compare", "initializer_list"],
+}
+
+new_in_version = {
+ "chrono": "11",
+ "compare": "20",
+ "concepts": "20",
+ "coroutine": "20",
+ "filesystem": "17",
+ "initializer_list": "11",
+ "optional": "17",
+ "ranges": "20",
+ "string_view": "17",
+ "syncstream": "20",
+ "system_error": "11",
+ "thread": "11",
+ "tuple": "11",
+ "unordered_map": "11",
+ "unordered_set": "11",
+ "variant": "17",
+}
+
+assert all(v == sorted(v) for k, v in mandatory_inclusions.items())
+
+# Map from each header to the Lit annotations that should be used for
+# tests that include that header.
+#
+# For example, when threads are not supported, any test
+# that includes <thread> should be marked as UNSUPPORTED, because including
+# <thread> is a hard error in that case.
+lit_markup = {
+ "atomic": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "barrier": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "filesystem": ["UNSUPPORTED: libcpp-has-no-filesystem-library"],
+ "format": ["UNSUPPORTED: libcpp-has-no-incomplete-format"],
+ "iomanip": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "ios": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "iostream": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "istream": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "latch": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "locale": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "ostream": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "ranges": ["UNSUPPORTED: libcpp-has-no-incomplete-ranges"],
+ "regex": ["UNSUPPORTED: libcpp-has-no-localization"],
+ "semaphore": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "shared_mutex": ["UNSUPPORTED: libcpp-has-no-threads"],
+ "thread": ["UNSUPPORTED: libcpp-has-no-threads"],
+}
+
+
+def get_std_ver_test(includee):
+ v = new_in_version.get(includee, "03")
+ if v == "03":
+ return ''
+ versions = ["03", "11", "14", "17", "20"]
+ return 'TEST_STD_VER > {} && '.format(max(i for i in versions if i < v))
+
+
+def get_unsupported_line(includee):
+ v = new_in_version.get(includee, "03")
+ return {
+ "03": [],
+ "11": ['UNSUPPORTED: c++03'],
+ "14": ['UNSUPPORTED: c++03, c++11'],
+ "17": ['UNSUPPORTED: c++03, c++11, c++14'],
+ "20": ['UNSUPPORTED: c++03, c++11, c++14, c++17'],
+ "2b": ['UNSUPPORTED: c++03, c++11, c++14, c++17, c++20'],
+ }[v]
+
+
+def get_libcpp_header_symbol(header_name):
+ return '_LIBCPP_' + header_name.upper().replace('.', '_')
+
+
+def get_includer_symbol_test(includer):
+ symbol = get_libcpp_header_symbol(includer)
+ return """
+#if !defined({symbol})
+ # error "{message}"
+#endif
+ """.strip().format(
+ symbol=symbol,
+ message="<{}> was expected to define {}".format(includer, symbol),
+ )
+
+
+def get_ifdef(includer, includee):
+ version = max(new_in_version.get(h, "03") for h in [includer, includee])
+ symbol = get_libcpp_header_symbol(includee)
+ return """
+#if {includee_test}!defined({symbol})
+ # error "{message}"
+#endif
+ """.strip().format(
+ includee_test=get_std_ver_test(includee),
+ symbol=symbol,
+ message="<{}> should include <{}> in C++{} and later".format(includer, includee, version)
+ )
+
+
+test_body_template = """
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// WARNING: This test was generated by {script_name}
+// and should not be edited manually.
+//
+// clang-format off
+{markup}
+// <{header}>
+
+// Test that <{header}> includes all the other headers it's supposed to.
+
+#include <{header}>
+#include "test_macros.h"
+
+{test_includers_symbol}
+{test_per_includee}
+""".strip()
+
+
+def produce_tests():
+ for includer, includees in mandatory_inclusions.items():
+ markup_tags = get_unsupported_line(includer) + lit_markup.get(includer, [])
+ test_body = test_body_template.format(
+ script_name=script_name,
+ header=includer,
+ markup=('\n' + '\n'.join('// ' + m for m in markup_tags) + '\n') if markup_tags else '',
+ test_includers_symbol=get_includer_symbol_test(includer),
+ test_per_includee='\n'.join(get_ifdef(includer, includee) for includee in includees),
+ )
+ test_name = "{header}.inclusions.compile.pass.cpp".format(header=includer)
+ out_path = os.path.join(test_path, test_name)
+ with open(out_path, 'w', newline='\n') as f:
+ f.write(test_body + '\n')
+
+
+if __name__ == '__main__':
+ produce_tests()
--- /dev/null
+#!/usr/bin/env python
+
+import glob
+import os
+import posixpath
+import re
+
+
+def get_libcxx_paths():
+ utils_path = os.path.dirname(os.path.abspath(__file__))
+ script_name = os.path.basename(__file__)
+ assert os.path.exists(utils_path)
+ src_root = os.path.dirname(utils_path)
+ include_path = os.path.join(src_root, 'include')
+ assert os.path.exists(include_path)
+ libcxx_test_path = os.path.join(src_root, 'test', 'libcxx')
+ assert os.path.exists(libcxx_test_path)
+ return script_name, src_root, include_path, libcxx_test_path
+
+
+script_name, source_root, include_path, libcxx_test_path = get_libcxx_paths()
+
+header_markup = {
+ "atomic": ["ifndef _LIBCPP_HAS_NO_THREADS"],
+ "barrier": ["ifndef _LIBCPP_HAS_NO_THREADS"],
+ "future": ["ifndef _LIBCPP_HAS_NO_THREADS"],
+ "latch": ["ifndef _LIBCPP_HAS_NO_THREADS"],
+ "mutex": ["ifndef _LIBCPP_HAS_NO_THREADS"],
+ "semaphore": ["ifndef _LIBCPP_HAS_NO_THREADS"],
+ "shared_mutex": ["ifndef _LIBCPP_HAS_NO_THREADS"],
+ "thread": ["ifndef _LIBCPP_HAS_NO_THREADS"],
+
+ "experimental/filesystem": ["ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY"],
+ "filesystem": ["ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY"],
+ "format": ["ifndef _LIBCPP_HAS_NO_INCOMPLETE_FORMAT"],
+
+ "clocale": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "codecvt": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "fstream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "iomanip": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "ios": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "iostream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "istream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "locale.h": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "locale": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "ostream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "ranges": ["ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES"],
+ "regex": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "sstream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "streambuf": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+ "strstream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+
+ "experimental/coroutine": ["if defined(__cpp_coroutines)"],
+ "experimental/regex": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
+}
+
+allowed_extensions = ['', '.h']
+indent_width = 4
+
+
+begin_pattern = """\
+////////////////////////////////////////////////////////////////////////////////
+// BEGIN-GENERATED-HEADERS
+////////////////////////////////////////////////////////////////////////////////
+"""
+
+warning_note = """\
+// WARNING: This test was generated by {script_name}
+// and should not be edited manually.
+
+""".format(script_name=script_name)
+
+end_pattern = """\
+////////////////////////////////////////////////////////////////////////////////
+// END-GENERATED-HEADERS
+////////////////////////////////////////////////////////////////////////////////
+"""
+
+generated_part_pattern = re.compile(re.escape(begin_pattern) + ".*" + re.escape(end_pattern),
+ re.MULTILINE | re.DOTALL)
+
+headers_template = """\
+// Top level headers
+{top_level_headers}
+
+// experimental headers
+#if __cplusplus >= 201103L
+{experimental_headers}
+#endif // __cplusplus >= 201103L
+
+// extended headers
+{extended_headers}
+"""
+
+
+def should_keep_header(p, exclusions=None):
+ if os.path.isdir(p):
+ return False
+
+ if exclusions:
+ relpath = os.path.relpath(p, include_path)
+ relpath = posixpath.join(*os.path.split(relpath))
+ if relpath in exclusions:
+ return False
+
+ return os.path.splitext(p)[1] in allowed_extensions
+
+
+def produce_include(relpath, indent_level, post_include=None):
+ relpath = posixpath.join(*os.path.split(relpath))
+ template = "{preambule}#{indentation}include <{include}>{post_include}{postambule}"
+
+ base_indentation = ' '*(indent_width * indent_level)
+ next_indentation = base_indentation + ' '*(indent_width)
+ post_include = "\n{}".format(post_include) if post_include else ''
+
+ markup = header_markup.get(relpath, None)
+ if markup:
+ preambule = '#{indentation}{directive}\n'.format(
+ directive=markup[0],
+ indentation=base_indentation,
+ )
+ postambule = '\n#{indentation}endif'.format(
+ indentation=base_indentation,
+ )
+ indentation = next_indentation
+ else:
+ preambule = ''
+ postambule = ''
+ indentation = base_indentation
+
+ return template.format(
+ include=relpath,
+ post_include=post_include,
+ preambule=preambule,
+ postambule=postambule,
+ indentation=indentation,
+ )
+
+
+def produce_headers(path_parts, indent_level, post_include=None, exclusions=None):
+ pattern = os.path.join(*path_parts, '[a-z]*')
+
+ files = sorted(glob.glob(pattern, recursive=False))
+
+ include_headers = [
+ produce_include(os.path.relpath(p, include_path),
+ indent_level, post_include=post_include)
+ for p in files
+ if should_keep_header(p, exclusions)
+ ]
+
+ return '\n'.join(include_headers)
+
+
+def produce_top_level_headers(post_include=None, exclusions=None):
+ return produce_headers([include_path], 0, post_include=post_include, exclusions=exclusions)
+
+
+def produce_experimental_headers(post_include=None, exclusions=None):
+ return produce_headers([include_path, 'experimental'], 1, post_include=post_include, exclusions=exclusions)
+
+
+def produce_extended_headers(post_include=None, exclusions=None):
+ return produce_headers([include_path, 'ext'], 0, post_include=post_include, exclusions=exclusions)
+
+
+def replace_generated_headers(test_path, test_str):
+ with open(test_path, 'r') as f:
+ content = f.read()
+
+ preambule = begin_pattern + '\n// clang-format off\n\n' + warning_note
+ postambule = '\n// clang-format on\n\n' + end_pattern
+ content = generated_part_pattern.sub(
+ preambule + test_str + postambule, content)
+
+ with open(test_path, 'w', newline='\n') as f:
+ f.write(content)
+
+
+def produce_test(test_filename, exclusions=None, post_include=None):
+ test_str = headers_template.format(
+ top_level_headers=produce_top_level_headers(
+ post_include=post_include,
+ exclusions=exclusions,
+ ),
+ experimental_headers=produce_experimental_headers(
+ post_include=post_include,
+ ),
+ extended_headers=produce_extended_headers(
+ post_include=post_include,
+ ),
+ )
+
+ replace_generated_headers(os.path.join(
+ libcxx_test_path, test_filename), test_str)
+
+
+def main():
+ produce_test('double_include.sh.cpp')
+ produce_test('min_max_macros.compile.pass.cpp',
+ post_include='TEST_MACROS();')
+ produce_test('no_assert_include.compile.pass.cpp',
+ exclusions=['cassert'])
+
+
+if __name__ == '__main__':
+ main()
--- /dev/null
+#!/usr/bin/env python
+
+import os
+import re
+import shutil
+from pathlib import Path
+
+
+def get_libcxx_paths():
+ utils_path = os.path.dirname(os.path.abspath(__file__))
+ script_name = os.path.basename(__file__)
+ assert os.path.exists(utils_path)
+ src_root = os.path.dirname(utils_path)
+ include_path = os.path.join(src_root, 'include')
+ assert os.path.exists(include_path)
+ docs_path = os.path.join(src_root, 'docs')
+ assert os.path.exists(docs_path)
+ detail_header_test_root = os.path.join(src_root, 'test', 'libcxx',
+ 'diagnostics', 'detail.headers')
+ assert os.path.exists(detail_header_test_root)
+ shutil.rmtree(detail_header_test_root)
+ Path(f'{detail_header_test_root}').mkdir()
+ assert os.path.exists(detail_header_test_root)
+ return script_name, src_root, include_path, docs_path, detail_header_test_root
+
+
+script_name, source_root, include_path, docs_path, detail_header_test_root = get_libcxx_paths(
+)
+
+
+def generate_test(header):
+ return f'''// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: modules-build
+
+// WARNING: This test was generated by '{script_name}'
+// and should not be edited manually.
+
+// expected-error@*:* {{{{use of private header from outside its module: '{header}'}}}}
+#include <{header}>
+'''
+
+
+def relative_path(path):
+ return path.as_posix()[len(include_path + '/'):]
+
+
+def is_still_public(path):
+ rp = relative_path(path)
+ return not rp.startswith('__support') and rp not in [
+ "__bsd_locale_defaults.h", "__bsd_locale_fallbacks.h", "__config",
+ "__config_site.in", "__debug", "__hash_table", "__functional_base",
+ "__libcpp_version", "__nullptr", "__threading_support", "__tree",
+ "__undef_macros"
+ ]
+
+
+def main():
+ paths = [
+ relative_path(p) for p in Path(include_path).rglob('*')
+ if relative_path(p).startswith('__') and not p.is_dir()
+ and is_still_public(p)
+ ]
+ for path in paths:
+ path_with_subdir = re.search(r'__(\w+)/(\w+)', path)
+ directory = path_with_subdir.group(1) + '/' if path_with_subdir else ""
+ file = path_with_subdir.group(2) if path_with_subdir else path[2:]
+ path_to_write = f'{detail_header_test_root}/{directory}{file}.module.verify.cpp'
+ Path(f'{detail_header_test_root}/{directory}').mkdir(exist_ok=True)
+ assert os.path.exists(f'{detail_header_test_root}/{directory}')
+ with open(path_to_write, 'w') as f:
+ f.write(generate_test(path))
+
+
+if __name__ == '__main__':
+ main()
---
Language: Cpp
BasedOnStyle: Google
+PointerAlignment: Left
...
--- /dev/null
+#!/usr/bin/env bash
+
+# Checkout LLVM sources
+git clone --depth=1 https://github.com/llvm/llvm-project.git llvm-project
+
+# Setup libc++ options
+if [ -z "$BUILD_32_BITS" ]; then
+ export BUILD_32_BITS=OFF && echo disabling 32 bit build
+fi
+
+# Build and install libc++ (Use unstable ABI for better sanitizer coverage)
+cd ./llvm-project
+cmake -DCMAKE_C_COMPILER=${C_COMPILER} \
+ -DCMAKE_CXX_COMPILER=${COMPILER} \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIBCXX_ABI_UNSTABLE=OFF \
+ -DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \
+ -DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
+ -DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi' \
+ -S llvm -B llvm-build -G "Unix Makefiles"
+make -C llvm-build -j3 cxx cxxabi
+sudo make -C llvm-build install-cxx install-cxxabi
+cd ..
--- /dev/null
+---
+name: Bug report
+about: Create a report to help us improve
+title: "[BUG]"
+labels: ''
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**System**
+Which OS, compiler, and compiler version are you using:
+ - OS:
+ - Compiler and version:
+
+**To reproduce**
+Steps to reproduce the behavior:
+1. sync to commit ...
+2. cmake/bazel...
+3. make ...
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Additional context**
+Add any other context about the problem here.
--- /dev/null
+---
+name: Feature request
+about: Suggest an idea for this project
+title: "[FR]"
+labels: ''
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
--- /dev/null
+name: bazel
+
+on:
+ push: {}
+ pull_request: {}
+
+jobs:
+ build-and-test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: mount bazel cache
+ uses: actions/cache@v2.0.0
+ env:
+ cache-name: bazel-cache
+ with:
+ path: "~/.cache/bazel"
+ key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.ref }}
+ restore-keys: |
+ ${{ env.cache-name }}-${{ runner.os }}-main
+
+ - name: build
+ run: |
+ bazel build //:benchmark //:benchmark_main //test/...
+
+ - name: test
+ run: |
+ bazel test --test_output=all //test/...
--- /dev/null
+name: build-and-test-perfcounters
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+jobs:
+ job:
+ # TODO(dominic): Extend this to include compiler and set through env: CC/CXX.
+ name: ${{ matrix.os }}.${{ matrix.build_type }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, ubuntu-16.04, ubuntu-20.04]
+ build_type: ['Release', 'Debug']
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: install libpfm
+ run: sudo apt install libpfm4-dev
+
+ - name: create build environment
+ run: cmake -E make_directory ${{ runner.workspace }}/_build
+
+ - name: configure cmake
+ shell: bash
+ working-directory: ${{ runner.workspace }}/_build
+ run: cmake -DBENCHMARK_ENABLE_LIBPFM=1 -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+
+ - name: build
+ shell: bash
+ working-directory: ${{ runner.workspace }}/_build
+ run: cmake --build . --config ${{ matrix.build_type }}
+
+ # Skip testing, for now. It seems perf_event_open does not succeed on the
+ # hosting machine, very likely a permissions issue.
+ # TODO(mtrofin): Enable test.
+ # - name: test
+ # shell: bash
+ # working-directory: ${{ runner.workspace }}/_build
+ # run: sudo ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure
--- /dev/null
+name: build-and-test
+
+on:
+ push: {}
+ pull_request: {}
+
+jobs:
+ # TODO: add 32-bit builds (g++ and clang++) for ubuntu
+ # (requires g++-multilib and libc6:i386)
+ # TODO: add coverage build (requires lcov)
+ # TODO: add clang + libc++ builds for ubuntu
+ # TODO: add clang + ubsan/asan/msan + libc++ builds for ubuntu
+ job:
+ name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.compiler }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, ubuntu-16.04, ubuntu-20.04, macos-latest]
+ build_type: ['Release', 'Debug']
+ compiler: [g++, clang++]
+ include:
+ - displayTargetName: windows-latest-release
+ os: windows-latest
+ build_type: 'Release'
+ - displayTargetName: windows-latest-debug
+ os: windows-latest
+ build_type: 'Debug'
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: create build environment
+ run: cmake -E make_directory ${{ runner.workspace }}/_build
+
+ - name: configure cmake
+ env:
+ CXX: ${{ matrix.compiler }}
+ shell: bash
+ working-directory: ${{ runner.workspace }}/_build
+ run: >
+ cmake $GITHUB_WORKSPACE
+ -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+
+ - name: build
+ shell: bash
+ working-directory: ${{ runner.workspace }}/_build
+ run: cmake --build . --config ${{ matrix.build_type }}
+
+ - name: test
+ shell: bash
+ working-directory: ${{ runner.workspace }}/_build
+ run: ctest -C ${{ matrix.build_type }} -VV
+
+ ubuntu-14_04:
+ name: ubuntu-14.04.${{ matrix.build_type }}.${{ matrix.compiler }}
+ runs-on: [ubuntu-latest]
+ strategy:
+ fail-fast: false
+ matrix:
+ build_type: ['Release', 'Debug']
+ compiler: [g++-4.8, clang++-3.6]
+ include:
+ - compiler: g++-6
+ build_type: 'Debug'
+ run_tests: true
+ - compiler: g++-6
+ build_type: 'Release'
+ run_tests: true
+ container: ubuntu:14.04
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: install required bits
+ run: |
+ sudo apt update
+ sudo apt -y install clang-3.6 cmake3 g++-4.8 git
+
+ - name: install other bits
+ if: ${{ matrix.compiler }} == g++-6
+ run: |
+ sudo apt -y install software-properties-common
+ sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test"
+ sudo apt update
+ sudo apt -y install g++-6
+
+ - name: create build environment
+ run: cmake -E make_directory $GITHUB_WORKSPACE/_build
+
+ - name: configure cmake
+ env:
+ CXX: ${{ matrix.compiler }}
+ shell: bash
+ working-directory: ${{ github.workspace }}/_build
+ run: >
+ cmake $GITHUB_WORKSPACE
+ -DBENCHMARK_ENABLE_TESTING=${{ matrix.run_tests }}
+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+ -DBENCHMARK_DOWNLOAD_DEPENDENCIES=${{ matrix.run_tests }}
+
+ - name: build
+ shell: bash
+ working-directory: ${{ github.workspace }}/_build
+ run: cmake --build . --config ${{ matrix.build_type }}
+
+ - name: test
+ if: ${{ matrix.run_tests }}
+ shell: bash
+ working-directory: ${{ github.workspace }}/_build
+ run: ctest -C ${{ matrix.build_type }} -VV
--- /dev/null
+name: pylint
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+jobs:
+ pylint:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python 3.8
+ uses: actions/setup-python@v1
+ with:
+ python-version: 3.8
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install pylint pylint-exit conan
+ - name: Run pylint
+ run: |
+ pylint `find . -name '*.py'|xargs` || pylint-exit $?
--- /dev/null
+name: sanitizer
+
+on:
+ push: {}
+ pull_request: {}
+
+env:
+ CC: clang
+ CXX: clang++
+ EXTRA_CXX_FLAGS: "-stdlib=libc++"
+ UBSAN_OPTIONS: "print_stacktrace=1"
+
+jobs:
+ job:
+ name: ${{ matrix.sanitizer }}.${{ matrix.build_type }}
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ build_type: ['Debug', 'RelWithDebInfo']
+ sanitizer: ['asan', 'ubsan', 'tsan']
+ # TODO: add 'msan' above. currently failing and needs investigation.
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: configure msan env
+ if: matrix.sanitizer == 'msan'
+ run: |
+ echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins" >> $GITHUB_ENV
+ echo "LIBCXX_SANITIZER=MemoryWithOrigins" >> $GITHUB_ENV
+
+ - name: configure ubsan env
+ if: matrix.sanitizer == 'ubsan'
+ run: |
+ echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all" >> $GITHUB_ENV
+ echo "LIBCXX_SANITIZER=Undefined" >> $GITHUB_ENV
+
+ - name: configure asan env
+ if: matrix.sanitizer == 'asan'
+ run: |
+ echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=address -fno-sanitize-recover=all" >> $GITHUB_ENV
+ echo "LIBCXX_SANITIZER=Address" >> $GITHUB_ENV
+
+ - name: configure tsan env
+ if: matrix.sanitizer == 'tsan'
+ run: |
+ echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all" >> $GITHUB_ENV
+ echo "LIBCXX_SANITIZER=Thread" >> $GITHUB_ENV
+
+ - name: install llvm stuff
+ run: "${GITHUB_WORKSPACE}/.github/.libcxx-setup.sh"
+
+ - name: create build environment
+ run: cmake -E make_directory ${{ runner.workspace }}/_build
+
+ - name: configure cmake
+ shell: bash
+ working-directory: ${{ runner.workspace }}/_build
+ run: >
+ cmake $GITHUB_WORKSPACE
+ -DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF
+ -DBENCHMARK_ENABLE_LIBPFM=OFF
+ -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
+ -DCMAKE_C_COMPILER=${{ env.CC }}
+ -DCMAKE_CXX_COMPILER=${{ env.CXX }}
+ -DCMAKE_C_FLAGS="${{ env.EXTRA_FLAGS }}"
+ -DCMAKE_CXX_FLAGS="${{ env.EXTRA_FLAGS }} ${{ env.EXTRA_CXX_FLAGS }}"
+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+
+ - name: build
+ shell: bash
+ working-directory: ${{ runner.workspace }}/_build
+ run: cmake --build . --config ${{ matrix.build_type }}
+
+ - name: test
+ shell: bash
+ working-directory: ${{ runner.workspace }}/_build
+ run: ctest -C ${{ matrix.build_type }} -VV
--- /dev/null
+name: test-bindings
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+jobs:
+ python_bindings:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python
+ uses: actions/setup-python@v1
+ with:
+ python-version: 3.8
+ - name: Install benchmark
+ run:
+ python setup.py install
+ - name: Run example bindings
+ run:
+ python bindings/python/google_benchmark/example.py
!/cmake/*.cmake
!/test/AssemblyTests.cmake
*~
+*.swp
*.pyc
__pycache__
# Visual Studio 2015/2017 cache/options directory
.vs/
CMakeSettings.json
+
+# Visual Studio Code cache/options directory
+.vscode/
+
+# Python build stuff
+dist/
+*.egg-info*
dist: trusty
language: cpp
-env:
- global:
- - /usr/local/bin:$PATH
-
matrix:
include:
- compiler: gcc
packages:
- lcov
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Coverage
- - compiler: gcc
- env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Debug
- - compiler: gcc
- env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Release
- compiler: gcc
addons:
apt:
packages:
- g++-multilib
- env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Debug BUILD_32_BITS=ON
+ - libc6:i386
+ env:
+ - COMPILER=g++
+ - C_COMPILER=gcc
+ - BUILD_TYPE=Debug
+ - BUILD_32_BITS=ON
+ - EXTRA_FLAGS="-m32"
- compiler: gcc
addons:
apt:
packages:
- g++-multilib
- env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Release BUILD_32_BITS=ON
+ - libc6:i386
+ env:
+ - COMPILER=g++
+ - C_COMPILER=gcc
+ - BUILD_TYPE=Release
+ - BUILD_32_BITS=ON
+ - EXTRA_FLAGS="-m32"
- compiler: gcc
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=g++-6 C_COMPILER=gcc-6 BUILD_TYPE=Debug
- ENABLE_SANITIZER=1
- EXTRA_FLAGS="-fno-omit-frame-pointer -g -O2 -fsanitize=undefined,address -fuse-ld=gold"
- - compiler: clang
- env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Debug
- - compiler: clang
- env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Release
# Clang w/ libc++
- compiler: clang
+ dist: xenial
addons:
apt:
packages:
clang-3.8
env:
+ - INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
- LIBCXX_BUILD=1
- - EXTRA_FLAGS="-stdlib=libc++"
+ - EXTRA_CXX_FLAGS="-stdlib=libc++"
- compiler: clang
+ dist: xenial
addons:
apt:
packages:
clang-3.8
env:
+ - INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
- LIBCXX_BUILD=1
- - EXTRA_FLAGS="-stdlib=libc++"
+ - EXTRA_CXX_FLAGS="-stdlib=libc++"
# Clang w/ 32bit libc++
- compiler: clang
+ dist: xenial
addons:
apt:
packages:
- clang-3.8
- g++-multilib
+ - libc6:i386
env:
+ - INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
- LIBCXX_BUILD=1
- BUILD_32_BITS=ON
- - EXTRA_FLAGS="-stdlib=libc++ -m32"
+ - EXTRA_FLAGS="-m32"
+ - EXTRA_CXX_FLAGS="-stdlib=libc++"
# Clang w/ 32bit libc++
- compiler: clang
+ dist: xenial
addons:
apt:
packages:
- clang-3.8
- g++-multilib
+ - libc6:i386
env:
+ - INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
- LIBCXX_BUILD=1
- BUILD_32_BITS=ON
- - EXTRA_FLAGS="-stdlib=libc++ -m32"
+ - EXTRA_FLAGS="-m32"
+ - EXTRA_CXX_FLAGS="-stdlib=libc++"
# Clang w/ libc++, ASAN, UBSAN
- compiler: clang
+ dist: xenial
addons:
apt:
packages:
clang-3.8
env:
+ - INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
- LIBCXX_BUILD=1 LIBCXX_SANITIZER="Undefined;Address"
- ENABLE_SANITIZER=1
- - EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=undefined,address -fno-sanitize-recover=all"
+ - EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=undefined,address -fno-sanitize-recover=all"
+ - EXTRA_CXX_FLAGS="-stdlib=libc++"
- UBSAN_OPTIONS=print_stacktrace=1
# Clang w/ libc++ and MSAN
- compiler: clang
+ dist: xenial
addons:
apt:
packages:
clang-3.8
env:
+ - INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
- LIBCXX_BUILD=1 LIBCXX_SANITIZER=MemoryWithOrigins
- ENABLE_SANITIZER=1
- - EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins"
+ - EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins"
+ - EXTRA_CXX_FLAGS="-stdlib=libc++"
# Clang w/ libc++ and MSAN
- compiler: clang
+ dist: xenial
addons:
apt:
packages:
clang-3.8
env:
+ - INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=RelWithDebInfo
- LIBCXX_BUILD=1 LIBCXX_SANITIZER=Thread
- ENABLE_SANITIZER=1
- - EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all"
- - os: osx
- osx_image: xcode8.3
- compiler: clang
- env:
- - COMPILER=clang++ BUILD_TYPE=Debug
- - os: osx
- osx_image: xcode8.3
- compiler: clang
- env:
- - COMPILER=clang++ BUILD_TYPE=Release
+ - EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all"
+ - EXTRA_CXX_FLAGS="-stdlib=libc++"
- os: osx
osx_image: xcode8.3
compiler: clang
env:
- - COMPILER=clang++ BUILD_TYPE=Release BUILD_32_BITS=ON
- - os: osx
- osx_image: xcode8.3
- compiler: gcc
- env:
- - COMPILER=g++-7 C_COMPILER=gcc-7 BUILD_TYPE=Debug
+ - COMPILER=clang++
+ - BUILD_TYPE=Release
+ - BUILD_32_BITS=ON
+ - EXTRA_FLAGS="-m32"
before_script:
- if [ -n "${LIBCXX_BUILD}" ]; then
- source .travis-libcxx-setup.sh;
+ source .libcxx-setup.sh;
fi
- if [ -n "${ENABLE_SANITIZER}" ]; then
export EXTRA_OPTIONS="-DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF";
fi
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
sudo apt-get update -qq;
- sudo apt-get install -qq unzip;
- wget https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-installer-linux-x86_64.sh --output-document bazel-installer.sh;
+ sudo apt-get install -qq unzip cmake3;
+ wget https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-linux-x86_64.sh --output-document bazel-installer.sh;
travis_wait sudo bash bazel-installer.sh;
fi
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
- curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-installer-darwin-x86_64.sh;
+ curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-darwin-x86_64.sh;
travis_wait sudo bash bazel-installer.sh;
fi
script:
- - cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="${EXTRA_FLAGS}" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DBENCHMARK_BUILD_32_BITS=${BUILD_32_BITS} ${EXTRA_OPTIONS} ..
+ - cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_C_FLAGS="${EXTRA_FLAGS}" -DCMAKE_CXX_FLAGS="${EXTRA_FLAGS} ${EXTRA_CXX_FLAGS}" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DBENCHMARK_BUILD_32_BITS=${BUILD_32_BITS} ${EXTRA_OPTIONS} ..
- make
- ctest -C ${BUILD_TYPE} --output-on-failure
- bazel test -c dbg --define google_benchmark.have_regex=posix --announce_rc --verbose_failures --test_output=errors --keep_going //test/...
# Please keep the list sorted.
Albert Pretorius <pretoalb@gmail.com>
+Alex Steele <steeleal123@gmail.com>
+Andriy Berestovskyy <berestovskyy@gmail.com>
Arne Beer <arne@twobeer.de>
Carto
+Christian Wassermann <christian_wassermann@web.de>
Christopher Seymour <chris.j.seymour@hotmail.com>
+Colin Braley <braley.colin@gmail.com>
+Daniel Harvey <danielharvey458@gmail.com>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
Deniz Evrenci <denizevrenci@gmail.com>
Dirac Research
Dominik Czarnota <dominik.b.czarnota@gmail.com>
+Eric Backus <eric_backus@alum.mit.edu>
Eric Fiselier <eric@efcs.ca>
Eugene Zhuk <eugene.zhuk@gmail.com>
Evgeny Safronov <division494@gmail.com>
Federico Ficarelli <federico.ficarelli@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
+Gergő Szitár <szitar.gergo@gmail.com>
Google Inc.
International Business Machines Corporation
Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
Jern-Kuan Leong <jernkuan@gmail.com>
JianXiong Zhou <zhoujianxiong2@gmail.com>
Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
+Jordan Williams <jwillikers@protonmail.com>
Jussi Knuuttila <jussi.knuuttila@gmail.com>
Kaito Udagawa <umireon@gmail.com>
Kishan Kumar <kumar.kishan@outlook.com>
Maxim Vafin <maxvafin@gmail.com>
MongoDB Inc.
Nick Hutchinson <nshutchinson@gmail.com>
+Norman Heino <norman.heino@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com>
Ori Livneh <ori.livneh@gmail.com>
Paul Redmond <paul.redmond@gmail.com>
Radoslav Yovchev <radoslav.tm@gmail.com>
Roman Lebedev <lebedev.ri@gmail.com>
+Sayan Bhattacharjee <aero.sayan@gmail.com>
Shuo Chen <chenshuo@chenshuo.com>
Steinar H. Gunderson <sgunderson@bigfoot.com>
Stripe, Inc.
+Tobias Schmidt <tobias.schmidt@in.tum.de>
Yixuan Qiu <yixuanq@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Zbigniew Skowron <zbychs@gmail.com>
+Min-Yih Hsu <yihshyng223@gmail.com>
--- /dev/null
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
+licenses(["notice"])
+
+config_setting(
+ name = "windows",
+ values = {
+ "cpu": "x64_windows",
+ },
+ visibility = [":__subpackages__"],
+)
+
+cc_library(
+ name = "benchmark",
+ srcs = glob(
+ [
+ "src/*.cc",
+ "src/*.h",
+ ],
+ exclude = ["src/benchmark_main.cc"],
+ ),
+ hdrs = ["include/benchmark/benchmark.h"],
+ linkopts = select({
+ ":windows": ["-DEFAULTLIB:shlwapi.lib"],
+ "//conditions:default": ["-pthread"],
+ }),
+ strip_include_prefix = "include",
+ visibility = ["//visibility:public"],
+)
+
+cc_library(
+ name = "benchmark_main",
+ srcs = ["src/benchmark_main.cc"],
+ hdrs = ["include/benchmark/benchmark.h"],
+ strip_include_prefix = "include",
+ visibility = ["//visibility:public"],
+ deps = [":benchmark"],
+)
+
+cc_library(
+ name = "benchmark_internal_headers",
+ hdrs = glob(["src/*.h"]),
+ visibility = ["//test:__pkg__"],
+)
-cmake_minimum_required (VERSION 2.8.12)
-
-project (benchmark)
+cmake_minimum_required (VERSION 3.5.1)
foreach(p
+ CMP0048 # OK to clear PROJECT_VERSION on project()
CMP0054 # CMake 3.1
CMP0056 # export EXE_LINKER_FLAGS to try_run
CMP0057 # Support no if() IN_LIST operator
+ CMP0063 # Honor visibility properties for all targets
+ CMP0077 # Allow option() overrides in importing projects
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
endif()
endforeach()
+project (benchmark VERSION 1.5.4 LANGUAGES CXX)
+
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON)
option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF)
# in cases where it is not possible to build or find a valid version of gtest.
option(BENCHMARK_ENABLE_GTEST_TESTS "Enable building the unit tests which depend on gtest" ON)
+option(BENCHMARK_ENABLE_LIBPFM "Enable performance counters provided by libpfm" OFF)
+
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+if(MSVC)
+ # As of CMake 3.18, CMAKE_SYSTEM_PROCESSOR is not set properly for MSVC and
+ # cross-compilation (e.g. Host=x86_64, target=aarch64) requires using the
+ # undocumented, but working variable.
+ # See https://gitlab.kitware.com/cmake/cmake/-/issues/15170
+ set(CMAKE_SYSTEM_PROCESSOR ${MSVC_CXX_ARCHITECTURE_ID})
+ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ARM")
+ set(CMAKE_CROSSCOMPILING TRUE)
+ endif()
+endif()
+
set(ENABLE_ASSEMBLY_TESTS_DEFAULT OFF)
function(should_enable_assembly_tests)
if(CMAKE_BUILD_TYPE)
include(GetGitVersion)
get_git_version(GIT_VERSION)
+# If no git version can be determined, use the version
+# from the project() command
+if ("${GIT_VERSION}" STREQUAL "0.0.0")
+ set(VERSION "${benchmark_VERSION}")
+else()
+ set(VERSION "${GIT_VERSION}")
+endif()
# Tell the user what versions we are using
-string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION ${GIT_VERSION})
message(STATUS "Version: ${VERSION}")
# The version of the libraries
add_cxx_compiler_flag(-Werror RELEASE)
add_cxx_compiler_flag(-Werror RELWITHDEBINFO)
add_cxx_compiler_flag(-Werror MINSIZEREL)
+ if (NOT BENCHMARK_ENABLE_TESTING)
+ # Disable warning when compiling tests as gtest does not use 'override'.
+ add_cxx_compiler_flag(-Wsuggest-override)
+ endif()
add_cxx_compiler_flag(-pedantic)
add_cxx_compiler_flag(-pedantic-errors)
add_cxx_compiler_flag(-Wshorten-64-to-32)
add_definitions(-D_GNU_SOURCE=1)
endif()
+ if (QNXNTO)
+ add_definitions(-D_QNX_SOURCE)
+ endif()
+
# Link time optimisation
if (BENCHMARK_ENABLE_LTO)
add_cxx_compiler_flag(-flto)
- if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ add_cxx_compiler_flag(-Wno-lto-type-mismatch)
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
find_program(GCC_AR gcc-ar)
if (GCC_AR)
set(CMAKE_AR ${GCC_AR})
if (GCC_RANLIB)
set(CMAKE_RANLIB ${GCC_RANLIB})
endif()
- elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
+ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
include(llvm-toolchain)
endif()
endif()
endif()
endif(BENCHMARK_USE_LIBCXX)
+set(EXTRA_CXX_FLAGS "")
+if (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ # Clang on Windows fails to compile the regex feature check under C++11
+ set(EXTRA_CXX_FLAGS "-DCMAKE_CXX_STANDARD=14")
+endif()
+
# C++ feature checks
# Determine the correct regular expression engine to use
-cxx_feature_check(STD_REGEX)
-cxx_feature_check(GNU_POSIX_REGEX)
-cxx_feature_check(POSIX_REGEX)
+cxx_feature_check(STD_REGEX ${EXTRA_CXX_FLAGS})
+cxx_feature_check(GNU_POSIX_REGEX ${EXTRA_CXX_FLAGS})
+cxx_feature_check(POSIX_REGEX ${EXTRA_CXX_FLAGS})
if(NOT HAVE_STD_REGEX AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
message(FATAL_ERROR "Failed to determine the source files for the regular expression backend")
endif()
AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
message(WARNING "Using std::regex with exceptions disabled is not fully supported")
endif()
+
cxx_feature_check(STEADY_CLOCK)
# Ensure we have pthreads
+set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
+if (BENCHMARK_ENABLE_LIBPFM)
+ find_package(PFM)
+endif()
+
# Set up directories
include_directories(${PROJECT_SOURCE_DIR}/include)
if (BENCHMARK_ENABLE_TESTING)
enable_testing()
- if (BENCHMARK_ENABLE_GTEST_TESTS)
- include(HandleGTest)
+ if (BENCHMARK_ENABLE_GTEST_TESTS AND
+ NOT (TARGET gtest AND TARGET gtest_main AND
+ TARGET gmock AND TARGET gmock_main))
+ include(GoogleTest)
endif()
add_subdirectory(test)
endif()
#
# Please keep the list sorted.
+Abhina Sreeskantharajan <abhina.sreeskantharajan@ibm.com>
Albert Pretorius <pretoalb@gmail.com>
+Alex Steele <steelal123@gmail.com>
+Andriy Berestovskyy <berestovskyy@gmail.com>
Arne Beer <arne@twobeer.de>
Billy Robert O'Neal III <billy.oneal@gmail.com> <bion@microsoft.com>
Chris Kennelly <ckennelly@google.com> <ckennelly@ckennelly.com>
+Christian Wassermann <christian_wassermann@web.de>
Christopher Seymour <chris.j.seymour@hotmail.com>
+Colin Braley <braley.colin@gmail.com>
Cyrille Faucheux <cyrille.faucheux@gmail.com>
+Daniel Harvey <danielharvey458@gmail.com>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
Deniz Evrenci <denizevrenci@gmail.com>
Dominic Hamon <dma@stripysock.com> <dominic@google.com>
Dominik Czarnota <dominik.b.czarnota@gmail.com>
+Eric Backus <eric_backus@alum.mit.edu>
Eric Fiselier <eric@efcs.ca>
Eugene Zhuk <eugene.zhuk@gmail.com>
Evgeny Safronov <division494@gmail.com>
+Fanbo Meng <fanbo.meng@ibm.com>
Federico Ficarelli <federico.ficarelli@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
+Geoffrey Martin-Noble <gcmn@google.com> <gmngeoffrey@gmail.com>
+Gergő Szitár <szitar.gergo@gmail.com>
+Hannes Hauswedell <h2@fsfe.org>
Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
Jern-Kuan Leong <jernkuan@gmail.com>
JianXiong Zhou <zhoujianxiong2@gmail.com>
Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
John Millikin <jmillikin@stripe.com>
+Jordan Williams <jwillikers@protonmail.com>
Jussi Knuuttila <jussi.knuuttila@gmail.com>
Kai Wolf <kai.wolf@gmail.com>
-Kishan Kumar <kumar.kishan@outlook.com>
Kaito Udagawa <umireon@gmail.com>
+Kishan Kumar <kumar.kishan@outlook.com>
Lei Xu <eddyxu@gmail.com>
Matt Clarkson <mattyclarkson@gmail.com>
Maxim Vafin <maxvafin@gmail.com>
Nick Hutchinson <nshutchinson@gmail.com>
+Norman Heino <norman.heino@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com>
Ori Livneh <ori.livneh@gmail.com>
Pascal Leroy <phl@google.com>
Ray Glover <ray.glover@uk.ibm.com>
Robert Guo <robert.guo@mongodb.com>
Roman Lebedev <lebedev.ri@gmail.com>
+Sayan Bhattacharjee <aero.sayan@gmail.com>
Shuo Chen <chenshuo@chenshuo.com>
+Steven Wan <wan.yu@ibm.com>
+Tobias Schmidt <tobias.schmidt@in.tum.de>
Tobias Ulvgård <tobias.ulvgard@dirac.se>
Tom Madams <tom.ej.madams@gmail.com> <tmadams@google.com>
Yixuan Qiu <yixuanq@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Zbigniew Skowron <zbychs@gmail.com>
+Min-Yih Hsu <yihshyng223@gmail.com>
-# benchmark
+# Benchmark
+
+[![build-and-test](https://github.com/google/benchmark/workflows/build-and-test/badge.svg)](https://github.com/google/benchmark/actions?query=workflow%3Abuild-and-test)
+[![bazel](https://github.com/google/benchmark/actions/workflows/bazel.yml/badge.svg)](https://github.com/google/benchmark/actions/workflows/bazel.yml)
+[![pylint](https://github.com/google/benchmark/workflows/pylint/badge.svg)](https://github.com/google/benchmark/actions?query=workflow%3Apylint)
+[![test-bindings](https://github.com/google/benchmark/workflows/test-bindings/badge.svg)](https://github.com/google/benchmark/actions?query=workflow%3Atest-bindings)
+
[![Build Status](https://travis-ci.org/google/benchmark.svg?branch=master)](https://travis-ci.org/google/benchmark)
-[![Build status](https://ci.appveyor.com/api/projects/status/u0qsyp7t1tk7cpxs/branch/master?svg=true)](https://ci.appveyor.com/project/google/benchmark/branch/master)
[![Coverage Status](https://coveralls.io/repos/google/benchmark/badge.svg)](https://coveralls.io/r/google/benchmark)
-[![slackin](https://slackin-iqtfqnpzxd.now.sh/badge.svg)](https://slackin-iqtfqnpzxd.now.sh/)
-A library to support the benchmarking of functions, similar to unit-tests.
+
+A library to benchmark code snippets, similar to unit tests. Example:
+
+```c++
+#include <benchmark/benchmark.h>
+
+static void BM_SomeFunction(benchmark::State& state) {
+ // Perform setup here
+ for (auto _ : state) {
+ // This code gets timed
+ SomeFunction();
+ }
+}
+// Register the function as a benchmark
+BENCHMARK(BM_SomeFunction);
+// Run the benchmark
+BENCHMARK_MAIN();
+```
+
+To get started, see [Requirements](#requirements) and
+[Installation](#installation). See [Usage](#usage) for a full example and the
+[User Guide](#user-guide) for a more comprehensive feature overview.
+
+It may also help to read the [Google Test documentation](https://github.com/google/googletest/blob/master/docs/primer.md)
+as some of the structural aspects of the APIs are similar.
+
+### Resources
[Discussion group](https://groups.google.com/d/forum/benchmark-discuss)
-IRC channel: [freenode](https://freenode.net) #googlebenchmark
+IRC channels:
+* [libera](https://libera.chat) #benchmark
[Additional Tooling Documentation](docs/tools.md)
[Assembly Testing Documentation](docs/AssemblyTests.md)
+## Requirements
+
+The library can be used with C++03. However, it requires C++11 to build,
+including compiler and standard library support.
+
+The following minimum versions are required to build the library:
+
+* GCC 4.8
+* Clang 3.4
+* Visual Studio 14 2015
+* Intel 2015 Update 1
+
+See [Platform-Specific Build Instructions](#platform-specific-build-instructions).
-## Building
+## Installation
-The basic steps for configuring and building the library look like this:
+This describes the installation process using cmake. As pre-requisites, you'll
+need git and cmake installed.
+
+_See [dependencies.md](dependencies.md) for more details regarding supported
+versions of build tools._
```bash
+# Check out the library.
$ git clone https://github.com/google/benchmark.git
# Benchmark requires Google Test as a dependency. Add the source tree as a subdirectory.
$ git clone https://github.com/google/googletest.git benchmark/googletest
-$ mkdir build && cd build
-$ cmake -G <generator> [options] ../benchmark
-# Assuming a makefile generator was used
-$ make
+# Go to the library root directory
+$ cd benchmark
+# Make a build directory to place the build output.
+$ cmake -E make_directory "build"
+# Generate build system files with cmake.
+$ cmake -E chdir "build" cmake -DCMAKE_BUILD_TYPE=Release ../
+# or, starting with CMake 3.13, use a simpler form:
+# cmake -DCMAKE_BUILD_TYPE=Release -S . -B "build"
+# Build the library.
+$ cmake --build "build" --config Release
+```
+This builds the `benchmark` and `benchmark_main` libraries and tests.
+On a unix system, the build directory should now look something like this:
+
+```
+/benchmark
+ /build
+ /src
+ /libbenchmark.a
+ /libbenchmark_main.a
+ /test
+ ...
+```
+
+Next, you can run the tests to check the build.
+
+```bash
+$ cmake -E chdir "build" ctest --build-config Release
+```
+
+If you want to install the library globally, also run:
+
+```
+sudo cmake --build "build" --config Release --target install
```
Note that Google Benchmark requires Google Test to build and run the tests. This
If you do not wish to build and run the tests, add `-DBENCHMARK_ENABLE_GTEST_TESTS=OFF`
to `CMAKE_ARGS`.
+### Debug vs Release
-## Installation Guide
-
-For Ubuntu and Debian Based System
-
-First make sure you have git and cmake installed (If not please install them)
-
-```
-sudo apt-get install git cmake
-```
-
-Now, let's clone the repository and build it
+By default, benchmark builds as a debug library. You will see a warning in the
+output when this is the case. To build it as a release library instead, add
+`-DCMAKE_BUILD_TYPE=Release` when generating the build system files, as shown
+above. The use of `--config Release` in build commands is needed to properly
+support multi-configuration tools (like Visual Studio for example) and can be
+skipped for other build systems (like Makefile).
-```
-git clone https://github.com/google/benchmark.git
-cd benchmark
-# If you want to build tests and don't use BENCHMARK_DOWNLOAD_DEPENDENCIES, then
-# git clone https://github.com/google/googletest.git
-mkdir build
-cd build
-cmake .. -DCMAKE_BUILD_TYPE=RELEASE
-make
-```
+To enable link-time optimisation, also add `-DBENCHMARK_ENABLE_LTO=true` when
+generating the build system files.
-If you need to install the library globally
+If you are using gcc, you might need to set `GCC_AR` and `GCC_RANLIB` cmake
+cache variables, if autodetection fails.
-```
-sudo make install
-```
+If you are using clang, you may need to set `LLVMAR_EXECUTABLE`,
+`LLVMNM_EXECUTABLE` and `LLVMRANLIB_EXECUTABLE` cmake cache variables.
-## Stable and Experimental Library Versions
+### Stable and Experimental Library Versions
The main branch contains the latest stable version of the benchmarking library;
the API of which can be considered largely stable, with source breaking changes
this branch. However, this branch provides no stability guarantees and reserves
the right to change and break the API at any time.
-## Further knowledge
-
-It may help to read the [Google Test documentation](https://github.com/google/googletest/blob/master/googletest/docs/primer.md)
-as some of the structural aspects of the APIs are similar.
+## Usage
-## Example usage
### Basic usage
-Define a function that executes the code to be measured, register it as a
-benchmark function using the `BENCHMARK` macro, and ensure an appropriate `main`
-function is available:
+
+Define a function that executes the code to measure, register it as a benchmark
+function using the `BENCHMARK` macro, and ensure an appropriate `main` function
+is available:
```c++
#include <benchmark/benchmark.h>
BENCHMARK_MAIN();
```
-Don't forget to inform your linker to add benchmark library e.g. through
-`-lbenchmark` compilation flag. Alternatively, you may leave out the
-`BENCHMARK_MAIN();` at the end of the source file and link against
-`-lbenchmark_main` to get the same default behavior.
+To run the benchmark, compile and link against the `benchmark` library
+(libbenchmark.a/.so). If you followed the build steps above, this library will
+be under the build directory you created.
+
+```bash
+# Example on linux after running the build steps above. Assumes the
+# `benchmark` and `build` directories are under the current directory.
+$ g++ mybenchmark.cc -std=c++11 -isystem benchmark/include \
+ -Lbenchmark/build/src -lbenchmark -lpthread -o mybenchmark
+```
+
+Alternatively, link against the `benchmark_main` library and remove
+`BENCHMARK_MAIN();` above to get the same behavior.
+
+The compiled executable will run all benchmarks by default. Pass the `--help`
+flag for option information or see the guide below.
+
+### Usage with CMake
+
+If using CMake, it is recommended to link against the project-provided
+`benchmark::benchmark` and `benchmark::benchmark_main` targets using
+`target_link_libraries`.
+It is possible to use ```find_package``` to import an installed version of the
+library.
+```cmake
+find_package(benchmark REQUIRED)
+```
+Alternatively, ```add_subdirectory``` will incorporate the library directly in
+to one's CMake project.
+```cmake
+add_subdirectory(benchmark)
+```
+Either way, link to the library as follows.
+```cmake
+target_link_libraries(MyTarget benchmark::benchmark)
+```
+
+## Platform Specific Build Instructions
-The benchmark library will measure and report the timing for code within the
-`for(...)` loop.
+### Building with GCC
-#### Platform-specific libraries
When the library is built using GCC it is necessary to link with the pthread
library due to how GCC implements `std::thread`. Failing to link to pthread will
lead to runtime exceptions (unless you're using libc++), not linker errors. See
also use `-lpthread`, but there are potential issues with ordering of command
line parameters if you use that.
-If you're running benchmarks on Windows, the shlwapi library (`-lshlwapi`) is
-also required.
+### Building with Visual Studio 2015 or 2017
+
+The `shlwapi` library (`-lshlwapi`) is required to support a call to `CPUInfo` which reads the registry. Either add `shlwapi.lib` under `[ Configuration Properties > Linker > Input ]`, or use the following:
+
+```
+// Alternatively, can add libraries using linker options.
+#ifdef _WIN32
+#pragma comment ( lib, "Shlwapi.lib" )
+#ifdef _DEBUG
+#pragma comment ( lib, "benchmarkd.lib" )
+#else
+#pragma comment ( lib, "benchmark.lib" )
+#endif
+#endif
+```
+
+Can also use the graphical version of CMake:
+* Open `CMake GUI`.
+* Under `Where to build the binaries`, same path as source plus `build`.
+* Under `CMAKE_INSTALL_PREFIX`, same path as source plus `install`.
+* Click `Configure`, `Generate`, `Open Project`.
+* If build fails, try deleting entire directory and starting again, or unticking options to build less.
+
+### Building with Intel 2015 Update 1 or Intel System Studio Update 4
+
+See instructions for building with Visual Studio. Once built, right click on the solution and change the build to Intel.
+
+### Building on Solaris
If you're running benchmarks on solaris, you'll want the kstat library linked in
too (`-lkstat`).
-### Passing arguments
+## User Guide
+
+### Command Line
+
+[Output Formats](#output-formats)
+
+[Output Files](#output-files)
+
+[Running Benchmarks](#running-benchmarks)
+
+[Running a Subset of Benchmarks](#running-a-subset-of-benchmarks)
+
+[Result Comparison](#result-comparison)
+
+[Extra Context](#extra-context)
+
+### Library
+
+[Runtime and Reporting Considerations](#runtime-and-reporting-considerations)
+
+[Passing Arguments](#passing-arguments)
+
+[Custom Benchmark Name](#custom-benchmark-name)
+
+[Calculating Asymptotic Complexity](#asymptotic-complexity)
+
+[Templated Benchmarks](#templated-benchmarks)
+
+[Fixtures](#fixtures)
+
+[Custom Counters](#custom-counters)
+
+[Multithreaded Benchmarks](#multithreaded-benchmarks)
+
+[CPU Timers](#cpu-timers)
+
+[Manual Timing](#manual-timing)
+
+[Setting the Time Unit](#setting-the-time-unit)
+
+[Random Interleaving](docs/random_interleaving.md)
+
+[User-Requested Performance Counters](docs/perf_counters.md)
+
+[Preventing Optimization](#preventing-optimization)
+
+[Reporting Statistics](#reporting-statistics)
+
+[Custom Statistics](#custom-statistics)
+
+[Using RegisterBenchmark](#using-register-benchmark)
+
+[Exiting with an Error](#exiting-with-an-error)
+
+[A Faster KeepRunning Loop](#a-faster-keep-running-loop)
+
+[Disabling CPU Frequency Scaling](#disabling-cpu-frequency-scaling)
+
+
+<a name="output-formats" />
+
+### Output Formats
+
+The library supports multiple output formats. Use the
+`--benchmark_format=<console|json|csv>` flag (or set the
+`BENCHMARK_FORMAT=<console|json|csv>` environment variable) to set
+the format type. `console` is the default format.
+
+The Console format is intended to be a human readable format. By default
+the format generates color output. Context is output on stderr and the
+tabular data on stdout. Example tabular output looks like:
+
+```
+Benchmark Time(ns) CPU(ns) Iterations
+----------------------------------------------------------------------
+BM_SetInsert/1024/1 28928 29349 23853 133.097kB/s 33.2742k items/s
+BM_SetInsert/1024/8 32065 32913 21375 949.487kB/s 237.372k items/s
+BM_SetInsert/1024/10 33157 33648 21431 1.13369MB/s 290.225k items/s
+```
+
+The JSON format outputs human readable json split into two top level attributes.
+The `context` attribute contains information about the run in general, including
+information about the CPU and the date.
+The `benchmarks` attribute contains a list of every benchmark run. Example json
+output looks like:
+
+```json
+{
+ "context": {
+ "date": "2015/03/17-18:40:25",
+ "num_cpus": 40,
+ "mhz_per_cpu": 2801,
+ "cpu_scaling_enabled": false,
+ "build_type": "debug"
+ },
+ "benchmarks": [
+ {
+ "name": "BM_SetInsert/1024/1",
+ "iterations": 94877,
+ "real_time": 29275,
+ "cpu_time": 29836,
+ "bytes_per_second": 134066,
+ "items_per_second": 33516
+ },
+ {
+ "name": "BM_SetInsert/1024/8",
+ "iterations": 21609,
+ "real_time": 32317,
+ "cpu_time": 32429,
+ "bytes_per_second": 986770,
+ "items_per_second": 246693
+ },
+ {
+ "name": "BM_SetInsert/1024/10",
+ "iterations": 21393,
+ "real_time": 32724,
+ "cpu_time": 33355,
+ "bytes_per_second": 1199226,
+ "items_per_second": 299807
+ }
+ ]
+}
+```
+
+The CSV format outputs comma-separated values. The `context` is output on stderr
+and the CSV itself on stdout. Example CSV output looks like:
+
+```
+name,iterations,real_time,cpu_time,bytes_per_second,items_per_second,label
+"BM_SetInsert/1024/1",65465,17890.7,8407.45,475768,118942,
+"BM_SetInsert/1024/8",116606,18810.1,9766.64,3.27646e+06,819115,
+"BM_SetInsert/1024/10",106365,17238.4,8421.53,4.74973e+06,1.18743e+06,
+```
+
+<a name="output-files" />
+
+### Output Files
+
+Write benchmark results to a file with the `--benchmark_out=<filename>` option
+(or set `BENCHMARK_OUT`). Specify the output format with
+`--benchmark_out_format={json|console|csv}` (or set
+`BENCHMARK_OUT_FORMAT={json|console|csv}`). Note that the 'csv' reporter is
+deprecated and the saved `.csv` file
+[is not parsable](https://github.com/google/benchmark/issues/794) by csv
+parsers.
+
+Specifying `--benchmark_out` does not suppress the console output.
+
+<a name="running-benchmarks" />
+
+### Running Benchmarks
+
+Benchmarks are executed by running the produced binaries. Benchmarks binaries,
+by default, accept options that may be specified either through their command
+line interface or by setting environment variables before execution. For every
+`--option_flag=<value>` CLI switch, a corresponding environment variable
+`OPTION_FLAG=<value>` exist and is used as default if set (CLI switches always
+ prevails). A complete list of CLI options is available running benchmarks
+ with the `--help` switch.
+
+<a name="running-a-subset-of-benchmarks" />
+
+### Running a Subset of Benchmarks
+
+The `--benchmark_filter=<regex>` option (or `BENCHMARK_FILTER=<regex>`
+environment variable) can be used to only run the benchmarks that match
+the specified `<regex>`. For example:
+
+```bash
+$ ./run_benchmarks.x --benchmark_filter=BM_memcpy/32
+Run on (1 X 2300 MHz CPU )
+2016-06-25 19:34:24
+Benchmark Time CPU Iterations
+----------------------------------------------------
+BM_memcpy/32 11 ns 11 ns 79545455
+BM_memcpy/32k 2181 ns 2185 ns 324074
+BM_memcpy/32 12 ns 12 ns 54687500
+BM_memcpy/32k 1834 ns 1837 ns 357143
+```
+
+<a name="result-comparison" />
+
+### Result comparison
+
+It is possible to compare the benchmarking results.
+See [Additional Tooling Documentation](docs/tools.md)
+
+<a name="extra-context" />
+
+### Extra Context
+
+Sometimes it's useful to add extra context to the content printed before the
+results. By default this section includes information about the CPU on which
+the benchmarks are running. If you do want to add more context, you can use
+the `benchmark_context` command line flag:
+
+```bash
+$ ./run_benchmarks --benchmark_context=pwd=`pwd`
+Run on (1 x 2300 MHz CPU)
+pwd: /home/user/benchmark/
+Benchmark Time CPU Iterations
+----------------------------------------------------
+BM_memcpy/32 11 ns 11 ns 79545455
+BM_memcpy/32k 2181 ns 2185 ns 324074
+```
+
+You can get the same effect with the API:
+
+```c++
+ benchmark::AddCustomContext("foo", "bar");
+```
+
+Note that attempts to add a second value with the same key will fail with an
+error message.
+
+<a name="runtime-and-reporting-considerations" />
+
+### Runtime and Reporting Considerations
+
+When the benchmark binary is executed, each benchmark function is run serially.
+The number of iterations to run is determined dynamically by running the
+benchmark a few times and measuring the time taken and ensuring that the
+ultimate result will be statistically stable. As such, faster benchmark
+functions will be run for more iterations than slower benchmark functions, and
+the number of iterations is thus reported.
+
+In all cases, the number of iterations for which the benchmark is run is
+governed by the amount of time the benchmark takes. Concretely, the number of
+iterations is at least one, not more than 1e9, until CPU time is greater than
+the minimum time, or the wallclock time is 5x minimum time. The minimum time is
+set per benchmark by calling `MinTime` on the registered benchmark object.
+
+Average timings are then reported over the iterations run. If multiple
+repetitions are requested using the `--benchmark_repetitions` command-line
+option, or at registration time, the benchmark function will be run several
+times and statistical results across these repetitions will also be reported.
+
+As well as the per-benchmark entries, a preamble in the report will include
+information about the machine on which the benchmarks are run.
+
+<a name="passing-arguments" />
+
+### Passing Arguments
+
Sometimes a family of benchmarks can be implemented with just one routine that
takes an extra argument to specify which one of the family of benchmarks to
run. For example, the following code defines a family of benchmarks for
```c++
BENCHMARK(BM_memcpy)->RangeMultiplier(2)->Range(8, 8<<10);
```
+
Now arguments generated are [ 8, 16, 32, 64, 128, 256, 512, 1024, 2k, 4k, 8k ].
+The preceding code shows a method of defining a sparse range. The following
+example shows a method of defining a dense range. It is then used to benchmark
+the performance of `std::vector` initialization for uniformly increasing sizes.
+
+```c++
+static void BM_DenseRange(benchmark::State& state) {
+ for(auto _ : state) {
+ std::vector<int> v(state.range(0), state.range(0));
+ benchmark::DoNotOptimize(v.data());
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK(BM_DenseRange)->DenseRange(0, 1024, 128);
+```
+
+Now arguments generated are [ 0, 128, 256, 384, 512, 640, 768, 896, 1024 ].
+
You might have a benchmark that depends on two or more inputs. For example, the
following code defines a family of benchmarks for measuring the speed of set
insertion.
BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {128, 512}});
```
+Some benchmarks may require specific argument values that cannot be expressed
+with `Ranges`. In this case, `ArgsProduct` offers the ability to generate a
+benchmark input for each combination in the product of the supplied vectors.
+
+```c++
+BENCHMARK(BM_SetInsert)
+ ->ArgsProduct({{1<<10, 3<<10, 8<<10}, {20, 40, 60, 80}})
+// would generate the same benchmark arguments as
+BENCHMARK(BM_SetInsert)
+ ->Args({1<<10, 20})
+ ->Args({3<<10, 20})
+ ->Args({8<<10, 20})
+ ->Args({3<<10, 40})
+ ->Args({8<<10, 40})
+ ->Args({1<<10, 40})
+ ->Args({1<<10, 60})
+ ->Args({3<<10, 60})
+ ->Args({8<<10, 60})
+ ->Args({1<<10, 80})
+ ->Args({3<<10, 80})
+ ->Args({8<<10, 80});
+```
+
For more complex patterns of inputs, passing a custom function to `Apply` allows
programmatic specification of an arbitrary set of arguments on which to run the
benchmark. The following example enumerates a dense range on one parameter,
BENCHMARK(BM_SetInsert)->Apply(CustomArguments);
```
-### Calculate asymptotic complexity (Big O)
+#### Passing Arbitrary Arguments to a Benchmark
+
+In C++11 it is possible to define a benchmark that takes an arbitrary number
+of extra arguments. The `BENCHMARK_CAPTURE(func, test_case_name, ...args)`
+macro creates a benchmark that invokes `func` with the `benchmark::State` as
+the first argument followed by the specified `args...`.
+The `test_case_name` is appended to the name of the benchmark and
+should describe the values passed.
+
+```c++
+template <class ...ExtraArgs>
+void BM_takes_args(benchmark::State& state, ExtraArgs&&... extra_args) {
+ [...]
+}
+// Registers a benchmark named "BM_takes_args/int_string_test" that passes
+// the specified values to `extra_args`.
+BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc"));
+```
+
+Note that elements of `...args` may refer to global variables. Users should
+avoid modifying global state inside of a benchmark.
+
+<a name="asymptotic-complexity" />
+
+### Calculating Asymptotic Complexity (Big O)
+
Asymptotic complexity might be calculated for a family of benchmarks. The
following code will calculate the coefficient for the high-order term in the
running time and the normalized root-mean square error of string comparison.
```c++
BENCHMARK(BM_StringCompare)->RangeMultiplier(2)
- ->Range(1<<10, 1<<18)->Complexity([](int64_t n)->double{return n; });
+ ->Range(1<<10, 1<<18)->Complexity([](benchmark::IterationCount n)->double{return n; });
+```
+
+<a name="custom-benchmark-name" />
+
+### Custom Benchmark Name
+
+You can change the benchmark's name as follows:
+
+```c++
+BENCHMARK(BM_memcpy)->Name("memcpy")->RangeMultiplier(2)->Range(8, 8<<10);
```
-### Templated benchmarks
-Templated benchmarks work the same way: This example produces and consumes
-messages of size `sizeof(v)` `range_x` times. It also outputs throughput in the
-absence of multiprogramming.
+The invocation will execute the benchmark as before using `BM_memcpy` but changes
+the prefix in the report to `memcpy`.
+
+<a name="templated-benchmarks" />
+
+### Templated Benchmarks
+
+This example produces and consumes messages of size `sizeof(v)` `range_x`
+times. It also outputs throughput in the absence of multiprogramming.
```c++
template <class Q> void BM_Sequential(benchmark::State& state) {
#define BENCHMARK_TEMPLATE2(func, arg1, arg2)
```
-### A Faster KeepRunning loop
+<a name="fixtures" />
-In C++11 mode, a ranged-based for loop should be used in preference to
-the `KeepRunning` loop for running the benchmarks. For example:
-
-```c++
-static void BM_Fast(benchmark::State &state) {
- for (auto _ : state) {
- FastOperation();
- }
-}
-BENCHMARK(BM_Fast);
-```
-
-The reason the ranged-for loop is faster than using `KeepRunning`, is
-because `KeepRunning` requires a memory load and store of the iteration count
-ever iteration, whereas the ranged-for variant is able to keep the iteration count
-in a register.
+### Fixtures
-For example, an empty inner loop of using the ranged-based for method looks like:
+Fixture tests are created by first defining a type that derives from
+`::benchmark::Fixture` and then creating/registering the tests using the
+following macros:
-```asm
-# Loop Init
- mov rbx, qword ptr [r14 + 104]
- call benchmark::State::StartKeepRunning()
- test rbx, rbx
- je .LoopEnd
-.LoopHeader: # =>This Inner Loop Header: Depth=1
- add rbx, -1
- jne .LoopHeader
-.LoopEnd:
-```
+* `BENCHMARK_F(ClassName, Method)`
+* `BENCHMARK_DEFINE_F(ClassName, Method)`
+* `BENCHMARK_REGISTER_F(ClassName, Method)`
-Compared to an empty `KeepRunning` loop, which looks like:
+For Example:
-```asm
-.LoopHeader: # in Loop: Header=BB0_3 Depth=1
- cmp byte ptr [rbx], 1
- jne .LoopInit
-.LoopBody: # =>This Inner Loop Header: Depth=1
- mov rax, qword ptr [rbx + 8]
- lea rcx, [rax + 1]
- mov qword ptr [rbx + 8], rcx
- cmp rax, qword ptr [rbx + 104]
- jb .LoopHeader
- jmp .LoopEnd
-.LoopInit:
- mov rdi, rbx
- call benchmark::State::StartKeepRunning()
- jmp .LoopBody
-.LoopEnd:
-```
+```c++
+class MyFixture : public benchmark::Fixture {
+public:
+ void SetUp(const ::benchmark::State& state) {
+ }
-Unless C++03 compatibility is required, the ranged-for variant of writing
-the benchmark loop should be preferred.
+ void TearDown(const ::benchmark::State& state) {
+ }
+};
-## Passing arbitrary arguments to a benchmark
-In C++11 it is possible to define a benchmark that takes an arbitrary number
-of extra arguments. The `BENCHMARK_CAPTURE(func, test_case_name, ...args)`
-macro creates a benchmark that invokes `func` with the `benchmark::State` as
-the first argument followed by the specified `args...`.
-The `test_case_name` is appended to the name of the benchmark and
-should describe the values passed.
+BENCHMARK_F(MyFixture, FooTest)(benchmark::State& st) {
+ for (auto _ : st) {
+ ...
+ }
+}
-```c++
-template <class ...ExtraArgs>
-void BM_takes_args(benchmark::State& state, ExtraArgs&&... extra_args) {
- [...]
+BENCHMARK_DEFINE_F(MyFixture, BarTest)(benchmark::State& st) {
+ for (auto _ : st) {
+ ...
+ }
}
-// Registers a benchmark named "BM_takes_args/int_string_test" that passes
-// the specified values to `extra_args`.
-BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc"));
+/* BarTest is NOT registered */
+BENCHMARK_REGISTER_F(MyFixture, BarTest)->Threads(2);
+/* BarTest is now registered */
```
-Note that elements of `...args` may refer to global variables. Users should
-avoid modifying global state inside of a benchmark.
-## Using RegisterBenchmark(name, fn, args...)
+#### Templated Fixtures
-The `RegisterBenchmark(name, func, args...)` function provides an alternative
-way to create and register benchmarks.
-`RegisterBenchmark(name, func, args...)` creates, registers, and returns a
-pointer to a new benchmark with the specified `name` that invokes
-`func(st, args...)` where `st` is a `benchmark::State` object.
+Also you can create templated fixture by using the following macros:
-Unlike the `BENCHMARK` registration macros, which can only be used at the global
-scope, the `RegisterBenchmark` can be called anywhere. This allows for
-benchmark tests to be registered programmatically.
+* `BENCHMARK_TEMPLATE_F(ClassName, Method, ...)`
+* `BENCHMARK_TEMPLATE_DEFINE_F(ClassName, Method, ...)`
-Additionally `RegisterBenchmark` allows any callable object to be registered
-as a benchmark. Including capturing lambdas and function objects.
+For example:
-For Example:
```c++
-auto BM_test = [](benchmark::State& st, auto Inputs) { /* ... */ };
+template<typename T>
+class MyFixture : public benchmark::Fixture {};
-int main(int argc, char** argv) {
- for (auto& test_input : { /* ... */ })
- benchmark::RegisterBenchmark(test_input.name(), BM_test, test_input);
- benchmark::Initialize(&argc, argv);
- benchmark::RunSpecifiedBenchmarks();
+BENCHMARK_TEMPLATE_F(MyFixture, IntTest, int)(benchmark::State& st) {
+ for (auto _ : st) {
+ ...
+ }
}
-```
-
-### Multithreaded benchmarks
-In a multithreaded test (benchmark invoked by multiple threads simultaneously),
-it is guaranteed that none of the threads will start until all have reached
-the start of the benchmark loop, and all will have finished before any thread
-exits the benchmark loop. (This behavior is also provided by the `KeepRunning()`
-API) As such, any global setup or teardown can be wrapped in a check against the thread
-index:
-```c++
-static void BM_MultiThreaded(benchmark::State& state) {
- if (state.thread_index == 0) {
- // Setup code here.
- }
- for (auto _ : state) {
- // Run the test as normal.
- }
- if (state.thread_index == 0) {
- // Teardown code here.
+BENCHMARK_TEMPLATE_DEFINE_F(MyFixture, DoubleTest, double)(benchmark::State& st) {
+ for (auto _ : st) {
+ ...
}
}
-BENCHMARK(BM_MultiThreaded)->Threads(2);
-```
-
-If the benchmarked code itself uses threads and you want to compare it to
-single-threaded code, you may want to use real-time ("wallclock") measurements
-for latency comparisons:
-```c++
-BENCHMARK(BM_test)->Range(8, 8<<10)->UseRealTime();
+BENCHMARK_REGISTER_F(MyFixture, DoubleTest)->Threads(2);
```
-Without `UseRealTime`, CPU time is used by default.
+<a name="custom-counters" />
-## Controlling timers
-Normally, the entire duration of the work loop (`for (auto _ : state) {}`)
-is measured. But sometimes, it is nessesary to do some work inside of
-that loop, every iteration, but without counting that time to the benchmark time.
-That is possible, althought it is not recommended, since it has high overhead.
+### Custom Counters
+
+You can add your own counters with user-defined names. The example below
+will add columns "Foo", "Bar" and "Baz" in its output:
```c++
-static void BM_SetInsert_With_Timer_Control(benchmark::State& state) {
- std::set<int> data;
+static void UserCountersExample1(benchmark::State& state) {
+ double numFoos = 0, numBars = 0, numBazs = 0;
for (auto _ : state) {
- state.PauseTiming(); // Stop timers. They will not count until they are resumed.
- data = ConstructRandomSet(state.range(0)); // Do something that should not be measured
- state.ResumeTiming(); // And resume timers. They are now counting again.
- // The rest will be measured.
- for (int j = 0; j < state.range(1); ++j)
- data.insert(RandomNumber());
+ // ... count Foo,Bar,Baz events
}
+ state.counters["Foo"] = numFoos;
+ state.counters["Bar"] = numBars;
+ state.counters["Baz"] = numBazs;
}
-BENCHMARK(BM_SetInsert_With_Timer_Control)->Ranges({{1<<10, 8<<10}, {128, 512}});
```
-## Manual timing
-For benchmarking something for which neither CPU time nor real-time are
-correct or accurate enough, completely manual timing is supported using
-the `UseManualTime` function.
+The `state.counters` object is a `std::map` with `std::string` keys
+and `Counter` values. The latter is a `double`-like class, via an implicit
+conversion to `double&`. Thus you can use all of the standard arithmetic
+assignment operators (`=,+=,-=,*=,/=`) to change the value of each counter.
-When `UseManualTime` is used, the benchmarked code must call
-`SetIterationTime` once per iteration of the benchmark loop to
-report the manually measured time.
+In multithreaded benchmarks, each counter is set on the calling thread only.
+When the benchmark finishes, the counters from each thread will be summed;
+the resulting sum is the value which will be shown for the benchmark.
-An example use case for this is benchmarking GPU execution (e.g. OpenCL
-or CUDA kernels, OpenGL or Vulkan or Direct3D draw calls), which cannot
-be accurately measured using CPU time or real-time. Instead, they can be
-measured accurately using a dedicated API, and these measurement results
-can be reported back with `SetIterationTime`.
+The `Counter` constructor accepts three parameters: the value as a `double`
+; a bit flag which allows you to show counters as rates, and/or as per-thread
+iteration, and/or as per-thread averages, and/or iteration invariants,
+and/or finally inverting the result; and a flag specifying the 'unit' - i.e.
+is 1k a 1000 (default, `benchmark::Counter::OneK::kIs1000`), or 1024
+(`benchmark::Counter::OneK::kIs1024`)?
```c++
-static void BM_ManualTiming(benchmark::State& state) {
- int microseconds = state.range(0);
- std::chrono::duration<double, std::micro> sleep_duration {
- static_cast<double>(microseconds)
- };
+ // sets a simple counter
+ state.counters["Foo"] = numFoos;
- for (auto _ : state) {
- auto start = std::chrono::high_resolution_clock::now();
- // Simulate some useful workload with a sleep
- std::this_thread::sleep_for(sleep_duration);
- auto end = std::chrono::high_resolution_clock::now();
+ // Set the counter as a rate. It will be presented divided
+ // by the duration of the benchmark.
+ // Meaning: per one second, how many 'foo's are processed?
+ state.counters["FooRate"] = Counter(numFoos, benchmark::Counter::kIsRate);
- auto elapsed_seconds =
- std::chrono::duration_cast<std::chrono::duration<double>>(
- end - start);
+ // Set the counter as a rate. It will be presented divided
+ // by the duration of the benchmark, and the result inverted.
+ // Meaning: how many seconds it takes to process one 'foo'?
+ state.counters["FooInvRate"] = Counter(numFoos, benchmark::Counter::kIsRate | benchmark::Counter::kInvert);
- state.SetIterationTime(elapsed_seconds.count());
- }
-}
-BENCHMARK(BM_ManualTiming)->Range(1, 1<<17)->UseManualTime();
-```
+ // Set the counter as a thread-average quantity. It will
+ // be presented divided by the number of threads.
+ state.counters["FooAvg"] = Counter(numFoos, benchmark::Counter::kAvgThreads);
-### Preventing optimisation
-To prevent a value or expression from being optimized away by the compiler
-the `benchmark::DoNotOptimize(...)` and `benchmark::ClobberMemory()`
-functions can be used.
+ // There's also a combined flag:
+ state.counters["FooAvgRate"] = Counter(numFoos,benchmark::Counter::kAvgThreadsRate);
-```c++
-static void BM_test(benchmark::State& state) {
- for (auto _ : state) {
- int x = 0;
- for (int i=0; i < 64; ++i) {
- benchmark::DoNotOptimize(x += i);
- }
- }
-}
+ // This says that we process with the rate of state.range(0) bytes every iteration:
+ state.counters["BytesProcessed"] = Counter(state.range(0), benchmark::Counter::kIsIterationInvariantRate, benchmark::Counter::OneK::kIs1024);
```
-`DoNotOptimize(<expr>)` forces the *result* of `<expr>` to be stored in either
-memory or a register. For GNU based compilers it acts as read/write barrier
+When you're compiling in C++11 mode or later you can use `insert()` with
+`std::initializer_list`:
+
+```c++
+ // With C++11, this can be done:
+ state.counters.insert({{"Foo", numFoos}, {"Bar", numBars}, {"Baz", numBazs}});
+ // ... instead of:
+ state.counters["Foo"] = numFoos;
+ state.counters["Bar"] = numBars;
+ state.counters["Baz"] = numBazs;
+```
+
+#### Counter Reporting
+
+When using the console reporter, by default, user counters are printed at
+the end after the table, the same way as ``bytes_processed`` and
+``items_processed``. This is best for cases in which there are few counters,
+or where there are only a couple of lines per benchmark. Here's an example of
+the default output:
+
+```
+------------------------------------------------------------------------------
+Benchmark Time CPU Iterations UserCounters...
+------------------------------------------------------------------------------
+BM_UserCounter/threads:8 2248 ns 10277 ns 68808 Bar=16 Bat=40 Baz=24 Foo=8
+BM_UserCounter/threads:1 9797 ns 9788 ns 71523 Bar=2 Bat=5 Baz=3 Foo=1024m
+BM_UserCounter/threads:2 4924 ns 9842 ns 71036 Bar=4 Bat=10 Baz=6 Foo=2
+BM_UserCounter/threads:4 2589 ns 10284 ns 68012 Bar=8 Bat=20 Baz=12 Foo=4
+BM_UserCounter/threads:8 2212 ns 10287 ns 68040 Bar=16 Bat=40 Baz=24 Foo=8
+BM_UserCounter/threads:16 1782 ns 10278 ns 68144 Bar=32 Bat=80 Baz=48 Foo=16
+BM_UserCounter/threads:32 1291 ns 10296 ns 68256 Bar=64 Bat=160 Baz=96 Foo=32
+BM_UserCounter/threads:4 2615 ns 10307 ns 68040 Bar=8 Bat=20 Baz=12 Foo=4
+BM_Factorial 26 ns 26 ns 26608979 40320
+BM_Factorial/real_time 26 ns 26 ns 26587936 40320
+BM_CalculatePiRange/1 16 ns 16 ns 45704255 0
+BM_CalculatePiRange/8 73 ns 73 ns 9520927 3.28374
+BM_CalculatePiRange/64 609 ns 609 ns 1140647 3.15746
+BM_CalculatePiRange/512 4900 ns 4901 ns 142696 3.14355
+```
+
+If this doesn't suit you, you can print each counter as a table column by
+passing the flag `--benchmark_counters_tabular=true` to the benchmark
+application. This is best for cases in which there are a lot of counters, or
+a lot of lines per individual benchmark. Note that this will trigger a
+reprinting of the table header any time the counter set changes between
+individual benchmarks. Here's an example of corresponding output when
+`--benchmark_counters_tabular=true` is passed:
+
+```
+---------------------------------------------------------------------------------------
+Benchmark Time CPU Iterations Bar Bat Baz Foo
+---------------------------------------------------------------------------------------
+BM_UserCounter/threads:8 2198 ns 9953 ns 70688 16 40 24 8
+BM_UserCounter/threads:1 9504 ns 9504 ns 73787 2 5 3 1
+BM_UserCounter/threads:2 4775 ns 9550 ns 72606 4 10 6 2
+BM_UserCounter/threads:4 2508 ns 9951 ns 70332 8 20 12 4
+BM_UserCounter/threads:8 2055 ns 9933 ns 70344 16 40 24 8
+BM_UserCounter/threads:16 1610 ns 9946 ns 70720 32 80 48 16
+BM_UserCounter/threads:32 1192 ns 9948 ns 70496 64 160 96 32
+BM_UserCounter/threads:4 2506 ns 9949 ns 70332 8 20 12 4
+--------------------------------------------------------------
+Benchmark Time CPU Iterations
+--------------------------------------------------------------
+BM_Factorial 26 ns 26 ns 26392245 40320
+BM_Factorial/real_time 26 ns 26 ns 26494107 40320
+BM_CalculatePiRange/1 15 ns 15 ns 45571597 0
+BM_CalculatePiRange/8 74 ns 74 ns 9450212 3.28374
+BM_CalculatePiRange/64 595 ns 595 ns 1173901 3.15746
+BM_CalculatePiRange/512 4752 ns 4752 ns 147380 3.14355
+BM_CalculatePiRange/4k 37970 ns 37972 ns 18453 3.14184
+BM_CalculatePiRange/32k 303733 ns 303744 ns 2305 3.14162
+BM_CalculatePiRange/256k 2434095 ns 2434186 ns 288 3.1416
+BM_CalculatePiRange/1024k 9721140 ns 9721413 ns 71 3.14159
+BM_CalculatePi/threads:8 2255 ns 9943 ns 70936
+```
+
+Note above the additional header printed when the benchmark changes from
+``BM_UserCounter`` to ``BM_Factorial``. This is because ``BM_Factorial`` does
+not have the same counter set as ``BM_UserCounter``.
+
+<a name="multithreaded-benchmarks"/>
+
+### Multithreaded Benchmarks
+
+In a multithreaded test (benchmark invoked by multiple threads simultaneously),
+it is guaranteed that none of the threads will start until all have reached
+the start of the benchmark loop, and all will have finished before any thread
+exits the benchmark loop. (This behavior is also provided by the `KeepRunning()`
+API) As such, any global setup or teardown can be wrapped in a check against the thread
+index:
+
+```c++
+static void BM_MultiThreaded(benchmark::State& state) {
+ if (state.thread_index == 0) {
+ // Setup code here.
+ }
+ for (auto _ : state) {
+ // Run the test as normal.
+ }
+ if (state.thread_index == 0) {
+ // Teardown code here.
+ }
+}
+BENCHMARK(BM_MultiThreaded)->Threads(2);
+```
+
+If the benchmarked code itself uses threads and you want to compare it to
+single-threaded code, you may want to use real-time ("wallclock") measurements
+for latency comparisons:
+
+```c++
+BENCHMARK(BM_test)->Range(8, 8<<10)->UseRealTime();
+```
+
+Without `UseRealTime`, CPU time is used by default.
+
+<a name="cpu-timers" />
+
+### CPU Timers
+
+By default, the CPU timer only measures the time spent by the main thread.
+If the benchmark itself uses threads internally, this measurement may not
+be what you are looking for. Instead, there is a way to measure the total
+CPU usage of the process, by all the threads.
+
+```c++
+void callee(int i);
+
+static void MyMain(int size) {
+#pragma omp parallel for
+ for(int i = 0; i < size; i++)
+ callee(i);
+}
+
+static void BM_OpenMP(benchmark::State& state) {
+ for (auto _ : state)
+ MyMain(state.range(0));
+}
+
+// Measure the time spent by the main thread, use it to decide for how long to
+// run the benchmark loop. Depending on the internal implementation detail may
+// measure to anywhere from near-zero (the overhead spent before/after work
+// handoff to worker thread[s]) to the whole single-thread time.
+BENCHMARK(BM_OpenMP)->Range(8, 8<<10);
+
+// Measure the user-visible time, the wall clock (literally, the time that
+// has passed on the clock on the wall), use it to decide for how long to
+// run the benchmark loop. This will always be meaningful, an will match the
+// time spent by the main thread in single-threaded case, in general decreasing
+// with the number of internal threads doing the work.
+BENCHMARK(BM_OpenMP)->Range(8, 8<<10)->UseRealTime();
+
+// Measure the total CPU consumption, use it to decide for how long to
+// run the benchmark loop. This will always measure to no less than the
+// time spent by the main thread in single-threaded case.
+BENCHMARK(BM_OpenMP)->Range(8, 8<<10)->MeasureProcessCPUTime();
+
+// A mixture of the last two. Measure the total CPU consumption, but use the
+// wall clock to decide for how long to run the benchmark loop.
+BENCHMARK(BM_OpenMP)->Range(8, 8<<10)->MeasureProcessCPUTime()->UseRealTime();
+```
+
+#### Controlling Timers
+
+Normally, the entire duration of the work loop (`for (auto _ : state) {}`)
+is measured. But sometimes, it is necessary to do some work inside of
+that loop, every iteration, but without counting that time to the benchmark time.
+That is possible, although it is not recommended, since it has high overhead.
+
+```c++
+static void BM_SetInsert_With_Timer_Control(benchmark::State& state) {
+ std::set<int> data;
+ for (auto _ : state) {
+ state.PauseTiming(); // Stop timers. They will not count until they are resumed.
+ data = ConstructRandomSet(state.range(0)); // Do something that should not be measured
+ state.ResumeTiming(); // And resume timers. They are now counting again.
+ // The rest will be measured.
+ for (int j = 0; j < state.range(1); ++j)
+ data.insert(RandomNumber());
+ }
+}
+BENCHMARK(BM_SetInsert_With_Timer_Control)->Ranges({{1<<10, 8<<10}, {128, 512}});
+```
+
+<a name="manual-timing" />
+
+### Manual Timing
+
+For benchmarking something for which neither CPU time nor real-time are
+correct or accurate enough, completely manual timing is supported using
+the `UseManualTime` function.
+
+When `UseManualTime` is used, the benchmarked code must call
+`SetIterationTime` once per iteration of the benchmark loop to
+report the manually measured time.
+
+An example use case for this is benchmarking GPU execution (e.g. OpenCL
+or CUDA kernels, OpenGL or Vulkan or Direct3D draw calls), which cannot
+be accurately measured using CPU time or real-time. Instead, they can be
+measured accurately using a dedicated API, and these measurement results
+can be reported back with `SetIterationTime`.
+
+```c++
+static void BM_ManualTiming(benchmark::State& state) {
+ int microseconds = state.range(0);
+ std::chrono::duration<double, std::micro> sleep_duration {
+ static_cast<double>(microseconds)
+ };
+
+ for (auto _ : state) {
+ auto start = std::chrono::high_resolution_clock::now();
+ // Simulate some useful workload with a sleep
+ std::this_thread::sleep_for(sleep_duration);
+ auto end = std::chrono::high_resolution_clock::now();
+
+ auto elapsed_seconds =
+ std::chrono::duration_cast<std::chrono::duration<double>>(
+ end - start);
+
+ state.SetIterationTime(elapsed_seconds.count());
+ }
+}
+BENCHMARK(BM_ManualTiming)->Range(1, 1<<17)->UseManualTime();
+```
+
+<a name="setting-the-time-unit" />
+
+### Setting the Time Unit
+
+If a benchmark runs a few milliseconds it may be hard to visually compare the
+measured times, since the output data is given in nanoseconds per default. In
+order to manually set the time unit, you can specify it manually:
+
+```c++
+BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
+```
+
+<a name="preventing-optimization" />
+
+### Preventing Optimization
+
+To prevent a value or expression from being optimized away by the compiler
+the `benchmark::DoNotOptimize(...)` and `benchmark::ClobberMemory()`
+functions can be used.
+
+```c++
+static void BM_test(benchmark::State& state) {
+ for (auto _ : state) {
+ int x = 0;
+ for (int i=0; i < 64; ++i) {
+ benchmark::DoNotOptimize(x += i);
+ }
+ }
+}
+```
+
+`DoNotOptimize(<expr>)` forces the *result* of `<expr>` to be stored in either
+memory or a register. For GNU based compilers it acts as read/write barrier
for global memory. More specifically it forces the compiler to flush pending
writes to memory and reload any other values as necessary.
Note that `ClobberMemory()` is only available for GNU or MSVC based compilers.
-### Set time unit manually
-If a benchmark runs a few milliseconds it may be hard to visually compare the
-measured times, since the output data is given in nanoseconds per default. In
-order to manually set the time unit, you can specify it manually:
+<a name="reporting-statistics" />
-```c++
-BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
-```
+### Statistics: Reporting the Mean, Median and Standard Deviation of Repeated Benchmarks
-### Reporting the mean, median and standard deviation by repeated benchmarks
By default each benchmark is run once and that single result is reported.
However benchmarks are often noisy and a single result may not be representative
of the overall behavior. For this reason it's possible to repeatedly rerun the
registered benchmark object overrides the value of the appropriate flag for that
benchmark.
-## User-defined statistics for repeated benchmarks
+<a name="custom-statistics" />
+
+### Custom Statistics
+
While having mean, median and standard deviation is nice, this may not be
-enough for everyone. For example you may want to know what is the largest
-observation, e.g. because you have some real-time constraints. This is easy.
+enough for everyone. For example you may want to know what the largest
+observation is, e.g. because you have some real-time constraints. This is easy.
The following code will specify a custom statistic to be calculated, defined
by a lambda function.
->Arg(512);
```
-## Fixtures
-Fixture tests are created by
-first defining a type that derives from `::benchmark::Fixture` and then
-creating/registering the tests using the following macros:
+<a name="using-register-benchmark" />
-* `BENCHMARK_F(ClassName, Method)`
-* `BENCHMARK_DEFINE_F(ClassName, Method)`
-* `BENCHMARK_REGISTER_F(ClassName, Method)`
+### Using RegisterBenchmark(name, fn, args...)
-For Example:
+The `RegisterBenchmark(name, func, args...)` function provides an alternative
+way to create and register benchmarks.
+`RegisterBenchmark(name, func, args...)` creates, registers, and returns a
+pointer to a new benchmark with the specified `name` that invokes
+`func(st, args...)` where `st` is a `benchmark::State` object.
-```c++
-class MyFixture : public benchmark::Fixture {};
+Unlike the `BENCHMARK` registration macros, which can only be used at the global
+scope, the `RegisterBenchmark` can be called anywhere. This allows for
+benchmark tests to be registered programmatically.
-BENCHMARK_F(MyFixture, FooTest)(benchmark::State& st) {
- for (auto _ : st) {
- ...
- }
-}
+Additionally `RegisterBenchmark` allows any callable object to be registered
+as a benchmark. Including capturing lambdas and function objects.
-BENCHMARK_DEFINE_F(MyFixture, BarTest)(benchmark::State& st) {
- for (auto _ : st) {
- ...
- }
+For Example:
+```c++
+auto BM_test = [](benchmark::State& st, auto Inputs) { /* ... */ };
+
+int main(int argc, char** argv) {
+ for (auto& test_input : { /* ... */ })
+ benchmark::RegisterBenchmark(test_input.name(), BM_test, test_input);
+ benchmark::Initialize(&argc, argv);
+ benchmark::RunSpecifiedBenchmarks();
+ benchmark::Shutdown();
}
-/* BarTest is NOT registered */
-BENCHMARK_REGISTER_F(MyFixture, BarTest)->Threads(2);
-/* BarTest is now registered */
```
-### Templated fixtures
-Also you can create templated fixture by using the following macros:
+<a name="exiting-with-an-error" />
-* `BENCHMARK_TEMPLATE_F(ClassName, Method, ...)`
-* `BENCHMARK_TEMPLATE_DEFINE_F(ClassName, Method, ...)`
-
-For example:
-```c++
-template<typename T>
-class MyFixture : public benchmark::Fixture {};
-
-BENCHMARK_TEMPLATE_F(MyFixture, IntTest, int)(benchmark::State& st) {
- for (auto _ : st) {
- ...
- }
-}
-
-BENCHMARK_TEMPLATE_DEFINE_F(MyFixture, DoubleTest, double)(benchmark::State& st) {
- for (auto _ : st) {
- ...
- }
-}
-
-BENCHMARK_REGISTER_F(MyFixture, DoubleTest)->Threads(2);
-```
-
-## User-defined counters
-
-You can add your own counters with user-defined names. The example below
-will add columns "Foo", "Bar" and "Baz" in its output:
-
-```c++
-static void UserCountersExample1(benchmark::State& state) {
- double numFoos = 0, numBars = 0, numBazs = 0;
- for (auto _ : state) {
- // ... count Foo,Bar,Baz events
- }
- state.counters["Foo"] = numFoos;
- state.counters["Bar"] = numBars;
- state.counters["Baz"] = numBazs;
-}
-```
-
-The `state.counters` object is a `std::map` with `std::string` keys
-and `Counter` values. The latter is a `double`-like class, via an implicit
-conversion to `double&`. Thus you can use all of the standard arithmetic
-assignment operators (`=,+=,-=,*=,/=`) to change the value of each counter.
-
-In multithreaded benchmarks, each counter is set on the calling thread only.
-When the benchmark finishes, the counters from each thread will be summed;
-the resulting sum is the value which will be shown for the benchmark.
-
-The `Counter` constructor accepts three parameters: the value as a `double`
-; a bit flag which allows you to show counters as rates, and/or as per-thread
-iteration, and/or as per-thread averages, and/or iteration invariants;
-and a flag specifying the 'unit' - i.e. is 1k a 1000 (default,
-`benchmark::Counter::OneK::kIs1000`), or 1024
-(`benchmark::Counter::OneK::kIs1024`)?
-
-```c++
- // sets a simple counter
- state.counters["Foo"] = numFoos;
-
- // Set the counter as a rate. It will be presented divided
- // by the duration of the benchmark.
- state.counters["FooRate"] = Counter(numFoos, benchmark::Counter::kIsRate);
-
- // Set the counter as a thread-average quantity. It will
- // be presented divided by the number of threads.
- state.counters["FooAvg"] = Counter(numFoos, benchmark::Counter::kAvgThreads);
-
- // There's also a combined flag:
- state.counters["FooAvgRate"] = Counter(numFoos,benchmark::Counter::kAvgThreadsRate);
-
- // This says that we process with the rate of state.range(0) bytes every iteration:
- state.counters["BytesProcessed"] = Counter(state.range(0), benchmark::Counter::kIsIterationInvariantRate, benchmark::Counter::OneK::kIs1024);
-```
-
-When you're compiling in C++11 mode or later you can use `insert()` with
-`std::initializer_list`:
-
-```c++
- // With C++11, this can be done:
- state.counters.insert({{"Foo", numFoos}, {"Bar", numBars}, {"Baz", numBazs}});
- // ... instead of:
- state.counters["Foo"] = numFoos;
- state.counters["Bar"] = numBars;
- state.counters["Baz"] = numBazs;
-```
-
-### Counter reporting
-
-When using the console reporter, by default, user counters are are printed at
-the end after the table, the same way as ``bytes_processed`` and
-``items_processed``. This is best for cases in which there are few counters,
-or where there are only a couple of lines per benchmark. Here's an example of
-the default output:
-
-```
-------------------------------------------------------------------------------
-Benchmark Time CPU Iterations UserCounters...
-------------------------------------------------------------------------------
-BM_UserCounter/threads:8 2248 ns 10277 ns 68808 Bar=16 Bat=40 Baz=24 Foo=8
-BM_UserCounter/threads:1 9797 ns 9788 ns 71523 Bar=2 Bat=5 Baz=3 Foo=1024m
-BM_UserCounter/threads:2 4924 ns 9842 ns 71036 Bar=4 Bat=10 Baz=6 Foo=2
-BM_UserCounter/threads:4 2589 ns 10284 ns 68012 Bar=8 Bat=20 Baz=12 Foo=4
-BM_UserCounter/threads:8 2212 ns 10287 ns 68040 Bar=16 Bat=40 Baz=24 Foo=8
-BM_UserCounter/threads:16 1782 ns 10278 ns 68144 Bar=32 Bat=80 Baz=48 Foo=16
-BM_UserCounter/threads:32 1291 ns 10296 ns 68256 Bar=64 Bat=160 Baz=96 Foo=32
-BM_UserCounter/threads:4 2615 ns 10307 ns 68040 Bar=8 Bat=20 Baz=12 Foo=4
-BM_Factorial 26 ns 26 ns 26608979 40320
-BM_Factorial/real_time 26 ns 26 ns 26587936 40320
-BM_CalculatePiRange/1 16 ns 16 ns 45704255 0
-BM_CalculatePiRange/8 73 ns 73 ns 9520927 3.28374
-BM_CalculatePiRange/64 609 ns 609 ns 1140647 3.15746
-BM_CalculatePiRange/512 4900 ns 4901 ns 142696 3.14355
-```
-
-If this doesn't suit you, you can print each counter as a table column by
-passing the flag `--benchmark_counters_tabular=true` to the benchmark
-application. This is best for cases in which there are a lot of counters, or
-a lot of lines per individual benchmark. Note that this will trigger a
-reprinting of the table header any time the counter set changes between
-individual benchmarks. Here's an example of corresponding output when
-`--benchmark_counters_tabular=true` is passed:
-
-```
----------------------------------------------------------------------------------------
-Benchmark Time CPU Iterations Bar Bat Baz Foo
----------------------------------------------------------------------------------------
-BM_UserCounter/threads:8 2198 ns 9953 ns 70688 16 40 24 8
-BM_UserCounter/threads:1 9504 ns 9504 ns 73787 2 5 3 1
-BM_UserCounter/threads:2 4775 ns 9550 ns 72606 4 10 6 2
-BM_UserCounter/threads:4 2508 ns 9951 ns 70332 8 20 12 4
-BM_UserCounter/threads:8 2055 ns 9933 ns 70344 16 40 24 8
-BM_UserCounter/threads:16 1610 ns 9946 ns 70720 32 80 48 16
-BM_UserCounter/threads:32 1192 ns 9948 ns 70496 64 160 96 32
-BM_UserCounter/threads:4 2506 ns 9949 ns 70332 8 20 12 4
---------------------------------------------------------------
-Benchmark Time CPU Iterations
---------------------------------------------------------------
-BM_Factorial 26 ns 26 ns 26392245 40320
-BM_Factorial/real_time 26 ns 26 ns 26494107 40320
-BM_CalculatePiRange/1 15 ns 15 ns 45571597 0
-BM_CalculatePiRange/8 74 ns 74 ns 9450212 3.28374
-BM_CalculatePiRange/64 595 ns 595 ns 1173901 3.15746
-BM_CalculatePiRange/512 4752 ns 4752 ns 147380 3.14355
-BM_CalculatePiRange/4k 37970 ns 37972 ns 18453 3.14184
-BM_CalculatePiRange/32k 303733 ns 303744 ns 2305 3.14162
-BM_CalculatePiRange/256k 2434095 ns 2434186 ns 288 3.1416
-BM_CalculatePiRange/1024k 9721140 ns 9721413 ns 71 3.14159
-BM_CalculatePi/threads:8 2255 ns 9943 ns 70936
-```
-Note above the additional header printed when the benchmark changes from
-``BM_UserCounter`` to ``BM_Factorial``. This is because ``BM_Factorial`` does
-not have the same counter set as ``BM_UserCounter``.
-
-## Exiting Benchmarks in Error
+### Exiting with an Error
When errors caused by external influences, such as file I/O and network
communication, occur within a benchmark the
Users may explicitly return to exit the benchmark immediately.
The `SkipWithError(...)` function may be used at any point within the benchmark,
-including before and after the benchmark loop.
+including before and after the benchmark loop. Moreover, if `SkipWithError(...)`
+has been used, it is not required to reach the benchmark loop and one may return
+from the benchmark function early.
For example:
static void BM_test(benchmark::State& state) {
auto resource = GetResource();
if (!resource.good()) {
- state.SkipWithError("Resource is not good!");
- // KeepRunning() loop will not be entered.
+ state.SkipWithError("Resource is not good!");
+ // KeepRunning() loop will not be entered.
}
- for (state.KeepRunning()) {
- auto data = resource.read_data();
- if (!resource.good()) {
- state.SkipWithError("Failed to read data!");
- break; // Needed to skip the rest of the iteration.
- }
- do_stuff(data);
+ while (state.KeepRunning()) {
+ auto data = resource.read_data();
+ if (!resource.good()) {
+ state.SkipWithError("Failed to read data!");
+ break; // Needed to skip the rest of the iteration.
+ }
+ do_stuff(data);
}
}
static void BM_test_ranged_fo(benchmark::State & state) {
- state.SkipWithError("test will not be entered");
+ auto resource = GetResource();
+ if (!resource.good()) {
+ state.SkipWithError("Resource is not good!");
+ return; // Early return is allowed when SkipWithError() has been used.
+ }
for (auto _ : state) {
- state.SkipWithError("Failed!");
- break; // REQUIRED to prevent all further iterations.
+ auto data = resource.read_data();
+ if (!resource.good()) {
+ state.SkipWithError("Failed to read data!");
+ break; // REQUIRED to prevent all further iterations.
+ }
+ do_stuff(data);
}
}
```
+<a name="a-faster-keep-running-loop" />
-## Running a subset of the benchmarks
-
-The `--benchmark_filter=<regex>` option can be used to only run the benchmarks
-which match the specified `<regex>`. For example:
+### A Faster KeepRunning Loop
-```bash
-$ ./run_benchmarks.x --benchmark_filter=BM_memcpy/32
-Run on (1 X 2300 MHz CPU )
-2016-06-25 19:34:24
-Benchmark Time CPU Iterations
-----------------------------------------------------
-BM_memcpy/32 11 ns 11 ns 79545455
-BM_memcpy/32k 2181 ns 2185 ns 324074
-BM_memcpy/32 12 ns 12 ns 54687500
-BM_memcpy/32k 1834 ns 1837 ns 357143
-```
-
-## Runtime and reporting considerations
-When the benchmark binary is executed, each benchmark function is run serially.
-The number of iterations to run is determined dynamically by running the
-benchmark a few times and measuring the time taken and ensuring that the
-ultimate result will be statistically stable. As such, faster benchmark
-functions will be run for more iterations than slower benchmark functions, and
-the number of iterations is thus reported.
-
-In all cases, the number of iterations for which the benchmark is run is
-governed by the amount of time the benchmark takes. Concretely, the number of
-iterations is at least one, not more than 1e9, until CPU time is greater than
-the minimum time, or the wallclock time is 5x minimum time. The minimum time is
-set per benchmark by calling `MinTime` on the registered benchmark object.
-
-Average timings are then reported over the iterations run. If multiple
-repetitions are requested using the `--benchmark_repetitions` command-line
-option, or at registration time, the benchmark function will be run several
-times and statistical results across these repetitions will also be reported.
-
-As well as the per-benchmark entries, a preamble in the report will include
-information about the machine on which the benchmarks are run.
-
-### Output Formats
-The library supports multiple output formats. Use the
-`--benchmark_format=<console|json|csv>` flag to set the format type. `console`
-is the default format.
-
-The Console format is intended to be a human readable format. By default
-the format generates color output. Context is output on stderr and the
-tabular data on stdout. Example tabular output looks like:
-```
-Benchmark Time(ns) CPU(ns) Iterations
-----------------------------------------------------------------------
-BM_SetInsert/1024/1 28928 29349 23853 133.097kB/s 33.2742k items/s
-BM_SetInsert/1024/8 32065 32913 21375 949.487kB/s 237.372k items/s
-BM_SetInsert/1024/10 33157 33648 21431 1.13369MB/s 290.225k items/s
-```
+In C++11 mode, a ranged-based for loop should be used in preference to
+the `KeepRunning` loop for running the benchmarks. For example:
-The JSON format outputs human readable json split into two top level attributes.
-The `context` attribute contains information about the run in general, including
-information about the CPU and the date.
-The `benchmarks` attribute contains a list of every benchmark run. Example json
-output looks like:
-```json
-{
- "context": {
- "date": "2015/03/17-18:40:25",
- "num_cpus": 40,
- "mhz_per_cpu": 2801,
- "cpu_scaling_enabled": false,
- "build_type": "debug"
- },
- "benchmarks": [
- {
- "name": "BM_SetInsert/1024/1",
- "iterations": 94877,
- "real_time": 29275,
- "cpu_time": 29836,
- "bytes_per_second": 134066,
- "items_per_second": 33516
- },
- {
- "name": "BM_SetInsert/1024/8",
- "iterations": 21609,
- "real_time": 32317,
- "cpu_time": 32429,
- "bytes_per_second": 986770,
- "items_per_second": 246693
- },
- {
- "name": "BM_SetInsert/1024/10",
- "iterations": 21393,
- "real_time": 32724,
- "cpu_time": 33355,
- "bytes_per_second": 1199226,
- "items_per_second": 299807
- }
- ]
+```c++
+static void BM_Fast(benchmark::State &state) {
+ for (auto _ : state) {
+ FastOperation();
+ }
}
+BENCHMARK(BM_Fast);
```
-The CSV format outputs comma-separated values. The `context` is output on stderr
-and the CSV itself on stdout. Example CSV output looks like:
-```
-name,iterations,real_time,cpu_time,bytes_per_second,items_per_second,label
-"BM_SetInsert/1024/1",65465,17890.7,8407.45,475768,118942,
-"BM_SetInsert/1024/8",116606,18810.1,9766.64,3.27646e+06,819115,
-"BM_SetInsert/1024/10",106365,17238.4,8421.53,4.74973e+06,1.18743e+06,
-```
-
-### Output Files
-The library supports writing the output of the benchmark to a file specified
-by `--benchmark_out=<filename>`. The format of the output can be specified
-using `--benchmark_out_format={json|console|csv}`. Specifying
-`--benchmark_out` does not suppress the console output.
-
-## Result comparison
-
-It is possible to compare the benchmarking results. See [Additional Tooling Documentation](docs/tools.md)
+The reason the ranged-for loop is faster than using `KeepRunning`, is
+because `KeepRunning` requires a memory load and store of the iteration count
+ever iteration, whereas the ranged-for variant is able to keep the iteration count
+in a register.
-## Debug vs Release
-By default, benchmark builds as a debug library. You will see a warning in the
-output when this is the case. To build it as a release library instead, use:
+For example, an empty inner loop of using the ranged-based for method looks like:
-```
-cmake -DCMAKE_BUILD_TYPE=Release
+```asm
+# Loop Init
+ mov rbx, qword ptr [r14 + 104]
+ call benchmark::State::StartKeepRunning()
+ test rbx, rbx
+ je .LoopEnd
+.LoopHeader: # =>This Inner Loop Header: Depth=1
+ add rbx, -1
+ jne .LoopHeader
+.LoopEnd:
```
-To enable link-time optimisation, use
+Compared to an empty `KeepRunning` loop, which looks like:
+```asm
+.LoopHeader: # in Loop: Header=BB0_3 Depth=1
+ cmp byte ptr [rbx], 1
+ jne .LoopInit
+.LoopBody: # =>This Inner Loop Header: Depth=1
+ mov rax, qword ptr [rbx + 8]
+ lea rcx, [rax + 1]
+ mov qword ptr [rbx + 8], rcx
+ cmp rax, qword ptr [rbx + 104]
+ jb .LoopHeader
+ jmp .LoopEnd
+.LoopInit:
+ mov rdi, rbx
+ call benchmark::State::StartKeepRunning()
+ jmp .LoopBody
+.LoopEnd:
```
-cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_LTO=true
-```
-
-If you are using gcc, you might need to set `GCC_AR` and `GCC_RANLIB` cmake
-cache variables, if autodetection fails.
-
-If you are using clang, you may need to set `LLVMAR_EXECUTABLE`,
-`LLVMNM_EXECUTABLE` and `LLVMRANLIB_EXECUTABLE` cmake cache variables.
-
-## Compiler Support
-Google Benchmark uses C++11 when building the library. As such we require
-a modern C++ toolchain, both compiler and standard library.
-
-The following minimum versions are strongly recommended build the library:
-
-* GCC 4.8
-* Clang 3.4
-* Visual Studio 2013
-* Intel 2015 Update 1
+Unless C++03 compatibility is required, the ranged-for variant of writing
+the benchmark loop should be preferred.
-Anything older *may* work.
+<a name="disabling-cpu-frequency-scaling" />
-Note: Using the library and its headers in C++03 is supported. C++11 is only
-required to build the library.
+### Disabling CPU Frequency Scaling
-## Disable CPU frequency scaling
If you see this error:
+
```
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
```
+
you might want to disable the CPU frequency scaling while running the benchmark:
+
```bash
sudo cpupower frequency-set --governor performance
./mybench
workspace(name = "com_github_google_benchmark")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+http_archive(
+ name = "rules_cc",
+ strip_prefix = "rules_cc-a508235df92e71d537fcbae0c7c952ea6957a912",
+ urls = ["https://github.com/bazelbuild/rules_cc/archive/a508235df92e71d537fcbae0c7c952ea6957a912.zip"],
+ sha256 = "d7dc12c1d5bc1a87474de8e3d17b7731a4dcebcfb8aa3990fe8ac7734ef12f2f",
+)
+
+http_archive(
+ name = "com_google_absl",
+ sha256 = "f41868f7a938605c92936230081175d1eae87f6ea2c248f41077c8f88316f111",
+ strip_prefix = "abseil-cpp-20200225.2",
+ urls = ["https://github.com/abseil/abseil-cpp/archive/20200225.2.tar.gz"],
+)
+
+http_archive(
+ name = "com_google_googletest",
+ strip_prefix = "googletest-3f0cf6b62ad1eb50d8736538363d3580dd640c3e",
+ urls = ["https://github.com/google/googletest/archive/3f0cf6b62ad1eb50d8736538363d3580dd640c3e.zip"],
+ sha256 = "8f827dd550db8b4fdf73904690df0be9fccc161017c9038a724bc9a0617a1bc8",
+)
+
http_archive(
- name = "com_google_googletest",
- urls = ["https://github.com/google/googletest/archive/3f0cf6b62ad1eb50d8736538363d3580dd640c3e.zip"],
- strip_prefix = "googletest-3f0cf6b62ad1eb50d8736538363d3580dd640c3e",
+ name = "pybind11",
+ build_file = "@//bindings/python:pybind11.BUILD",
+ sha256 = "1eed57bc6863190e35637290f97a20c81cfe4d9090ac0a24f3bbf08f265eb71d",
+ strip_prefix = "pybind11-2.4.3",
+ urls = ["https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz"],
+)
+
+new_local_repository(
+ name = "python_headers",
+ build_file = "@//bindings/python:python_headers.BUILD",
+ path = "/usr/include/python3.6", # May be overwritten by setup.py.
+)
+
+http_archive(
+ name = "rules_python",
+ url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
+ sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
+)
+
+load("@rules_python//python:pip.bzl", pip3_install="pip_install")
+
+pip3_install(
+ name = "py_deps",
+ requirements = "//:requirements.txt",
)
--- /dev/null
+theme: jekyll-theme-midnight
+markdown: GFM
- cmake --build . --config %configuration%
test_script:
- - ctest -c %configuration% --timeout 300 --output-on-failure
+ - ctest --build-config %configuration% --timeout 300 --output-on-failure
artifacts:
- path: '_build/CMakeFiles/*.log'
--- /dev/null
+exports_files(glob(["*.BUILD"]))
+exports_files(["build_defs.bzl"])
+
--- /dev/null
+_SHARED_LIB_SUFFIX = {
+ "//conditions:default": ".so",
+ "//:windows": ".dll",
+}
+
+def py_extension(name, srcs, hdrs = [], copts = [], features = [], deps = []):
+ for shared_lib_suffix in _SHARED_LIB_SUFFIX.values():
+ shared_lib_name = name + shared_lib_suffix
+ native.cc_binary(
+ name = shared_lib_name,
+ linkshared = 1,
+ linkstatic = 1,
+ srcs = srcs + hdrs,
+ copts = copts,
+ features = features,
+ deps = deps,
+ )
+
+ return native.py_library(
+ name = name,
+ data = select({
+ platform: [name + shared_lib_suffix]
+ for platform, shared_lib_suffix in _SHARED_LIB_SUFFIX.items()
+ }),
+ )
--- /dev/null
+load("//bindings/python:build_defs.bzl", "py_extension")
+
+py_library(
+ name = "google_benchmark",
+ srcs = ["__init__.py"],
+ visibility = ["//visibility:public"],
+ deps = [
+ ":_benchmark",
+ # pip; absl:app
+ ],
+)
+
+py_extension(
+ name = "_benchmark",
+ srcs = ["benchmark.cc"],
+ copts = [
+ "-fexceptions",
+ "-fno-strict-aliasing",
+ ],
+ features = ["-use_header_modules"],
+ deps = [
+ "//:benchmark",
+ "@pybind11",
+ "@python_headers",
+ ],
+)
+
+py_test(
+ name = "example",
+ srcs = ["example.py"],
+ python_version = "PY3",
+ srcs_version = "PY3",
+ visibility = ["//visibility:public"],
+ deps = [
+ ":google_benchmark",
+ ],
+)
+
--- /dev/null
+# Copyright 2020 Google Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Python benchmarking utilities.
+
+Example usage:
+ import google_benchmark as benchmark
+
+ @benchmark.register
+ def my_benchmark(state):
+ ... # Code executed outside `while` loop is not timed.
+
+ while state:
+ ... # Code executed within `while` loop is timed.
+
+ if __name__ == '__main__':
+ benchmark.main()
+"""
+
+from absl import app
+from google_benchmark import _benchmark
+from google_benchmark._benchmark import (
+ Counter,
+ kNanosecond,
+ kMicrosecond,
+ kMillisecond,
+ kSecond,
+ oNone,
+ o1,
+ oN,
+ oNSquared,
+ oNCubed,
+ oLogN,
+ oNLogN,
+ oAuto,
+ oLambda,
+)
+
+
+__all__ = [
+ "register",
+ "main",
+ "Counter",
+ "kNanosecond",
+ "kMicrosecond",
+ "kMillisecond",
+ "kSecond",
+ "oNone",
+ "o1",
+ "oN",
+ "oNSquared",
+ "oNCubed",
+ "oLogN",
+ "oNLogN",
+ "oAuto",
+ "oLambda",
+]
+
+__version__ = "0.2.0"
+
+
+class __OptionMaker:
+ """A stateless class to collect benchmark options.
+
+ Collect all decorator calls like @option.range(start=0, limit=1<<5).
+ """
+
+ class Options:
+ """Pure data class to store options calls, along with the benchmarked function."""
+
+ def __init__(self, func):
+ self.func = func
+ self.builder_calls = []
+
+ @classmethod
+ def make(cls, func_or_options):
+ """Make Options from Options or the benchmarked function."""
+ if isinstance(func_or_options, cls.Options):
+ return func_or_options
+ return cls.Options(func_or_options)
+
+ def __getattr__(self, builder_name):
+ """Append option call in the Options."""
+
+ # The function that get returned on @option.range(start=0, limit=1<<5).
+ def __builder_method(*args, **kwargs):
+
+ # The decorator that get called, either with the benchmared function
+ # or the previous Options
+ def __decorator(func_or_options):
+ options = self.make(func_or_options)
+ options.builder_calls.append((builder_name, args, kwargs))
+ # The decorator returns Options so it is not technically a decorator
+ # and needs a final call to @regiser
+ return options
+
+ return __decorator
+
+ return __builder_method
+
+
+# Alias for nicer API.
+# We have to instantiate an object, even if stateless, to be able to use __getattr__
+# on option.range
+option = __OptionMaker()
+
+
+def register(undefined=None, *, name=None):
+ """Register function for benchmarking."""
+ if undefined is None:
+ # Decorator is called without parenthesis so we return a decorator
+ return lambda f: register(f, name=name)
+
+ # We have either the function to benchmark (simple case) or an instance of Options
+ # (@option._ case).
+ options = __OptionMaker.make(undefined)
+
+ if name is None:
+ name = options.func.__name__
+
+ # We register the benchmark and reproduce all the @option._ calls onto the
+ # benchmark builder pattern
+ benchmark = _benchmark.RegisterBenchmark(name, options.func)
+ for name, args, kwargs in options.builder_calls[::-1]:
+ getattr(benchmark, name)(*args, **kwargs)
+
+ # return the benchmarked function because the decorator does not modify it
+ return options.func
+
+
+def _flags_parser(argv):
+ argv = _benchmark.Initialize(argv)
+ return app.parse_flags_with_usage(argv)
+
+
+def _run_benchmarks(argv):
+ if len(argv) > 1:
+ raise app.UsageError("Too many command-line arguments.")
+ return _benchmark.RunSpecifiedBenchmarks()
+
+
+def main(argv=None):
+ return app.run(_run_benchmarks, argv=argv, flags_parser=_flags_parser)
+
+
+# Methods for use with custom main function.
+initialize = _benchmark.Initialize
+run_benchmarks = _benchmark.RunSpecifiedBenchmarks
--- /dev/null
+// Benchmark for Python.
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "pybind11/operators.h"
+#include "pybind11/pybind11.h"
+#include "pybind11/stl.h"
+#include "pybind11/stl_bind.h"
+
+#include "benchmark/benchmark.h"
+
+PYBIND11_MAKE_OPAQUE(benchmark::UserCounters);
+
+namespace {
+namespace py = ::pybind11;
+
+std::vector<std::string> Initialize(const std::vector<std::string>& argv) {
+ // The `argv` pointers here become invalid when this function returns, but
+ // benchmark holds the pointer to `argv[0]`. We create a static copy of it
+ // so it persists, and replace the pointer below.
+ static std::string executable_name(argv[0]);
+ std::vector<char*> ptrs;
+ ptrs.reserve(argv.size());
+ for (auto& arg : argv) {
+ ptrs.push_back(const_cast<char*>(arg.c_str()));
+ }
+ ptrs[0] = const_cast<char*>(executable_name.c_str());
+ int argc = static_cast<int>(argv.size());
+ benchmark::Initialize(&argc, ptrs.data());
+ std::vector<std::string> remaining_argv;
+ remaining_argv.reserve(argc);
+ for (int i = 0; i < argc; ++i) {
+ remaining_argv.emplace_back(ptrs[i]);
+ }
+ return remaining_argv;
+}
+
+benchmark::internal::Benchmark* RegisterBenchmark(const char* name,
+ py::function f) {
+ return benchmark::RegisterBenchmark(
+ name, [f](benchmark::State& state) { f(&state); });
+}
+
+PYBIND11_MODULE(_benchmark, m) {
+ using benchmark::TimeUnit;
+ py::enum_<TimeUnit>(m, "TimeUnit")
+ .value("kNanosecond", TimeUnit::kNanosecond)
+ .value("kMicrosecond", TimeUnit::kMicrosecond)
+ .value("kMillisecond", TimeUnit::kMillisecond)
+ .value("kSecond", TimeUnit::kSecond)
+ .export_values();
+
+ using benchmark::BigO;
+ py::enum_<BigO>(m, "BigO")
+ .value("oNone", BigO::oNone)
+ .value("o1", BigO::o1)
+ .value("oN", BigO::oN)
+ .value("oNSquared", BigO::oNSquared)
+ .value("oNCubed", BigO::oNCubed)
+ .value("oLogN", BigO::oLogN)
+ .value("oNLogN", BigO::oLogN)
+ .value("oAuto", BigO::oAuto)
+ .value("oLambda", BigO::oLambda)
+ .export_values();
+
+ using benchmark::internal::Benchmark;
+ py::class_<Benchmark>(m, "Benchmark")
+ // For methods returning a pointer tor the current object, reference
+ // return policy is used to ask pybind not to take ownership oof the
+ // returned object and avoid calling delete on it.
+ // https://pybind11.readthedocs.io/en/stable/advanced/functions.html#return-value-policies
+ //
+ // For methods taking a const std::vector<...>&, a copy is created
+ // because a it is bound to a Python list.
+ // https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html
+ .def("unit", &Benchmark::Unit, py::return_value_policy::reference)
+ .def("arg", &Benchmark::Arg, py::return_value_policy::reference)
+ .def("args", &Benchmark::Args, py::return_value_policy::reference)
+ .def("range", &Benchmark::Range, py::return_value_policy::reference,
+ py::arg("start"), py::arg("limit"))
+ .def("dense_range", &Benchmark::DenseRange,
+ py::return_value_policy::reference, py::arg("start"),
+ py::arg("limit"), py::arg("step") = 1)
+ .def("ranges", &Benchmark::Ranges, py::return_value_policy::reference)
+ .def("args_product", &Benchmark::ArgsProduct,
+ py::return_value_policy::reference)
+ .def("arg_name", &Benchmark::ArgName, py::return_value_policy::reference)
+ .def("arg_names", &Benchmark::ArgNames,
+ py::return_value_policy::reference)
+ .def("range_pair", &Benchmark::RangePair,
+ py::return_value_policy::reference, py::arg("lo1"), py::arg("hi1"),
+ py::arg("lo2"), py::arg("hi2"))
+ .def("range_multiplier", &Benchmark::RangeMultiplier,
+ py::return_value_policy::reference)
+ .def("min_time", &Benchmark::MinTime, py::return_value_policy::reference)
+ .def("iterations", &Benchmark::Iterations,
+ py::return_value_policy::reference)
+ .def("repetitions", &Benchmark::Repetitions,
+ py::return_value_policy::reference)
+ .def("report_aggregates_only", &Benchmark::ReportAggregatesOnly,
+ py::return_value_policy::reference, py::arg("value") = true)
+ .def("display_aggregates_only", &Benchmark::DisplayAggregatesOnly,
+ py::return_value_policy::reference, py::arg("value") = true)
+ .def("measure_process_cpu_time", &Benchmark::MeasureProcessCPUTime,
+ py::return_value_policy::reference)
+ .def("use_real_time", &Benchmark::UseRealTime,
+ py::return_value_policy::reference)
+ .def("use_manual_time", &Benchmark::UseManualTime,
+ py::return_value_policy::reference)
+ .def(
+ "complexity",
+ (Benchmark * (Benchmark::*)(benchmark::BigO)) & Benchmark::Complexity,
+ py::return_value_policy::reference,
+ py::arg("complexity") = benchmark::oAuto);
+
+ using benchmark::Counter;
+ py::class_<Counter> py_counter(m, "Counter");
+
+ py::enum_<Counter::Flags>(py_counter, "Flags")
+ .value("kDefaults", Counter::Flags::kDefaults)
+ .value("kIsRate", Counter::Flags::kIsRate)
+ .value("kAvgThreads", Counter::Flags::kAvgThreads)
+ .value("kAvgThreadsRate", Counter::Flags::kAvgThreadsRate)
+ .value("kIsIterationInvariant", Counter::Flags::kIsIterationInvariant)
+ .value("kIsIterationInvariantRate",
+ Counter::Flags::kIsIterationInvariantRate)
+ .value("kAvgIterations", Counter::Flags::kAvgIterations)
+ .value("kAvgIterationsRate", Counter::Flags::kAvgIterationsRate)
+ .value("kInvert", Counter::Flags::kInvert)
+ .export_values()
+ .def(py::self | py::self);
+
+ py::enum_<Counter::OneK>(py_counter, "OneK")
+ .value("kIs1000", Counter::OneK::kIs1000)
+ .value("kIs1024", Counter::OneK::kIs1024)
+ .export_values();
+
+ py_counter
+ .def(py::init<double, Counter::Flags, Counter::OneK>(),
+ py::arg("value") = 0., py::arg("flags") = Counter::kDefaults,
+ py::arg("k") = Counter::kIs1000)
+ .def(py::init([](double value) { return Counter(value); }))
+ .def_readwrite("value", &Counter::value)
+ .def_readwrite("flags", &Counter::flags)
+ .def_readwrite("oneK", &Counter::oneK);
+ py::implicitly_convertible<py::float_, Counter>();
+ py::implicitly_convertible<py::int_, Counter>();
+
+ py::bind_map<benchmark::UserCounters>(m, "UserCounters");
+
+ using benchmark::State;
+ py::class_<State>(m, "State")
+ .def("__bool__", &State::KeepRunning)
+ .def_property_readonly("keep_running", &State::KeepRunning)
+ .def("pause_timing", &State::PauseTiming)
+ .def("resume_timing", &State::ResumeTiming)
+ .def("skip_with_error", &State::SkipWithError)
+ .def_property_readonly("error_occurred", &State::error_occurred)
+ .def("set_iteration_time", &State::SetIterationTime)
+ .def_property("bytes_processed", &State::bytes_processed,
+ &State::SetBytesProcessed)
+ .def_property("complexity_n", &State::complexity_length_n,
+ &State::SetComplexityN)
+ .def_property("items_processed", &State::items_processed,
+ &State::SetItemsProcessed)
+ .def("set_label", (void (State::*)(const char*)) & State::SetLabel)
+ .def("range", &State::range, py::arg("pos") = 0)
+ .def_property_readonly("iterations", &State::iterations)
+ .def_readwrite("counters", &State::counters)
+ .def_readonly("thread_index", &State::thread_index)
+ .def_readonly("threads", &State::threads);
+
+ m.def("Initialize", Initialize);
+ m.def("RegisterBenchmark", RegisterBenchmark,
+ py::return_value_policy::reference);
+ m.def("RunSpecifiedBenchmarks",
+ []() { benchmark::RunSpecifiedBenchmarks(); });
+};
+} // namespace
--- /dev/null
+# Copyright 2020 Google Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Example of Python using C++ benchmark framework.
+
+To run this example, you must first install the `google_benchmark` Python package.
+
+To install using `setup.py`, download and extract the `google_benchmark` source.
+In the extracted directory, execute:
+ python setup.py install
+"""
+
+import random
+import time
+
+import google_benchmark as benchmark
+from google_benchmark import Counter
+
+
+@benchmark.register
+def empty(state):
+ while state:
+ pass
+
+
+@benchmark.register
+def sum_million(state):
+ while state:
+ sum(range(1_000_000))
+
+@benchmark.register
+def pause_timing(state):
+ """Pause timing every iteration."""
+ while state:
+ # Construct a list of random ints every iteration without timing it
+ state.pause_timing()
+ random_list = [random.randint(0, 100) for _ in range(100)]
+ state.resume_timing()
+ # Time the in place sorting algorithm
+ random_list.sort()
+
+
+@benchmark.register
+def skipped(state):
+ if True: # Test some predicate here.
+ state.skip_with_error("some error")
+ return # NOTE: You must explicitly return, or benchmark will continue.
+
+ ... # Benchmark code would be here.
+
+
+@benchmark.register
+def manual_timing(state):
+ while state:
+ # Manually count Python CPU time
+ start = time.perf_counter() # perf_counter_ns() in Python 3.7+
+ # Something to benchmark
+ time.sleep(0.01)
+ end = time.perf_counter()
+ state.set_iteration_time(end - start)
+
+
+@benchmark.register
+def custom_counters(state):
+ """Collect cutom metric using benchmark.Counter."""
+ num_foo = 0.0
+ while state:
+ # Benchmark some code here
+ pass
+ # Collect some custom metric named foo
+ num_foo += 0.13
+
+ # Automatic Counter from numbers.
+ state.counters["foo"] = num_foo
+ # Set a counter as a rate.
+ state.counters["foo_rate"] = Counter(num_foo, Counter.kIsRate)
+ # Set a counter as an inverse of rate.
+ state.counters["foo_inv_rate"] = Counter(num_foo, Counter.kIsRate | Counter.kInvert)
+ # Set a counter as a thread-average quantity.
+ state.counters["foo_avg"] = Counter(num_foo, Counter.kAvgThreads)
+ # There's also a combined flag:
+ state.counters["foo_avg_rate"] = Counter(num_foo, Counter.kAvgThreadsRate)
+
+
+@benchmark.register
+@benchmark.option.measure_process_cpu_time()
+@benchmark.option.use_real_time()
+def with_options(state):
+ while state:
+ sum(range(1_000_000))
+
+
+@benchmark.register(name="sum_million_microseconds")
+@benchmark.option.unit(benchmark.kMicrosecond)
+def with_options(state):
+ while state:
+ sum(range(1_000_000))
+
+
+@benchmark.register
+@benchmark.option.arg(100)
+@benchmark.option.arg(1000)
+def passing_argument(state):
+ while state:
+ sum(range(state.range(0)))
+
+
+@benchmark.register
+@benchmark.option.range(8, limit=8 << 10)
+def using_range(state):
+ while state:
+ sum(range(state.range(0)))
+
+
+@benchmark.register
+@benchmark.option.range_multiplier(2)
+@benchmark.option.range(1 << 10, 1 << 18)
+@benchmark.option.complexity(benchmark.oN)
+def computing_complexity(state):
+ while state:
+ sum(range(state.range(0)))
+ state.complexity_n = state.range(0)
+
+
+if __name__ == "__main__":
+ benchmark.main()
--- /dev/null
+cc_library(
+ name = "pybind11",
+ hdrs = glob(
+ include = [
+ "include/pybind11/*.h",
+ "include/pybind11/detail/*.h",
+ ],
+ exclude = [
+ "include/pybind11/common.h",
+ "include/pybind11/eigen.h",
+ ],
+ ),
+ copts = [
+ "-fexceptions",
+ "-Wno-undefined-inline",
+ "-Wno-pragma-once-outside-header",
+ ],
+ includes = ["include"],
+ visibility = ["//visibility:public"],
+)
--- /dev/null
+cc_library(
+ name = "python_headers",
+ hdrs = glob(["**/*.h"]),
+ includes = ["."],
+ visibility = ["//visibility:public"],
+)
--- /dev/null
+absl-py>=0.7.1
+
check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
if(${MANGLED_FLAG})
- set(VARIANT ${ARGV1})
- if(ARGV1)
+ if(ARGC GREATER 1)
+ set(VARIANT ${ARGV1})
string(TOUPPER "_${VARIANT}" VARIANT)
+ else()
+ set(VARIANT "")
endif()
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${BENCHMARK_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
endif()
check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
if(${MANGLED_FLAG})
- set(VARIANT ${ARGV1})
- if(ARGV1)
+ if(ARGC GREATER 1)
+ set(VARIANT ${ARGV1})
string(TOUPPER "_${VARIANT}" VARIANT)
+ else()
+ set(VARIANT "")
endif()
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
return()
endif()
+ if (ARGC GREATER 1)
+ message(STATUS "Enabling additional flags: ${ARGV1}")
+ list(APPEND BENCHMARK_CXX_LINKER_FLAGS ${ARGV1})
+ endif()
+
if (NOT DEFINED COMPILE_${FEATURE})
message(STATUS "Performing Test ${FEATURE}")
if(CMAKE_CROSSCOMPILING)
if(COMPILE_${FEATURE})
message(WARNING
"If you see build failures due to cross compilation, try setting HAVE_${VAR} to 0")
- set(RUN_${FEATURE} 0)
+ set(RUN_${FEATURE} 0 CACHE INTERNAL "")
else()
- set(RUN_${FEATURE} 1)
+ set(RUN_${FEATURE} 1 CACHE INTERNAL "")
endif()
else()
message(STATUS "Performing Test ${FEATURE}")
function(get_git_version var)
if(GIT_EXECUTABLE)
- execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8
+ execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE status
- OUTPUT_VARIABLE GIT_VERSION
+ OUTPUT_VARIABLE GIT_DESCRIBE_VERSION
ERROR_QUIET)
- if(${status})
- set(GIT_VERSION "v0.0.0")
+ if(status)
+ set(GIT_DESCRIBE_VERSION "v0.0.0")
+ endif()
+
+ string(STRIP ${GIT_DESCRIBE_VERSION} GIT_DESCRIBE_VERSION)
+ if(GIT_DESCRIBE_VERSION MATCHES v[^-]*-)
+ string(REGEX REPLACE "v([^-]*)-([0-9]+)-.*" "\\1.\\2" GIT_VERSION ${GIT_DESCRIBE_VERSION})
else()
- string(STRIP ${GIT_VERSION} GIT_VERSION)
- string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION})
+ string(REGEX REPLACE "v(.*)" "\\1" GIT_VERSION ${GIT_DESCRIBE_VERSION})
endif()
# Work out if the repository is dirty
ERROR_QUIET)
string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY)
if (${GIT_DIRTY})
- set(GIT_VERSION "${GIT_VERSION}-dirty")
+ set(GIT_DESCRIBE_VERSION "${GIT_DESCRIBE_VERSION}-dirty")
endif()
+ message(STATUS "git version: ${GIT_DESCRIBE_VERSION} normalized to ${GIT_VERSION}")
else()
- set(GIT_VERSION "v0.0.0")
+ set(GIT_VERSION "0.0.0")
endif()
- message(STATUS "git Version: ${GIT_VERSION}")
set(${var} ${GIT_VERSION} PARENT_SCOPE)
endfunction()
--- /dev/null
+# Download and unpack googletest at configure time
+set(GOOGLETEST_PREFIX "${benchmark_BINARY_DIR}/third_party/googletest")
+configure_file(${benchmark_SOURCE_DIR}/cmake/GoogleTest.cmake.in ${GOOGLETEST_PREFIX}/CMakeLists.txt @ONLY)
+
+set(GOOGLETEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/googletest" CACHE PATH "") # Mind the quotes
+execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
+ -DALLOW_DOWNLOADING_GOOGLETEST=${BENCHMARK_DOWNLOAD_DEPENDENCIES} -DGOOGLETEST_PATH:PATH=${GOOGLETEST_PATH} .
+ RESULT_VARIABLE result
+ WORKING_DIRECTORY ${GOOGLETEST_PREFIX}
+)
+
+if(result)
+ message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+endif()
+
+execute_process(
+ COMMAND ${CMAKE_COMMAND} --build .
+ RESULT_VARIABLE result
+ WORKING_DIRECTORY ${GOOGLETEST_PREFIX}
+)
+
+if(result)
+ message(FATAL_ERROR "Build step for googletest failed: ${result}")
+endif()
+
+# Prevent overriding the parent project's compiler/linker
+# settings on Windows
+set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+
+include(${GOOGLETEST_PREFIX}/googletest-paths.cmake)
+
+# Add googletest directly to our build. This defines
+# the gtest and gtest_main targets.
+add_subdirectory(${GOOGLETEST_SOURCE_DIR}
+ ${GOOGLETEST_BINARY_DIR}
+ EXCLUDE_FROM_ALL)
+
+set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest,INTERFACE_INCLUDE_DIRECTORIES>)
+set_target_properties(gtest_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest_main,INTERFACE_INCLUDE_DIRECTORIES>)
+set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock,INTERFACE_INCLUDE_DIRECTORIES>)
+set_target_properties(gmock_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock_main,INTERFACE_INCLUDE_DIRECTORIES>)
--- /dev/null
+cmake_minimum_required(VERSION 2.8.12)
+
+project(googletest-download NONE)
+
+# Enable ExternalProject CMake module
+include(ExternalProject)
+
+option(ALLOW_DOWNLOADING_GOOGLETEST "If googletest src tree is not found in location specified by GOOGLETEST_PATH, do fetch the archive from internet" OFF)
+set(GOOGLETEST_PATH "/usr/src/googletest" CACHE PATH
+ "Path to the googletest root tree. Should contain googletest and googlemock subdirs. And CMakeLists.txt in root, and in both of these subdirs")
+
+# Download and install GoogleTest
+
+message(STATUS "Looking for Google Test sources")
+message(STATUS "Looking for Google Test sources in ${GOOGLETEST_PATH}")
+if(EXISTS "${GOOGLETEST_PATH}" AND IS_DIRECTORY "${GOOGLETEST_PATH}" AND EXISTS "${GOOGLETEST_PATH}/CMakeLists.txt" AND
+ EXISTS "${GOOGLETEST_PATH}/googletest" AND IS_DIRECTORY "${GOOGLETEST_PATH}/googletest" AND EXISTS "${GOOGLETEST_PATH}/googletest/CMakeLists.txt" AND
+ EXISTS "${GOOGLETEST_PATH}/googlemock" AND IS_DIRECTORY "${GOOGLETEST_PATH}/googlemock" AND EXISTS "${GOOGLETEST_PATH}/googlemock/CMakeLists.txt")
+ message(STATUS "Found Google Test in ${GOOGLETEST_PATH}")
+
+ ExternalProject_Add(
+ googletest
+ PREFIX "${CMAKE_BINARY_DIR}"
+ DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/download"
+ SOURCE_DIR "${GOOGLETEST_PATH}" # use existing src dir.
+ BINARY_DIR "${CMAKE_BINARY_DIR}/build"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ TEST_COMMAND ""
+ )
+else()
+ if(NOT ALLOW_DOWNLOADING_GOOGLETEST)
+ message(SEND_ERROR "Did not find Google Test sources! Either pass correct path in GOOGLETEST_PATH, or enable BENCHMARK_DOWNLOAD_DEPENDENCIES, or disable BENCHMARK_ENABLE_GTEST_TESTS / BENCHMARK_ENABLE_TESTING.")
+ else()
+ message(WARNING "Did not find Google Test sources! Fetching from web...")
+ ExternalProject_Add(
+ googletest
+ GIT_REPOSITORY https://github.com/google/googletest.git
+ GIT_TAG master
+ PREFIX "${CMAKE_BINARY_DIR}"
+ STAMP_DIR "${CMAKE_BINARY_DIR}/stamp"
+ DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/download"
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/src"
+ BINARY_DIR "${CMAKE_BINARY_DIR}/build"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ TEST_COMMAND ""
+ )
+ endif()
+endif()
+
+ExternalProject_Get_Property(googletest SOURCE_DIR BINARY_DIR)
+file(WRITE googletest-paths.cmake
+"set(GOOGLETEST_SOURCE_DIR \"${SOURCE_DIR}\")
+set(GOOGLETEST_BINARY_DIR \"${BINARY_DIR}\")
+")
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/lib
-includedir=${prefix}/include
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: Google microbenchmark framework
Version: @VERSION@
Libs: -L${libdir} -lbenchmark
+Libs.private: -lpthread
Cflags: -I${includedir}
}
return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
}
+
regfree(&re);
return ret;
}
+
std::regex_constants::extended | std::regex_constants::nosubs);
return std::regex_search(str, re) ? 0 : -1;
}
+
--- /dev/null
+# Build tool dependency policy
+
+To ensure the broadest compatibility when building the benchmark library, but
+still allow forward progress, we require any build tooling to be available for:
+
+* Debian stable AND
+* The last two Ubuntu LTS releases AND
+
+Currently, this means using build tool versions that are available for Ubuntu
+16.04 (Xenial), Ubuntu 18.04 (Bionic), and Debian stretch.
+
+_Note, [travis](.travis.yml) runs under Ubuntu 14.04 (Trusty) for linux builds._
+
+## cmake
+The current supported version is cmake 3.5.1 as of 2018-06-06.
+
+_Note, this version is also available for Ubuntu 14.04, the previous Ubuntu LTS
+release, as `cmake3`._
Furthermore, the tests fail for builds which specify additional flags
that modify code generation, including `--coverage` or `-fsanitize=`.
+
--- /dev/null
+theme: jekyll-theme-hacker
\ No newline at end of file
--- /dev/null
+<a name="perf-counters" />
+
+# User-Requested Performance Counters
+
+When running benchmarks, the user may choose to request collection of
+performance counters. This may be useful in investigation scenarios - narrowing
+down the cause of a regression; or verifying that the underlying cause of a
+performance improvement matches expectations.
+
+This feature is available if:
+
+* The benchmark is run on an architecture featuring a Performance Monitoring
+ Unit (PMU),
+* The benchmark is compiled with support for collecting counters. Currently,
+ this requires [libpfm](http://perfmon2.sourceforge.net/) be available at build
+ time
+
+The feature does not require modifying benchmark code. Counter collection is
+handled at the boundaries where timer collection is also handled.
+
+To opt-in:
+
+* Install `libpfm4-dev`, e.g. `apt-get install libpfm4-dev`.
+* Enable the cmake flag BENCHMARK_ENABLE_LIBPFM.
+
+To use, pass a comma-separated list of counter names through the
+`--benchmark_perf_counters` flag. The names are decoded through libpfm - meaning,
+they are platform specific, but some (e.g. `CYCLES` or `INSTRUCTIONS`) are
+mapped by libpfm to platform-specifics - see libpfm
+[documentation](http://perfmon2.sourceforge.net/docs.html) for more details.
+
+The counter values are reported back through the [User Counters](../README.md#custom-counters)
+mechanism, meaning, they are available in all the formats (e.g. JSON) supported
+by User Counters.
\ No newline at end of file
--- /dev/null
+<a name="interleaving" />
+
+# Random Interleaving
+
+[Random Interleaving](https://github.com/google/benchmark/issues/1051) is a
+technique to lower run-to-run variance. It randomly interleaves repetitions of a
+microbenchmark with repetitions from other microbenchmarks in the same benchmark
+test. Data shows it is able to lower run-to-run variance by
+[40%](https://github.com/google/benchmark/issues/1051) on average.
+
+To use, you mainly need to set `--benchmark_enable_random_interleaving=true`,
+and optionally specify non-zero repetition count `--benchmark_repetitions=9`
+and optionally decrease the per-repetition time `--benchmark_min_time=0.1`.
--- /dev/null
+# How to release
+
+* Make sure you're on main and synced to HEAD
+* Ensure the project builds and tests run (sanity check only, obviously)
+ * `parallel -j0 exec ::: test/*_test` can help ensure everything at least
+ passes
+* Prepare release notes
+ * `git log $(git describe --abbrev=0 --tags)..HEAD` gives you the list of
+ commits between the last annotated tag and HEAD
+ * Pick the most interesting.
+* Create one last commit that updates the version saved in `CMakeLists.txt` to the release version you're creating. (This version will be used if benchmark is installed from the archive you'll be creating in the next step.)
+
+```
+project (benchmark VERSION 1.5.3 LANGUAGES CXX)
+```
+
+* Create a release through github's interface
+ * Note this will create a lightweight tag.
+ * Update this to an annotated tag:
+ * `git pull --tags`
+ * `git tag -a -f <tag> <tag>`
+ * `git push --force origin`
The `compare.py` can be used to compare the result of benchmarks.
-**NOTE**: the utility relies on the scipy package which can be installed using [these instructions](https://www.scipy.org/install.html).
+### Dependencies
+The utility relies on the [scipy](https://www.scipy.org) package which can be installed using pip:
+```bash
+pip3 install -r requirements.txt
+```
### Displaying aggregates only
int main(int argc, char** argv) {
benchmark::Initialize(&argc, argv);
benchmark::RunSpecifiedBenchmarks();
+ benchmark::Shutdown();
return 0;
}
memset(src, 'x', state.range(0));
for (auto _ : state)
memcpy(dst, src, state.range(0));
- state.SetBytesProcessed(int64_t(state.iterations()) *
- int64_t(state.range(0)));
+ state.SetBytesProcessed(state.iterations() * state.range(0));
delete[] src; delete[] dst;
}
BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(1<<10)->Arg(8<<10);
q.Wait(&v);
}
// actually messages, not bytes:
- state.SetBytesProcessed(
- static_cast<int64_t>(state.iterations())*state.range(0));
+ state.SetBytesProcessed(state.iterations() * state.range(0));
}
BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10);
#define BENCHMARK_HAS_CXX11
#endif
+// This _MSC_VER check should detect VS 2017 v15.3 and newer.
+#if __cplusplus >= 201703L || \
+ (defined(_MSC_VER) && _MSC_VER >= 1911 && _MSVC_LANG >= 201703L)
+#define BENCHMARK_HAS_CXX17
+#endif
+
#include <stdint.h>
#include <algorithm>
#include <map>
#include <set>
#include <string>
+#include <utility>
#include <vector>
#if defined(BENCHMARK_HAS_CXX11)
TypeName& operator=(const TypeName&) = delete
#endif
-#if defined(__GNUC__)
+#ifdef BENCHMARK_HAS_CXX17
+#define BENCHMARK_UNUSED [[maybe_unused]]
+#elif defined(__GNUC__) || defined(__clang__)
#define BENCHMARK_UNUSED __attribute__((unused))
+#else
+#define BENCHMARK_UNUSED
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
#define BENCHMARK_ALWAYS_INLINE __attribute__((always_inline))
#define BENCHMARK_NOEXCEPT noexcept
#define BENCHMARK_NOEXCEPT_OP(x) noexcept(x)
#elif defined(_MSC_VER) && !defined(__clang__)
-#define BENCHMARK_UNUSED
#define BENCHMARK_ALWAYS_INLINE __forceinline
#if _MSC_VER >= 1900
#define BENCHMARK_NOEXCEPT noexcept
#endif
#define __func__ __FUNCTION__
#else
-#define BENCHMARK_UNUSED
#define BENCHMARK_ALWAYS_INLINE
#define BENCHMARK_NOEXCEPT
#define BENCHMARK_NOEXCEPT_OP(x)
#endif
#if defined(__GNUC__) || __has_builtin(__builtin_unreachable)
- #define BENCHMARK_UNREACHABLE() __builtin_unreachable()
+#define BENCHMARK_UNREACHABLE() __builtin_unreachable()
#elif defined(_MSC_VER)
- #define BENCHMARK_UNREACHABLE() __assume(false)
+#define BENCHMARK_UNREACHABLE() __assume(false)
+#else
+#define BENCHMARK_UNREACHABLE() ((void)0)
+#endif
+
+#ifdef BENCHMARK_HAS_CXX11
+#define BENCHMARK_OVERRIDE override
#else
- #define BENCHMARK_UNREACHABLE() ((void)0)
+#define BENCHMARK_OVERRIDE
#endif
namespace benchmark {
class MemoryManager;
void Initialize(int* argc, char** argv);
+void Shutdown();
// Report to stdout all arguments in 'argv' as unrecognized except the first.
// Returns true there is at least on unrecognized argument (i.e. 'argc' > 1).
// allocation measurements for benchmark runs.
void RegisterMemoryManager(MemoryManager* memory_manager);
+// Add a key-value pair to output as part of the context stanza in the report.
+void AddCustomContext(const std::string& key, const std::string& value);
+
namespace internal {
class Benchmark;
class BenchmarkImp;
// It will be presented divided by the number of iterations.
kAvgIterations = 1U << 3U,
// Mark the counter as a iteration-average rate. See above.
- kAvgIterationsRate = kIsRate | kAvgIterations
+ kAvgIterationsRate = kIsRate | kAvgIterations,
+
+ // In the end, invert the result. This is always done last!
+ kInvert = 1U << 31U
};
enum OneK {
// TimeUnit is passed to a benchmark in order to specify the order of magnitude
// for the measured time.
-enum TimeUnit { kNanosecond, kMicrosecond, kMillisecond };
+enum TimeUnit { kNanosecond, kMicrosecond, kMillisecond, kSecond };
// BigO is passed to a benchmark in order to specify the asymptotic
// computational
// calculated automatically to the best fit.
enum BigO { oNone, o1, oN, oNSquared, oNCubed, oLogN, oNLogN, oAuto, oLambda };
+typedef uint64_t IterationCount;
+
// BigOFunc is passed to a benchmark in order to specify the asymptotic
// computational complexity for the benchmark.
-typedef double(BigOFunc)(int64_t);
+typedef double(BigOFunc)(IterationCount);
// StatisticsFunc is passed to a benchmark in order to compute some descriptive
// statistics over all the measurements of some type
typedef double(StatisticsFunc)(const std::vector<double>&);
+namespace internal {
struct Statistics {
std::string name_;
StatisticsFunc* compute_;
: name_(name), compute_(compute) {}
};
-namespace internal {
-struct BenchmarkInstance;
+class BenchmarkInstance;
class ThreadTimer;
class ThreadManager;
+class PerfCountersMeasurement;
enum AggregationReportMode
#if defined(BENCHMARK_HAS_CXX11)
// while (state.KeepRunningBatch(1000)) {
// // process 1000 elements
// }
- bool KeepRunningBatch(size_t n);
+ bool KeepRunningBatch(IterationCount n);
// REQUIRES: timer is running and 'SkipWithError(...)' has not been called
// by the current thread.
// responsibility to exit the scope as needed.
void SkipWithError(const char* msg);
+ // Returns true if an error has been reported with 'SkipWithError(...)'.
+ bool error_occurred() const { return error_occurred_; }
+
// REQUIRES: called exactly once per iteration of the benchmarking loop.
// Set the manually measured time for this benchmark iteration, which
// is used instead of automatically measured time if UseManualTime() was
void SetComplexityN(int64_t complexity_n) { complexity_n_ = complexity_n; }
BENCHMARK_ALWAYS_INLINE
- int64_t complexity_length_n() { return complexity_n_; }
+ int64_t complexity_length_n() const { return complexity_n_; }
// If this routine is called with items > 0, then an items/s
// label is printed on the benchmark report line for the currently
int64_t range_y() const { return range(1); }
BENCHMARK_ALWAYS_INLINE
- size_t iterations() const {
+ IterationCount iterations() const {
if (BENCHMARK_BUILTIN_EXPECT(!started_, false)) {
return 0;
}
: // items we expect on the first cache line (ie 64 bytes of the struct)
// When total_iterations_ is 0, KeepRunning() and friends will return false.
// May be larger than max_iterations.
- size_t total_iterations_;
+ IterationCount total_iterations_;
// When using KeepRunningBatch(), batch_leftover_ holds the number of
// iterations beyond max_iters that were run. Used to track
// completed_iterations_ accurately.
- size_t batch_leftover_;
+ IterationCount batch_leftover_;
public:
- const size_t max_iterations;
+ const IterationCount max_iterations;
private:
bool started_;
const int threads;
private:
- State(size_t max_iters, const std::vector<int64_t>& ranges, int thread_i,
- int n_threads, internal::ThreadTimer* timer,
- internal::ThreadManager* manager);
+ State(IterationCount max_iters, const std::vector<int64_t>& ranges,
+ int thread_i, int n_threads, internal::ThreadTimer* timer,
+ internal::ThreadManager* manager,
+ internal::PerfCountersMeasurement* perf_counters_measurement);
void StartKeepRunning();
// Implementation of KeepRunning() and KeepRunningBatch().
// is_batch must be true unless n is 1.
- bool KeepRunningInternal(size_t n, bool is_batch);
+ bool KeepRunningInternal(IterationCount n, bool is_batch);
void FinishKeepRunning();
- internal::ThreadTimer* timer_;
- internal::ThreadManager* manager_;
+ internal::ThreadTimer* const timer_;
+ internal::ThreadManager* const manager_;
+ internal::PerfCountersMeasurement* const perf_counters_measurement_;
- friend struct internal::BenchmarkInstance;
+ friend class internal::BenchmarkInstance;
};
inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunning() {
return KeepRunningInternal(1, /*is_batch=*/false);
}
-inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunningBatch(size_t n) {
+inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunningBatch(IterationCount n) {
return KeepRunningInternal(n, /*is_batch=*/true);
}
-inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunningInternal(size_t n,
+inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunningInternal(IterationCount n,
bool is_batch) {
// total_iterations_ is set to 0 by the constructor, and always set to a
// nonzero value by StartKepRunning().
}
private:
- size_t cached_;
+ IterationCount cached_;
State* const parent_;
};
// Note: the following methods all return "this" so that multiple
// method calls can be chained together in one expression.
+ // Specify the name of the benchmark
+ Benchmark* Name(const std::string& name);
+
// Run this benchmark once with "x" as the extra argument passed
// to the function.
// REQUIRES: The function passed to the constructor must accept an arg1.
// REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
Benchmark* Ranges(const std::vector<std::pair<int64_t, int64_t> >& ranges);
+ // Run this benchmark once for each combination of values in the (cartesian)
+ // product of the supplied argument lists.
+ // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
+ Benchmark* ArgsProduct(const std::vector<std::vector<int64_t> >& arglists);
+
// Equivalent to ArgNames({name})
Benchmark* ArgName(const std::string& name);
// NOTE: This function should only be used when *exact* iteration control is
// needed and never to control or limit how long a benchmark runs, where
// `--benchmark_min_time=N` or `MinTime(...)` should be used instead.
- Benchmark* Iterations(size_t n);
+ Benchmark* Iterations(IterationCount n);
// Specify the amount of times to repeat this benchmark. This option overrides
// the `benchmark_repetitions` flag.
// Same as ReportAggregatesOnly(), but applies to display reporter only.
Benchmark* DisplayAggregatesOnly(bool value = true);
- // If a particular benchmark is I/O bound, runs multiple threads internally or
- // if for some reason CPU timings are not representative, call this method. If
- // called, the elapsed time will be used to control how many iterations are
- // run, and in the printing of items/second or MB/seconds values. If not
- // called, the cpu time used by the benchmark will be used.
+ // By default, the CPU time is measured only for the main thread, which may
+ // be unrepresentative if the benchmark uses threads internally. If called,
+ // the total CPU time spent by all the threads will be measured instead.
+ // By default, the only the main thread CPU time will be measured.
+ Benchmark* MeasureProcessCPUTime();
+
+ // If a particular benchmark should use the Wall clock instead of the CPU time
+ // (be it either the CPU time of the main thread only (default), or the
+ // total CPU usage of the benchmark), call this method. If called, the elapsed
+ // (wall) time will be used to control how many iterations are run, and in the
+ // printing of items/second or MB/seconds values.
+ // If not called, the CPU time used by the benchmark will be used.
Benchmark* UseRealTime();
// If a benchmark must measure time manually (e.g. if GPU execution time is
private:
friend class BenchmarkFamilies;
+ friend class BenchmarkInstance;
std::string name_;
AggregationReportMode aggregation_report_mode_;
TimeUnit time_unit_;
int range_multiplier_;
double min_time_;
- size_t iterations_;
+ IterationCount iterations_;
int repetitions_;
+ bool measure_process_cpu_time_;
bool use_real_time_;
bool use_manual_time_;
BigO complexity_;
FunctionBenchmark(const char* name, Function* func)
: Benchmark(name), func_(func) {}
- virtual void Run(State& st);
+ virtual void Run(State& st) BENCHMARK_OVERRIDE;
private:
Function* func_;
template <class Lambda>
class LambdaBenchmark : public Benchmark {
public:
- virtual void Run(State& st) { lambda_(st); }
+ virtual void Run(State& st) BENCHMARK_OVERRIDE { lambda_(st); }
private:
template <class OLambda>
public:
Fixture() : internal::Benchmark("") {}
- virtual void Run(State& st) {
+ virtual void Run(State& st) BENCHMARK_OVERRIDE {
this->SetUp(st);
this->BenchmarkCase(st);
this->TearDown(st);
// Helpers for generating unique variable names
#define BENCHMARK_PRIVATE_NAME(n) \
- BENCHMARK_PRIVATE_CONCAT(_benchmark_, BENCHMARK_PRIVATE_UNIQUE_ID, n)
+ BENCHMARK_PRIVATE_CONCAT(benchmark_uniq_, BENCHMARK_PRIVATE_UNIQUE_ID, n)
#define BENCHMARK_PRIVATE_CONCAT(a, b, c) BENCHMARK_PRIVATE_CONCAT2(a, b, c)
#define BENCHMARK_PRIVATE_CONCAT2(a, b, c) a##b##c
+// Helper for concatenation with macro name expansion
+#define BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method) \
+ BaseClass##_##Method##_Benchmark
#define BENCHMARK_PRIVATE_DECLARE(n) \
static ::benchmark::internal::Benchmark* BENCHMARK_PRIVATE_NAME(n) \
#define BENCHMARK_TEMPLATE(n, a) BENCHMARK_TEMPLATE1(n, a)
#endif
-#define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
- class BaseClass##_##Method##_Benchmark : public BaseClass { \
- public: \
- BaseClass##_##Method##_Benchmark() : BaseClass() { \
- this->SetName(#BaseClass "/" #Method); \
- } \
- \
- protected: \
- virtual void BenchmarkCase(::benchmark::State&); \
+#define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
+ class BaseClass##_##Method##_Benchmark : public BaseClass { \
+ public: \
+ BaseClass##_##Method##_Benchmark() : BaseClass() { \
+ this->SetName(#BaseClass "/" #Method); \
+ } \
+ \
+ protected: \
+ virtual void BenchmarkCase(::benchmark::State&) BENCHMARK_OVERRIDE; \
};
-#define BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \
- class BaseClass##_##Method##_Benchmark : public BaseClass<a> { \
- public: \
- BaseClass##_##Method##_Benchmark() : BaseClass<a>() { \
- this->SetName(#BaseClass "<" #a ">/" #Method); \
- } \
- \
- protected: \
- virtual void BenchmarkCase(::benchmark::State&); \
+#define BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \
+ class BaseClass##_##Method##_Benchmark : public BaseClass<a> { \
+ public: \
+ BaseClass##_##Method##_Benchmark() : BaseClass<a>() { \
+ this->SetName(#BaseClass "<" #a ">/" #Method); \
+ } \
+ \
+ protected: \
+ virtual void BenchmarkCase(::benchmark::State&) BENCHMARK_OVERRIDE; \
};
-#define BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \
- class BaseClass##_##Method##_Benchmark : public BaseClass<a, b> { \
- public: \
- BaseClass##_##Method##_Benchmark() : BaseClass<a, b>() { \
- this->SetName(#BaseClass "<" #a "," #b ">/" #Method); \
- } \
- \
- protected: \
- virtual void BenchmarkCase(::benchmark::State&); \
+#define BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \
+ class BaseClass##_##Method##_Benchmark : public BaseClass<a, b> { \
+ public: \
+ BaseClass##_##Method##_Benchmark() : BaseClass<a, b>() { \
+ this->SetName(#BaseClass "<" #a "," #b ">/" #Method); \
+ } \
+ \
+ protected: \
+ virtual void BenchmarkCase(::benchmark::State&) BENCHMARK_OVERRIDE; \
};
#ifdef BENCHMARK_HAS_CXX11
} \
\
protected: \
- virtual void BenchmarkCase(::benchmark::State&); \
+ virtual void BenchmarkCase(::benchmark::State&) BENCHMARK_OVERRIDE; \
};
#else
#define BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(n, a) \
#define BENCHMARK_DEFINE_F(BaseClass, Method) \
BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
- void BaseClass##_##Method##_Benchmark::BenchmarkCase
+ void BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method)::BenchmarkCase
#define BENCHMARK_TEMPLATE1_DEFINE_F(BaseClass, Method, a) \
BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \
- void BaseClass##_##Method##_Benchmark::BenchmarkCase
+ void BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method)::BenchmarkCase
#define BENCHMARK_TEMPLATE2_DEFINE_F(BaseClass, Method, a, b) \
BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \
- void BaseClass##_##Method##_Benchmark::BenchmarkCase
+ void BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method)::BenchmarkCase
#ifdef BENCHMARK_HAS_CXX11
#define BENCHMARK_TEMPLATE_DEFINE_F(BaseClass, Method, ...) \
BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(BaseClass, Method, __VA_ARGS__) \
- void BaseClass##_##Method##_Benchmark::BenchmarkCase
+ void BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method)::BenchmarkCase
#else
#define BENCHMARK_TEMPLATE_DEFINE_F(BaseClass, Method, a) \
BENCHMARK_TEMPLATE1_DEFINE_F(BaseClass, Method, a)
#endif
#define BENCHMARK_REGISTER_F(BaseClass, Method) \
- BENCHMARK_PRIVATE_REGISTER_F(BaseClass##_##Method##_Benchmark)
+ BENCHMARK_PRIVATE_REGISTER_F(BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method))
#define BENCHMARK_PRIVATE_REGISTER_F(TestName) \
BENCHMARK_PRIVATE_DECLARE(TestName) = \
#define BENCHMARK_F(BaseClass, Method) \
BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
BENCHMARK_REGISTER_F(BaseClass, Method); \
- void BaseClass##_##Method##_Benchmark::BenchmarkCase
+ void BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method)::BenchmarkCase
#define BENCHMARK_TEMPLATE1_F(BaseClass, Method, a) \
BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \
BENCHMARK_REGISTER_F(BaseClass, Method); \
- void BaseClass##_##Method##_Benchmark::BenchmarkCase
+ void BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method)::BenchmarkCase
#define BENCHMARK_TEMPLATE2_F(BaseClass, Method, a, b) \
BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \
BENCHMARK_REGISTER_F(BaseClass, Method); \
- void BaseClass##_##Method##_Benchmark::BenchmarkCase
+ void BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method)::BenchmarkCase
#ifdef BENCHMARK_HAS_CXX11
#define BENCHMARK_TEMPLATE_F(BaseClass, Method, ...) \
BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(BaseClass, Method, __VA_ARGS__) \
BENCHMARK_REGISTER_F(BaseClass, Method); \
- void BaseClass##_##Method##_Benchmark::BenchmarkCase
+ void BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method)::BenchmarkCase
#else
#define BENCHMARK_TEMPLATE_F(BaseClass, Method, a) \
BENCHMARK_TEMPLATE1_F(BaseClass, Method, a)
::benchmark::Initialize(&argc, argv); \
if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; \
::benchmark::RunSpecifiedBenchmarks(); \
+ ::benchmark::Shutdown(); \
+ return 0; \
} \
int main(int, char**)
int num_sharing;
};
+ enum Scaling {
+ UNKNOWN,
+ ENABLED,
+ DISABLED
+ };
+
int num_cpus;
+ Scaling scaling;
double cycles_per_second;
std::vector<CacheInfo> caches;
- bool scaling_enabled;
std::vector<double> load_avg;
static const CPUInfo& Get();
BENCHMARK_DISALLOW_COPY_AND_ASSIGN(CPUInfo);
};
-//Adding Struct for System Information
+// Adding Struct for System Information
struct SystemInfo {
std::string name;
static const SystemInfo& Get();
+
private:
SystemInfo();
BENCHMARK_DISALLOW_COPY_AND_ASSIGN(SystemInfo);
};
+// BenchmarkName contains the components of the Benchmark's name
+// which allows individual fields to be modified or cleared before
+// building the final name using 'str()'.
+struct BenchmarkName {
+ std::string function_name;
+ std::string args;
+ std::string min_time;
+ std::string iterations;
+ std::string repetitions;
+ std::string time_type;
+ std::string threads;
+
+ // Return the full name of the benchmark with each non-empty
+ // field separated by a '/'
+ std::string str() const;
+};
+
// Interface for custom benchmark result printers.
// By default, benchmark reports are printed to stdout. However an application
// can control the destination of the reports by calling
};
struct Run {
+ static const int64_t no_repetition_index = -1;
enum RunType { RT_Iteration, RT_Aggregate };
Run()
: run_type(RT_Iteration),
error_occurred(false),
iterations(1),
+ threads(1),
time_unit(kNanosecond),
real_accumulated_time(0),
cpu_accumulated_time(0),
max_bytes_used(0) {}
std::string benchmark_name() const;
- std::string run_name;
- RunType run_type; // is this a measurement, or an aggregate?
+ BenchmarkName run_name;
+ int64_t family_index;
+ int64_t per_family_instance_index;
+ RunType run_type;
std::string aggregate_name;
std::string report_label; // Empty if not set by benchmark.
bool error_occurred;
std::string error_message;
- int64_t iterations;
+ IterationCount iterations;
+ int64_t threads;
+ int64_t repetition_index;
+ int64_t repetitions;
TimeUnit time_unit;
double real_accumulated_time;
double cpu_accumulated_time;
int64_t complexity_n;
// what statistics to compute from the measurements
- const std::vector<Statistics>* statistics;
+ const std::vector<internal::Statistics>* statistics;
// Inform print function whether the current run is a complexity report
bool report_big_o;
int64_t max_bytes_used;
};
+ struct PerFamilyRunReports {
+ PerFamilyRunReports() : num_runs_total(0), num_runs_done(0) {}
+
+ // How many runs will all instances of this benchmark perform?
+ int num_runs_total;
+
+ // How many runs have happened already?
+ int num_runs_done;
+
+ // The reports about (non-errneous!) runs of this family.
+ std::vector<BenchmarkReporter::Run> Runs;
+ };
+
// Construct a BenchmarkReporter with the output stream set to 'std::cout'
// and the error stream set to 'std::cerr'
BenchmarkReporter();
prev_counters_(),
printed_header_(false) {}
- virtual bool ReportContext(const Context& context);
- virtual void ReportRuns(const std::vector<Run>& reports);
+ virtual bool ReportContext(const Context& context) BENCHMARK_OVERRIDE;
+ virtual void ReportRuns(const std::vector<Run>& reports) BENCHMARK_OVERRIDE;
protected:
virtual void PrintRunData(const Run& report);
class JSONReporter : public BenchmarkReporter {
public:
JSONReporter() : first_report_(true) {}
- virtual bool ReportContext(const Context& context);
- virtual void ReportRuns(const std::vector<Run>& reports);
- virtual void Finalize();
+ virtual bool ReportContext(const Context& context) BENCHMARK_OVERRIDE;
+ virtual void ReportRuns(const std::vector<Run>& reports) BENCHMARK_OVERRIDE;
+ virtual void Finalize() BENCHMARK_OVERRIDE;
private:
void PrintRunData(const Run& report);
bool first_report_;
};
-class BENCHMARK_DEPRECATED_MSG("The CSV Reporter will be removed in a future release")
- CSVReporter : public BenchmarkReporter {
+class BENCHMARK_DEPRECATED_MSG(
+ "The CSV Reporter will be removed in a future release") CSVReporter
+ : public BenchmarkReporter {
public:
CSVReporter() : printed_header_(false) {}
- virtual bool ReportContext(const Context& context);
- virtual void ReportRuns(const std::vector<Run>& reports);
+ virtual bool ReportContext(const Context& context) BENCHMARK_OVERRIDE;
+ virtual void ReportRuns(const std::vector<Run>& reports) BENCHMARK_OVERRIDE;
private:
void PrintRunData(const Run& report);
inline const char* GetTimeUnitString(TimeUnit unit) {
switch (unit) {
+ case kSecond:
+ return "s";
case kMillisecond:
return "ms";
case kMicrosecond:
inline double GetTimeUnitMultiplier(TimeUnit unit) {
switch (unit) {
+ case kSecond:
+ return 1;
case kMillisecond:
return 1e3;
case kMicrosecond:
--- /dev/null
+numpy == 1.19.4
+scipy == 1.5.4
--- /dev/null
+import os
+import posixpath
+import re
+import shutil
+import sys
+
+from distutils import sysconfig
+import setuptools
+from setuptools.command import build_ext
+
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+
+
+IS_WINDOWS = sys.platform.startswith("win")
+
+
+def _get_version():
+ """Parse the version string from __init__.py."""
+ with open(
+ os.path.join(HERE, "bindings", "python", "google_benchmark", "__init__.py")
+ ) as init_file:
+ try:
+ version_line = next(
+ line for line in init_file if line.startswith("__version__")
+ )
+ except StopIteration:
+ raise ValueError("__version__ not defined in __init__.py")
+ else:
+ namespace = {}
+ exec(version_line, namespace) # pylint: disable=exec-used
+ return namespace["__version__"]
+
+
+def _parse_requirements(path):
+ with open(os.path.join(HERE, path)) as requirements:
+ return [
+ line.rstrip()
+ for line in requirements
+ if not (line.isspace() or line.startswith("#"))
+ ]
+
+
+class BazelExtension(setuptools.Extension):
+ """A C/C++ extension that is defined as a Bazel BUILD target."""
+
+ def __init__(self, name, bazel_target):
+ self.bazel_target = bazel_target
+ self.relpath, self.target_name = posixpath.relpath(bazel_target, "//").split(
+ ":"
+ )
+ setuptools.Extension.__init__(self, name, sources=[])
+
+
+class BuildBazelExtension(build_ext.build_ext):
+ """A command that runs Bazel to build a C/C++ extension."""
+
+ def run(self):
+ for ext in self.extensions:
+ self.bazel_build(ext)
+ build_ext.build_ext.run(self)
+
+ def bazel_build(self, ext):
+ """Runs the bazel build to create the package."""
+ with open("WORKSPACE", "r") as workspace:
+ workspace_contents = workspace.read()
+
+ with open("WORKSPACE", "w") as workspace:
+ workspace.write(
+ re.sub(
+ r'(?<=path = ").*(?=", # May be overwritten by setup\.py\.)',
+ sysconfig.get_python_inc().replace(os.path.sep, posixpath.sep),
+ workspace_contents,
+ )
+ )
+
+ if not os.path.exists(self.build_temp):
+ os.makedirs(self.build_temp)
+
+ bazel_argv = [
+ "bazel",
+ "build",
+ ext.bazel_target,
+ "--symlink_prefix=" + os.path.join(self.build_temp, "bazel-"),
+ "--compilation_mode=" + ("dbg" if self.debug else "opt"),
+ ]
+
+ if IS_WINDOWS:
+ # Link with python*.lib.
+ for library_dir in self.library_dirs:
+ bazel_argv.append("--linkopt=/LIBPATH:" + library_dir)
+
+ self.spawn(bazel_argv)
+
+ shared_lib_suffix = '.dll' if IS_WINDOWS else '.so'
+ ext_bazel_bin_path = os.path.join(
+ self.build_temp, 'bazel-bin',
+ ext.relpath, ext.target_name + shared_lib_suffix)
+
+ ext_dest_path = self.get_ext_fullpath(ext.name)
+ ext_dest_dir = os.path.dirname(ext_dest_path)
+ if not os.path.exists(ext_dest_dir):
+ os.makedirs(ext_dest_dir)
+ shutil.copyfile(ext_bazel_bin_path, ext_dest_path)
+
+
+setuptools.setup(
+ name="google_benchmark",
+ version=_get_version(),
+ url="https://github.com/google/benchmark",
+ description="A library to benchmark code snippets.",
+ author="Google",
+ author_email="benchmark-py@google.com",
+ # Contained modules and scripts.
+ package_dir={"": "bindings/python"},
+ packages=setuptools.find_packages("bindings/python"),
+ install_requires=_parse_requirements("bindings/python/requirements.txt"),
+ cmdclass=dict(build_ext=BuildBazelExtension),
+ ext_modules=[
+ BazelExtension(
+ "google_benchmark._benchmark",
+ "//bindings/python/google_benchmark:_benchmark",
+ )
+ ],
+ zip_safe=False,
+ # PyPI package information.
+ classifiers=[
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "Intended Audience :: Science/Research",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Topic :: Software Development :: Testing",
+ "Topic :: System :: Benchmark",
+ ],
+ license="Apache 2.0",
+ keywords="benchmark",
+)
# Allow the source files to find headers in src/
+include(GNUInstallDirs)
include_directories(${PROJECT_SOURCE_DIR}/src)
if (DEFINED BENCHMARK_CXX_LINKER_FLAGS)
endforeach()
add_library(benchmark ${SOURCE_FILES})
+add_library(benchmark::benchmark ALIAS benchmark)
set_target_properties(benchmark PROPERTIES
OUTPUT_NAME "benchmark"
VERSION ${GENERIC_LIB_VERSION}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)
+# libpfm, if available
+if (HAVE_LIBPFM)
+ target_link_libraries(benchmark libpfm.a)
+ add_definitions(-DHAVE_LIBPFM)
+endif()
+
# Link threads.
target_link_libraries(benchmark ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
find_library(LIBRT rt)
target_link_libraries(benchmark ${LIBRT})
endif()
+if(CMAKE_BUILD_TYPE)
+ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
+endif()
+if(NOT CMAKE_THREAD_LIBS_INIT AND "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}" MATCHES ".*-fsanitize=[^ ]*address.*")
+ message(WARNING "CMake's FindThreads.cmake did not fail, but CMAKE_THREAD_LIBS_INIT ended up being empty. This was fixed in https://github.com/Kitware/CMake/commit/d53317130e84898c5328c237186dbd995aaf1c12 Let's guess that -pthread is sufficient.")
+ target_link_libraries(benchmark -pthread)
+endif()
+
# We need extra libraries on Windows
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
target_link_libraries(benchmark shlwapi)
# Benchmark main library
add_library(benchmark_main "benchmark_main.cc")
+add_library(benchmark::benchmark_main ALIAS benchmark_main)
set_target_properties(benchmark_main PROPERTIES
OUTPUT_NAME "benchmark_main"
VERSION ${GENERIC_LIB_VERSION}
target_include_directories(benchmark PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)
-target_link_libraries(benchmark_main benchmark)
+target_link_libraries(benchmark_main benchmark::benchmark)
-set(include_install_dir "include")
-set(lib_install_dir "lib/")
-set(bin_install_dir "bin/")
-set(config_install_dir "lib/cmake/${PROJECT_NAME}")
-set(pkgconfig_install_dir "lib/pkgconfig")
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
install(
TARGETS benchmark benchmark_main
EXPORT ${targets_export_name}
- ARCHIVE DESTINATION ${lib_install_dir}
- LIBRARY DESTINATION ${lib_install_dir}
- RUNTIME DESTINATION ${bin_install_dir}
- INCLUDES DESTINATION ${include_install_dir})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(
DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark"
- DESTINATION ${include_install_dir}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.*h")
install(
FILES "${project_config}" "${version_config}"
- DESTINATION "${config_install_dir}")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
install(
FILES "${pkg_config}"
- DESTINATION "${pkgconfig_install_dir}")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(
EXPORT "${targets_export_name}"
NAMESPACE "${namespace}"
- DESTINATION "${config_install_dir}")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
endif()
// limitations under the License.
#include "benchmark/benchmark.h"
+
#include "benchmark_api_internal.h"
#include "benchmark_runner.h"
#include "internal_macros.h"
#include <cstdlib>
#include <fstream>
#include <iostream>
+#include <limits>
+#include <map>
#include <memory>
+#include <random>
#include <string>
#include <thread>
#include <utility>
#include "internal_macros.h"
#include "log.h"
#include "mutex.h"
+#include "perf_counters.h"
#include "re.h"
#include "statistics.h"
#include "string_util.h"
#include "thread_manager.h"
#include "thread_timer.h"
-DEFINE_bool(benchmark_list_tests, false,
- "Print a list of benchmarks. This option overrides all other "
- "options.");
-
-DEFINE_string(benchmark_filter, ".",
- "A regular expression that specifies the set of benchmarks "
- "to execute. If this flag is empty, or if this flag is the "
- "string \"all\", all benchmarks linked into the binary are "
- "run.");
-
-DEFINE_double(benchmark_min_time, 0.5,
- "Minimum number of seconds we should run benchmark before "
- "results are considered significant. For cpu-time based "
- "tests, this is the lower bound on the total cpu time "
- "used by all threads that make up the test. For real-time "
- "based tests, this is the lower bound on the elapsed time "
- "of the benchmark execution, regardless of number of "
- "threads.");
-
-DEFINE_int32(benchmark_repetitions, 1,
- "The number of runs of each benchmark. If greater than 1, the "
- "mean and standard deviation of the runs will be reported.");
-
-DEFINE_bool(
- benchmark_report_aggregates_only, false,
- "Report the result of each benchmark repetitions. When 'true' is specified "
- "only the mean, standard deviation, and other statistics are reported for "
- "repeated benchmarks. Affects all reporters.");
-
-DEFINE_bool(
- benchmark_display_aggregates_only, false,
- "Display the result of each benchmark repetitions. When 'true' is "
- "specified only the mean, standard deviation, and other statistics are "
- "displayed for repeated benchmarks. Unlike "
- "benchmark_report_aggregates_only, only affects the display reporter, but "
- "*NOT* file reporter, which will still contain all the output.");
-
-DEFINE_string(benchmark_format, "console",
- "The format to use for console output. Valid values are "
- "'console', 'json', or 'csv'.");
-
-DEFINE_string(benchmark_out_format, "json",
- "The format to use for file output. Valid values are "
- "'console', 'json', or 'csv'.");
-
-DEFINE_string(benchmark_out, "", "The file to write additional output to");
-
-DEFINE_string(benchmark_color, "auto",
- "Whether to use colors in the output. Valid values: "
- "'true'/'yes'/1, 'false'/'no'/0, and 'auto'. 'auto' means to use "
- "colors if the output is being sent to a terminal and the TERM "
- "environment variable is set to a terminal type that supports "
- "colors.");
-
-DEFINE_bool(benchmark_counters_tabular, false,
- "Whether to use tabular format when printing user counters to "
- "the console. Valid values: 'true'/'yes'/1, 'false'/'no'/0."
- "Defaults to false.");
-
-DEFINE_int32(v, 0, "The level of verbose logging to output");
+// Print a list of benchmarks. This option overrides all other options.
+DEFINE_bool(benchmark_list_tests, false);
+
+// A regular expression that specifies the set of benchmarks to execute. If
+// this flag is empty, or if this flag is the string \"all\", all benchmarks
+// linked into the binary are run.
+DEFINE_string(benchmark_filter, ".");
+
+// Minimum number of seconds we should run benchmark before results are
+// considered significant. For cpu-time based tests, this is the lower bound
+// on the total cpu time used by all threads that make up the test. For
+// real-time based tests, this is the lower bound on the elapsed time of the
+// benchmark execution, regardless of number of threads.
+DEFINE_double(benchmark_min_time, 0.5);
+
+// The number of runs of each benchmark. If greater than 1, the mean and
+// standard deviation of the runs will be reported.
+DEFINE_int32(benchmark_repetitions, 1);
+
+// If set, enable random interleaving of repetitions of all benchmarks.
+// See http://github.com/google/benchmark/issues/1051 for details.
+DEFINE_bool(benchmark_enable_random_interleaving, false);
+
+// Report the result of each benchmark repetitions. When 'true' is specified
+// only the mean, standard deviation, and other statistics are reported for
+// repeated benchmarks. Affects all reporters.
+DEFINE_bool(benchmark_report_aggregates_only, false);
+
+// Display the result of each benchmark repetitions. When 'true' is specified
+// only the mean, standard deviation, and other statistics are displayed for
+// repeated benchmarks. Unlike benchmark_report_aggregates_only, only affects
+// the display reporter, but *NOT* file reporter, which will still contain
+// all the output.
+DEFINE_bool(benchmark_display_aggregates_only, false);
+
+// The format to use for console output.
+// Valid values are 'console', 'json', or 'csv'.
+DEFINE_string(benchmark_format, "console");
+
+// The format to use for file output.
+// Valid values are 'console', 'json', or 'csv'.
+DEFINE_string(benchmark_out_format, "json");
+
+// The file to write additional output to.
+DEFINE_string(benchmark_out, "");
+
+// Whether to use colors in the output. Valid values:
+// 'true'/'yes'/1, 'false'/'no'/0, and 'auto'. 'auto' means to use colors if
+// the output is being sent to a terminal and the TERM environment variable is
+// set to a terminal type that supports colors.
+DEFINE_string(benchmark_color, "auto");
+
+// Whether to use tabular format when printing user counters to the console.
+// Valid values: 'true'/'yes'/1, 'false'/'no'/0. Defaults to false.
+DEFINE_bool(benchmark_counters_tabular, false);
+
+// The level of verbose logging to output
+DEFINE_int32(v, 0);
+
+// List of additional perf counters to collect, in libpfm format. For more
+// information about libpfm: https://man7.org/linux/man-pages/man3/libpfm.3.html
+DEFINE_string(benchmark_perf_counters, "");
namespace benchmark {
-
namespace internal {
+// Extra context to include in the output formatted as comma-separated key-value
+// pairs. Kept internal as it's only used for parsing from env/command line.
+DEFINE_kvpairs(benchmark_context, {});
+
+std::map<std::string, std::string>* global_context = nullptr;
+
// FIXME: wouldn't LTO mess this up?
void UseCharPointer(char const volatile*) {}
} // namespace internal
-State::State(size_t max_iters, const std::vector<int64_t>& ranges, int thread_i,
- int n_threads, internal::ThreadTimer* timer,
- internal::ThreadManager* manager)
+State::State(IterationCount max_iters, const std::vector<int64_t>& ranges,
+ int thread_i, int n_threads, internal::ThreadTimer* timer,
+ internal::ThreadManager* manager,
+ internal::PerfCountersMeasurement* perf_counters_measurement)
: total_iterations_(0),
batch_leftover_(0),
max_iterations(max_iters),
thread_index(thread_i),
threads(n_threads),
timer_(timer),
- manager_(manager) {
+ manager_(manager),
+ perf_counters_measurement_(perf_counters_measurement) {
CHECK(max_iterations != 0) << "At least one iteration must be run";
CHECK_LT(thread_index, threads) << "thread_index must be less than threads";
// which must be suppressed.
#if defined(__INTEL_COMPILER)
#pragma warning push
-#pragma warning(disable:1875)
+#pragma warning(disable : 1875)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
// Add in time accumulated so far
CHECK(started_ && !finished_ && !error_occurred_);
timer_->StopTimer();
+ if (perf_counters_measurement_) {
+ auto measurements = perf_counters_measurement_->StopAndGetMeasurements();
+ for (const auto& name_and_measurement : measurements) {
+ auto name = name_and_measurement.first;
+ auto measurement = name_and_measurement.second;
+ CHECK_EQ(counters[name], 0.0);
+ counters[name] = Counter(measurement, Counter::kAvgIterations);
+ }
+ }
}
void State::ResumeTiming() {
CHECK(started_ && !finished_ && !error_occurred_);
timer_->StartTimer();
+ if (perf_counters_measurement_) {
+ perf_counters_measurement_->Start();
+ }
}
void State::SkipWithError(const char* msg) {
namespace internal {
namespace {
+// Flushes streams after invoking reporter methods that write to them. This
+// ensures users get timely updates even when streams are not line-buffered.
+void FlushStreams(BenchmarkReporter* reporter) {
+ if (!reporter) return;
+ std::flush(reporter->GetOutputStream());
+ std::flush(reporter->GetErrorStream());
+}
+
+// Reports in both display and file reporters.
+void Report(BenchmarkReporter* display_reporter,
+ BenchmarkReporter* file_reporter, const RunResults& run_results) {
+ auto report_one = [](BenchmarkReporter* reporter, bool aggregates_only,
+ const RunResults& results) {
+ assert(reporter);
+ // If there are no aggregates, do output non-aggregates.
+ aggregates_only &= !results.aggregates_only.empty();
+ if (!aggregates_only) reporter->ReportRuns(results.non_aggregates);
+ if (!results.aggregates_only.empty())
+ reporter->ReportRuns(results.aggregates_only);
+ };
+
+ report_one(display_reporter, run_results.display_report_aggregates_only,
+ run_results);
+ if (file_reporter)
+ report_one(file_reporter, run_results.file_report_aggregates_only,
+ run_results);
+
+ FlushStreams(display_reporter);
+ FlushStreams(file_reporter);
+}
+
void RunBenchmarks(const std::vector<BenchmarkInstance>& benchmarks,
BenchmarkReporter* display_reporter,
BenchmarkReporter* file_reporter) {
size_t stat_field_width = 0;
for (const BenchmarkInstance& benchmark : benchmarks) {
name_field_width =
- std::max<size_t>(name_field_width, benchmark.name.size());
- might_have_aggregates |= benchmark.repetitions > 1;
+ std::max<size_t>(name_field_width, benchmark.name().str().size());
+ might_have_aggregates |= benchmark.repetitions() > 1;
- for (const auto& Stat : *benchmark.statistics)
+ for (const auto& Stat : benchmark.statistics())
stat_field_width = std::max<size_t>(stat_field_width, Stat.name_.size());
}
if (might_have_aggregates) name_field_width += 1 + stat_field_width;
BenchmarkReporter::Context context;
context.name_field_width = name_field_width;
- // Keep track of running times of all instances of current benchmark
- std::vector<BenchmarkReporter::Run> complexity_reports;
-
- // We flush streams after invoking reporter methods that write to them. This
- // ensures users get timely updates even when streams are not line-buffered.
- auto flushStreams = [](BenchmarkReporter* reporter) {
- if (!reporter) return;
- std::flush(reporter->GetOutputStream());
- std::flush(reporter->GetErrorStream());
- };
+ // Keep track of running times of all instances of each benchmark family.
+ std::map<int /*family_index*/, BenchmarkReporter::PerFamilyRunReports>
+ per_family_reports;
if (display_reporter->ReportContext(context) &&
(!file_reporter || file_reporter->ReportContext(context))) {
- flushStreams(display_reporter);
- flushStreams(file_reporter);
-
- for (const auto& benchmark : benchmarks) {
- RunResults run_results = RunBenchmark(benchmark, &complexity_reports);
-
- auto report = [&run_results](BenchmarkReporter* reporter,
- bool report_aggregates_only) {
- assert(reporter);
- // If there are no aggregates, do output non-aggregates.
- report_aggregates_only &= !run_results.aggregates_only.empty();
- if (!report_aggregates_only)
- reporter->ReportRuns(run_results.non_aggregates);
- if (!run_results.aggregates_only.empty())
- reporter->ReportRuns(run_results.aggregates_only);
- };
-
- report(display_reporter, run_results.display_report_aggregates_only);
- if (file_reporter)
- report(file_reporter, run_results.file_report_aggregates_only);
-
- flushStreams(display_reporter);
- flushStreams(file_reporter);
+ FlushStreams(display_reporter);
+ FlushStreams(file_reporter);
+
+ size_t num_repetitions_total = 0;
+
+ std::vector<internal::BenchmarkRunner> runners;
+ runners.reserve(benchmarks.size());
+ for (const BenchmarkInstance& benchmark : benchmarks) {
+ BenchmarkReporter::PerFamilyRunReports* reports_for_family = nullptr;
+ if (benchmark.complexity() != oNone)
+ reports_for_family = &per_family_reports[benchmark.family_index()];
+
+ runners.emplace_back(benchmark, reports_for_family);
+ int num_repeats_of_this_instance = runners.back().GetNumRepeats();
+ num_repetitions_total += num_repeats_of_this_instance;
+ if (reports_for_family)
+ reports_for_family->num_runs_total += num_repeats_of_this_instance;
+ }
+ assert(runners.size() == benchmarks.size() && "Unexpected runner count.");
+
+ std::vector<int> repetition_indices;
+ repetition_indices.reserve(num_repetitions_total);
+ for (size_t runner_index = 0, num_runners = runners.size();
+ runner_index != num_runners; ++runner_index) {
+ const internal::BenchmarkRunner& runner = runners[runner_index];
+ std::fill_n(std::back_inserter(repetition_indices),
+ runner.GetNumRepeats(), runner_index);
+ }
+ assert(repetition_indices.size() == num_repetitions_total &&
+ "Unexpected number of repetition indexes.");
+
+ if (FLAGS_benchmark_enable_random_interleaving) {
+ std::random_device rd;
+ std::mt19937 g(rd());
+ std::shuffle(repetition_indices.begin(), repetition_indices.end(), g);
+ }
+
+ for (size_t repetition_index : repetition_indices) {
+ internal::BenchmarkRunner& runner = runners[repetition_index];
+ runner.DoOneRepetition();
+ if (runner.HasRepeatsRemaining()) continue;
+ // FIXME: report each repetition separately, not all of them in bulk.
+
+ RunResults run_results = runner.GetResults();
+
+ // Maybe calculate complexity report
+ if (const auto* reports_for_family = runner.GetReportsForFamily()) {
+ if (reports_for_family->num_runs_done ==
+ reports_for_family->num_runs_total) {
+ auto additional_run_stats = ComputeBigO(reports_for_family->Runs);
+ run_results.aggregates_only.insert(run_results.aggregates_only.end(),
+ additional_run_stats.begin(),
+ additional_run_stats.end());
+ per_family_reports.erase(
+ (int)reports_for_family->Runs.front().family_index);
+ }
+ }
+
+ Report(display_reporter, file_reporter, run_results);
}
}
display_reporter->Finalize();
if (file_reporter) file_reporter->Finalize();
- flushStreams(display_reporter);
- flushStreams(file_reporter);
+ FlushStreams(display_reporter);
+ FlushStreams(file_reporter);
}
+// Disable deprecated warnings temporarily because we need to reference
+// CSVReporter but don't want to trigger -Werror=-Wdeprecated-declarations
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
std::unique_ptr<BenchmarkReporter> CreateReporter(
std::string const& name, ConsoleReporter::OutputOptions output_opts) {
typedef std::unique_ptr<BenchmarkReporter> PtrType;
}
}
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
} // end namespace
bool IsZero(double n) {
ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color) {
int output_opts = ConsoleReporter::OO_Defaults;
- auto is_benchmark_color = [force_no_color] () -> bool {
+ auto is_benchmark_color = [force_no_color]() -> bool {
if (force_no_color) {
return false;
}
if (!fname.empty()) {
output_file.open(fname);
if (!output_file.is_open()) {
- Err << "invalid file name: '" << fname << std::endl;
+ Err << "invalid file name: '" << fname << "'" << std::endl;
std::exit(1);
}
if (!file_reporter) {
}
if (FLAGS_benchmark_list_tests) {
- for (auto const& benchmark : benchmarks) Out << benchmark.name << "\n";
+ for (auto const& benchmark : benchmarks)
+ Out << benchmark.name().str() << "\n";
} else {
internal::RunBenchmarks(benchmarks, display_reporter, file_reporter);
}
internal::memory_manager = manager;
}
+void AddCustomContext(const std::string& key, const std::string& value) {
+ if (internal::global_context == nullptr) {
+ internal::global_context = new std::map<std::string, std::string>();
+ }
+ if (!internal::global_context->emplace(key, value).second) {
+ std::cerr << "Failed to add custom context \"" << key << "\" as it already "
+ << "exists with value \"" << value << "\"\n";
+ }
+}
+
namespace internal {
void PrintUsageAndExit() {
" [--benchmark_filter=<regex>]\n"
" [--benchmark_min_time=<min_time>]\n"
" [--benchmark_repetitions=<num_repetitions>]\n"
+ " [--benchmark_enable_random_interleaving={true|false}]\n"
" [--benchmark_report_aggregates_only={true|false}]\n"
" [--benchmark_display_aggregates_only={true|false}]\n"
" [--benchmark_format=<console|json|csv>]\n"
" [--benchmark_out_format=<json|console|csv>]\n"
" [--benchmark_color={auto|true|false}]\n"
" [--benchmark_counters_tabular={true|false}]\n"
+ " [--benchmark_context=<key>=<value>,...]\n"
" [--v=<verbosity>]\n");
exit(0);
}
using namespace benchmark;
BenchmarkReporter::Context::executable_name =
(argc && *argc > 0) ? argv[0] : "unknown";
- for (int i = 1; i < *argc; ++i) {
+ for (int i = 1; argc && i < *argc; ++i) {
if (ParseBoolFlag(argv[i], "benchmark_list_tests",
&FLAGS_benchmark_list_tests) ||
ParseStringFlag(argv[i], "benchmark_filter", &FLAGS_benchmark_filter) ||
&FLAGS_benchmark_min_time) ||
ParseInt32Flag(argv[i], "benchmark_repetitions",
&FLAGS_benchmark_repetitions) ||
+ ParseBoolFlag(argv[i], "benchmark_enable_random_interleaving",
+ &FLAGS_benchmark_enable_random_interleaving) ||
ParseBoolFlag(argv[i], "benchmark_report_aggregates_only",
&FLAGS_benchmark_report_aggregates_only) ||
ParseBoolFlag(argv[i], "benchmark_display_aggregates_only",
ParseStringFlag(argv[i], "color_print", &FLAGS_benchmark_color) ||
ParseBoolFlag(argv[i], "benchmark_counters_tabular",
&FLAGS_benchmark_counters_tabular) ||
+ ParseStringFlag(argv[i], "benchmark_perf_counters",
+ &FLAGS_benchmark_perf_counters) ||
+ ParseKeyValueFlag(argv[i], "benchmark_context",
+ &FLAGS_benchmark_context) ||
ParseInt32Flag(argv[i], "v", &FLAGS_v)) {
for (int j = i; j != *argc - 1; ++j) argv[j] = argv[j + 1];
}
}
for (auto const* flag :
- {&FLAGS_benchmark_format, &FLAGS_benchmark_out_format})
+ {&FLAGS_benchmark_format, &FLAGS_benchmark_out_format}) {
if (*flag != "console" && *flag != "json" && *flag != "csv") {
PrintUsageAndExit();
}
+ }
if (FLAGS_benchmark_color.empty()) {
PrintUsageAndExit();
}
+ for (const auto& kv : FLAGS_benchmark_context) {
+ AddCustomContext(kv.first, kv.second);
+ }
}
int InitializeStreams() {
internal::LogLevel() = FLAGS_v;
}
+void Shutdown() {
+ delete internal::global_context;
+}
+
bool ReportUnrecognizedArguments(int argc, char** argv) {
for (int i = 1; i < argc; ++i) {
fprintf(stderr, "%s: error: unrecognized command-line flag: %s\n", argv[0],
#include "benchmark_api_internal.h"
+#include <cinttypes>
+
+#include "string_util.h"
+
namespace benchmark {
namespace internal {
+BenchmarkInstance::BenchmarkInstance(Benchmark* benchmark, int family_idx,
+ int per_family_instance_idx,
+ const std::vector<int64_t>& args,
+ int thread_count)
+ : benchmark_(*benchmark),
+ family_index_(family_idx),
+ per_family_instance_index_(per_family_instance_idx),
+ aggregation_report_mode_(benchmark_.aggregation_report_mode_),
+ args_(args),
+ time_unit_(benchmark_.time_unit_),
+ measure_process_cpu_time_(benchmark_.measure_process_cpu_time_),
+ use_real_time_(benchmark_.use_real_time_),
+ use_manual_time_(benchmark_.use_manual_time_),
+ complexity_(benchmark_.complexity_),
+ complexity_lambda_(benchmark_.complexity_lambda_),
+ statistics_(benchmark_.statistics_),
+ repetitions_(benchmark_.repetitions_),
+ min_time_(benchmark_.min_time_),
+ iterations_(benchmark_.iterations_),
+ threads_(thread_count) {
+ name_.function_name = benchmark_.name_;
+
+ size_t arg_i = 0;
+ for (const auto& arg : args) {
+ if (!name_.args.empty()) {
+ name_.args += '/';
+ }
+
+ if (arg_i < benchmark->arg_names_.size()) {
+ const auto& arg_name = benchmark_.arg_names_[arg_i];
+ if (!arg_name.empty()) {
+ name_.args += StrFormat("%s:", arg_name.c_str());
+ }
+ }
+
+ name_.args += StrFormat("%" PRId64, arg);
+ ++arg_i;
+ }
+
+ if (!IsZero(benchmark->min_time_)) {
+ name_.min_time = StrFormat("min_time:%0.3f", benchmark_.min_time_);
+ }
+
+ if (benchmark_.iterations_ != 0) {
+ name_.iterations = StrFormat(
+ "iterations:%lu", static_cast<unsigned long>(benchmark_.iterations_));
+ }
+
+ if (benchmark_.repetitions_ != 0) {
+ name_.repetitions = StrFormat("repeats:%d", benchmark_.repetitions_);
+ }
+
+ if (benchmark_.measure_process_cpu_time_) {
+ name_.time_type = "process_time";
+ }
+
+ if (benchmark_.use_manual_time_) {
+ if (!name_.time_type.empty()) {
+ name_.time_type += '/';
+ }
+ name_.time_type += "manual_time";
+ } else if (benchmark_.use_real_time_) {
+ if (!name_.time_type.empty()) {
+ name_.time_type += '/';
+ }
+ name_.time_type += "real_time";
+ }
+
+ if (!benchmark_.thread_counts_.empty()) {
+ name_.threads = StrFormat("threads:%d", threads_);
+ }
+}
+
State BenchmarkInstance::Run(
- size_t iters, int thread_id, internal::ThreadTimer* timer,
- internal::ThreadManager* manager) const {
- State st(iters, arg, thread_id, threads, timer, manager);
- benchmark->Run(st);
+ IterationCount iters, int thread_id, internal::ThreadTimer* timer,
+ internal::ThreadManager* manager,
+ internal::PerfCountersMeasurement* perf_counters_measurement) const {
+ State st(iters, args_, thread_id, threads_, timer, manager,
+ perf_counters_measurement);
+ benchmark_.Run(st);
return st;
}
-} // internal
-} // benchmark
+} // namespace internal
+} // namespace benchmark
#ifndef BENCHMARK_API_INTERNAL_H
#define BENCHMARK_API_INTERNAL_H
-#include "benchmark/benchmark.h"
-#include "commandlineflags.h"
-
#include <cmath>
#include <iosfwd>
#include <limits>
#include <string>
#include <vector>
+#include "benchmark/benchmark.h"
+#include "commandlineflags.h"
+
namespace benchmark {
namespace internal {
// Information kept per benchmark we may want to run
-struct BenchmarkInstance {
- std::string name;
- Benchmark* benchmark;
- AggregationReportMode aggregation_report_mode;
- std::vector<int64_t> arg;
- TimeUnit time_unit;
- int range_multiplier;
- bool use_real_time;
- bool use_manual_time;
- BigO complexity;
- BigOFunc* complexity_lambda;
- UserCounters counters;
- const std::vector<Statistics>* statistics;
- bool last_benchmark_instance;
- int repetitions;
- double min_time;
- size_t iterations;
- int threads; // Number of concurrent threads to us
-
- State Run(size_t iters, int thread_id, internal::ThreadTimer* timer,
- internal::ThreadManager* manager) const;
+class BenchmarkInstance {
+ public:
+ BenchmarkInstance(Benchmark* benchmark, int family_index,
+ int per_family_instance_index,
+ const std::vector<int64_t>& args, int threads);
+
+ const BenchmarkName& name() const { return name_; }
+ int family_index() const { return family_index_; }
+ int per_family_instance_index() const { return per_family_instance_index_; }
+ AggregationReportMode aggregation_report_mode() const {
+ return aggregation_report_mode_;
+ }
+ TimeUnit time_unit() const { return time_unit_; }
+ bool measure_process_cpu_time() const { return measure_process_cpu_time_; }
+ bool use_real_time() const { return use_real_time_; }
+ bool use_manual_time() const { return use_manual_time_; }
+ BigO complexity() const { return complexity_; }
+ BigOFunc& complexity_lambda() const { return *complexity_lambda_; }
+ const std::vector<Statistics>& statistics() const { return statistics_; }
+ int repetitions() const { return repetitions_; }
+ double min_time() const { return min_time_; }
+ IterationCount iterations() const { return iterations_; }
+ int threads() const { return threads_; }
+
+ State Run(IterationCount iters, int thread_id, internal::ThreadTimer* timer,
+ internal::ThreadManager* manager,
+ internal::PerfCountersMeasurement* perf_counters_measurement) const;
+
+ private:
+ BenchmarkName name_;
+ Benchmark& benchmark_;
+ const int family_index_;
+ const int per_family_instance_index_;
+ AggregationReportMode aggregation_report_mode_;
+ const std::vector<int64_t>& args_;
+ TimeUnit time_unit_;
+ bool measure_process_cpu_time_;
+ bool use_real_time_;
+ bool use_manual_time_;
+ BigO complexity_;
+ BigOFunc* complexity_lambda_;
+ UserCounters counters_;
+ const std::vector<Statistics>& statistics_;
+ int repetitions_;
+ double min_time_;
+ IterationCount iterations_;
+ int threads_; // Number of concurrent threads to us
};
bool FindBenchmarksInternal(const std::string& re,
--- /dev/null
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <benchmark/benchmark.h>
+
+namespace benchmark {
+
+namespace {
+
+// Compute the total size of a pack of std::strings
+size_t size_impl() { return 0; }
+
+template <typename Head, typename... Tail>
+size_t size_impl(const Head& head, const Tail&... tail) {
+ return head.size() + size_impl(tail...);
+}
+
+// Join a pack of std::strings using a delimiter
+// TODO: use absl::StrJoin
+void join_impl(std::string&, char) {}
+
+template <typename Head, typename... Tail>
+void join_impl(std::string& s, const char delimiter, const Head& head,
+ const Tail&... tail) {
+ if (!s.empty() && !head.empty()) {
+ s += delimiter;
+ }
+
+ s += head;
+
+ join_impl(s, delimiter, tail...);
+}
+
+template <typename... Ts>
+std::string join(char delimiter, const Ts&... ts) {
+ std::string s;
+ s.reserve(sizeof...(Ts) + size_impl(ts...));
+ join_impl(s, delimiter, ts...);
+ return s;
+}
+} // namespace
+
+std::string BenchmarkName::str() const {
+ return join('/', function_name, args, min_time, iterations, repetitions,
+ time_type, threads);
+}
+} // namespace benchmark
#include <algorithm>
#include <atomic>
+#include <cinttypes>
#include <condition_variable>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <memory>
+#include <numeric>
#include <sstream>
#include <thread>
// Special list of thread counts to use when none are specified
const std::vector<int> one_thread = {1};
+ int next_family_index = 0;
+
MutexLock l(mutex_);
for (std::unique_ptr<Benchmark>& family : families_) {
+ int family_index = next_family_index;
+ int per_family_instance_index = 0;
+
// Family was deleted or benchmark doesn't match
if (!family) continue;
}
// reserve in the special case the regex ".", since we know the final
// family size.
- if (spec == ".") benchmarks->reserve(family_size);
+ if (spec == ".") benchmarks->reserve(benchmarks->size() + family_size);
for (auto const& args : family->args_) {
for (int num_threads : *thread_counts) {
- BenchmarkInstance instance;
- instance.name = family->name_;
- instance.benchmark = family.get();
- instance.aggregation_report_mode = family->aggregation_report_mode_;
- instance.arg = args;
- instance.time_unit = family->time_unit_;
- instance.range_multiplier = family->range_multiplier_;
- instance.min_time = family->min_time_;
- instance.iterations = family->iterations_;
- instance.repetitions = family->repetitions_;
- instance.use_real_time = family->use_real_time_;
- instance.use_manual_time = family->use_manual_time_;
- instance.complexity = family->complexity_;
- instance.complexity_lambda = family->complexity_lambda_;
- instance.statistics = &family->statistics_;
- instance.threads = num_threads;
-
- // Add arguments to instance name
- size_t arg_i = 0;
- for (auto const& arg : args) {
- instance.name += "/";
-
- if (arg_i < family->arg_names_.size()) {
- const auto& arg_name = family->arg_names_[arg_i];
- if (!arg_name.empty()) {
- instance.name +=
- StrFormat("%s:", family->arg_names_[arg_i].c_str());
- }
- }
-
- // we know that the args are always non-negative (see 'AddRange()'),
- // thus print as 'unsigned'. BUT, do a cast due to the 32-bit builds.
- instance.name += StrFormat("%lu", static_cast<unsigned long>(arg));
- ++arg_i;
- }
+ BenchmarkInstance instance(family.get(), family_index,
+ per_family_instance_index, args,
+ num_threads);
- if (!IsZero(family->min_time_))
- instance.name += StrFormat("/min_time:%0.3f", family->min_time_);
- if (family->iterations_ != 0) {
- instance.name +=
- StrFormat("/iterations:%lu",
- static_cast<unsigned long>(family->iterations_));
- }
- if (family->repetitions_ != 0)
- instance.name += StrFormat("/repeats:%d", family->repetitions_);
-
- if (family->use_manual_time_) {
- instance.name += "/manual_time";
- } else if (family->use_real_time_) {
- instance.name += "/real_time";
- }
+ const auto full_name = instance.name().str();
+ if ((re.Match(full_name) && !isNegativeFilter) ||
+ (!re.Match(full_name) && isNegativeFilter)) {
+ benchmarks->push_back(std::move(instance));
- // Add the number of threads used to the name
- if (!family->thread_counts_.empty()) {
- instance.name += StrFormat("/threads:%d", instance.threads);
- }
+ ++per_family_instance_index;
- if ((re.Match(instance.name) && !isNegativeFilter) ||
- (!re.Match(instance.name) && isNegativeFilter)) {
- instance.last_benchmark_instance = (&args == &family->args_.back());
- benchmarks->push_back(std::move(instance));
+ // Only bump the next family index once we've estabilished that
+ // at least one instance of this family will be run.
+ if (next_family_index == family_index) ++next_family_index;
}
}
}
min_time_(0),
iterations_(0),
repetitions_(0),
+ measure_process_cpu_time_(false),
use_real_time_(false),
use_manual_time_(false),
complexity_(oNone),
Benchmark::~Benchmark() {}
+Benchmark* Benchmark::Name(const std::string& name) {
+ SetName(name.c_str());
+ return this;
+}
+
Benchmark* Benchmark::Arg(int64_t x) {
CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
args_.push_back({x});
const std::vector<std::pair<int64_t, int64_t>>& ranges) {
CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(ranges.size()));
std::vector<std::vector<int64_t>> arglists(ranges.size());
- std::size_t total = 1;
for (std::size_t i = 0; i < ranges.size(); i++) {
AddRange(&arglists[i], ranges[i].first, ranges[i].second,
range_multiplier_);
- total *= arglists[i].size();
}
- std::vector<std::size_t> ctr(arglists.size(), 0);
+ ArgsProduct(arglists);
- for (std::size_t i = 0; i < total; i++) {
- std::vector<int64_t> tmp;
- tmp.reserve(arglists.size());
-
- for (std::size_t j = 0; j < arglists.size(); j++) {
- tmp.push_back(arglists[j].at(ctr[j]));
- }
+ return this;
+}
- args_.push_back(std::move(tmp));
+Benchmark* Benchmark::ArgsProduct(
+ const std::vector<std::vector<int64_t>>& arglists) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(arglists.size()));
- for (std::size_t j = 0; j < arglists.size(); j++) {
- if (ctr[j] + 1 < arglists[j].size()) {
- ++ctr[j];
- break;
- }
- ctr[j] = 0;
+ std::vector<std::size_t> indices(arglists.size());
+ const std::size_t total = std::accumulate(
+ std::begin(arglists), std::end(arglists), std::size_t{1},
+ [](const std::size_t res, const std::vector<int64_t>& arglist) {
+ return res * arglist.size();
+ });
+ std::vector<int64_t> args;
+ args.reserve(arglists.size());
+ for (std::size_t i = 0; i < total; i++) {
+ for (std::size_t arg = 0; arg < arglists.size(); arg++) {
+ args.push_back(arglists[arg][indices[arg]]);
}
+ args_.push_back(args);
+ args.clear();
+
+ std::size_t arg = 0;
+ do {
+ indices[arg] = (indices[arg] + 1) % arglists[arg].size();
+ } while (indices[arg++] == 0 && arg < arglists.size());
}
+
return this;
}
Benchmark* Benchmark::DenseRange(int64_t start, int64_t limit, int step) {
CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
- CHECK_GE(start, 0);
CHECK_LE(start, limit);
for (int64_t arg = start; arg <= limit; arg += step) {
args_.push_back({arg});
return this;
}
-Benchmark* Benchmark::Iterations(size_t n) {
+Benchmark* Benchmark::Iterations(IterationCount n) {
CHECK(n > 0);
CHECK(IsZero(min_time_));
iterations_ = n;
return this;
}
+Benchmark* Benchmark::MeasureProcessCPUTime() {
+ // Can be used together with UseRealTime() / UseManualTime().
+ measure_process_cpu_time_ = true;
+ return this;
+}
+
Benchmark* Benchmark::UseRealTime() {
CHECK(!use_manual_time_)
<< "Cannot set UseRealTime and UseManualTime simultaneously.";
#ifndef BENCHMARK_REGISTER_H
#define BENCHMARK_REGISTER_H
+#include <limits>
#include <vector>
#include "check.h"
+namespace benchmark {
+namespace internal {
+
+// Append the powers of 'mult' in the closed interval [lo, hi].
+// Returns iterator to the start of the inserted range.
template <typename T>
-void AddRange(std::vector<T>* dst, T lo, T hi, int mult) {
+typename std::vector<T>::iterator
+AddPowers(std::vector<T>* dst, T lo, T hi, int mult) {
CHECK_GE(lo, 0);
CHECK_GE(hi, lo);
CHECK_GE(mult, 2);
- // Add "lo"
- dst->push_back(lo);
+ const size_t start_offset = dst->size();
static const T kmax = std::numeric_limits<T>::max();
- // Now space out the benchmarks in multiples of "mult"
- for (T i = 1; i < kmax / mult; i *= mult) {
- if (i >= hi) break;
- if (i > lo) {
+ // Space out the values in multiples of "mult"
+ for (T i = static_cast<T>(1); i <= hi; i *= mult) {
+ if (i >= lo) {
dst->push_back(i);
}
+ // Break the loop here since multiplying by
+ // 'mult' would move outside of the range of T
+ if (i > kmax / mult) break;
+ }
+
+ return dst->begin() + start_offset;
+}
+
+template <typename T>
+void AddNegatedPowers(std::vector<T>* dst, T lo, T hi, int mult) {
+ // We negate lo and hi so we require that they cannot be equal to 'min'.
+ CHECK_GT(lo, std::numeric_limits<T>::min());
+ CHECK_GT(hi, std::numeric_limits<T>::min());
+ CHECK_GE(hi, lo);
+ CHECK_LE(hi, 0);
+
+ // Add positive powers, then negate and reverse.
+ // Casts necessary since small integers get promoted
+ // to 'int' when negating.
+ const auto lo_complement = static_cast<T>(-lo);
+ const auto hi_complement = static_cast<T>(-hi);
+
+ const auto it = AddPowers(dst, hi_complement, lo_complement, mult);
+
+ std::for_each(it, dst->end(), [](T& t) { t *= -1; });
+ std::reverse(it, dst->end());
+}
+
+template <typename T>
+void AddRange(std::vector<T>* dst, T lo, T hi, int mult) {
+ static_assert(std::is_integral<T>::value && std::is_signed<T>::value,
+ "Args type must be a signed integer");
+
+ CHECK_GE(hi, lo);
+ CHECK_GE(mult, 2);
+
+ // Add "lo"
+ dst->push_back(lo);
+
+ // Handle lo == hi as a special case, so we then know
+ // lo < hi and so it is safe to add 1 to lo and subtract 1
+ // from hi without falling outside of the range of T.
+ if (lo == hi) return;
+
+ // Ensure that lo_inner <= hi_inner below.
+ if (lo + 1 == hi) {
+ dst->push_back(hi);
+ return;
}
- // Add "hi" (if different from "lo")
- if (hi != lo) {
+ // Add all powers of 'mult' in the range [lo+1, hi-1] (inclusive).
+ const auto lo_inner = static_cast<T>(lo + 1);
+ const auto hi_inner = static_cast<T>(hi - 1);
+
+ // Insert negative values
+ if (lo_inner < 0) {
+ AddNegatedPowers(dst, lo_inner, std::min(hi_inner, T{-1}), mult);
+ }
+
+ // Treat 0 as a special case (see discussion on #762).
+ if (lo < 0 && hi >= 0) {
+ dst->push_back(0);
+ }
+
+ // Insert positive values
+ if (hi_inner > 0) {
+ AddPowers(dst, std::max(lo_inner, T{1}), hi_inner, mult);
+ }
+
+ // Add "hi" (if different from last value).
+ if (hi != dst->back()) {
dst->push_back(hi);
}
}
+} // namespace internal
+} // namespace benchmark
+
#endif // BENCHMARK_REGISTER_H
// limitations under the License.
#include "benchmark_runner.h"
+
#include "benchmark/benchmark.h"
#include "benchmark_api_internal.h"
#include "internal_macros.h"
#include "internal_macros.h"
#include "log.h"
#include "mutex.h"
+#include "perf_counters.h"
#include "re.h"
#include "statistics.h"
#include "string_util.h"
namespace {
-static const size_t kMaxIterations = 1000000000;
+static constexpr IterationCount kMaxIterations = 1000000000;
BenchmarkReporter::Run CreateRunReport(
const benchmark::internal::BenchmarkInstance& b,
- const internal::ThreadManager::Result& results, size_t memory_iterations,
- const MemoryManager::Result& memory_result, double seconds) {
+ const internal::ThreadManager::Result& results,
+ IterationCount memory_iterations,
+ const MemoryManager::Result& memory_result, double seconds,
+ int64_t repetition_index, int64_t repeats) {
// Create report about this benchmark run.
BenchmarkReporter::Run report;
- report.run_name = b.name;
+ report.run_name = b.name();
+ report.family_index = b.family_index();
+ report.per_family_instance_index = b.per_family_instance_index();
report.error_occurred = results.has_error_;
report.error_message = results.error_message_;
report.report_label = results.report_label_;
// This is the total iterations across all threads.
report.iterations = results.iterations;
- report.time_unit = b.time_unit;
+ report.time_unit = b.time_unit();
+ report.threads = b.threads();
+ report.repetition_index = repetition_index;
+ report.repetitions = repeats;
if (!report.error_occurred) {
- if (b.use_manual_time) {
+ if (b.use_manual_time()) {
report.real_accumulated_time = results.manual_time_used;
} else {
report.real_accumulated_time = results.real_time_used;
}
report.cpu_accumulated_time = results.cpu_time_used;
report.complexity_n = results.complexity_n;
- report.complexity = b.complexity;
- report.complexity_lambda = b.complexity_lambda;
- report.statistics = b.statistics;
+ report.complexity = b.complexity();
+ report.complexity_lambda = b.complexity_lambda();
+ report.statistics = &b.statistics();
report.counters = results.counters;
if (memory_iterations > 0) {
report.max_bytes_used = memory_result.max_bytes_used;
}
- internal::Finish(&report.counters, results.iterations, seconds, b.threads);
+ internal::Finish(&report.counters, results.iterations, seconds,
+ b.threads());
}
return report;
}
// Execute one thread of benchmark b for the specified number of iterations.
-// Adds the stats collected for the thread into *total.
-void RunInThread(const BenchmarkInstance* b, size_t iters, int thread_id,
- ThreadManager* manager) {
- internal::ThreadTimer timer;
- State st = b->Run(iters, thread_id, &timer, manager);
- CHECK(st.iterations() >= st.max_iterations)
+// Adds the stats collected for the thread into manager->results.
+void RunInThread(const BenchmarkInstance* b, IterationCount iters,
+ int thread_id, ThreadManager* manager,
+ PerfCountersMeasurement* perf_counters_measurement) {
+ internal::ThreadTimer timer(
+ b->measure_process_cpu_time()
+ ? internal::ThreadTimer::CreateProcessCpuTime()
+ : internal::ThreadTimer::Create());
+ State st =
+ b->Run(iters, thread_id, &timer, manager, perf_counters_measurement);
+ CHECK(st.error_occurred() || st.iterations() >= st.max_iterations)
<< "Benchmark returned before State::KeepRunning() returned false!";
{
MutexLock l(manager->GetBenchmarkMutex());
manager->NotifyThreadComplete();
}
-class BenchmarkRunner {
- public:
- BenchmarkRunner(const benchmark::internal::BenchmarkInstance& b_,
- std::vector<BenchmarkReporter::Run>* complexity_reports_)
- : b(b_),
- complexity_reports(*complexity_reports_),
- min_time(!IsZero(b.min_time) ? b.min_time : FLAGS_benchmark_min_time),
- repeats(b.repetitions != 0 ? b.repetitions
+} // end namespace
+
+BenchmarkRunner::BenchmarkRunner(
+ const benchmark::internal::BenchmarkInstance& b_,
+ BenchmarkReporter::PerFamilyRunReports* reports_for_family_)
+ : b(b_),
+ reports_for_family(reports_for_family_),
+ min_time(!IsZero(b.min_time()) ? b.min_time() : FLAGS_benchmark_min_time),
+ repeats(b.repetitions() != 0 ? b.repetitions()
: FLAGS_benchmark_repetitions),
- has_explicit_iteration_count(b.iterations != 0),
- pool(b.threads - 1),
- iters(has_explicit_iteration_count ? b.iterations : 1) {
+ has_explicit_iteration_count(b.iterations() != 0),
+ pool(b.threads() - 1),
+ iters(has_explicit_iteration_count ? b.iterations() : 1),
+ perf_counters_measurement(
+ PerfCounters::Create(StrSplit(FLAGS_benchmark_perf_counters, ','))),
+ perf_counters_measurement_ptr(perf_counters_measurement.IsValid()
+ ? &perf_counters_measurement
+ : nullptr) {
+ run_results.display_report_aggregates_only =
+ (FLAGS_benchmark_report_aggregates_only ||
+ FLAGS_benchmark_display_aggregates_only);
+ run_results.file_report_aggregates_only =
+ FLAGS_benchmark_report_aggregates_only;
+ if (b.aggregation_report_mode() != internal::ARM_Unspecified) {
run_results.display_report_aggregates_only =
- (FLAGS_benchmark_report_aggregates_only ||
- FLAGS_benchmark_display_aggregates_only);
+ (b.aggregation_report_mode() &
+ internal::ARM_DisplayReportAggregatesOnly);
run_results.file_report_aggregates_only =
- FLAGS_benchmark_report_aggregates_only;
- if (b.aggregation_report_mode != internal::ARM_Unspecified) {
- run_results.display_report_aggregates_only =
- (b.aggregation_report_mode &
- internal::ARM_DisplayReportAggregatesOnly);
- run_results.file_report_aggregates_only =
- (b.aggregation_report_mode & internal::ARM_FileReportAggregatesOnly);
- }
+ (b.aggregation_report_mode() & internal::ARM_FileReportAggregatesOnly);
+ CHECK(FLAGS_benchmark_perf_counters.empty() ||
+ perf_counters_measurement.IsValid())
+ << "Perf counters were requested but could not be set up.";
+ }
+}
- for (int repetition_num = 0; repetition_num < repeats; repetition_num++) {
- const bool is_the_first_repetition = repetition_num == 0;
- DoOneRepetition(is_the_first_repetition);
- }
+BenchmarkRunner::IterationResults BenchmarkRunner::DoNIterations() {
+ VLOG(2) << "Running " << b.name().str() << " for " << iters << "\n";
- // Calculate additional statistics
- run_results.aggregates_only = ComputeStats(run_results.non_aggregates);
+ std::unique_ptr<internal::ThreadManager> manager;
+ manager.reset(new internal::ThreadManager(b.threads()));
- // Maybe calculate complexity report
- if ((b.complexity != oNone) && b.last_benchmark_instance) {
- auto additional_run_stats = ComputeBigO(complexity_reports);
- run_results.aggregates_only.insert(run_results.aggregates_only.end(),
- additional_run_stats.begin(),
- additional_run_stats.end());
- complexity_reports.clear();
- }
+ // Run all but one thread in separate threads
+ for (std::size_t ti = 0; ti < pool.size(); ++ti) {
+ pool[ti] = std::thread(&RunInThread, &b, iters, static_cast<int>(ti + 1),
+ manager.get(), perf_counters_measurement_ptr);
}
+ // And run one thread here directly.
+ // (If we were asked to run just one thread, we don't create new threads.)
+ // Yes, we need to do this here *after* we start the separate threads.
+ RunInThread(&b, iters, 0, manager.get(), perf_counters_measurement_ptr);
- RunResults&& get_results() { return std::move(run_results); }
+ // The main thread has finished. Now let's wait for the other threads.
+ manager->WaitForAllThreads();
+ for (std::thread& thread : pool) thread.join();
- private:
- RunResults run_results;
+ IterationResults i;
+ // Acquire the measurements/counters from the manager, UNDER THE LOCK!
+ {
+ MutexLock l(manager->GetBenchmarkMutex());
+ i.results = manager->results;
+ }
- const benchmark::internal::BenchmarkInstance& b;
- std::vector<BenchmarkReporter::Run>& complexity_reports;
+ // And get rid of the manager.
+ manager.reset();
- const double min_time;
- const int repeats;
- const bool has_explicit_iteration_count;
+ // Adjust real/manual time stats since they were reported per thread.
+ i.results.real_time_used /= b.threads();
+ i.results.manual_time_used /= b.threads();
+ // If we were measuring whole-process CPU usage, adjust the CPU time too.
+ if (b.measure_process_cpu_time()) i.results.cpu_time_used /= b.threads();
- std::vector<std::thread> pool;
+ VLOG(2) << "Ran in " << i.results.cpu_time_used << "/"
+ << i.results.real_time_used << "\n";
- size_t iters; // preserved between repetitions!
- // So only the first repetition has to find/calculate it,
- // the other repetitions will just use that precomputed iteration count.
+ // By using KeepRunningBatch a benchmark can iterate more times than
+ // requested, so take the iteration count from i.results.
+ i.iters = i.results.iterations / b.threads();
- struct IterationResults {
- internal::ThreadManager::Result results;
- size_t iters;
- double seconds;
- };
- IterationResults DoNIterations() {
- VLOG(2) << "Running " << b.name << " for " << iters << "\n";
+ // Base decisions off of real time if requested by this benchmark.
+ i.seconds = i.results.cpu_time_used;
+ if (b.use_manual_time()) {
+ i.seconds = i.results.manual_time_used;
+ } else if (b.use_real_time()) {
+ i.seconds = i.results.real_time_used;
+ }
- std::unique_ptr<internal::ThreadManager> manager;
- manager.reset(new internal::ThreadManager(b.threads));
+ return i;
+}
- // Run all but one thread in separate threads
- for (std::size_t ti = 0; ti < pool.size(); ++ti) {
- pool[ti] = std::thread(&RunInThread, &b, iters, static_cast<int>(ti + 1),
- manager.get());
- }
- // And run one thread here directly.
- // (If we were asked to run just one thread, we don't create new threads.)
- // Yes, we need to do this here *after* we start the separate threads.
- RunInThread(&b, iters, 0, manager.get());
+IterationCount BenchmarkRunner::PredictNumItersNeeded(
+ const IterationResults& i) const {
+ // See how much iterations should be increased by.
+ // Note: Avoid division by zero with max(seconds, 1ns).
+ double multiplier = min_time * 1.4 / std::max(i.seconds, 1e-9);
+ // If our last run was at least 10% of FLAGS_benchmark_min_time then we
+ // use the multiplier directly.
+ // Otherwise we use at most 10 times expansion.
+ // NOTE: When the last run was at least 10% of the min time the max
+ // expansion should be 14x.
+ bool is_significant = (i.seconds / min_time) > 0.1;
+ multiplier = is_significant ? multiplier : std::min(10.0, multiplier);
+ if (multiplier <= 1.0) multiplier = 2.0;
+
+ // So what seems to be the sufficiently-large iteration count? Round up.
+ const IterationCount max_next_iters = static_cast<IterationCount>(
+ std::lround(std::max(multiplier * static_cast<double>(i.iters),
+ static_cast<double>(i.iters) + 1.0)));
+ // But we do have *some* sanity limits though..
+ const IterationCount next_iters = std::min(max_next_iters, kMaxIterations);
+
+ VLOG(3) << "Next iters: " << next_iters << ", " << multiplier << "\n";
+ return next_iters; // round up before conversion to integer.
+}
- // The main thread has finished. Now let's wait for the other threads.
- manager->WaitForAllThreads();
- for (std::thread& thread : pool) thread.join();
+bool BenchmarkRunner::ShouldReportIterationResults(
+ const IterationResults& i) const {
+ // Determine if this run should be reported;
+ // Either it has run for a sufficient amount of time
+ // or because an error was reported.
+ return i.results.has_error_ ||
+ i.iters >= kMaxIterations || // Too many iterations already.
+ i.seconds >= min_time || // The elapsed time is large enough.
+ // CPU time is specified but the elapsed real time greatly exceeds
+ // the minimum time.
+ // Note that user provided timers are except from this sanity check.
+ ((i.results.real_time_used >= 5 * min_time) && !b.use_manual_time());
+}
- IterationResults i;
- // Acquire the measurements/counters from the manager, UNDER THE LOCK!
- {
- MutexLock l(manager->GetBenchmarkMutex());
- i.results = manager->results;
- }
+void BenchmarkRunner::DoOneRepetition() {
+ assert(HasRepeatsRemaining() && "Already done all repetitions?");
+
+ const bool is_the_first_repetition = num_repetitions_done == 0;
+ IterationResults i;
+
+ // We *may* be gradually increasing the length (iteration count)
+ // of the benchmark until we decide the results are significant.
+ // And once we do, we report those last results and exit.
+ // Please do note that the if there are repetitions, the iteration count
+ // is *only* calculated for the *first* repetition, and other repetitions
+ // simply use that precomputed iteration count.
+ for (;;) {
+ i = DoNIterations();
+
+ // Do we consider the results to be significant?
+ // If we are doing repetitions, and the first repetition was already done,
+ // it has calculated the correct iteration time, so we have run that very
+ // iteration count just now. No need to calculate anything. Just report.
+ // Else, the normal rules apply.
+ const bool results_are_significant = !is_the_first_repetition ||
+ has_explicit_iteration_count ||
+ ShouldReportIterationResults(i);
+
+ if (results_are_significant) break; // Good, let's report them!
+
+ // Nope, bad iteration. Let's re-estimate the hopefully-sufficient
+ // iteration count, and run the benchmark again...
+
+ iters = PredictNumItersNeeded(i);
+ assert(iters > i.iters &&
+ "if we did more iterations than we want to do the next time, "
+ "then we should have accepted the current iteration run.");
+ }
- // And get rid of the manager.
+ // Oh, one last thing, we need to also produce the 'memory measurements'..
+ MemoryManager::Result memory_result;
+ IterationCount memory_iterations = 0;
+ if (memory_manager != nullptr) {
+ // Only run a few iterations to reduce the impact of one-time
+ // allocations in benchmarks that are not properly managed.
+ memory_iterations = std::min<IterationCount>(16, iters);
+ memory_manager->Start();
+ std::unique_ptr<internal::ThreadManager> manager;
+ manager.reset(new internal::ThreadManager(1));
+ RunInThread(&b, memory_iterations, 0, manager.get(),
+ perf_counters_measurement_ptr);
+ manager->WaitForAllThreads();
manager.reset();
- // Adjust real/manual time stats since they were reported per thread.
- i.results.real_time_used /= b.threads;
- i.results.manual_time_used /= b.threads;
-
- VLOG(2) << "Ran in " << i.results.cpu_time_used << "/"
- << i.results.real_time_used << "\n";
-
- // So for how long were we running?
- i.iters = iters;
- // Base decisions off of real time if requested by this benchmark.
- i.seconds = i.results.cpu_time_used;
- if (b.use_manual_time) {
- i.seconds = i.results.manual_time_used;
- } else if (b.use_real_time) {
- i.seconds = i.results.real_time_used;
- }
-
- return i;
+ memory_manager->Stop(&memory_result);
}
- size_t PredictNumItersNeeded(const IterationResults& i) const {
- // See how much iterations should be increased by.
- // Note: Avoid division by zero with max(seconds, 1ns).
- double multiplier = min_time * 1.4 / std::max(i.seconds, 1e-9);
- // If our last run was at least 10% of FLAGS_benchmark_min_time then we
- // use the multiplier directly.
- // Otherwise we use at most 10 times expansion.
- // NOTE: When the last run was at least 10% of the min time the max
- // expansion should be 14x.
- bool is_significant = (i.seconds / min_time) > 0.1;
- multiplier = is_significant ? multiplier : std::min(10.0, multiplier);
- if (multiplier <= 1.0) multiplier = 2.0;
-
- // So what seems to be the sufficiently-large iteration count? Round up.
- const size_t max_next_iters =
- 0.5 + std::max(multiplier * i.iters, i.iters + 1.0);
- // But we do have *some* sanity limits though..
- const size_t next_iters = std::min(max_next_iters, kMaxIterations);
-
- VLOG(3) << "Next iters: " << next_iters << ", " << multiplier << "\n";
- return next_iters; // round up before conversion to integer.
- }
+ // Ok, now actualy report.
+ BenchmarkReporter::Run report =
+ CreateRunReport(b, i.results, memory_iterations, memory_result, i.seconds,
+ num_repetitions_done, repeats);
- bool ShouldReportIterationResults(const IterationResults& i) const {
- // Determine if this run should be reported;
- // Either it has run for a sufficient amount of time
- // or because an error was reported.
- return i.results.has_error_ ||
- i.iters >= kMaxIterations || // Too many iterations already.
- i.seconds >= min_time || // The elapsed time is large enough.
- // CPU time is specified but the elapsed real time greatly exceeds
- // the minimum time.
- // Note that user provided timers are except from this sanity check.
- ((i.results.real_time_used >= 5 * min_time) && !b.use_manual_time);
+ if (reports_for_family) {
+ ++reports_for_family->num_runs_done;
+ if (!report.error_occurred) reports_for_family->Runs.push_back(report);
}
- void DoOneRepetition(bool is_the_first_repetition) {
- IterationResults i;
-
- // We *may* be gradually increasing the length (iteration count)
- // of the benchmark until we decide the results are significant.
- // And once we do, we report those last results and exit.
- // Please do note that the if there are repetitions, the iteration count
- // is *only* calculated for the *first* repetition, and other repetitions
- // simply use that precomputed iteration count.
- for (;;) {
- i = DoNIterations();
-
- // Do we consider the results to be significant?
- // If we are doing repetitions, and the first repetition was already done,
- // it has calculated the correct iteration time, so we have run that very
- // iteration count just now. No need to calculate anything. Just report.
- // Else, the normal rules apply.
- const bool results_are_significant = !is_the_first_repetition ||
- has_explicit_iteration_count ||
- ShouldReportIterationResults(i);
-
- if (results_are_significant) break; // Good, let's report them!
-
- // Nope, bad iteration. Let's re-estimate the hopefully-sufficient
- // iteration count, and run the benchmark again...
-
- iters = PredictNumItersNeeded(i);
- assert(iters > i.iters &&
- "if we did more iterations than we want to do the next time, "
- "then we should have accepted the current iteration run.");
- }
-
- // Oh, one last thing, we need to also produce the 'memory measurements'..
- MemoryManager::Result memory_result;
- size_t memory_iterations = 0;
- if (memory_manager != nullptr) {
- // Only run a few iterations to reduce the impact of one-time
- // allocations in benchmarks that are not properly managed.
- memory_iterations = std::min<size_t>(16, iters);
- memory_manager->Start();
- std::unique_ptr<internal::ThreadManager> manager;
- manager.reset(new internal::ThreadManager(1));
- RunInThread(&b, memory_iterations, 0, manager.get());
- manager->WaitForAllThreads();
- manager.reset();
-
- memory_manager->Stop(&memory_result);
- }
-
- // Ok, now actualy report.
- BenchmarkReporter::Run report = CreateRunReport(
- b, i.results, memory_iterations, memory_result, i.seconds);
+ run_results.non_aggregates.push_back(report);
- if (!report.error_occurred && b.complexity != oNone)
- complexity_reports.push_back(report);
+ ++num_repetitions_done;
+}
- run_results.non_aggregates.push_back(report);
- }
-};
+RunResults&& BenchmarkRunner::GetResults() {
+ assert(!HasRepeatsRemaining() && "Did not run all repetitions yet?");
-} // end namespace
+ // Calculate additional statistics over the repetitions of this instance.
+ run_results.aggregates_only = ComputeStats(run_results.non_aggregates);
-RunResults RunBenchmark(
- const benchmark::internal::BenchmarkInstance& b,
- std::vector<BenchmarkReporter::Run>* complexity_reports) {
- internal::BenchmarkRunner r(b, complexity_reports);
- return r.get_results();
+ return std::move(run_results);
}
} // end namespace internal
#ifndef BENCHMARK_RUNNER_H_
#define BENCHMARK_RUNNER_H_
+#include <thread>
+#include <vector>
+
#include "benchmark_api_internal.h"
#include "internal_macros.h"
+#include "perf_counters.h"
+#include "thread_manager.h"
DECLARE_double(benchmark_min_time);
DECLARE_bool(benchmark_display_aggregates_only);
+DECLARE_string(benchmark_perf_counters);
+
namespace benchmark {
namespace internal {
bool file_report_aggregates_only = false;
};
-RunResults RunBenchmark(
- const benchmark::internal::BenchmarkInstance& b,
- std::vector<BenchmarkReporter::Run>* complexity_reports);
+class BenchmarkRunner {
+ public:
+ BenchmarkRunner(const benchmark::internal::BenchmarkInstance& b_,
+ BenchmarkReporter::PerFamilyRunReports* reports_for_family);
+
+ int GetNumRepeats() const { return repeats; }
+
+ bool HasRepeatsRemaining() const {
+ return GetNumRepeats() != num_repetitions_done;
+ }
+
+ void DoOneRepetition();
+
+ RunResults&& GetResults();
+
+ BenchmarkReporter::PerFamilyRunReports* GetReportsForFamily() const {
+ return reports_for_family;
+ };
+
+ private:
+ RunResults run_results;
+
+ const benchmark::internal::BenchmarkInstance& b;
+ BenchmarkReporter::PerFamilyRunReports* reports_for_family;
+
+ const double min_time;
+ const int repeats;
+ const bool has_explicit_iteration_count;
+
+ int num_repetitions_done = 0;
+
+ std::vector<std::thread> pool;
+
+ IterationCount iters; // preserved between repetitions!
+ // So only the first repetition has to find/calculate it,
+ // the other repetitions will just use that precomputed iteration count.
+
+ PerfCountersMeasurement perf_counters_measurement;
+ PerfCountersMeasurement* const perf_counters_measurement_ptr;
+
+ struct IterationResults {
+ internal::ThreadManager::Result results;
+ IterationCount iters;
+ double seconds;
+ };
+ IterationResults DoNIterations();
+
+ IterationCount PredictNumItersNeeded(const IterationResults& i) const;
+
+ bool ShouldReportIterationResults(const IterationResults& i) const;
+};
} // namespace internal
#include "commandlineflags.h"
+#include <algorithm>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <limits>
+#include <map>
+#include <utility>
+
+#include "../src/string_util.h"
namespace benchmark {
+namespace {
+
// Parses 'str' for a 32-bit signed integer. If successful, writes
// the result to *value and returns true; otherwise leaves *value
// unchanged and returns false.
return true;
}
+// Parses 'str' into KV pairs. If successful, writes the result to *value and
+// returns true; otherwise leaves *value unchanged and returns false.
+bool ParseKvPairs(const std::string& src_text, const char* str,
+ std::map<std::string, std::string>* value) {
+ std::map<std::string, std::string> kvs;
+ for (const auto& kvpair : StrSplit(str, ',')) {
+ const auto kv = StrSplit(kvpair, '=');
+ if (kv.size() != 2) {
+ std::cerr << src_text << " is expected to be a comma-separated list of "
+ << "<key>=<value> strings, but actually has value \"" << str
+ << "\".\n";
+ return false;
+ }
+ if (!kvs.emplace(kv[0], kv[1]).second) {
+ std::cerr << src_text << " is expected to contain unique keys but key \""
+ << kv[0] << "\" was repeated.\n";
+ return false;
+ }
+ }
+
+ *value = kvs;
+ return true;
+}
+
// Returns the name of the environment variable corresponding to the
// given flag. For example, FlagToEnvVar("foo") will return
// "BENCHMARK_FOO" in the open-source version.
for (size_t i = 0; i != flag_str.length(); ++i)
env_var += static_cast<char>(::toupper(flag_str.c_str()[i]));
- return "BENCHMARK_" + env_var;
+ return env_var;
}
-// Reads and returns the Boolean environment variable corresponding to
-// the given flag; if it's not set, returns default_value.
-//
-// The value is considered true iff it's not "0".
-bool BoolFromEnv(const char* flag, bool default_value) {
+} // namespace
+
+bool BoolFromEnv(const char* flag, bool default_val) {
const std::string env_var = FlagToEnvVar(flag);
- const char* const string_value = getenv(env_var.c_str());
- return string_value == nullptr ? default_value
- : strcmp(string_value, "0") != 0;
+ const char* const value_str = getenv(env_var.c_str());
+ return value_str == nullptr ? default_val : IsTruthyFlagValue(value_str);
}
-// Reads and returns a 32-bit integer stored in the environment
-// variable corresponding to the given flag; if it isn't set or
-// doesn't represent a valid 32-bit integer, returns default_value.
-int32_t Int32FromEnv(const char* flag, int32_t default_value) {
+int32_t Int32FromEnv(const char* flag, int32_t default_val) {
const std::string env_var = FlagToEnvVar(flag);
- const char* const string_value = getenv(env_var.c_str());
- if (string_value == nullptr) {
- // The environment variable is not set.
- return default_value;
+ const char* const value_str = getenv(env_var.c_str());
+ int32_t value = default_val;
+ if (value_str == nullptr ||
+ !ParseInt32(std::string("Environment variable ") + env_var, value_str,
+ &value)) {
+ return default_val;
}
+ return value;
+}
- int32_t result = default_value;
- if (!ParseInt32(std::string("Environment variable ") + env_var, string_value,
- &result)) {
- std::cout << "The default value " << default_value << " is used.\n";
- return default_value;
+double DoubleFromEnv(const char* flag, double default_val) {
+ const std::string env_var = FlagToEnvVar(flag);
+ const char* const value_str = getenv(env_var.c_str());
+ double value = default_val;
+ if (value_str == nullptr ||
+ !ParseDouble(std::string("Environment variable ") + env_var, value_str,
+ &value)) {
+ return default_val;
}
-
- return result;
+ return value;
}
-// Reads and returns the string environment variable corresponding to
-// the given flag; if it's not set, returns default_value.
-const char* StringFromEnv(const char* flag, const char* default_value) {
+const char* StringFromEnv(const char* flag, const char* default_val) {
const std::string env_var = FlagToEnvVar(flag);
const char* const value = getenv(env_var.c_str());
- return value == nullptr ? default_value : value;
+ return value == nullptr ? default_val : value;
+}
+
+std::map<std::string, std::string> KvPairsFromEnv(
+ const char* flag, std::map<std::string, std::string> default_val) {
+ const std::string env_var = FlagToEnvVar(flag);
+ const char* const value_str = getenv(env_var.c_str());
+
+ if (value_str == nullptr) return default_val;
+
+ std::map<std::string, std::string> value;
+ if (!ParseKvPairs("Environment variable " + env_var, value_str, &value)) {
+ return default_val;
+ }
+ return value;
}
// Parses a string as a command line flag. The string should have
return true;
}
+bool ParseKeyValueFlag(
+ const char* str, const char* flag,
+ std::map<std::string, std::string>* value) {
+ const char* const value_str = ParseFlagValue(str, flag, false);
+
+ if (value_str == nullptr) return false;
+
+ for (const auto& kvpair : StrSplit(value_str, ',')) {
+ const auto kv = StrSplit(kvpair, '=');
+ if (kv.size() != 2) return false;
+ value->emplace(kv[0], kv[1]);
+ }
+
+ return true;
+}
+
bool IsFlag(const char* str, const char* flag) {
return (ParseFlagValue(str, flag, true) != nullptr);
}
bool IsTruthyFlagValue(const std::string& value) {
- if (value.empty()) return true;
- char ch = value[0];
- return isalnum(ch) &&
- !(ch == '0' || ch == 'f' || ch == 'F' || ch == 'n' || ch == 'N');
+ if (value.size() == 1) {
+ char v = value[0];
+ return isalnum(v) &&
+ !(v == '0' || v == 'f' || v == 'F' || v == 'n' || v == 'N');
+ } else if (!value.empty()) {
+ std::string value_lower(value);
+ std::transform(value_lower.begin(), value_lower.end(), value_lower.begin(),
+ [](char c) { return static_cast<char>(::tolower(c)); });
+ return !(value_lower == "false" || value_lower == "no" ||
+ value_lower == "off");
+ } else
+ return true;
}
+
} // end namespace benchmark
#define BENCHMARK_COMMANDLINEFLAGS_H_
#include <cstdint>
+#include <map>
#include <string>
// Macro for referencing flags.
// Macros for declaring flags.
#define DECLARE_bool(name) extern bool FLAG(name)
#define DECLARE_int32(name) extern int32_t FLAG(name)
-#define DECLARE_int64(name) extern int64_t FLAG(name)
#define DECLARE_double(name) extern double FLAG(name)
#define DECLARE_string(name) extern std::string FLAG(name)
+#define DECLARE_kvpairs(name) \
+ extern std::map<std::string, std::string> FLAG(name)
// Macros for defining flags.
-#define DEFINE_bool(name, default_val, doc) bool FLAG(name) = (default_val)
-#define DEFINE_int32(name, default_val, doc) int32_t FLAG(name) = (default_val)
-#define DEFINE_int64(name, default_val, doc) int64_t FLAG(name) = (default_val)
-#define DEFINE_double(name, default_val, doc) double FLAG(name) = (default_val)
-#define DEFINE_string(name, default_val, doc) \
- std::string FLAG(name) = (default_val)
+#define DEFINE_bool(name, default_val) \
+ bool FLAG(name) = benchmark::BoolFromEnv(#name, default_val)
+#define DEFINE_int32(name, default_val) \
+ int32_t FLAG(name) = benchmark::Int32FromEnv(#name, default_val)
+#define DEFINE_double(name, default_val) \
+ double FLAG(name) = benchmark::DoubleFromEnv(#name, default_val)
+#define DEFINE_string(name, default_val) \
+ std::string FLAG(name) = benchmark::StringFromEnv(#name, default_val)
+#define DEFINE_kvpairs(name, default_val) \
+ std::map<std::string, std::string> FLAG(name) = \
+ benchmark::KvPairsFromEnv(#name, default_val)
namespace benchmark {
-// Parses 'str' for a 32-bit signed integer. If successful, writes the result
-// to *value and returns true; otherwise leaves *value unchanged and returns
-// false.
-bool ParseInt32(const std::string& src_text, const char* str, int32_t* value);
-// Parses a bool/Int32/string from the environment variable
-// corresponding to the given Google Test flag.
+// Parses a bool from the environment variable corresponding to the given flag.
+//
+// If the variable exists, returns IsTruthyFlagValue() value; if not,
+// returns the given default value.
bool BoolFromEnv(const char* flag, bool default_val);
+
+// Parses an Int32 from the environment variable corresponding to the given
+// flag.
+//
+// If the variable exists, returns ParseInt32() value; if not, returns
+// the given default value.
int32_t Int32FromEnv(const char* flag, int32_t default_val);
+
+// Parses an Double from the environment variable corresponding to the given
+// flag.
+//
+// If the variable exists, returns ParseDouble(); if not, returns
+// the given default value.
double DoubleFromEnv(const char* flag, double default_val);
+
+// Parses a string from the environment variable corresponding to the given
+// flag.
+//
+// If variable exists, returns its value; if not, returns
+// the given default value.
const char* StringFromEnv(const char* flag, const char* default_val);
+// Parses a set of kvpairs from the environment variable corresponding to the
+// given flag.
+//
+// If variable exists, returns its value; if not, returns
+// the given default value.
+std::map<std::string, std::string> KvPairsFromEnv(
+ const char* flag, std::map<std::string, std::string> default_val);
+
// Parses a string for a bool flag, in the form of either
// "--flag=value" or "--flag".
//
// true. On failure, returns false without changing *value.
bool ParseBoolFlag(const char* str, const char* flag, bool* value);
-// Parses a string for an Int32 flag, in the form of
-// "--flag=value".
+// Parses a string for an Int32 flag, in the form of "--flag=value".
//
// On success, stores the value of the flag in *value, and returns
// true. On failure, returns false without changing *value.
bool ParseInt32Flag(const char* str, const char* flag, int32_t* value);
-// Parses a string for a Double flag, in the form of
-// "--flag=value".
+// Parses a string for a Double flag, in the form of "--flag=value".
//
// On success, stores the value of the flag in *value, and returns
// true. On failure, returns false without changing *value.
bool ParseDoubleFlag(const char* str, const char* flag, double* value);
-// Parses a string for a string flag, in the form of
-// "--flag=value".
+// Parses a string for a string flag, in the form of "--flag=value".
//
// On success, stores the value of the flag in *value, and returns
// true. On failure, returns false without changing *value.
bool ParseStringFlag(const char* str, const char* flag, std::string* value);
+// Parses a string for a kvpairs flag in the form "--flag=key=value,key=value"
+//
+// On success, stores the value of the flag in *value and returns true. On
+// failure returns false, though *value may have been mutated.
+bool ParseKeyValueFlag(const char* str, const char* flag,
+ std::map<std::string, std::string>* value);
+
// Returns true if the string matches the flag.
bool IsFlag(const char* str, const char* flag);
// Returns true unless value starts with one of: '0', 'f', 'F', 'n' or 'N', or
-// some non-alphanumeric character. As a special case, also returns true if
-// value is the empty string.
+// some non-alphanumeric character. Also returns false if the value matches
+// one of 'no', 'false', 'off' (case-insensitive). As a special case, also
+// returns true if value is the empty string.
bool IsTruthyFlagValue(const std::string& value);
+
} // end namespace benchmark
#endif // BENCHMARK_COMMANDLINEFLAGS_H_
static const double kLog2E = 1.44269504088896340736;
switch (complexity) {
case oN:
- return [](int64_t n) -> double { return static_cast<double>(n); };
+ return [](IterationCount n) -> double { return static_cast<double>(n); };
case oNSquared:
- return [](int64_t n) -> double { return std::pow(n, 2); };
+ return [](IterationCount n) -> double { return std::pow(n, 2); };
case oNCubed:
- return [](int64_t n) -> double { return std::pow(n, 3); };
+ return [](IterationCount n) -> double { return std::pow(n, 3); };
case oLogN:
/* Note: can't use log2 because Android's GNU STL lacks it */
- return [](int64_t n) { return kLog2E * log(static_cast<double>(n)); };
+ return
+ [](IterationCount n) { return kLog2E * log(static_cast<double>(n)); };
case oNLogN:
/* Note: can't use log2 because Android's GNU STL lacks it */
- return [](int64_t n) { return kLog2E * n * log(static_cast<double>(n)); };
+ return [](IterationCount n) {
+ return kLog2E * n * log(static_cast<double>(n));
+ };
case o1:
default:
- return [](int64_t) { return 1.0; };
+ return [](IterationCount) { return 1.0; };
}
}
LeastSq MinimalLeastSq(const std::vector<int64_t>& n,
const std::vector<double>& time,
BigOFunc* fitting_curve) {
- double sigma_gn = 0.0;
double sigma_gn_squared = 0.0;
double sigma_time = 0.0;
double sigma_time_gn = 0.0;
// Calculate least square fitting parameter
for (size_t i = 0; i < n.size(); ++i) {
double gn_i = fitting_curve(n[i]);
- sigma_gn += gn_i;
sigma_gn_squared += gn_i * gn_i;
sigma_time += time[i];
sigma_time_gn += time[i] * gn_i;
result_real = MinimalLeastSq(n, real_time, result_cpu.complexity);
}
- std::string run_name = reports[0].benchmark_name().substr(
- 0, reports[0].benchmark_name().find('/'));
+ // Drop the 'args' when reporting complexity.
+ auto run_name = reports[0].run_name;
+ run_name.args.clear();
// Get the data from the accumulator to BenchmarkReporter::Run's.
Run big_o;
big_o.run_name = run_name;
+ big_o.family_index = reports[0].family_index;
+ big_o.per_family_instance_index = reports[0].per_family_instance_index;
big_o.run_type = BenchmarkReporter::Run::RT_Aggregate;
+ big_o.repetitions = reports[0].repetitions;
+ big_o.repetition_index = Run::no_repetition_index;
+ big_o.threads = reports[0].threads;
big_o.aggregate_name = "BigO";
+ big_o.report_label = reports[0].report_label;
big_o.iterations = 0;
big_o.real_accumulated_time = result_real.coef;
big_o.cpu_accumulated_time = result_cpu.coef;
// Only add label to mean/stddev if it is same for all runs
Run rms;
rms.run_name = run_name;
- big_o.report_label = reports[0].report_label;
+ rms.family_index = reports[0].family_index;
+ rms.per_family_instance_index = reports[0].per_family_instance_index;
rms.run_type = BenchmarkReporter::Run::RT_Aggregate;
rms.aggregate_name = "RMS";
rms.report_label = big_o.report_label;
rms.iterations = 0;
+ rms.repetition_index = Run::no_repetition_index;
+ rms.repetitions = reports[0].repetitions;
+ rms.threads = reports[0].threads;
rms.real_accumulated_time = result_real.rms / multiplier;
rms.cpu_accumulated_time = result_cpu.rms / multiplier;
rms.report_rms = true;
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "benchmark/benchmark.h"
-#include "complexity.h"
-#include "counter.h"
-
#include <algorithm>
#include <cstdint>
#include <cstdio>
+#include <cstring>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>
+#include "benchmark/benchmark.h"
#include "check.h"
#include "colorprint.h"
#include "commandlineflags.h"
+#include "complexity.h"
+#include "counter.h"
#include "internal_macros.h"
#include "string_util.h"
#include "timers.h"
str += " UserCounters...";
}
}
- str += "\n";
std::string line = std::string(str.length(), '-');
- GetOutputStream() << line << "\n" << str << line << "\n";
+ GetOutputStream() << line << "\n" << str << "\n" << line << "\n";
}
void ConsoleReporter::ReportRuns(const std::vector<Run>& reports) {
const std::size_t cNameLen = std::max(std::string::size_type(10),
c.first.length());
auto const& s = HumanReadableNumber(c.second.value, c.second.oneK);
+ const char* unit = "";
+ if (c.second.flags & Counter::kIsRate)
+ unit = (c.second.flags & Counter::kInvert) ? "s" : "/s";
if (output_options_ & OO_Tabular) {
- if (c.second.flags & Counter::kIsRate) {
- printer(Out, COLOR_DEFAULT, " %*s/s", cNameLen - 2, s.c_str());
- } else {
- printer(Out, COLOR_DEFAULT, " %*s", cNameLen, s.c_str());
- }
- } else {
- const char* unit = (c.second.flags & Counter::kIsRate) ? "/s" : "";
- printer(Out, COLOR_DEFAULT, " %s=%s%s", c.first.c_str(), s.c_str(),
+ printer(Out, COLOR_DEFAULT, " %*s%s", cNameLen - strlen(unit), s.c_str(),
unit);
+ } else {
+ printer(Out, COLOR_DEFAULT, " %s=%s%s", c.first.c_str(), s.c_str(), unit);
}
}
namespace benchmark {
namespace internal {
-double Finish(Counter const& c, int64_t iterations, double cpu_time,
+double Finish(Counter const& c, IterationCount iterations, double cpu_time,
double num_threads) {
double v = c.value;
if (c.flags & Counter::kIsRate) {
if (c.flags & Counter::kAvgIterations) {
v /= iterations;
}
+
+ if (c.flags & Counter::kInvert) { // Invert is *always* last.
+ v = 1.0 / v;
+ }
return v;
}
-void Finish(UserCounters* l, int64_t iterations, double cpu_time, double num_threads) {
+void Finish(UserCounters* l, IterationCount iterations, double cpu_time,
+ double num_threads) {
for (auto& c : *l) {
c.second.value = Finish(c.second, iterations, cpu_time, num_threads);
}
// See the License for the specific language governing permissions and
// limitations under the License.
+#ifndef BENCHMARK_COUNTER_H_
+#define BENCHMARK_COUNTER_H_
+
#include "benchmark/benchmark.h"
namespace benchmark {
// these counter-related functions are hidden to reduce API surface.
namespace internal {
-void Finish(UserCounters* l, int64_t iterations, double time, double num_threads);
+void Finish(UserCounters* l, IterationCount iterations, double time,
+ double num_threads);
void Increment(UserCounters* l, UserCounters const& r);
bool SameNames(UserCounters const& l, UserCounters const& r);
} // end namespace internal
} // end namespace benchmark
+
+#endif // BENCHMARK_COUNTER_H_
"error_occurred", "error_message"};
} // namespace
+std::string CsvEscape(const std::string & s) {
+ std::string tmp;
+ tmp.reserve(s.size() + 2);
+ for (char c : s) {
+ switch (c) {
+ case '"' : tmp += "\"\""; break;
+ default : tmp += c; break;
+ }
+ }
+ return '"' + tmp + '"';
+}
+
bool CSVReporter::ReportContext(const Context& context) {
PrintBasicContext(&GetErrorStream(), context);
return true;
void CSVReporter::PrintRunData(const Run& run) {
std::ostream& Out = GetOutputStream();
-
- // Field with embedded double-quote characters must be doubled and the field
- // delimited with double-quotes.
- std::string name = run.benchmark_name();
- ReplaceAll(&name, "\"", "\"\"");
- Out << '"' << name << "\",";
+ Out << CsvEscape(run.benchmark_name()) << ",";
if (run.error_occurred) {
Out << std::string(elements.size() - 3, ',');
Out << "true,";
- std::string msg = run.error_message;
- ReplaceAll(&msg, "\"", "\"\"");
- Out << '"' << msg << "\"\n";
+ Out << CsvEscape(run.error_message) << "\n";
return;
}
}
Out << ",";
if (!run.report_label.empty()) {
- // Field with embedded double-quote characters must be doubled and the field
- // delimited with double-quotes.
- std::string label = run.report_label;
- ReplaceAll(&label, "\"", "\"\"");
- Out << "\"" << label << "\"";
+ Out << CsvEscape(run.report_label);
}
Out << ",,"; // for error_occurred and error_message
// declarations of some other intrinsics, breaking compilation.
// Therefore, we simply declare __rdtsc ourselves. See also
// http://connect.microsoft.com/VisualStudio/feedback/details/262047
-#if defined(COMPILER_MSVC) && !defined(_M_IX86)
+#if defined(COMPILER_MSVC) && !defined(_M_IX86) && !defined(_M_ARM64)
extern "C" uint64_t __rdtsc();
#pragma intrinsic(__rdtsc)
#endif
uint32_t tbl, tbu0, tbu1;
asm volatile(
"mftbu %0\n"
- "mftbl %1\n"
+ "mftb %1\n"
"mftbu %2"
: "=r"(tbu0), "=r"(tbl), "=r"(tbu1));
tbl &= -static_cast<int32_t>(tbu0 == tbu1);
// when I know it will work. Otherwise, I'll use __rdtsc and hope
// the code is being compiled with a non-ancient compiler.
_asm rdtsc
+#elif defined(COMPILER_MSVC) && defined(_M_ARM64)
+ // See https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=vs-2019
+ // and https://reviews.llvm.org/D53115
+ int64_t virtual_timer_value;
+ virtual_timer_value = _ReadStatusReg(ARM64_CNTVCT);
+ return virtual_timer_value;
#elif defined(COMPILER_MSVC)
return __rdtsc();
#elif defined(BENCHMARK_OS_NACL)
struct timeval tv;
gettimeofday(&tv, nullptr);
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
-#elif defined(__mips__)
+#elif defined(__mips__) || defined(__m68k__)
// mips apparently only allows rdtsc for superusers, so we fall
// back to gettimeofday. It's possible clock_gettime would be better.
struct timeval tv;
gettimeofday(&tv, nullptr);
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
+#elif defined(__loongarch__)
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
#elif defined(__s390__) // Covers both s390 and s390x.
// Return the CPU clock.
uint64_t tsc;
+#if defined(BENCHMARK_OS_ZOS) && defined(COMPILER_IBMXL)
+ // z/OS XL compiler HLASM syntax.
+ asm(" stck %0" : "=m"(tsc) : : "cc");
+#else
asm("stck %0" : "=Q"(tsc) : : "cc");
+#endif
return tsc;
#elif defined(__riscv) // RISC-V
// Use RDCYCLE (and RDCYCLEH on riscv32)
asm volatile("rdcycle %0" : "=r"(cycles));
return cycles;
#endif
+#elif defined(__e2k__) || defined(__elbrus__)
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
#else
// The soft failover to a generic implementation is automatic only for ARM.
// For other platforms the developer is expected to make an attempt to create
#endif
#if defined(__clang__)
- #if !defined(COMPILER_CLANG)
+ #if defined(__ibmxl__)
+ #if !defined(COMPILER_IBMXL)
+ #define COMPILER_IBMXL
+ #endif
+ #elif !defined(COMPILER_CLANG)
#define COMPILER_CLANG
#endif
#elif defined(_MSC_VER)
#define BENCHMARK_OS_NETBSD 1
#elif defined(__OpenBSD__)
#define BENCHMARK_OS_OPENBSD 1
+#elif defined(__DragonFly__)
+ #define BENCHMARK_OS_DRAGONFLY 1
#elif defined(__linux__)
#define BENCHMARK_OS_LINUX 1
#elif defined(__native_client__)
#define BENCHMARK_OS_FUCHSIA 1
#elif defined (__SVR4) && defined (__sun)
#define BENCHMARK_OS_SOLARIS 1
+#elif defined(__QNX__)
+#define BENCHMARK_OS_QNX 1
+#elif defined(__MVS__)
+#define BENCHMARK_OS_ZOS 1
#endif
#if defined(__ANDROID__) && defined(__GLIBCXX__)
#include "complexity.h"
#include <algorithm>
+#include <cmath>
#include <cstdint>
#include <iomanip> // for setprecision
#include <iostream>
#include "timers.h"
namespace benchmark {
+namespace internal {
+extern std::map<std::string, std::string>* global_context;
+}
namespace {
+std::string StrEscape(const std::string & s) {
+ std::string tmp;
+ tmp.reserve(s.size());
+ for (char c : s) {
+ switch (c) {
+ case '\b': tmp += "\\b"; break;
+ case '\f': tmp += "\\f"; break;
+ case '\n': tmp += "\\n"; break;
+ case '\r': tmp += "\\r"; break;
+ case '\t': tmp += "\\t"; break;
+ case '\\': tmp += "\\\\"; break;
+ case '"' : tmp += "\\\""; break;
+ default : tmp += c; break;
+ }
+ }
+ return tmp;
+}
+
std::string FormatKV(std::string const& key, std::string const& value) {
- return StrFormat("\"%s\": \"%s\"", key.c_str(), value.c_str());
+ return StrFormat("\"%s\": \"%s\"", StrEscape(key).c_str(), StrEscape(value).c_str());
}
std::string FormatKV(std::string const& key, const char* value) {
- return StrFormat("\"%s\": \"%s\"", key.c_str(), value);
+ return StrFormat("\"%s\": \"%s\"", StrEscape(key).c_str(), StrEscape(value).c_str());
}
std::string FormatKV(std::string const& key, bool value) {
- return StrFormat("\"%s\": %s", key.c_str(), value ? "true" : "false");
+ return StrFormat("\"%s\": %s", StrEscape(key).c_str(), value ? "true" : "false");
}
std::string FormatKV(std::string const& key, int64_t value) {
std::stringstream ss;
- ss << '"' << key << "\": " << value;
+ ss << '"' << StrEscape(key) << "\": " << value;
return ss.str();
}
-std::string FormatKV(std::string const& key, double value) {
+std::string FormatKV(std::string const& key, IterationCount value) {
std::stringstream ss;
- ss << '"' << key << "\": ";
+ ss << '"' << StrEscape(key) << "\": " << value;
+ return ss.str();
+}
- const auto max_digits10 = std::numeric_limits<decltype(value)>::max_digits10;
- const auto max_fractional_digits10 = max_digits10 - 1;
+std::string FormatKV(std::string const& key, double value) {
+ std::stringstream ss;
+ ss << '"' << StrEscape(key) << "\": ";
- ss << std::scientific << std::setprecision(max_fractional_digits10) << value;
+ if (std::isnan(value))
+ ss << (value < 0 ? "-" : "") << "NaN";
+ else if (std::isinf(value))
+ ss << (value < 0 ? "-" : "") << "Infinity";
+ else {
+ const auto max_digits10 =
+ std::numeric_limits<decltype(value)>::max_digits10;
+ const auto max_fractional_digits10 = max_digits10 - 1;
+ ss << std::scientific << std::setprecision(max_fractional_digits10)
+ << value;
+ }
return ss.str();
}
-int64_t RoundDouble(double v) { return static_cast<int64_t>(v + 0.5); }
+int64_t RoundDouble(double v) { return std::lround(v); }
} // end namespace
out << indent << FormatKV("host_name", context.sys_info.name) << ",\n";
if (Context::executable_name) {
- // windows uses backslash for its path separator,
- // which must be escaped in JSON otherwise it blows up conforming JSON
- // decoders
- std::string executable_name = Context::executable_name;
- ReplaceAll(&executable_name, "\\", "\\\\");
- out << indent << FormatKV("executable", executable_name) << ",\n";
+ out << indent << FormatKV("executable", Context::executable_name) << ",\n";
}
CPUInfo const& info = context.cpu_info;
<< FormatKV("mhz_per_cpu",
RoundDouble(info.cycles_per_second / 1000000.0))
<< ",\n";
- out << indent << FormatKV("cpu_scaling_enabled", info.scaling_enabled)
- << ",\n";
+ if (CPUInfo::Scaling::UNKNOWN != info.scaling) {
+ out << indent << FormatKV("cpu_scaling_enabled", info.scaling == CPUInfo::Scaling::ENABLED ? true : false)
+ << ",\n";
+ }
out << indent << "\"caches\": [\n";
indent = std::string(6, ' ');
out << cache_indent << FormatKV("level", static_cast<int64_t>(CI.level))
<< ",\n";
out << cache_indent
- << FormatKV("size", static_cast<int64_t>(CI.size) * 1000u) << ",\n";
+ << FormatKV("size", static_cast<int64_t>(CI.size)) << ",\n";
out << cache_indent
<< FormatKV("num_sharing", static_cast<int64_t>(CI.num_sharing))
<< "\n";
const char build_type[] = "debug";
#endif
out << indent << FormatKV("library_build_type", build_type) << "\n";
+
+ if (internal::global_context != nullptr) {
+ for (const auto& kv: *internal::global_context) {
+ out << indent << FormatKV(kv.first, kv.second) << "\n";
+ }
+ }
+
// Close context block and open the list of benchmarks.
out << inner_indent << "},\n";
out << inner_indent << "\"benchmarks\": [\n";
std::string indent(6, ' ');
std::ostream& out = GetOutputStream();
out << indent << FormatKV("name", run.benchmark_name()) << ",\n";
- out << indent << FormatKV("run_name", run.run_name) << ",\n";
+ out << indent << FormatKV("family_index", run.family_index) << ",\n";
+ out << indent
+ << FormatKV("per_family_instance_index", run.per_family_instance_index)
+ << ",\n";
+ out << indent << FormatKV("run_name", run.run_name.str()) << ",\n";
out << indent << FormatKV("run_type", [&run]() -> const char* {
switch (run.run_type) {
case BenchmarkReporter::Run::RT_Iteration:
}
BENCHMARK_UNREACHABLE();
}()) << ",\n";
+ out << indent << FormatKV("repetitions", run.repetitions) << ",\n";
+ if (run.run_type != BenchmarkReporter::Run::RT_Aggregate) {
+ out << indent << FormatKV("repetition_index", run.repetition_index)
+ << ",\n";
+ }
+ out << indent << FormatKV("threads", run.threads) << ",\n";
if (run.run_type == BenchmarkReporter::Run::RT_Aggregate) {
out << indent << FormatKV("aggregate_name", run.aggregate_name) << ",\n";
}
// Enable thread safety attributes only with clang.
// The attributes can be safely erased when compiling with other compilers.
#if defined(HAVE_THREAD_SAFETY_ATTRIBUTES)
-#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
+#define THREAD_ANNOTATION_ATTRIBUTE_(x) __attribute__((x))
#else
-#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op
+#define THREAD_ANNOTATION_ATTRIBUTE_(x) // no-op
#endif
-#define CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
+#define CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(capability(x))
-#define SCOPED_CAPABILITY THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
+#define SCOPED_CAPABILITY THREAD_ANNOTATION_ATTRIBUTE_(scoped_lockable)
-#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
+#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE_(guarded_by(x))
-#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
+#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE_(pt_guarded_by(x))
#define ACQUIRED_BEFORE(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(acquired_before(__VA_ARGS__))
#define ACQUIRED_AFTER(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(acquired_after(__VA_ARGS__))
#define REQUIRES(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(requires_capability(__VA_ARGS__))
#define REQUIRES_SHARED(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(requires_shared_capability(__VA_ARGS__))
#define ACQUIRE(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(acquire_capability(__VA_ARGS__))
#define ACQUIRE_SHARED(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(acquire_shared_capability(__VA_ARGS__))
#define RELEASE(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(release_capability(__VA_ARGS__))
#define RELEASE_SHARED(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(release_shared_capability(__VA_ARGS__))
#define TRY_ACQUIRE(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(try_acquire_capability(__VA_ARGS__))
#define TRY_ACQUIRE_SHARED(...) \
- THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(__VA_ARGS__))
+ THREAD_ANNOTATION_ATTRIBUTE_(try_acquire_shared_capability(__VA_ARGS__))
-#define EXCLUDES(...) THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
+#define EXCLUDES(...) THREAD_ANNOTATION_ATTRIBUTE_(locks_excluded(__VA_ARGS__))
-#define ASSERT_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
+#define ASSERT_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(assert_capability(x))
#define ASSERT_SHARED_CAPABILITY(x) \
- THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
+ THREAD_ANNOTATION_ATTRIBUTE_(assert_shared_capability(x))
-#define RETURN_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
+#define RETURN_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(lock_returned(x))
#define NO_THREAD_SAFETY_ANALYSIS \
- THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
+ THREAD_ANNOTATION_ATTRIBUTE_(no_thread_safety_analysis)
namespace benchmark {
// NOTE: Wrappers for std::mutex and std::unique_lock are provided so that
// we can annotate them with thread safety attributes and use the
// -Wthread-safety warning with clang. The standard library types cannot be
-// used directly because they do not provided the required annotations.
+// used directly because they do not provide the required annotations.
class CAPABILITY("mutex") Mutex {
public:
Mutex() {}
--- /dev/null
+// Copyright 2021 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "perf_counters.h"
+
+#include <cstring>
+#include <vector>
+
+#if defined HAVE_LIBPFM
+#include "perfmon/pfmlib.h"
+#include "perfmon/pfmlib_perf_event.h"
+#endif
+
+namespace benchmark {
+namespace internal {
+
+constexpr size_t PerfCounterValues::kMaxCounters;
+
+#if defined HAVE_LIBPFM
+const bool PerfCounters::kSupported = true;
+
+bool PerfCounters::Initialize() { return pfm_initialize() == PFM_SUCCESS; }
+
+PerfCounters PerfCounters::Create(
+ const std::vector<std::string>& counter_names) {
+ if (counter_names.empty()) {
+ return NoCounters();
+ }
+ if (counter_names.size() > PerfCounterValues::kMaxCounters) {
+ GetErrorLogInstance()
+ << counter_names.size()
+ << " counters were requested. The minimum is 1, the maximum is "
+ << PerfCounterValues::kMaxCounters << "\n";
+ return NoCounters();
+ }
+ std::vector<int> counter_ids(counter_names.size());
+
+ const int mode = PFM_PLM3; // user mode only
+ for (size_t i = 0; i < counter_names.size(); ++i) {
+ const bool is_first = i == 0;
+ struct perf_event_attr attr{};
+ attr.size = sizeof(attr);
+ const int group_id = !is_first ? counter_ids[0] : -1;
+ const auto& name = counter_names[i];
+ if (name.empty()) {
+ GetErrorLogInstance() << "A counter name was the empty string\n";
+ return NoCounters();
+ }
+ pfm_perf_encode_arg_t arg{};
+ arg.attr = &attr;
+
+ const int pfm_get =
+ pfm_get_os_event_encoding(name.c_str(), mode, PFM_OS_PERF_EVENT, &arg);
+ if (pfm_get != PFM_SUCCESS) {
+ GetErrorLogInstance() << "Unknown counter name: " << name << "\n";
+ return NoCounters();
+ }
+ attr.disabled = is_first;
+ // Note: the man page for perf_event_create suggests inerit = true and
+ // read_format = PERF_FORMAT_GROUP don't work together, but that's not the
+ // case.
+ attr.inherit = true;
+ attr.pinned = is_first;
+ attr.exclude_kernel = true;
+ attr.exclude_user = false;
+ attr.exclude_hv = true;
+ // Read all counters in one read.
+ attr.read_format = PERF_FORMAT_GROUP;
+
+ int id = -1;
+ static constexpr size_t kNrOfSyscallRetries = 5;
+ // Retry syscall as it was interrupted often (b/64774091).
+ for (size_t num_retries = 0; num_retries < kNrOfSyscallRetries;
+ ++num_retries) {
+ id = perf_event_open(&attr, 0, -1, group_id, 0);
+ if (id >= 0 || errno != EINTR) {
+ break;
+ }
+ }
+ if (id < 0) {
+ GetErrorLogInstance()
+ << "Failed to get a file descriptor for " << name << "\n";
+ return NoCounters();
+ }
+
+ counter_ids[i] = id;
+ }
+ if (ioctl(counter_ids[0], PERF_EVENT_IOC_ENABLE) != 0) {
+ GetErrorLogInstance() << "Failed to start counters\n";
+ return NoCounters();
+ }
+
+ return PerfCounters(counter_names, std::move(counter_ids));
+}
+
+PerfCounters::~PerfCounters() {
+ if (counter_ids_.empty()) {
+ return;
+ }
+ ioctl(counter_ids_[0], PERF_EVENT_IOC_DISABLE);
+ for (int fd : counter_ids_) {
+ close(fd);
+ }
+}
+#else // defined HAVE_LIBPFM
+const bool PerfCounters::kSupported = false;
+
+bool PerfCounters::Initialize() { return false; }
+
+PerfCounters PerfCounters::Create(
+ const std::vector<std::string>& counter_names) {
+ if (!counter_names.empty()) {
+ GetErrorLogInstance() << "Performance counters not supported.";
+ }
+ return NoCounters();
+}
+
+PerfCounters::~PerfCounters() = default;
+#endif // defined HAVE_LIBPFM
+} // namespace internal
+} // namespace benchmark
--- /dev/null
+// Copyright 2021 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef BENCHMARK_PERF_COUNTERS_H
+#define BENCHMARK_PERF_COUNTERS_H
+
+#include <array>
+#include <cstdint>
+#include <vector>
+
+#include "benchmark/benchmark.h"
+#include "check.h"
+#include "log.h"
+
+#ifndef BENCHMARK_OS_WINDOWS
+#include <unistd.h>
+#endif
+
+namespace benchmark {
+namespace internal {
+
+// Typically, we can only read a small number of counters. There is also a
+// padding preceding counter values, when reading multiple counters with one
+// syscall (which is desirable). PerfCounterValues abstracts these details.
+// The implementation ensures the storage is inlined, and allows 0-based
+// indexing into the counter values.
+// The object is used in conjunction with a PerfCounters object, by passing it
+// to Snapshot(). The values are populated such that
+// perfCounters->names()[i]'s value is obtained at position i (as given by
+// operator[]) of this object.
+class PerfCounterValues {
+ public:
+ explicit PerfCounterValues(size_t nr_counters) : nr_counters_(nr_counters) {
+ CHECK_LE(nr_counters_, kMaxCounters);
+ }
+
+ uint64_t operator[](size_t pos) const { return values_[kPadding + pos]; }
+
+ static constexpr size_t kMaxCounters = 3;
+
+ private:
+ friend class PerfCounters;
+ // Get the byte buffer in which perf counters can be captured.
+ // This is used by PerfCounters::Read
+ std::pair<char*, size_t> get_data_buffer() {
+ return {reinterpret_cast<char*>(values_.data()),
+ sizeof(uint64_t) * (kPadding + nr_counters_)};
+ }
+
+ static constexpr size_t kPadding = 1;
+ std::array<uint64_t, kPadding + kMaxCounters> values_;
+ const size_t nr_counters_;
+};
+
+// Collect PMU counters. The object, once constructed, is ready to be used by
+// calling read(). PMU counter collection is enabled from the time create() is
+// called, to obtain the object, until the object's destructor is called.
+class PerfCounters final {
+ public:
+ // True iff this platform supports performance counters.
+ static const bool kSupported;
+
+ bool IsValid() const { return is_valid_; }
+ static PerfCounters NoCounters() { return PerfCounters(); }
+
+ ~PerfCounters();
+ PerfCounters(PerfCounters&&) = default;
+ PerfCounters(const PerfCounters&) = delete;
+
+ // Platform-specific implementations may choose to do some library
+ // initialization here.
+ static bool Initialize();
+
+ // Return a PerfCounters object ready to read the counters with the names
+ // specified. The values are user-mode only. The counter name format is
+ // implementation and OS specific.
+ // TODO: once we move to C++-17, this should be a std::optional, and then the
+ // IsValid() boolean can be dropped.
+ static PerfCounters Create(const std::vector<std::string>& counter_names);
+
+ // Take a snapshot of the current value of the counters into the provided
+ // valid PerfCounterValues storage. The values are populated such that:
+ // names()[i]'s value is (*values)[i]
+ BENCHMARK_ALWAYS_INLINE bool Snapshot(PerfCounterValues* values) const {
+#ifndef BENCHMARK_OS_WINDOWS
+ assert(values != nullptr);
+ assert(IsValid());
+ auto buffer = values->get_data_buffer();
+ auto read_bytes = ::read(counter_ids_[0], buffer.first, buffer.second);
+ return static_cast<size_t>(read_bytes) == buffer.second;
+#else
+ (void)values;
+ return false;
+#endif
+ }
+
+ const std::vector<std::string>& names() const { return counter_names_; }
+ size_t num_counters() const { return counter_names_.size(); }
+
+ private:
+ PerfCounters(const std::vector<std::string>& counter_names,
+ std::vector<int>&& counter_ids)
+ : counter_ids_(std::move(counter_ids)),
+ counter_names_(counter_names),
+ is_valid_(true) {}
+ PerfCounters() : is_valid_(false) {}
+
+ std::vector<int> counter_ids_;
+ const std::vector<std::string> counter_names_;
+ const bool is_valid_;
+};
+
+// Typical usage of the above primitives.
+class PerfCountersMeasurement final {
+ public:
+ PerfCountersMeasurement(PerfCounters&& c)
+ : counters_(std::move(c)),
+ start_values_(counters_.IsValid() ? counters_.names().size() : 0),
+ end_values_(counters_.IsValid() ? counters_.names().size() : 0) {}
+
+ bool IsValid() const { return counters_.IsValid(); }
+
+ BENCHMARK_ALWAYS_INLINE void Start() {
+ assert(IsValid());
+ // Tell the compiler to not move instructions above/below where we take
+ // the snapshot.
+ ClobberMemory();
+ counters_.Snapshot(&start_values_);
+ ClobberMemory();
+ }
+
+ BENCHMARK_ALWAYS_INLINE std::vector<std::pair<std::string, double>>
+ StopAndGetMeasurements() {
+ assert(IsValid());
+ // Tell the compiler to not move instructions above/below where we take
+ // the snapshot.
+ ClobberMemory();
+ counters_.Snapshot(&end_values_);
+ ClobberMemory();
+
+ std::vector<std::pair<std::string, double>> ret;
+ for (size_t i = 0; i < counters_.names().size(); ++i) {
+ double measurement = static_cast<double>(end_values_[i]) -
+ static_cast<double>(start_values_[i]);
+ ret.push_back({counters_.names()[i], measurement});
+ }
+ return ret;
+ }
+
+ private:
+ PerfCounters counters_;
+ PerfCounterValues start_values_;
+ PerfCounterValues end_values_;
+};
+
+BENCHMARK_UNUSED static bool perf_init_anchor = PerfCounters::Initialize();
+
+} // namespace internal
+} // namespace benchmark
+
+#endif // BENCHMARK_PERF_COUNTERS_H
#include <cstdlib>
#include <iostream>
+#include <map>
+#include <string>
#include <tuple>
#include <vector>
#include "string_util.h"
namespace benchmark {
+namespace internal {
+extern std::map<std::string, std::string>* global_context;
+}
BenchmarkReporter::BenchmarkReporter()
: output_stream_(&std::cout), error_stream_(&std::cerr) {}
Out << "CPU Caches:\n";
for (auto &CInfo : info.caches) {
Out << " L" << CInfo.level << " " << CInfo.type << " "
- << (CInfo.size / 1000) << "K";
+ << (CInfo.size / 1024) << " KiB";
if (CInfo.num_sharing != 0)
Out << " (x" << (info.num_cpus / CInfo.num_sharing) << ")";
Out << "\n";
Out << "\n";
}
- if (info.scaling_enabled) {
+ if (internal::global_context != nullptr) {
+ for (const auto& kv: *internal::global_context) {
+ Out << kv.first << ": " << kv.second << "\n";
+ }
+ }
+
+ if (CPUInfo::Scaling::ENABLED == info.scaling) {
Out << "***WARNING*** CPU scaling is enabled, the benchmark "
"real time measurements may be noisy and will incur extra "
"overhead.\n";
: cpu_info(CPUInfo::Get()), sys_info(SystemInfo::Get()) {}
std::string BenchmarkReporter::Run::benchmark_name() const {
- std::string name = run_name;
+ std::string name = run_name.str();
if (run_type == RT_Aggregate) {
name += "_" + aggregate_name;
}
#include <windows.h>
#endif
+#ifdef BENCHMARK_OS_ZOS
+#include <unistd.h>
+#endif
+
namespace benchmark {
#ifdef BENCHMARK_OS_WINDOWS
// Window's Sleep takes milliseconds argument.
}
#else // BENCHMARK_OS_WINDOWS
void SleepForMicroseconds(int microseconds) {
+#ifdef BENCHMARK_OS_ZOS
+ // z/OS does not support nanosleep. Instead call sleep() and then usleep() to
+ // sleep for the remaining microseconds because usleep() will fail if its
+ // argument is greater than 1000000.
+ div_t sleepTime = div(microseconds, kNumMicrosPerSecond);
+ int seconds = sleepTime.quot;
+ while (seconds != 0)
+ seconds = sleep(seconds);
+ while (usleep(sleepTime.rem) == -1 && errno == EINTR)
+ ;
+#else
struct timespec sleep_time;
sleep_time.tv_sec = microseconds / kNumMicrosPerSecond;
sleep_time.tv_nsec = (microseconds % kNumMicrosPerSecond) * kNumNanosPerMicro;
while (nanosleep(&sleep_time, &sleep_time) != 0 && errno == EINTR)
; // Ignore signals and wait for the full interval to elapse.
+#endif
}
void SleepForMilliseconds(int milliseconds) {
// All repetitions should be run with the same number of iterations so we
// can take this information from the first benchmark.
- int64_t const run_iterations = reports.front().iterations;
+ const IterationCount run_iterations = reports.front().iterations;
// create stats for user counters
struct CounterStat {
Counter c;
for (const auto& Stat : *reports[0].statistics) {
// Get the data from the accumulator to BenchmarkReporter::Run's.
Run data;
- data.run_name = reports[0].benchmark_name();
+ data.run_name = reports[0].run_name;
+ data.family_index = reports[0].family_index;
+ data.per_family_instance_index = reports[0].per_family_instance_index;
data.run_type = BenchmarkReporter::Run::RT_Aggregate;
+ data.threads = reports[0].threads;
+ data.repetitions = reports[0].repetitions;
+ data.repetition_index = Run::no_repetition_index;
data.aggregate_name = Stat.name_;
data.report_label = report_label;
#include "string_util.h"
#include <array>
+#ifdef BENCHMARK_STL_ANDROID_GNUSTL
+#include <cerrno>
+#endif
#include <cmath>
#include <cstdarg>
#include <cstdio>
return tmp;
}
-void ReplaceAll(std::string* str, const std::string& from,
- const std::string& to) {
- std::size_t start = 0;
- while ((start = str->find(from, start)) != std::string::npos) {
- str->replace(start, from.length(), to);
- start += to.length();
+std::vector<std::string> StrSplit(const std::string& str, char delim) {
+ if (str.empty()) return {};
+ std::vector<std::string> ret;
+ size_t first = 0;
+ size_t next = str.find(delim);
+ for (; next != std::string::npos;
+ first = next + 1, next = str.find(delim, first)) {
+ ret.push_back(str.substr(first, next - first));
}
+ ret.push_back(str.substr(first));
+ return ret;
}
#ifdef BENCHMARK_STL_ANDROID_GNUSTL
std::string HumanReadableNumber(double n, double one_k = 1024.0);
-#ifdef __GNUC__
+#if defined(__MINGW32__)
+__attribute__((format(__MINGW_PRINTF_FORMAT, 1, 2)))
+#elif defined(__GNUC__)
__attribute__((format(printf, 1, 2)))
#endif
std::string
return ss.str();
}
-void ReplaceAll(std::string* str, const std::string& from,
- const std::string& to);
+std::vector<std::string> StrSplit(const std::string& str, char delim);
#ifdef BENCHMARK_STL_ANDROID_GNUSTL
/*
#include <sys/types.h> // this header must be included before 'sys/sysctl.h' to avoid compilation error on FreeBSD
#include <unistd.h>
#if defined BENCHMARK_OS_FREEBSD || defined BENCHMARK_OS_MACOSX || \
- defined BENCHMARK_OS_NETBSD || defined BENCHMARK_OS_OPENBSD
+ defined BENCHMARK_OS_NETBSD || defined BENCHMARK_OS_OPENBSD || \
+ defined BENCHMARK_OS_DRAGONFLY
#define BENCHMARK_HAS_SYSCTL
#include <sys/sysctl.h>
#endif
#if defined(BENCHMARK_OS_SOLARIS)
#include <kstat.h>
#endif
+#if defined(BENCHMARK_OS_QNX)
+#include <sys/syspage.h>
+#endif
#include <algorithm>
#include <array>
#include <memory>
#include <sstream>
#include <locale>
+#include <utility>
#include "check.h"
#include "cycleclock.h"
return f.good();
}
-bool CpuScalingEnabled(int num_cpus) {
+CPUInfo::Scaling CpuScaling(int num_cpus) {
// We don't have a valid CPU count, so don't even bother.
- if (num_cpus <= 0) return false;
+ if (num_cpus <= 0) return CPUInfo::Scaling::UNKNOWN;
+#ifdef BENCHMARK_OS_QNX
+ return CPUInfo::Scaling::UNKNOWN;
+#endif
#ifndef BENCHMARK_OS_WINDOWS
// On Linux, the CPUfreq subsystem exposes CPU information as files on the
// local file system. If reading the exported files fails, then we may not be
for (int cpu = 0; cpu < num_cpus; ++cpu) {
std::string governor_file =
StrCat("/sys/devices/system/cpu/cpu", cpu, "/cpufreq/scaling_governor");
- if (ReadFromFile(governor_file, &res) && res != "performance") return true;
+ if (ReadFromFile(governor_file, &res) && res != "performance") return CPUInfo::Scaling::ENABLED;
}
+ return CPUInfo::Scaling::DISABLED;
#endif
- return false;
+ return CPUInfo::Scaling::UNKNOWN;
}
int CountSetBitsInCPUMap(std::string Val) {
else if (f && suffix != "K")
PrintErrorAndDie("Invalid cache size format: Expected bytes ", suffix);
else if (suffix == "K")
- info.size *= 1000;
+ info.size *= 1024;
}
if (!ReadFromFile(StrCat(FPath, "type"), &info.type))
PrintErrorAndDie("Failed to read from file ", FPath, "type");
}
return res;
}
+#elif BENCHMARK_OS_QNX
+std::vector<CPUInfo::CacheInfo> GetCacheSizesQNX() {
+ std::vector<CPUInfo::CacheInfo> res;
+ struct cacheattr_entry *cache = SYSPAGE_ENTRY(cacheattr);
+ uint32_t const elsize = SYSPAGE_ELEMENT_SIZE(cacheattr);
+ int num = SYSPAGE_ENTRY_SIZE(cacheattr) / elsize ;
+ for(int i = 0; i < num; ++i ) {
+ CPUInfo::CacheInfo info;
+ switch (cache->flags){
+ case CACHE_FLAG_INSTR :
+ info.type = "Instruction";
+ info.level = 1;
+ break;
+ case CACHE_FLAG_DATA :
+ info.type = "Data";
+ info.level = 1;
+ break;
+ case CACHE_FLAG_UNIFIED :
+ info.type = "Unified";
+ info.level = 2;
+ break;
+ case CACHE_FLAG_SHARED :
+ info.type = "Shared";
+ info.level = 3;
+ break;
+ default :
+ continue;
+ break;
+ }
+ info.size = cache->line_size * cache->num_lines;
+ info.num_sharing = 0;
+ res.push_back(std::move(info));
+ cache = SYSPAGE_ARRAY_ADJ_OFFSET(cacheattr, cache, elsize);
+ }
+ return res;
+}
#endif
std::vector<CPUInfo::CacheInfo> GetCacheSizes() {
return GetCacheSizesMacOSX();
#elif defined(BENCHMARK_OS_WINDOWS)
return GetCacheSizesWindows();
+#elif defined(BENCHMARK_OS_QNX)
+ return GetCacheSizesQNX();
#else
return GetCacheSizesFromKVFS();
#endif
#endif
return str;
#else // defined(BENCHMARK_OS_WINDOWS)
-#ifdef BENCHMARK_OS_MACOSX //Mac Doesnt have HOST_NAME_MAX defined
+#ifndef HOST_NAME_MAX
+#ifdef BENCHMARK_HAS_SYSCTL // BSD/Mac Doesnt have HOST_NAME_MAX defined
+#define HOST_NAME_MAX 64
+#elif defined(BENCHMARK_OS_NACL)
+#define HOST_NAME_MAX 64
+#elif defined(BENCHMARK_OS_QNX)
+#define HOST_NAME_MAX 154
+#elif defined(BENCHMARK_OS_RTEMS)
+#define HOST_NAME_MAX 256
+#else
+#warning "HOST_NAME_MAX not defined. using 64"
#define HOST_NAME_MAX 64
#endif
+#endif // def HOST_NAME_MAX
char hostname[HOST_NAME_MAX];
int retVal = gethostname(hostname, HOST_NAME_MAX);
if (retVal != 0) return std::string("");
strerror(errno));
}
return NumCPU;
+#elif defined(BENCHMARK_OS_QNX)
+ return static_cast<int>(_syspage_ptr->num_cpu);
#else
int NumCPUs = 0;
int MaxID = -1;
BENCHMARK_UNREACHABLE();
}
-double GetCPUCyclesPerSecond() {
+double GetCPUCyclesPerSecond(CPUInfo::Scaling scaling) {
+ // Currently, scaling is only used on linux path here,
+ // suppress diagnostics about it being unused on other paths.
+ (void)scaling;
+
#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN
long freq;
// cannot always be relied upon. The same reasons apply to /proc/cpuinfo as
// well.
if (ReadFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &freq)
- // If CPU scaling is in effect, we want to use the *maximum* frequency,
- // not whatever CPU speed some random processor happens to be using now.
+ // If CPU scaling is disabled, use the the *current* frequency.
+ // Note that we specifically don't want to read cpuinfo_cur_freq,
+ // because it is only readable by root.
+ || (scaling == CPUInfo::Scaling::DISABLED &&
+ ReadFromFile("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq",
+ &freq))
+ // Otherwise, if CPU scaling may be in effect, we want to use
+ // the *maximum* frequency, not whatever CPU speed some random processor
+ // happens to be using now.
|| ReadFromFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq",
&freq)) {
// The value is in kHz (as the file name suggests). For example, on a
"machdep.tsc_freq";
#elif defined BENCHMARK_OS_OPENBSD
"hw.cpuspeed";
+#elif defined BENCHMARK_OS_DRAGONFLY
+ "hw.tsc_frequency";
#else
"hw.cpufrequency";
#endif
double clock_hz = knp->value.ui64;
kstat_close(kc);
return clock_hz;
+#elif defined (BENCHMARK_OS_QNX)
+ return static_cast<double>((int64_t)(SYSPAGE_ENTRY(cpuinfo)->speed) *
+ (int64_t)(1000 * 1000));
#endif
// If we've fallen through, attempt to roughly estimate the CPU clock rate.
const int estimate_time_ms = 1000;
}
std::vector<double> GetLoadAvg() {
-#if defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
- defined BENCHMARK_OS_MACOSX || defined BENCHMARK_OS_NETBSD || \
- defined BENCHMARK_OS_OPENBSD
+#if (defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
+ defined BENCHMARK_OS_MACOSX || defined BENCHMARK_OS_NETBSD || \
+ defined BENCHMARK_OS_OPENBSD || defined BENCHMARK_OS_DRAGONFLY) && \
+ !defined(__ANDROID__)
constexpr int kMaxSamples = 3;
std::vector<double> res(kMaxSamples, 0.0);
const int nelem = getloadavg(res.data(), kMaxSamples);
CPUInfo::CPUInfo()
: num_cpus(GetNumCPUs()),
- cycles_per_second(GetCPUCyclesPerSecond()),
+ scaling(CpuScaling(num_cpus)),
+ cycles_per_second(GetCPUCyclesPerSecond(scaling)),
caches(GetCacheSizes()),
- scaling_enabled(CpuScalingEnabled(num_cpus)),
load_avg(GetLoadAvg()) {}
-
const SystemInfo& SystemInfo::Get() {
static const SystemInfo* info = new SystemInfo();
return *info;
class ThreadManager {
public:
- ThreadManager(int num_threads)
+ explicit ThreadManager(int num_threads)
: alive_threads_(num_threads), start_stop_barrier_(num_threads) {}
Mutex& GetBenchmarkMutex() const RETURN_CAPABILITY(benchmark_mutex_) {
public:
struct Result {
- int64_t iterations = 0;
+ IterationCount iterations = 0;
double real_time_used = 0;
double cpu_time_used = 0;
double manual_time_used = 0;
namespace internal {
class ThreadTimer {
+ explicit ThreadTimer(bool measure_process_cpu_time_)
+ : measure_process_cpu_time(measure_process_cpu_time_) {}
+
public:
- ThreadTimer() = default;
+ static ThreadTimer Create() {
+ return ThreadTimer(/*measure_process_cpu_time_=*/false);
+ }
+ static ThreadTimer CreateProcessCpuTime() {
+ return ThreadTimer(/*measure_process_cpu_time_=*/true);
+ }
// Called by each thread
void StartTimer() {
running_ = true;
start_real_time_ = ChronoClockNow();
- start_cpu_time_ = ThreadCPUUsage();
+ start_cpu_time_ = ReadCpuTimerOfChoice();
}
// Called by each thread
real_time_used_ += ChronoClockNow() - start_real_time_;
// Floating point error can result in the subtraction producing a negative
// time. Guard against that.
- cpu_time_used_ += std::max<double>(ThreadCPUUsage() - start_cpu_time_, 0);
+ cpu_time_used_ +=
+ std::max<double>(ReadCpuTimerOfChoice() - start_cpu_time_, 0);
}
// Called by each thread
bool running() const { return running_; }
// REQUIRES: timer is not running
- double real_time_used() {
+ double real_time_used() const {
CHECK(!running_);
return real_time_used_;
}
// REQUIRES: timer is not running
- double cpu_time_used() {
+ double cpu_time_used() const {
CHECK(!running_);
return cpu_time_used_;
}
// REQUIRES: timer is not running
- double manual_time_used() {
+ double manual_time_used() const {
CHECK(!running_);
return manual_time_used_;
}
private:
+ double ReadCpuTimerOfChoice() const {
+ if (measure_process_cpu_time) return ProcessCPUUsage();
+ return ThreadCPUUsage();
+ }
+
+ // should the thread, or the process, time be measured?
+ const bool measure_process_cpu_time;
+
bool running_ = false; // Is the timer running
double start_real_time_ = 0; // If running_
double start_cpu_time_ = 0; // If running_
#include <sys/time.h>
#include <sys/types.h> // this header must be included before 'sys/sysctl.h' to avoid compilation error on FreeBSD
#include <unistd.h>
-#if defined BENCHMARK_OS_FREEBSD || defined BENCHMARK_OS_MACOSX
+#if defined BENCHMARK_OS_FREEBSD || defined BENCHMARK_OS_DRAGONFLY || \
+ defined BENCHMARK_OS_MACOSX
#include <sys/sysctl.h>
#endif
#if defined(BENCHMARK_OS_MACOSX)
#endif
}
-namespace {
-
-std::string DateTimeString(bool local) {
+std::string LocalDateTimeString() {
+ // Write the local time in RFC3339 format yyyy-mm-ddTHH:MM:SS+/-HH:MM.
typedef std::chrono::system_clock Clock;
std::time_t now = Clock::to_time_t(Clock::now());
- const std::size_t kStorageSize = 128;
- char storage[kStorageSize];
- std::size_t written;
+ const std::size_t kTzOffsetLen = 6;
+ const std::size_t kTimestampLen = 19;
+
+ std::size_t tz_len;
+ std::size_t timestamp_len;
+ long int offset_minutes;
+ char tz_offset_sign = '+';
+ // tz_offset is set in one of three ways:
+ // * strftime with %z - This either returns empty or the ISO 8601 time. The maximum length an
+ // ISO 8601 string can be is 7 (e.g. -03:30, plus trailing zero).
+ // * snprintf with %c%02li:%02li - The maximum length is 41 (one for %c, up to 19 for %02li,
+ // one for :, up to 19 %02li, plus trailing zero).
+ // * A fixed string of "-00:00". The maximum length is 7 (-00:00, plus trailing zero).
+ //
+ // Thus, the maximum size this needs to be is 41.
+ char tz_offset[41];
+ // Long enough buffer to avoid format-overflow warnings
+ char storage[128];
- if (local) {
#if defined(BENCHMARK_OS_WINDOWS)
- written =
- std::strftime(storage, sizeof(storage), "%x %X", ::localtime(&now));
+ std::tm *timeinfo_p = ::localtime(&now);
#else
- std::tm timeinfo;
- ::localtime_r(&now, &timeinfo);
- written = std::strftime(storage, sizeof(storage), "%F %T", &timeinfo);
+ std::tm timeinfo;
+ std::tm *timeinfo_p = &timeinfo;
+ ::localtime_r(&now, &timeinfo);
#endif
+
+ tz_len = std::strftime(tz_offset, sizeof(tz_offset), "%z", timeinfo_p);
+
+ if (tz_len < kTzOffsetLen && tz_len > 1) {
+ // Timezone offset was written. strftime writes offset as +HHMM or -HHMM,
+ // RFC3339 specifies an offset as +HH:MM or -HH:MM. To convert, we parse
+ // the offset as an integer, then reprint it to a string.
+
+ offset_minutes = ::strtol(tz_offset, NULL, 10);
+ if (offset_minutes < 0) {
+ offset_minutes *= -1;
+ tz_offset_sign = '-';
+ }
+
+ tz_len = ::snprintf(tz_offset, sizeof(tz_offset), "%c%02li:%02li",
+ tz_offset_sign, offset_minutes / 100, offset_minutes % 100);
+ CHECK(tz_len == kTzOffsetLen);
+ ((void)tz_len); // Prevent unused variable warning in optimized build.
} else {
+ // Unknown offset. RFC3339 specifies that unknown local offsets should be
+ // written as UTC time with -00:00 timezone.
#if defined(BENCHMARK_OS_WINDOWS)
- written = std::strftime(storage, sizeof(storage), "%x %X", ::gmtime(&now));
+ // Potential race condition if another thread calls localtime or gmtime.
+ timeinfo_p = ::gmtime(&now);
#else
- std::tm timeinfo;
::gmtime_r(&now, &timeinfo);
- written = std::strftime(storage, sizeof(storage), "%F %T", &timeinfo);
#endif
+
+ strncpy(tz_offset, "-00:00", kTzOffsetLen + 1);
}
- CHECK(written < kStorageSize);
- ((void)written); // prevent unused variable in optimized mode.
- return std::string(storage);
-}
-} // end namespace
+ timestamp_len = std::strftime(storage, sizeof(storage), "%Y-%m-%dT%H:%M:%S",
+ timeinfo_p);
+ CHECK(timestamp_len == kTimestampLen);
+ // Prevent unused variable warning in optimized build.
+ ((void)kTimestampLen);
-std::string LocalDateTimeString() { return DateTimeString(true); }
+ std::strncat(storage, tz_offset, sizeof(storage) - timestamp_len - 1);
+ return std::string(storage);
+}
} // end namespace benchmark
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endforeach()
endmacro()
+
--- /dev/null
+TEST_COPTS = [
+ "-pedantic",
+ "-pedantic-errors",
+ "-std=c++11",
+ "-Wall",
+ "-Wextra",
+ "-Wshadow",
+ # "-Wshorten-64-to-32",
+ "-Wfloat-equal",
+ "-fstrict-aliasing",
+]
+
+PER_SRC_COPTS = ({
+ "cxx03_test.cc": ["-std=c++03"],
+ # Some of the issues with DoNotOptimize only occur when optimization is enabled
+ "donotoptimize_test.cc": ["-O3"],
+})
+
+TEST_ARGS = ["--benchmark_min_time=0.01"]
+
+PER_SRC_TEST_ARGS = ({
+ "user_counters_tabular_test.cc": ["--benchmark_counters_tabular=true"],
+ "repetitions_test.cc": [" --benchmark_repetitions=3"],
+})
+
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
+
+cc_library(
+ name = "output_test_helper",
+ testonly = 1,
+ srcs = ["output_test_helper.cc"],
+ hdrs = ["output_test.h"],
+ copts = TEST_COPTS,
+ deps = [
+ "//:benchmark",
+ "//:benchmark_internal_headers",
+ ],
+)
+
+[
+ cc_test(
+ name = test_src[:-len(".cc")],
+ size = "small",
+ srcs = [test_src],
+ args = TEST_ARGS + PER_SRC_TEST_ARGS.get(test_src, []),
+ copts = TEST_COPTS + PER_SRC_COPTS.get(test_src, []),
+ deps = [
+ ":output_test_helper",
+ "//:benchmark",
+ "//:benchmark_internal_headers",
+ "@com_google_googletest//:gtest",
+ ] + (
+ ["@com_google_googletest//:gtest_main"] if (test_src[-len("gtest.cc"):] == "gtest.cc") else []
+ ),
+ # FIXME: Add support for assembly tests to bazel.
+ # See Issue #556
+ # https://github.com/google/benchmark/issues/556
+ )
+ for test_src in glob(
+ ["*test.cc"],
+ exclude = [
+ "*_assembly_test.cc",
+ "link_main_test.cc",
+ ],
+ )
+]
+
+cc_test(
+ name = "link_main_test",
+ size = "small",
+ srcs = ["link_main_test.cc"],
+ copts = TEST_COPTS,
+ deps = ["//:benchmark_main"],
+)
macro(compile_benchmark_test name)
add_executable(${name} "${name}.cc")
- target_link_libraries(${name} benchmark ${CMAKE_THREAD_LIBS_INIT})
+ target_link_libraries(${name} benchmark::benchmark ${CMAKE_THREAD_LIBS_INIT})
endmacro(compile_benchmark_test)
macro(compile_benchmark_test_with_main name)
add_executable(${name} "${name}.cc")
- target_link_libraries(${name} benchmark_main)
+ target_link_libraries(${name} benchmark::benchmark_main)
endmacro(compile_benchmark_test_with_main)
macro(compile_output_test name)
add_executable(${name} "${name}.cc" output_test.h)
- target_link_libraries(${name} output_test_helper benchmark
+ target_link_libraries(${name} output_test_helper benchmark::benchmark
${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endmacro(compile_output_test)
# Demonstration executable
compile_benchmark_test(benchmark_test)
-add_test(benchmark benchmark_test --benchmark_min_time=0.01)
+add_test(NAME benchmark COMMAND benchmark_test --benchmark_min_time=0.01)
compile_benchmark_test(filter_test)
macro(add_filter_test name filter expect)
- add_test(${name} filter_test --benchmark_min_time=0.01 --benchmark_filter=${filter} ${expect})
- add_test(${name}_list_only filter_test --benchmark_list_tests --benchmark_filter=${filter} ${expect})
+ add_test(NAME ${name} COMMAND filter_test --benchmark_min_time=0.01 --benchmark_filter=${filter} ${expect})
+ add_test(NAME ${name}_list_only COMMAND filter_test --benchmark_list_tests --benchmark_filter=${filter} ${expect})
endmacro(add_filter_test)
add_filter_test(filter_simple "Foo" 3)
add_filter_test(filter_regex_end_negative "-.*Ba$" 4)
compile_benchmark_test(options_test)
-add_test(options_benchmarks options_test --benchmark_min_time=0.01)
+add_test(NAME options_benchmarks COMMAND options_test --benchmark_min_time=0.01)
compile_benchmark_test(basic_test)
-add_test(basic_benchmark basic_test --benchmark_min_time=0.01)
+add_test(NAME basic_benchmark COMMAND basic_test --benchmark_min_time=0.01)
+
+compile_output_test(repetitions_test)
+add_test(NAME repetitions_benchmark COMMAND repetitions_test --benchmark_min_time=0.01 --benchmark_repetitions=3)
compile_benchmark_test(diagnostics_test)
-add_test(diagnostics_test diagnostics_test --benchmark_min_time=0.01)
+add_test(NAME diagnostics_test COMMAND diagnostics_test --benchmark_min_time=0.01)
compile_benchmark_test(skip_with_error_test)
-add_test(skip_with_error_test skip_with_error_test --benchmark_min_time=0.01)
+add_test(NAME skip_with_error_test COMMAND skip_with_error_test --benchmark_min_time=0.01)
compile_benchmark_test(donotoptimize_test)
# Some of the issues with DoNotOptimize only occur when optimization is enabled
if (BENCHMARK_HAS_O3_FLAG)
set_target_properties(donotoptimize_test PROPERTIES COMPILE_FLAGS "-O3")
endif()
-add_test(donotoptimize_test donotoptimize_test --benchmark_min_time=0.01)
+add_test(NAME donotoptimize_test COMMAND donotoptimize_test --benchmark_min_time=0.01)
compile_benchmark_test(fixture_test)
-add_test(fixture_test fixture_test --benchmark_min_time=0.01)
+add_test(NAME fixture_test COMMAND fixture_test --benchmark_min_time=0.01)
compile_benchmark_test(register_benchmark_test)
-add_test(register_benchmark_test register_benchmark_test --benchmark_min_time=0.01)
+add_test(NAME register_benchmark_test COMMAND register_benchmark_test --benchmark_min_time=0.01)
compile_benchmark_test(map_test)
-add_test(map_test map_test --benchmark_min_time=0.01)
+add_test(NAME map_test COMMAND map_test --benchmark_min_time=0.01)
compile_benchmark_test(multiple_ranges_test)
-add_test(multiple_ranges_test multiple_ranges_test --benchmark_min_time=0.01)
+add_test(NAME multiple_ranges_test COMMAND multiple_ranges_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(args_product_test)
+add_test(NAME args_product_test COMMAND args_product_test --benchmark_min_time=0.01)
compile_benchmark_test_with_main(link_main_test)
-add_test(link_main_test link_main_test --benchmark_min_time=0.01)
+add_test(NAME link_main_test COMMAND link_main_test --benchmark_min_time=0.01)
compile_output_test(reporter_output_test)
-add_test(reporter_output_test reporter_output_test --benchmark_min_time=0.01)
+add_test(NAME reporter_output_test COMMAND reporter_output_test --benchmark_min_time=0.01)
compile_output_test(templated_fixture_test)
-add_test(templated_fixture_test templated_fixture_test --benchmark_min_time=0.01)
+add_test(NAME templated_fixture_test COMMAND templated_fixture_test --benchmark_min_time=0.01)
compile_output_test(user_counters_test)
-add_test(user_counters_test user_counters_test --benchmark_min_time=0.01)
+add_test(NAME user_counters_test COMMAND user_counters_test --benchmark_min_time=0.01)
+
+compile_output_test(perf_counters_test)
+add_test(NAME perf_counters_test COMMAND perf_counters_test --benchmark_min_time=0.01 --benchmark_perf_counters=CYCLES,BRANCHES)
+
+compile_output_test(internal_threading_test)
+add_test(NAME internal_threading_test COMMAND internal_threading_test --benchmark_min_time=0.01)
compile_output_test(report_aggregates_only_test)
-add_test(report_aggregates_only_test report_aggregates_only_test --benchmark_min_time=0.01)
+add_test(NAME report_aggregates_only_test COMMAND report_aggregates_only_test --benchmark_min_time=0.01)
compile_output_test(display_aggregates_only_test)
-add_test(display_aggregates_only_test display_aggregates_only_test --benchmark_min_time=0.01)
+add_test(NAME display_aggregates_only_test COMMAND display_aggregates_only_test --benchmark_min_time=0.01)
compile_output_test(user_counters_tabular_test)
-add_test(user_counters_tabular_test user_counters_tabular_test --benchmark_counters_tabular=true --benchmark_min_time=0.01)
+add_test(NAME user_counters_tabular_test COMMAND user_counters_tabular_test --benchmark_counters_tabular=true --benchmark_min_time=0.01)
compile_output_test(user_counters_thousands_test)
-add_test(user_counters_thousands_test user_counters_thousands_test --benchmark_min_time=0.01)
+add_test(NAME user_counters_thousands_test COMMAND user_counters_thousands_test --benchmark_min_time=0.01)
compile_output_test(memory_manager_test)
-add_test(memory_manager_test memory_manager_test --benchmark_min_time=0.01)
+add_test(NAME memory_manager_test COMMAND memory_manager_test --benchmark_min_time=0.01)
check_cxx_compiler_flag(-std=c++03 BENCHMARK_HAS_CXX03_FLAG)
if (BENCHMARK_HAS_CXX03_FLAG)
compile_benchmark_test(cxx03_test)
set_target_properties(cxx03_test
PROPERTIES
- COMPILE_FLAGS "-std=c++03")
+ CXX_STANDARD 98
+ CXX_STANDARD_REQUIRED YES)
# libstdc++ provides different definitions within <map> between dialects. When
# LTO is enabled and -Werror is specified GCC diagnoses this ODR violation
# causing the test to fail to compile. To prevent this we explicitly disable
PROPERTIES
LINK_FLAGS "-Wno-odr")
endif()
- add_test(cxx03 cxx03_test --benchmark_min_time=0.01)
+ add_test(NAME cxx03 COMMAND cxx03_test --benchmark_min_time=0.01)
endif()
# Attempt to work around flaky test failures when running on Appveyor servers.
set(COMPLEXITY_MIN_TIME "0.01")
endif()
compile_output_test(complexity_test)
-add_test(complexity_benchmark complexity_test --benchmark_min_time=${COMPLEXITY_MIN_TIME})
+add_test(NAME complexity_benchmark COMMAND complexity_test --benchmark_min_time=${COMPLEXITY_MIN_TIME})
###############################################################################
# GoogleTest Unit Tests
if (BENCHMARK_ENABLE_GTEST_TESTS)
macro(compile_gtest name)
add_executable(${name} "${name}.cc")
- if (TARGET googletest)
- add_dependencies(${name} googletest)
- endif()
- if (GTEST_INCLUDE_DIRS)
- target_include_directories(${name} PRIVATE ${GTEST_INCLUDE_DIRS})
- endif()
- target_link_libraries(${name} benchmark
- ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+ target_link_libraries(${name} benchmark::benchmark
+ gmock_main ${CMAKE_THREAD_LIBS_INIT})
endmacro(compile_gtest)
macro(add_gtest name)
compile_gtest(${name})
- add_test(${name} ${name})
+ add_test(NAME ${name} COMMAND ${name})
endmacro()
add_gtest(benchmark_gtest)
+ add_gtest(benchmark_name_gtest)
+ add_gtest(benchmark_random_interleaving_gtest)
+ add_gtest(commandlineflags_gtest)
add_gtest(statistics_gtest)
add_gtest(string_util_gtest)
+ add_gtest(perf_counters_gtest)
endif(BENCHMARK_ENABLE_GTEST_TESTS)
###############################################################################
--- /dev/null
+#include "benchmark/benchmark.h"
+
+#include <cassert>
+#include <iostream>
+#include <set>
+#include <vector>
+
+class ArgsProductFixture : public ::benchmark::Fixture {
+ public:
+ ArgsProductFixture()
+ : expectedValues({{0, 100, 2000, 30000},
+ {1, 15, 3, 8},
+ {1, 15, 3, 9},
+ {1, 15, 7, 8},
+ {1, 15, 7, 9},
+ {1, 15, 10, 8},
+ {1, 15, 10, 9},
+ {2, 15, 3, 8},
+ {2, 15, 3, 9},
+ {2, 15, 7, 8},
+ {2, 15, 7, 9},
+ {2, 15, 10, 8},
+ {2, 15, 10, 9},
+ {4, 5, 6, 11}}) {}
+
+ void SetUp(const ::benchmark::State& state) BENCHMARK_OVERRIDE {
+ std::vector<int64_t> ranges = {state.range(0), state.range(1),
+ state.range(2), state.range(3)};
+
+ assert(expectedValues.find(ranges) != expectedValues.end());
+
+ actualValues.insert(ranges);
+ }
+
+ // NOTE: This is not TearDown as we want to check after _all_ runs are
+ // complete.
+ virtual ~ArgsProductFixture() {
+ if (actualValues != expectedValues) {
+ std::cout << "EXPECTED\n";
+ for (auto v : expectedValues) {
+ std::cout << "{";
+ for (int64_t iv : v) {
+ std::cout << iv << ", ";
+ }
+ std::cout << "}\n";
+ }
+ std::cout << "ACTUAL\n";
+ for (auto v : actualValues) {
+ std::cout << "{";
+ for (int64_t iv : v) {
+ std::cout << iv << ", ";
+ }
+ std::cout << "}\n";
+ }
+ }
+ }
+
+ std::set<std::vector<int64_t>> expectedValues;
+ std::set<std::vector<int64_t>> actualValues;
+};
+
+BENCHMARK_DEFINE_F(ArgsProductFixture, Empty)(benchmark::State& state) {
+ for (auto _ : state) {
+ int64_t product =
+ state.range(0) * state.range(1) * state.range(2) * state.range(3);
+ for (int64_t x = 0; x < product; x++) {
+ benchmark::DoNotOptimize(x);
+ }
+ }
+}
+
+BENCHMARK_REGISTER_F(ArgsProductFixture, Empty)
+ ->Args({0, 100, 2000, 30000})
+ ->ArgsProduct({{1, 2}, {15}, {3, 7, 10}, {8, 9}})
+ ->Args({4, 5, 6, 11});
+
+BENCHMARK_MAIN();
void BM_KeepRunning(benchmark::State& state) {
- size_t iter_count = 0;
+ benchmark::IterationCount iter_count = 0;
assert(iter_count == state.iterations());
while (state.KeepRunning()) {
++iter_count;
BENCHMARK(BM_KeepRunning);
void BM_KeepRunningBatch(benchmark::State& state) {
- // Choose a prime batch size to avoid evenly dividing max_iterations.
- const size_t batch_size = 101;
- size_t iter_count = 0;
+ // Choose a batch size >1000 to skip the typical runs with iteration
+ // targets of 10, 100 and 1000. If these are not actually skipped the
+ // bug would be detectable as consecutive runs with the same iteration
+ // count. Below we assert that this does not happen.
+ const benchmark::IterationCount batch_size = 1009;
+
+ static benchmark::IterationCount prior_iter_count = 0;
+ benchmark::IterationCount iter_count = 0;
while (state.KeepRunningBatch(batch_size)) {
iter_count += batch_size;
}
assert(state.iterations() == iter_count);
+
+ // Verify that the iteration count always increases across runs (see
+ // comment above).
+ assert(iter_count == batch_size // max_iterations == 1
+ || iter_count > prior_iter_count); // max_iterations > batch_size
+ prior_iter_count = iter_count;
}
-BENCHMARK(BM_KeepRunningBatch);
+// Register with a fixed repetition count to establish the invariant that
+// the iteration count should always change across runs. This overrides
+// the --benchmark_repetitions command line flag, which would otherwise
+// cause this test to fail if set > 1.
+BENCHMARK(BM_KeepRunningBatch)->Repetitions(1);
void BM_RangedFor(benchmark::State& state) {
- size_t iter_count = 0;
+ benchmark::IterationCount iter_count = 0;
for (auto _ : state) {
++iter_count;
}
+#include <map>
+#include <string>
#include <vector>
#include "../src/benchmark_register.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+namespace benchmark {
+namespace internal {
+extern std::map<std::string, std::string>* global_context;
+
namespace {
TEST(AddRangeTest, Simple) {
EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15));
}
-} // end namespace
+TEST(AddRangeTest, FullRange8) {
+ std::vector<int8_t> dst;
+ AddRange(&dst, int8_t{1}, std::numeric_limits<int8_t>::max(), 8);
+ EXPECT_THAT(dst, testing::ElementsAre(1, 8, 64, 127));
+}
+
+TEST(AddRangeTest, FullRange64) {
+ std::vector<int64_t> dst;
+ AddRange(&dst, int64_t{1}, std::numeric_limits<int64_t>::max(), 1024);
+ EXPECT_THAT(
+ dst, testing::ElementsAre(1LL, 1024LL, 1048576LL, 1073741824LL,
+ 1099511627776LL, 1125899906842624LL,
+ 1152921504606846976LL, 9223372036854775807LL));
+}
+
+TEST(AddRangeTest, NegativeRanges) {
+ std::vector<int> dst;
+ AddRange(&dst, -8, 0, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(-8, -4, -2, -1, 0));
+}
+
+TEST(AddRangeTest, StrictlyNegative) {
+ std::vector<int> dst;
+ AddRange(&dst, -8, -1, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(-8, -4, -2, -1));
+}
+
+TEST(AddRangeTest, SymmetricNegativeRanges) {
+ std::vector<int> dst;
+ AddRange(&dst, -8, 8, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(-8, -4, -2, -1, 0, 1, 2, 4, 8));
+}
+
+TEST(AddRangeTest, SymmetricNegativeRangesOddMult) {
+ std::vector<int> dst;
+ AddRange(&dst, -30, 32, 5);
+ EXPECT_THAT(dst, testing::ElementsAre(-30, -25, -5, -1, 0, 1, 5, 25, 32));
+}
+
+TEST(AddRangeTest, NegativeRangesAsymmetric) {
+ std::vector<int> dst;
+ AddRange(&dst, -3, 5, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(-3, -2, -1, 0, 1, 2, 4, 5));
+}
+
+TEST(AddRangeTest, NegativeRangesLargeStep) {
+ // Always include -1, 0, 1 when crossing zero.
+ std::vector<int> dst;
+ AddRange(&dst, -8, 8, 10);
+ EXPECT_THAT(dst, testing::ElementsAre(-8, -1, 0, 1, 8));
+}
+
+TEST(AddRangeTest, ZeroOnlyRange) {
+ std::vector<int> dst;
+ AddRange(&dst, 0, 0, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(0));
+}
+
+TEST(AddRangeTest, ZeroStartingRange) {
+ std::vector<int> dst;
+ AddRange(&dst, 0, 2, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(0, 1, 2));
+}
+
+TEST(AddRangeTest, NegativeRange64) {
+ std::vector<int64_t> dst;
+ AddRange<int64_t>(&dst, -4, 4, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(-4, -2, -1, 0, 1, 2, 4));
+}
+
+TEST(AddRangeTest, NegativeRangePreservesExistingOrder) {
+ // If elements already exist in the range, ensure we don't change
+ // their ordering by adding negative values.
+ std::vector<int64_t> dst = {1, 2, 3};
+ AddRange<int64_t>(&dst, -2, 2, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(1, 2, 3, -2, -1, 0, 1, 2));
+}
+
+TEST(AddRangeTest, FullNegativeRange64) {
+ std::vector<int64_t> dst;
+ const auto min = std::numeric_limits<int64_t>::min();
+ const auto max = std::numeric_limits<int64_t>::max();
+ AddRange(&dst, min, max, 1024);
+ EXPECT_THAT(
+ dst, testing::ElementsAreArray(std::vector<int64_t>{
+ min, -1152921504606846976LL, -1125899906842624LL,
+ -1099511627776LL, -1073741824LL, -1048576LL, -1024LL, -1LL, 0LL,
+ 1LL, 1024LL, 1048576LL, 1073741824LL, 1099511627776LL,
+ 1125899906842624LL, 1152921504606846976LL, max}));
+}
+
+TEST(AddRangeTest, Simple8) {
+ std::vector<int8_t> dst;
+ AddRange<int8_t>(&dst, 1, 8, 2);
+ EXPECT_THAT(dst, testing::ElementsAre(1, 2, 4, 8));
+}
+
+TEST(AddCustomContext, Simple) {
+ EXPECT_THAT(global_context, nullptr);
+
+ AddCustomContext("foo", "bar");
+ AddCustomContext("baz", "qux");
+
+ EXPECT_THAT(*global_context,
+ testing::UnorderedElementsAre(testing::Pair("foo", "bar"),
+ testing::Pair("baz", "qux")));
+
+ delete global_context;
+ global_context = nullptr;
+}
+
+TEST(AddCustomContext, DuplicateKey) {
+ EXPECT_THAT(global_context, nullptr);
+
+ AddCustomContext("foo", "bar");
+ AddCustomContext("foo", "qux");
+
+ EXPECT_THAT(*global_context,
+ testing::UnorderedElementsAre(testing::Pair("foo", "bar")));
+
+ delete global_context;
+ global_context = nullptr;
+}
+
+} // namespace
+} // namespace internal
+} // namespace benchmark
--- /dev/null
+#include "benchmark/benchmark.h"
+#include "gtest/gtest.h"
+
+namespace {
+
+using namespace benchmark;
+using namespace benchmark::internal;
+
+TEST(BenchmarkNameTest, Empty) {
+ const auto name = BenchmarkName();
+ EXPECT_EQ(name.str(), std::string());
+}
+
+TEST(BenchmarkNameTest, FunctionName) {
+ auto name = BenchmarkName();
+ name.function_name = "function_name";
+ EXPECT_EQ(name.str(), "function_name");
+}
+
+TEST(BenchmarkNameTest, FunctionNameAndArgs) {
+ auto name = BenchmarkName();
+ name.function_name = "function_name";
+ name.args = "some_args:3/4/5";
+ EXPECT_EQ(name.str(), "function_name/some_args:3/4/5");
+}
+
+TEST(BenchmarkNameTest, MinTime) {
+ auto name = BenchmarkName();
+ name.function_name = "function_name";
+ name.args = "some_args:3/4";
+ name.min_time = "min_time:3.4s";
+ EXPECT_EQ(name.str(), "function_name/some_args:3/4/min_time:3.4s");
+}
+
+TEST(BenchmarkNameTest, Iterations) {
+ auto name = BenchmarkName();
+ name.function_name = "function_name";
+ name.min_time = "min_time:3.4s";
+ name.iterations = "iterations:42";
+ EXPECT_EQ(name.str(), "function_name/min_time:3.4s/iterations:42");
+}
+
+TEST(BenchmarkNameTest, Repetitions) {
+ auto name = BenchmarkName();
+ name.function_name = "function_name";
+ name.min_time = "min_time:3.4s";
+ name.repetitions = "repetitions:24";
+ EXPECT_EQ(name.str(), "function_name/min_time:3.4s/repetitions:24");
+}
+
+TEST(BenchmarkNameTest, TimeType) {
+ auto name = BenchmarkName();
+ name.function_name = "function_name";
+ name.min_time = "min_time:3.4s";
+ name.time_type = "hammer_time";
+ EXPECT_EQ(name.str(), "function_name/min_time:3.4s/hammer_time");
+}
+
+TEST(BenchmarkNameTest, Threads) {
+ auto name = BenchmarkName();
+ name.function_name = "function_name";
+ name.min_time = "min_time:3.4s";
+ name.threads = "threads:256";
+ EXPECT_EQ(name.str(), "function_name/min_time:3.4s/threads:256");
+}
+
+TEST(BenchmarkNameTest, TestEmptyFunctionName) {
+ auto name = BenchmarkName();
+ name.args = "first:3/second:4";
+ name.threads = "threads:22";
+ EXPECT_EQ(name.str(), "first:3/second:4/threads:22");
+}
+
+} // end namespace
--- /dev/null
+#include <queue>
+#include <string>
+#include <vector>
+
+#include "../src/commandlineflags.h"
+#include "../src/string_util.h"
+#include "benchmark/benchmark.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+DECLARE_bool(benchmark_enable_random_interleaving);
+DECLARE_string(benchmark_filter);
+DECLARE_int32(benchmark_repetitions);
+
+namespace benchmark {
+namespace internal {
+namespace {
+
+class EventQueue : public std::queue<std::string> {
+ public:
+ void Put(const std::string& event) { push(event); }
+
+ void Clear() {
+ while (!empty()) {
+ pop();
+ }
+ }
+
+ std::string Get() {
+ std::string event = front();
+ pop();
+ return event;
+ }
+};
+
+static EventQueue* queue = new EventQueue;
+
+class NullReporter : public BenchmarkReporter {
+ public:
+ bool ReportContext(const Context& /*context*/) override { return true; }
+ void ReportRuns(const std::vector<Run>& /* report */) override {}
+};
+
+class BenchmarkTest : public testing::Test {
+ public:
+ static void SetupHook(int /* num_threads */) { queue->push("Setup"); }
+
+ static void TeardownHook(int /* num_threads */) { queue->push("Teardown"); }
+
+ void Execute(const std::string& pattern) {
+ queue->Clear();
+
+ BenchmarkReporter* reporter = new NullReporter;
+ FLAGS_benchmark_filter = pattern;
+ RunSpecifiedBenchmarks(reporter);
+ delete reporter;
+
+ queue->Put("DONE"); // End marker
+ }
+};
+
+static void BM_Match1(benchmark::State& state) {
+ const int64_t arg = state.range(0);
+
+ for (auto _ : state) {
+ }
+ queue->Put(StrFormat("BM_Match1/%d", static_cast<int>(arg)));
+}
+BENCHMARK(BM_Match1)
+ ->Iterations(100)
+ ->Arg(1)
+ ->Arg(2)
+ ->Arg(3)
+ ->Range(10, 80)
+ ->Args({90})
+ ->Args({100});
+
+TEST_F(BenchmarkTest, Match1) {
+ Execute("BM_Match1");
+ ASSERT_EQ("BM_Match1/1", queue->Get());
+ ASSERT_EQ("BM_Match1/2", queue->Get());
+ ASSERT_EQ("BM_Match1/3", queue->Get());
+ ASSERT_EQ("BM_Match1/10", queue->Get());
+ ASSERT_EQ("BM_Match1/64", queue->Get());
+ ASSERT_EQ("BM_Match1/80", queue->Get());
+ ASSERT_EQ("BM_Match1/90", queue->Get());
+ ASSERT_EQ("BM_Match1/100", queue->Get());
+ ASSERT_EQ("DONE", queue->Get());
+}
+
+TEST_F(BenchmarkTest, Match1WithRepetition) {
+ FLAGS_benchmark_repetitions = 2;
+
+ Execute("BM_Match1/(64|80)");
+ ASSERT_EQ("BM_Match1/64", queue->Get());
+ ASSERT_EQ("BM_Match1/64", queue->Get());
+ ASSERT_EQ("BM_Match1/80", queue->Get());
+ ASSERT_EQ("BM_Match1/80", queue->Get());
+ ASSERT_EQ("DONE", queue->Get());
+}
+
+TEST_F(BenchmarkTest, Match1WithRandomInterleaving) {
+ FLAGS_benchmark_enable_random_interleaving = true;
+ FLAGS_benchmark_repetitions = 100;
+
+ std::map<std::string, int> element_count;
+ std::map<std::string, int> interleaving_count;
+ Execute("BM_Match1/(64|80)");
+ for (int i = 0; i < 100; ++i) {
+ std::vector<std::string> interleaving;
+ interleaving.push_back(queue->Get());
+ interleaving.push_back(queue->Get());
+ element_count[interleaving[0].c_str()]++;
+ element_count[interleaving[1].c_str()]++;
+ interleaving_count[StrFormat("%s,%s", interleaving[0].c_str(),
+ interleaving[1].c_str())]++;
+ }
+ EXPECT_EQ(element_count["BM_Match1/64"], 100) << "Unexpected repetitions.";
+ EXPECT_EQ(element_count["BM_Match1/80"], 100) << "Unexpected repetitions.";
+ EXPECT_GE(interleaving_count.size(), 2) << "Interleaving was not randomized.";
+ ASSERT_EQ("DONE", queue->Get());
+}
+
+} // namespace
+} // namespace internal
+} // namespace benchmark
--- /dev/null
+#include <cstdlib>
+
+#include "../src/commandlineflags.h"
+#include "../src/internal_macros.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace benchmark {
+namespace {
+
+#if defined(BENCHMARK_OS_WINDOWS)
+int setenv(const char* name, const char* value, int overwrite) {
+ if (!overwrite) {
+ // NOTE: getenv_s is far superior but not available under mingw.
+ char* env_value = getenv(name);
+ if (env_value == nullptr) {
+ return -1;
+ }
+ }
+ return _putenv_s(name, value);
+}
+
+int unsetenv(const char* name) { return _putenv_s(name, ""); }
+
+#endif // BENCHMARK_OS_WINDOWS
+
+TEST(BoolFromEnv, Default) {
+ ASSERT_EQ(unsetenv("NOT_IN_ENV"), 0);
+ EXPECT_EQ(BoolFromEnv("not_in_env", true), true);
+}
+
+TEST(BoolFromEnv, False) {
+ ASSERT_EQ(setenv("IN_ENV", "0", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "N", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "n", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "NO", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "No", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "no", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "F", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "f", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "FALSE", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "False", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "false", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "OFF", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "Off", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "off", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", true), false);
+ unsetenv("IN_ENV");
+}
+
+TEST(BoolFromEnv, True) {
+ ASSERT_EQ(setenv("IN_ENV", "1", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "Y", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "y", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "YES", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "Yes", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "yes", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "T", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "t", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "TRUE", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "True", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "true", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "ON", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "On", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+ ASSERT_EQ(setenv("IN_ENV", "on", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+
+#ifndef BENCHMARK_OS_WINDOWS
+ ASSERT_EQ(setenv("IN_ENV", "", 1), 0);
+ EXPECT_EQ(BoolFromEnv("in_env", false), true);
+ unsetenv("IN_ENV");
+#endif
+}
+
+TEST(Int32FromEnv, NotInEnv) {
+ ASSERT_EQ(unsetenv("NOT_IN_ENV"), 0);
+ EXPECT_EQ(Int32FromEnv("not_in_env", 42), 42);
+}
+
+TEST(Int32FromEnv, InvalidInteger) {
+ ASSERT_EQ(setenv("IN_ENV", "foo", 1), 0);
+ EXPECT_EQ(Int32FromEnv("in_env", 42), 42);
+ unsetenv("IN_ENV");
+}
+
+TEST(Int32FromEnv, ValidInteger) {
+ ASSERT_EQ(setenv("IN_ENV", "42", 1), 0);
+ EXPECT_EQ(Int32FromEnv("in_env", 64), 42);
+ unsetenv("IN_ENV");
+}
+
+TEST(DoubleFromEnv, NotInEnv) {
+ ASSERT_EQ(unsetenv("NOT_IN_ENV"), 0);
+ EXPECT_EQ(DoubleFromEnv("not_in_env", 0.51), 0.51);
+}
+
+TEST(DoubleFromEnv, InvalidReal) {
+ ASSERT_EQ(setenv("IN_ENV", "foo", 1), 0);
+ EXPECT_EQ(DoubleFromEnv("in_env", 0.51), 0.51);
+ unsetenv("IN_ENV");
+}
+
+TEST(DoubleFromEnv, ValidReal) {
+ ASSERT_EQ(setenv("IN_ENV", "0.51", 1), 0);
+ EXPECT_EQ(DoubleFromEnv("in_env", 0.71), 0.51);
+ unsetenv("IN_ENV");
+}
+
+TEST(StringFromEnv, Default) {
+ ASSERT_EQ(unsetenv("NOT_IN_ENV"), 0);
+ EXPECT_STREQ(StringFromEnv("not_in_env", "foo"), "foo");
+}
+
+TEST(StringFromEnv, Valid) {
+ ASSERT_EQ(setenv("IN_ENV", "foo", 1), 0);
+ EXPECT_STREQ(StringFromEnv("in_env", "bar"), "foo");
+ unsetenv("IN_ENV");
+}
+
+TEST(KvPairsFromEnv, Default) {
+ ASSERT_EQ(unsetenv("NOT_IN_ENV"), 0);
+ EXPECT_THAT(KvPairsFromEnv("not_in_env", {{"foo", "bar"}}),
+ testing::ElementsAre(testing::Pair("foo", "bar")));
+}
+
+TEST(KvPairsFromEnv, MalformedReturnsDefault) {
+ ASSERT_EQ(setenv("IN_ENV", "foo", 1), 0);
+ EXPECT_THAT(KvPairsFromEnv("in_env", {{"foo", "bar"}}),
+ testing::ElementsAre(testing::Pair("foo", "bar")));
+ unsetenv("IN_ENV");
+}
+
+TEST(KvPairsFromEnv, Single) {
+ ASSERT_EQ(setenv("IN_ENV", "foo=bar", 1), 0);
+ EXPECT_THAT(KvPairsFromEnv("in_env", {}),
+ testing::ElementsAre(testing::Pair("foo", "bar")));
+ unsetenv("IN_ENV");
+}
+
+TEST(KvPairsFromEnv, Multiple) {
+ ASSERT_EQ(setenv("IN_ENV", "foo=bar,baz=qux", 1), 0);
+ EXPECT_THAT(KvPairsFromEnv("in_env", {}),
+ testing::UnorderedElementsAre(testing::Pair("foo", "bar"),
+ testing::Pair("baz", "qux")));
+ unsetenv("IN_ENV");
+}
+
+} // namespace
+} // namespace benchmark
int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__)
int AddComplexityTest(std::string test_name, std::string big_o_test_name,
- std::string rms_test_name, std::string big_o) {
+ std::string rms_test_name, std::string big_o,
+ int family_index) {
SetSubstitutions({{"%name", test_name},
{"%bigo_name", big_o_test_name},
{"%rms_name", rms_test_name},
{{"^%bigo_name %bigo_str %bigo_str[ ]*$"},
{"^%bigo_name", MR_Not}, // Assert we we didn't only matched a name.
{"^%rms_name %rms %rms[ ]*$", MR_Next}});
- AddCases(TC_JSONOut, {{"\"name\": \"%bigo_name\",$"},
- {"\"run_name\": \"%name\",$", MR_Next},
- {"\"run_type\": \"aggregate\",$", MR_Next},
- {"\"aggregate_name\": \"BigO\",$", MR_Next},
- {"\"cpu_coefficient\": %float,$", MR_Next},
- {"\"real_coefficient\": %float,$", MR_Next},
- {"\"big_o\": \"%bigo\",$", MR_Next},
- {"\"time_unit\": \"ns\"$", MR_Next},
- {"}", MR_Next},
- {"\"name\": \"%rms_name\",$"},
- {"\"run_name\": \"%name\",$", MR_Next},
- {"\"run_type\": \"aggregate\",$", MR_Next},
- {"\"aggregate_name\": \"RMS\",$", MR_Next},
- {"\"rms\": %float$", MR_Next},
- {"}", MR_Next}});
+ AddCases(
+ TC_JSONOut,
+ {{"\"name\": \"%bigo_name\",$"},
+ {"\"family_index\": " + std::to_string(family_index) + ",$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"%name\",$", MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": %int,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"BigO\",$", MR_Next},
+ {"\"cpu_coefficient\": %float,$", MR_Next},
+ {"\"real_coefficient\": %float,$", MR_Next},
+ {"\"big_o\": \"%bigo\",$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next},
+ {"\"name\": \"%rms_name\",$"},
+ {"\"family_index\": " + std::to_string(family_index) + ",$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"%name\",$", MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": %int,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"RMS\",$", MR_Next},
+ {"\"rms\": %float$", MR_Next},
+ {"}", MR_Next}});
AddCases(TC_CSVOut, {{"^\"%bigo_name\",,%float,%float,%bigo,,,,,$"},
{"^\"%bigo_name\"", MR_Not},
{"^\"%rms_name\",,%float,%float,,,,,,$", MR_Next}});
}
BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity(benchmark::o1);
BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity();
-BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity([](int64_t) {
- return 1.0;
-});
+BENCHMARK(BM_Complexity_O1)
+ ->Range(1, 1 << 18)
+ ->Complexity([](benchmark::IterationCount) { return 1.0; });
const char *one_test_name = "BM_Complexity_O1";
const char *big_o_1_test_name = "BM_Complexity_O1_BigO";
// Add enum tests
ADD_COMPLEXITY_CASES(one_test_name, big_o_1_test_name, rms_o_1_test_name,
- enum_big_o_1);
+ enum_big_o_1, /*family_index=*/0);
// Add auto enum tests
ADD_COMPLEXITY_CASES(one_test_name, big_o_1_test_name, rms_o_1_test_name,
- auto_big_o_1);
+ auto_big_o_1, /*family_index=*/1);
// Add lambda tests
ADD_COMPLEXITY_CASES(one_test_name, big_o_1_test_name, rms_o_1_test_name,
- lambda_big_o_1);
+ lambda_big_o_1, /*family_index=*/2);
// ========================================================================= //
// --------------------------- Testing BigO O(N) --------------------------- //
BENCHMARK(BM_Complexity_O_N)
->RangeMultiplier(2)
->Range(1 << 10, 1 << 16)
- ->Complexity([](int64_t n) -> double { return static_cast<double>(n); });
+ ->Complexity([](benchmark::IterationCount n) -> double {
+ return static_cast<double>(n);
+ });
BENCHMARK(BM_Complexity_O_N)
->RangeMultiplier(2)
->Range(1 << 10, 1 << 16)
// Add enum tests
ADD_COMPLEXITY_CASES(n_test_name, big_o_n_test_name, rms_o_n_test_name,
- enum_auto_big_o_n);
+ enum_auto_big_o_n, /*family_index=*/3);
// Add lambda tests
ADD_COMPLEXITY_CASES(n_test_name, big_o_n_test_name, rms_o_n_test_name,
- lambda_big_o_n);
+ lambda_big_o_n, /*family_index=*/4);
// ========================================================================= //
// ------------------------- Testing BigO O(N*lgN) ------------------------- //
BENCHMARK(BM_Complexity_O_N_log_N)
->RangeMultiplier(2)
->Range(1 << 10, 1 << 16)
- ->Complexity([](int64_t n) { return kLog2E * n * log(static_cast<double>(n)); });
+ ->Complexity([](benchmark::IterationCount n) {
+ return kLog2E * n * log(static_cast<double>(n));
+ });
BENCHMARK(BM_Complexity_O_N_log_N)
->RangeMultiplier(2)
->Range(1 << 10, 1 << 16)
// Add enum tests
ADD_COMPLEXITY_CASES(n_lg_n_test_name, big_o_n_lg_n_test_name,
- rms_o_n_lg_n_test_name, enum_auto_big_o_n_lg_n);
+ rms_o_n_lg_n_test_name, enum_auto_big_o_n_lg_n,
+ /*family_index=*/6);
// Add lambda tests
ADD_COMPLEXITY_CASES(n_lg_n_test_name, big_o_n_lg_n_test_name,
- rms_o_n_lg_n_test_name, lambda_big_o_n_lg_n);
+ rms_o_n_lg_n_test_name, lambda_big_o_n_lg_n,
+ /*family_index=*/7);
+
+// ========================================================================= //
+// -------- Testing formatting of Complexity with captured args ------------ //
+// ========================================================================= //
+
+void BM_ComplexityCaptureArgs(benchmark::State& state, int n) {
+ for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
+ }
+ state.SetComplexityN(n);
+}
+
+BENCHMARK_CAPTURE(BM_ComplexityCaptureArgs, capture_test, 100)
+ ->Complexity(benchmark::oN)
+ ->Ranges({{1, 2}, {3, 4}});
+
+const std::string complexity_capture_name =
+ "BM_ComplexityCaptureArgs/capture_test";
+
+ADD_COMPLEXITY_CASES(complexity_capture_name, complexity_capture_name + "_BigO",
+ complexity_capture_name + "_RMS", "N", /*family_index=*/9);
// ========================================================================= //
// --------------------------- TEST CASES END ------------------------------ //
void BM_empty(benchmark::State& state) {
while (state.KeepRunning()) {
- volatile std::size_t x = state.iterations();
+ volatile benchmark::IterationCount x = state.iterations();
((void)x);
}
}
-#include "benchmark/benchmark.h"
-
+#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdlib>
-
#include <iostream>
#include <limits>
#include <sstream>
#include <string>
+#include "benchmark/benchmark.h"
+
namespace {
class TestReporter : public benchmark::ConsoleReporter {
public:
- virtual bool ReportContext(const Context& context) {
+ virtual bool ReportContext(const Context& context) BENCHMARK_OVERRIDE {
return ConsoleReporter::ReportContext(context);
};
- virtual void ReportRuns(const std::vector<Run>& report) {
+ virtual void ReportRuns(const std::vector<Run>& report) BENCHMARK_OVERRIDE {
++count_;
+ max_family_index_ =
+ std::max<size_t>(max_family_index_, report[0].family_index);
ConsoleReporter::ReportRuns(report);
};
- TestReporter() : count_(0) {}
+ TestReporter() : count_(0), max_family_index_(0) {}
virtual ~TestReporter() {}
size_t GetCount() const { return count_; }
+ size_t GetMaxFamilyIndex() const { return max_family_index_; }
+
private:
mutable size_t count_;
+ mutable size_t max_family_index_;
};
} // end namespace
<< std::endl;
return -1;
}
+
+ const size_t max_family_index = test_reporter.GetMaxFamilyIndex();
+ const size_t num_families = reports_count == 0 ? 0 : 1 + max_family_index;
+ if (num_families != expected_reports) {
+ std::cerr << "ERROR: Expected " << expected_reports
+ << " test families to be run but num_families = "
+ << num_families << std::endl;
+ return -1;
+ }
}
return 0;
#include <cassert>
#include <memory>
-class MyFixture : public ::benchmark::Fixture {
+#define FIXTURE_BECHMARK_NAME MyFixture
+
+class FIXTURE_BECHMARK_NAME : public ::benchmark::Fixture {
public:
- void SetUp(const ::benchmark::State& state) {
+ void SetUp(const ::benchmark::State& state) BENCHMARK_OVERRIDE {
if (state.thread_index == 0) {
assert(data.get() == nullptr);
data.reset(new int(42));
}
}
- void TearDown(const ::benchmark::State& state) {
+ void TearDown(const ::benchmark::State& state) BENCHMARK_OVERRIDE {
if (state.thread_index == 0) {
assert(data.get() != nullptr);
data.reset();
}
}
- ~MyFixture() { assert(data == nullptr); }
+ ~FIXTURE_BECHMARK_NAME() { assert(data == nullptr); }
std::unique_ptr<int> data;
};
-BENCHMARK_F(MyFixture, Foo)(benchmark::State &st) {
+BENCHMARK_F(FIXTURE_BECHMARK_NAME, Foo)(benchmark::State &st) {
assert(data.get() != nullptr);
assert(*data == 42);
for (auto _ : st) {
}
}
-BENCHMARK_DEFINE_F(MyFixture, Bar)(benchmark::State& st) {
+BENCHMARK_DEFINE_F(FIXTURE_BECHMARK_NAME, Bar)(benchmark::State& st) {
if (st.thread_index == 0) {
assert(data.get() != nullptr);
assert(*data == 42);
}
st.SetItemsProcessed(st.range(0));
}
-BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42);
-BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42)->ThreadPerCpu();
+BENCHMARK_REGISTER_F(FIXTURE_BECHMARK_NAME, Bar)->Arg(42);
+BENCHMARK_REGISTER_F(FIXTURE_BECHMARK_NAME, Bar)->Arg(42)->ThreadPerCpu();
BENCHMARK_MAIN();
--- /dev/null
+
+#undef NDEBUG
+
+#include <chrono>
+#include <thread>
+#include "../src/timers.h"
+#include "benchmark/benchmark.h"
+#include "output_test.h"
+
+static const std::chrono::duration<double, std::milli> time_frame(50);
+static const double time_frame_in_sec(
+ std::chrono::duration_cast<std::chrono::duration<double, std::ratio<1, 1>>>(
+ time_frame)
+ .count());
+
+void MyBusySpinwait() {
+ const auto start = benchmark::ChronoClockNow();
+
+ while (true) {
+ const auto now = benchmark::ChronoClockNow();
+ const auto elapsed = now - start;
+
+ if (std::chrono::duration<double, std::chrono::seconds::period>(elapsed) >=
+ time_frame)
+ return;
+ }
+}
+
+// ========================================================================= //
+// --------------------------- TEST CASES BEGIN ---------------------------- //
+// ========================================================================= //
+
+// ========================================================================= //
+// BM_MainThread
+
+void BM_MainThread(benchmark::State& state) {
+ for (auto _ : state) {
+ MyBusySpinwait();
+ state.SetIterationTime(time_frame_in_sec);
+ }
+ state.counters["invtime"] =
+ benchmark::Counter{1, benchmark::Counter::kIsRate};
+}
+
+BENCHMARK(BM_MainThread)->Iterations(1)->Threads(1);
+BENCHMARK(BM_MainThread)->Iterations(1)->Threads(1)->UseRealTime();
+BENCHMARK(BM_MainThread)->Iterations(1)->Threads(1)->UseManualTime();
+BENCHMARK(BM_MainThread)->Iterations(1)->Threads(1)->MeasureProcessCPUTime();
+BENCHMARK(BM_MainThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->MeasureProcessCPUTime()
+ ->UseRealTime();
+BENCHMARK(BM_MainThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->MeasureProcessCPUTime()
+ ->UseManualTime();
+
+BENCHMARK(BM_MainThread)->Iterations(1)->Threads(2);
+BENCHMARK(BM_MainThread)->Iterations(1)->Threads(2)->UseRealTime();
+BENCHMARK(BM_MainThread)->Iterations(1)->Threads(2)->UseManualTime();
+BENCHMARK(BM_MainThread)->Iterations(1)->Threads(2)->MeasureProcessCPUTime();
+BENCHMARK(BM_MainThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->MeasureProcessCPUTime()
+ ->UseRealTime();
+BENCHMARK(BM_MainThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->MeasureProcessCPUTime()
+ ->UseManualTime();
+
+// ========================================================================= //
+// BM_WorkerThread
+
+void BM_WorkerThread(benchmark::State& state) {
+ for (auto _ : state) {
+ std::thread Worker(&MyBusySpinwait);
+ Worker.join();
+ state.SetIterationTime(time_frame_in_sec);
+ }
+ state.counters["invtime"] =
+ benchmark::Counter{1, benchmark::Counter::kIsRate};
+}
+
+BENCHMARK(BM_WorkerThread)->Iterations(1)->Threads(1);
+BENCHMARK(BM_WorkerThread)->Iterations(1)->Threads(1)->UseRealTime();
+BENCHMARK(BM_WorkerThread)->Iterations(1)->Threads(1)->UseManualTime();
+BENCHMARK(BM_WorkerThread)->Iterations(1)->Threads(1)->MeasureProcessCPUTime();
+BENCHMARK(BM_WorkerThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->MeasureProcessCPUTime()
+ ->UseRealTime();
+BENCHMARK(BM_WorkerThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->MeasureProcessCPUTime()
+ ->UseManualTime();
+
+BENCHMARK(BM_WorkerThread)->Iterations(1)->Threads(2);
+BENCHMARK(BM_WorkerThread)->Iterations(1)->Threads(2)->UseRealTime();
+BENCHMARK(BM_WorkerThread)->Iterations(1)->Threads(2)->UseManualTime();
+BENCHMARK(BM_WorkerThread)->Iterations(1)->Threads(2)->MeasureProcessCPUTime();
+BENCHMARK(BM_WorkerThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->MeasureProcessCPUTime()
+ ->UseRealTime();
+BENCHMARK(BM_WorkerThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->MeasureProcessCPUTime()
+ ->UseManualTime();
+
+// ========================================================================= //
+// BM_MainThreadAndWorkerThread
+
+void BM_MainThreadAndWorkerThread(benchmark::State& state) {
+ for (auto _ : state) {
+ std::thread Worker(&MyBusySpinwait);
+ MyBusySpinwait();
+ Worker.join();
+ state.SetIterationTime(time_frame_in_sec);
+ }
+ state.counters["invtime"] =
+ benchmark::Counter{1, benchmark::Counter::kIsRate};
+}
+
+BENCHMARK(BM_MainThreadAndWorkerThread)->Iterations(1)->Threads(1);
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->UseRealTime();
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->UseManualTime();
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->MeasureProcessCPUTime();
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->MeasureProcessCPUTime()
+ ->UseRealTime();
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(1)
+ ->MeasureProcessCPUTime()
+ ->UseManualTime();
+
+BENCHMARK(BM_MainThreadAndWorkerThread)->Iterations(1)->Threads(2);
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->UseRealTime();
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->UseManualTime();
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->MeasureProcessCPUTime();
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->MeasureProcessCPUTime()
+ ->UseRealTime();
+BENCHMARK(BM_MainThreadAndWorkerThread)
+ ->Iterations(1)
+ ->Threads(2)
+ ->MeasureProcessCPUTime()
+ ->UseManualTime();
+
+// ========================================================================= //
+// ---------------------------- TEST CASES END ----------------------------- //
+// ========================================================================= //
+
+int main(int argc, char* argv[]) { RunOutputTests(argc, argv); }
// Using fixtures.
class MapFixture : public ::benchmark::Fixture {
public:
- void SetUp(const ::benchmark::State& st) {
+ void SetUp(const ::benchmark::State& st) BENCHMARK_OVERRIDE {
m = ConstructRandomMap(static_cast<int>(st.range(0)));
}
- void TearDown(const ::benchmark::State&) { m.clear(); }
+ void TearDown(const ::benchmark::State&) BENCHMARK_OVERRIDE { m.clear(); }
std::map<int, int> m;
};
#include "output_test.h"
class TestMemoryManager : public benchmark::MemoryManager {
- void Start() {}
- void Stop(Result* result) {
+ void Start() BENCHMARK_OVERRIDE {}
+ void Stop(Result* result) BENCHMARK_OVERRIDE {
result->num_allocs = 42;
result->max_bytes_used = 42000;
}
ADD_CASES(TC_ConsoleOut, {{"^BM_empty %console_report$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_empty\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_empty\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
{"}", MR_Next}});
ADD_CASES(TC_CSVOut, {{"^\"BM_empty\",%csv_report$"}});
-
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
std::unique_ptr<benchmark::MemoryManager> mm(new TestMemoryManager());
benchmark::RegisterMemoryManager(mm.get());
{2, 7, 15},
{7, 6, 3}}) {}
- void SetUp(const ::benchmark::State& state) {
+ void SetUp(const ::benchmark::State& state) BENCHMARK_OVERRIDE {
std::vector<int64_t> ranges = {state.range(0), state.range(1),
state.range(2)};
// NOTE: This is not TearDown as we want to check after _all_ runs are
// complete.
virtual ~MultipleRangesFixture() {
- assert(actualValues.size() == expectedValues.size());
- if (actualValues.size() != expectedValues.size()) {
+ if (actualValues != expectedValues) {
std::cout << "EXPECTED\n";
for (auto v : expectedValues) {
std::cout << "{";
BENCHMARK(BM_basic_slow)->Arg(10)->Unit(benchmark::kNanosecond);
BENCHMARK(BM_basic_slow)->Arg(100)->Unit(benchmark::kMicrosecond);
BENCHMARK(BM_basic_slow)->Arg(1000)->Unit(benchmark::kMillisecond);
+BENCHMARK(BM_basic_slow)->Arg(1000)->Unit(benchmark::kSecond);
BENCHMARK(BM_basic)->Range(1, 8);
BENCHMARK(BM_basic)->RangeMultiplier(2)->Range(1, 8);
BENCHMARK(BM_basic)->DenseRange(10, 15);
BENCHMARK(BM_basic)->ThreadRange(2, 4);
BENCHMARK(BM_basic)->ThreadPerCpu();
BENCHMARK(BM_basic)->Repetitions(3);
+BENCHMARK(BM_basic)
+ ->RangeMultiplier(std::numeric_limits<int>::max())
+ ->Range(std::numeric_limits<int64_t>::min(),
+ std::numeric_limits<int64_t>::max());
+
+// Negative ranges
+BENCHMARK(BM_basic)->Range(-64, -1);
+BENCHMARK(BM_basic)->RangeMultiplier(4)->Range(-8, 8);
+BENCHMARK(BM_basic)->DenseRange(-2, 2, 1);
+BENCHMARK(BM_basic)->Ranges({{-64, 1}, {-8, -1}});
void CustomArgs(benchmark::internal::Benchmark* b) {
for (int i = 0; i < 10; ++i) {
// clang-format off
-#define _CHECK_RESULT_VALUE(entry, getfn, var_type, var_name, relationship, value) \
+#define CHECK_RESULT_VALUE_IMPL(entry, getfn, var_type, var_name, relationship, value) \
CONCAT(CHECK_, relationship) \
(entry.getfn< var_type >(var_name), (value)) << "\n" \
<< __FILE__ << ":" << __LINE__ << ": " << (entry).name << ":\n" \
// check with tolerance. eps_factor is the tolerance window, which is
// interpreted relative to value (eg, 0.1 means 10% of value).
-#define _CHECK_FLOAT_RESULT_VALUE(entry, getfn, var_type, var_name, relationship, value, eps_factor) \
+#define CHECK_FLOAT_RESULT_VALUE_IMPL(entry, getfn, var_type, var_name, relationship, value, eps_factor) \
CONCAT(CHECK_FLOAT_, relationship) \
(entry.getfn< var_type >(var_name), (value), (eps_factor) * (value)) << "\n" \
<< __FILE__ << ":" << __LINE__ << ": " << (entry).name << ":\n" \
<< "%)"
#define CHECK_RESULT_VALUE(entry, var_type, var_name, relationship, value) \
- _CHECK_RESULT_VALUE(entry, GetAs, var_type, var_name, relationship, value)
+ CHECK_RESULT_VALUE_IMPL(entry, GetAs, var_type, var_name, relationship, value)
#define CHECK_COUNTER_VALUE(entry, var_type, var_name, relationship, value) \
- _CHECK_RESULT_VALUE(entry, GetCounterAs, var_type, var_name, relationship, value)
+ CHECK_RESULT_VALUE_IMPL(entry, GetCounterAs, var_type, var_name, relationship, value)
#define CHECK_FLOAT_RESULT_VALUE(entry, var_name, relationship, value, eps_factor) \
- _CHECK_FLOAT_RESULT_VALUE(entry, GetAs, double, var_name, relationship, value, eps_factor)
+ CHECK_FLOAT_RESULT_VALUE_IMPL(entry, GetAs, double, var_name, relationship, value, eps_factor)
#define CHECK_FLOAT_COUNTER_VALUE(entry, var_name, relationship, value, eps_factor) \
- _CHECK_FLOAT_RESULT_VALUE(entry, GetCounterAs, double, var_name, relationship, value, eps_factor)
+ CHECK_FLOAT_RESULT_VALUE_IMPL(entry, GetCounterAs, double, var_name, relationship, value, eps_factor)
// clang-format on
{" %s ", "[ ]+"},
{"%time", "[ ]*" + time_re + "[ ]+ns"},
{"%console_report", "[ ]*" + time_re + "[ ]+ns [ ]*" + time_re + "[ ]+ns [ ]*[0-9]+"},
+ {"%console_us_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*[0-9]+"},
+ {"%console_ms_report", "[ ]*" + time_re + "[ ]+ms [ ]*" + time_re + "[ ]+ms [ ]*[0-9]+"},
+ {"%console_s_report", "[ ]*" + time_re + "[ ]+s [ ]*" + time_re + "[ ]+s [ ]*[0-9]+"},
{"%console_time_only_report", "[ ]*" + time_re + "[ ]+ns [ ]*" + time_re + "[ ]+ns"},
{"%console_us_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*[0-9]+"},
{"%console_us_time_only_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us"},
"items_per_second,label,error_occurred,error_message"},
{"%csv_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns,,,,,"},
{"%csv_us_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",us,,,,,"},
+ {"%csv_ms_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ms,,,,,"},
+ {"%csv_s_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",s,,,,,"},
{"%csv_bytes_report",
"[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns," + safe_dec_re + ",,,,"},
{"%csv_items_report",
TestReporter(std::vector<benchmark::BenchmarkReporter*> reps)
: reporters_(reps) {}
- virtual bool ReportContext(const Context& context) {
+ virtual bool ReportContext(const Context& context) BENCHMARK_OVERRIDE {
bool last_ret = false;
bool first = true;
for (auto rep : reporters_) {
return last_ret;
}
- void ReportRuns(const std::vector<Run>& report) {
+ void ReportRuns(const std::vector<Run>& report) BENCHMARK_OVERRIDE {
for (auto rep : reporters_) rep->ReportRuns(report);
}
- void Finalize() {
+ void Finalize() BENCHMARK_OVERRIDE {
for (auto rep : reporters_) rep->Finalize();
}
return 0;
}
+// Disable deprecated warnings temporarily because we need to reference
+// CSVReporter but don't want to trigger -Werror=-Wdeprecated-declarations
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
void RunOutputTests(int argc, char* argv[]) {
using internal::GetTestCaseList;
benchmark::Initialize(&argc, argv);
internal::GetResultsChecker().CheckResults(csv.out_stream);
}
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
int SubstrCnt(const std::string& haystack, const std::string& pat) {
if (pat.length() == 0) return 0;
int count = 0;
--- /dev/null
+#include <thread>
+
+#include "../src/perf_counters.h"
+#include "gtest/gtest.h"
+
+#ifndef GTEST_SKIP
+struct MsgHandler {
+ void operator=(std::ostream&){}
+};
+#define GTEST_SKIP() return MsgHandler() = std::cout
+#endif
+
+using benchmark::internal::PerfCounters;
+using benchmark::internal::PerfCounterValues;
+
+namespace {
+const char kGenericPerfEvent1[] = "CYCLES";
+const char kGenericPerfEvent2[] = "BRANCHES";
+const char kGenericPerfEvent3[] = "INSTRUCTIONS";
+
+TEST(PerfCountersTest, Init) {
+ EXPECT_EQ(PerfCounters::Initialize(), PerfCounters::kSupported);
+}
+
+TEST(PerfCountersTest, OneCounter) {
+ if (!PerfCounters::kSupported) {
+ GTEST_SKIP() << "Performance counters not supported.\n";
+ }
+ EXPECT_TRUE(PerfCounters::Initialize());
+ EXPECT_TRUE(PerfCounters::Create({kGenericPerfEvent1}).IsValid());
+}
+
+TEST(PerfCountersTest, NegativeTest) {
+ if (!PerfCounters::kSupported) {
+ EXPECT_FALSE(PerfCounters::Initialize());
+ return;
+ }
+ EXPECT_TRUE(PerfCounters::Initialize());
+ EXPECT_FALSE(PerfCounters::Create({}).IsValid());
+ EXPECT_FALSE(PerfCounters::Create({""}).IsValid());
+ EXPECT_FALSE(PerfCounters::Create({"not a counter name"}).IsValid());
+ {
+ EXPECT_TRUE(PerfCounters::Create({kGenericPerfEvent1, kGenericPerfEvent2,
+ kGenericPerfEvent3})
+ .IsValid());
+ }
+ EXPECT_FALSE(
+ PerfCounters::Create({kGenericPerfEvent2, "", kGenericPerfEvent1})
+ .IsValid());
+ EXPECT_FALSE(PerfCounters::Create({kGenericPerfEvent3, "not a counter name",
+ kGenericPerfEvent1})
+ .IsValid());
+ {
+ EXPECT_TRUE(PerfCounters::Create({kGenericPerfEvent1, kGenericPerfEvent2,
+ kGenericPerfEvent3})
+ .IsValid());
+ }
+ EXPECT_FALSE(
+ PerfCounters::Create({kGenericPerfEvent1, kGenericPerfEvent2,
+ kGenericPerfEvent3, "MISPREDICTED_BRANCH_RETIRED"})
+ .IsValid());
+}
+
+TEST(PerfCountersTest, Read1Counter) {
+ if (!PerfCounters::kSupported) {
+ GTEST_SKIP() << "Test skipped because libpfm is not supported.\n";
+ }
+ EXPECT_TRUE(PerfCounters::Initialize());
+ auto counters = PerfCounters::Create({kGenericPerfEvent1});
+ EXPECT_TRUE(counters.IsValid());
+ PerfCounterValues values1(1);
+ EXPECT_TRUE(counters.Snapshot(&values1));
+ EXPECT_GT(values1[0], 0);
+ PerfCounterValues values2(1);
+ EXPECT_TRUE(counters.Snapshot(&values2));
+ EXPECT_GT(values2[0], 0);
+ EXPECT_GT(values2[0], values1[0]);
+}
+
+TEST(PerfCountersTest, Read2Counters) {
+ if (!PerfCounters::kSupported) {
+ GTEST_SKIP() << "Test skipped because libpfm is not supported.\n";
+ }
+ EXPECT_TRUE(PerfCounters::Initialize());
+ auto counters =
+ PerfCounters::Create({kGenericPerfEvent1, kGenericPerfEvent2});
+ EXPECT_TRUE(counters.IsValid());
+ PerfCounterValues values1(2);
+ EXPECT_TRUE(counters.Snapshot(&values1));
+ EXPECT_GT(values1[0], 0);
+ EXPECT_GT(values1[1], 0);
+ PerfCounterValues values2(2);
+ EXPECT_TRUE(counters.Snapshot(&values2));
+ EXPECT_GT(values2[0], 0);
+ EXPECT_GT(values2[1], 0);
+}
+
+size_t do_work() {
+ size_t res = 0;
+ for (size_t i = 0; i < 100000000; ++i) res += i * i;
+ return res;
+}
+
+void measure(size_t threadcount, PerfCounterValues* values1,
+ PerfCounterValues* values2) {
+ CHECK_NE(values1, nullptr);
+ CHECK_NE(values2, nullptr);
+ std::vector<std::thread> threads(threadcount);
+ auto work = [&]() { CHECK(do_work() > 1000); };
+
+ // We need to first set up the counters, then start the threads, so the
+ // threads would inherit the counters. But later, we need to first destroy the
+ // thread pool (so all the work finishes), then measure the counters. So the
+ // scopes overlap, and we need to explicitly control the scope of the
+ // threadpool.
+ auto counters =
+ PerfCounters::Create({kGenericPerfEvent1, kGenericPerfEvent3});
+ for (auto& t : threads) t = std::thread(work);
+ counters.Snapshot(values1);
+ for (auto& t : threads) t.join();
+ counters.Snapshot(values2);
+}
+
+TEST(PerfCountersTest, MultiThreaded) {
+ if (!PerfCounters::kSupported) {
+ GTEST_SKIP() << "Test skipped because libpfm is not supported.";
+ }
+ EXPECT_TRUE(PerfCounters::Initialize());
+ PerfCounterValues values1(2);
+ PerfCounterValues values2(2);
+
+ measure(2, &values1, &values2);
+ std::vector<double> D1{static_cast<double>(values2[0] - values1[0]),
+ static_cast<double>(values2[1] - values1[1])};
+
+ measure(4, &values1, &values2);
+ std::vector<double> D2{static_cast<double>(values2[0] - values1[0]),
+ static_cast<double>(values2[1] - values1[1])};
+
+ // Some extra work will happen on the main thread - like joining the threads
+ // - so the ratio won't be quite 2.0, but very close.
+ EXPECT_GE(D2[0], 1.9 * D1[0]);
+ EXPECT_GE(D2[1], 1.9 * D1[1]);
+}
+} // namespace
--- /dev/null
+#undef NDEBUG
+
+#include "../src/perf_counters.h"
+
+#include "benchmark/benchmark.h"
+#include "output_test.h"
+
+void BM_Simple(benchmark::State& state) {
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(state.iterations());
+ }
+}
+BENCHMARK(BM_Simple);
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Simple\",$"}});
+
+void CheckSimple(Results const& e) {
+ CHECK_COUNTER_VALUE(e, double, "CYCLES", GT, 0);
+ CHECK_COUNTER_VALUE(e, double, "BRANCHES", GT, 0.0);
+}
+CHECK_BENCHMARK_RESULTS("BM_Simple", &CheckSimple);
+
+int main(int argc, char* argv[]) {
+ if (!benchmark::internal::PerfCounters::kSupported) {
+ return 0;
+ }
+ RunOutputTests(argc, argv);
+}
class TestReporter : public benchmark::ConsoleReporter {
public:
- virtual void ReportRuns(const std::vector<Run>& report) {
+ virtual void ReportRuns(const std::vector<Run>& report) BENCHMARK_OVERRIDE {
all_runs_.insert(all_runs_.end(), begin(report), end(report));
ConsoleReporter::ReportRuns(report);
}
--- /dev/null
+
+#include "benchmark/benchmark.h"
+#include "output_test.h"
+
+// ========================================================================= //
+// ------------------------ Testing Basic Output --------------------------- //
+// ========================================================================= //
+
+void BM_ExplicitRepetitions(benchmark::State& state) {
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_ExplicitRepetitions)->Repetitions(2);
+
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_ExplicitRepetitions/repeats:2 %console_report$"}});
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_ExplicitRepetitions/repeats:2 %console_report$"}});
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_ExplicitRepetitions/repeats:2_mean %console_report$"}});
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_ExplicitRepetitions/repeats:2_median %console_report$"}});
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_ExplicitRepetitions/repeats:2_stddev %console_report$"}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_ExplicitRepetitions/repeats:2\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ExplicitRepetitions/repeats:2\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_ExplicitRepetitions/repeats:2\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ExplicitRepetitions/repeats:2\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_ExplicitRepetitions/repeats:2_mean\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ExplicitRepetitions/repeats:2\",$", MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"mean\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_ExplicitRepetitions/repeats:2_median\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ExplicitRepetitions/repeats:2\",$", MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"median\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_ExplicitRepetitions/repeats:2_stddev\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ExplicitRepetitions/repeats:2\",$", MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"stddev\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_ExplicitRepetitions/repeats:2\",%csv_report$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_ExplicitRepetitions/repeats:2\",%csv_report$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_ExplicitRepetitions/repeats:2_mean\",%csv_report$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_ExplicitRepetitions/repeats:2_median\",%csv_report$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_ExplicitRepetitions/repeats:2_stddev\",%csv_report$"}});
+
+// ========================================================================= //
+// ------------------------ Testing Basic Output --------------------------- //
+// ========================================================================= //
+
+void BM_ImplicitRepetitions(benchmark::State& state) {
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_ImplicitRepetitions);
+
+ADD_CASES(TC_ConsoleOut, {{"^BM_ImplicitRepetitions %console_report$"}});
+ADD_CASES(TC_ConsoleOut, {{"^BM_ImplicitRepetitions %console_report$"}});
+ADD_CASES(TC_ConsoleOut, {{"^BM_ImplicitRepetitions %console_report$"}});
+ADD_CASES(TC_ConsoleOut, {{"^BM_ImplicitRepetitions_mean %console_report$"}});
+ADD_CASES(TC_ConsoleOut, {{"^BM_ImplicitRepetitions_median %console_report$"}});
+ADD_CASES(TC_ConsoleOut, {{"^BM_ImplicitRepetitions_stddev %console_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_ImplicitRepetitions\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ImplicitRepetitions\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_ImplicitRepetitions\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ImplicitRepetitions\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_ImplicitRepetitions\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ImplicitRepetitions\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_ImplicitRepetitions_mean\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ImplicitRepetitions\",$", MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"mean\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_ImplicitRepetitions_median\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ImplicitRepetitions\",$", MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"median\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_ImplicitRepetitions_stddev\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_ImplicitRepetitions\",$", MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"stddev\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_ImplicitRepetitions\",%csv_report$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_ImplicitRepetitions\",%csv_report$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_ImplicitRepetitions_mean\",%csv_report$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_ImplicitRepetitions_median\",%csv_report$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_ImplicitRepetitions_stddev\",%csv_report$"}});
+
+// ========================================================================= //
+// --------------------------- TEST CASES END ------------------------------ //
+// ========================================================================= //
+
+int main(int argc, char* argv[]) { RunOutputTests(argc, argv); }
static int AddContextCases() {
AddCases(TC_ConsoleErr,
{
- {"%int[-/]%int[-/]%int %int:%int:%int$", MR_Default},
+ {"^%int-%int-%intT%int:%int:%int[-+]%int:%int$", MR_Default},
{"Running .*/reporter_output_test(\\.exe)?$", MR_Next},
{"Run on \\(%int X %float MHz CPU s?\\)", MR_Next},
});
MR_Next},
{"\"num_cpus\": %int,$", MR_Next},
{"\"mhz_per_cpu\": %float,$", MR_Next},
- {"\"cpu_scaling_enabled\": ", MR_Next},
- {"\"caches\": \\[$", MR_Next}});
+ {"\"caches\": \\[$", MR_Default}});
auto const& Info = benchmark::CPUInfo::Get();
auto const& Caches = Info.caches;
if (!Caches.empty()) {
for (size_t I = 0; I < Caches.size(); ++I) {
std::string num_caches_str =
Caches[I].num_sharing != 0 ? " \\(x%int\\)$" : "$";
- AddCases(
- TC_ConsoleErr,
- {{"L%int (Data|Instruction|Unified) %intK" + num_caches_str, MR_Next}});
+ AddCases(TC_ConsoleErr,
+ {{"L%int (Data|Instruction|Unified) %int KiB" + num_caches_str,
+ MR_Next}});
AddCases(TC_JSONOut, {{"\\{$", MR_Next},
{"\"type\": \"", MR_Next},
{"\"level\": %int,$", MR_Next},
ADD_CASES(TC_ConsoleOut, {{"^BM_basic %console_report$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_basic\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_basic\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
void BM_bytes_per_second(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
state.SetBytesProcessed(1);
}
ADD_CASES(TC_ConsoleOut, {{"^BM_bytes_per_second %console_report "
"bytes_per_second=%float[kM]{0,1}/s$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_bytes_per_second\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_bytes_per_second\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
void BM_items_per_second(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
state.SetItemsProcessed(1);
}
ADD_CASES(TC_ConsoleOut, {{"^BM_items_per_second %console_report "
"items_per_second=%float[kM]{0,1}/s$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_items_per_second\",$"},
+ {"\"family_index\": 2,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_items_per_second\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
ADD_CASES(TC_ConsoleOut, {{"^BM_label %console_report some label$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_label\",$"},
+ {"\"family_index\": 3,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_label\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
ADD_CASES(TC_CSVOut, {{"^\"BM_label\",%csv_label_report_begin\"some "
"label\"%csv_label_report_end$"}});
+// ========================================================================= //
+// ------------------------ Testing Time Label Output ---------------------- //
+// ========================================================================= //
+
+void BM_time_label_nanosecond(benchmark::State& state) {
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_time_label_nanosecond)->Unit(benchmark::kNanosecond);
+
+ADD_CASES(TC_ConsoleOut, {{"^BM_time_label_nanosecond %console_report$"}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_time_label_nanosecond\",$"},
+ {"\"family_index\": 4,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_time_label_nanosecond\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_time_label_nanosecond\",%csv_report$"}});
+
+void BM_time_label_microsecond(benchmark::State& state) {
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_time_label_microsecond)->Unit(benchmark::kMicrosecond);
+
+ADD_CASES(TC_ConsoleOut, {{"^BM_time_label_microsecond %console_us_report$"}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_time_label_microsecond\",$"},
+ {"\"family_index\": 5,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_time_label_microsecond\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"us\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_time_label_microsecond\",%csv_us_report$"}});
+
+void BM_time_label_millisecond(benchmark::State& state) {
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_time_label_millisecond)->Unit(benchmark::kMillisecond);
+
+ADD_CASES(TC_ConsoleOut, {{"^BM_time_label_millisecond %console_ms_report$"}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_time_label_millisecond\",$"},
+ {"\"family_index\": 6,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_time_label_millisecond\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ms\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_time_label_millisecond\",%csv_ms_report$"}});
+
+void BM_time_label_second(benchmark::State& state) {
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_time_label_second)->Unit(benchmark::kSecond);
+
+ADD_CASES(TC_ConsoleOut, {{"^BM_time_label_second %console_s_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_time_label_second\",$"},
+ {"\"family_index\": 7,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_time_label_second\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"s\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_time_label_second\",%csv_s_report$"}});
+
// ========================================================================= //
// ------------------------ Testing Error Output --------------------------- //
// ========================================================================= //
BENCHMARK(BM_error);
ADD_CASES(TC_ConsoleOut, {{"^BM_error[ ]+ERROR OCCURRED: 'message'$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_error\",$"},
+ {"\"family_index\": 8,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_error\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"error_occurred\": true,$", MR_Next},
{"\"error_message\": \"message\",$", MR_Next}});
BENCHMARK(BM_no_arg_name)->Arg(3);
ADD_CASES(TC_ConsoleOut, {{"^BM_no_arg_name/3 %console_report$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_no_arg_name/3\",$"},
+ {"\"family_index\": 9,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_no_arg_name/3\",$", MR_Next},
- {"\"run_type\": \"iteration\",$", MR_Next}});
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next}});
ADD_CASES(TC_CSVOut, {{"^\"BM_no_arg_name/3\",%csv_report$"}});
// ========================================================================= //
BENCHMARK(BM_arg_name)->ArgName("first")->Arg(3);
ADD_CASES(TC_ConsoleOut, {{"^BM_arg_name/first:3 %console_report$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_arg_name/first:3\",$"},
+ {"\"family_index\": 10,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_arg_name/first:3\",$", MR_Next},
- {"\"run_type\": \"iteration\",$", MR_Next}});
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next}});
ADD_CASES(TC_CSVOut, {{"^\"BM_arg_name/first:3\",%csv_report$"}});
// ========================================================================= //
{{"^BM_arg_names/first:2/5/third:4 %console_report$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_arg_names/first:2/5/third:4\",$"},
+ {"\"family_index\": 11,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_arg_names/first:2/5/third:4\",$", MR_Next},
- {"\"run_type\": \"iteration\",$", MR_Next}});
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next}});
ADD_CASES(TC_CSVOut, {{"^\"BM_arg_names/first:2/5/third:4\",%csv_report$"}});
+// ========================================================================= //
+// ------------------------ Testing Name Output ---------------------------- //
+// ========================================================================= //
+
+void BM_name(benchmark::State& state) {
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_name)->Name("BM_custom_name");
+
+ADD_CASES(TC_ConsoleOut, {{"^BM_custom_name %console_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_custom_name\",$"},
+ {"\"family_index\": 12,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_custom_name\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_custom_name\",%csv_report$"}});
+
// ========================================================================= //
// ------------------------ Testing Big Args Output ------------------------ //
// ========================================================================= //
void BM_Complexity_O1(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
state.SetComplexityN(state.range(0));
}
{"^BM_Repeat/repeats:2_median %console_time_only_report [ ]*2$"},
{"^BM_Repeat/repeats:2_stddev %console_time_only_report [ ]*2$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:2\",$"},
+ {"\"family_index\": 15,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:2\"", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:2\",$"},
+ {"\"family_index\": 15,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:2\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:2_mean\",$"},
+ {"\"family_index\": 15,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"mean\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:2_median\",$"},
+ {"\"family_index\": 15,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"median\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:2_stddev\",$"},
+ {"\"family_index\": 15,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"stddev\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next}});
ADD_CASES(TC_CSVOut, {{"^\"BM_Repeat/repeats:2\",%csv_report$"},
{"^BM_Repeat/repeats:3_median %console_time_only_report [ ]*3$"},
{"^BM_Repeat/repeats:3_stddev %console_time_only_report [ ]*3$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:3\",$"},
+ {"\"family_index\": 16,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:3\",$"},
+ {"\"family_index\": 16,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:3\",$"},
+ {"\"family_index\": 16,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:3_mean\",$"},
+ {"\"family_index\": 16,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"mean\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:3_median\",$"},
+ {"\"family_index\": 16,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"median\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:3_stddev\",$"},
+ {"\"family_index\": 16,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"stddev\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next}});
ADD_CASES(TC_CSVOut, {{"^\"BM_Repeat/repeats:3\",%csv_report$"},
{"^BM_Repeat/repeats:4_median %console_time_only_report [ ]*4$"},
{"^BM_Repeat/repeats:4_stddev %console_time_only_report [ ]*4$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:4\",$"},
+ {"\"family_index\": 17,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:4\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 4,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:4\",$"},
+ {"\"family_index\": 17,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:4\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 4,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:4\",$"},
+ {"\"family_index\": 17,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:4\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 4,$", MR_Next},
+ {"\"repetition_index\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:4\",$"},
+ {"\"family_index\": 17,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:4\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 4,$", MR_Next},
+ {"\"repetition_index\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:4_mean\",$"},
+ {"\"family_index\": 17,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:4\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 4,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"mean\",$", MR_Next},
{"\"iterations\": 4,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:4_median\",$"},
+ {"\"family_index\": 17,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:4\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 4,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"median\",$", MR_Next},
{"\"iterations\": 4,$", MR_Next},
{"\"name\": \"BM_Repeat/repeats:4_stddev\",$"},
+ {"\"family_index\": 17,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Repeat/repeats:4\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 4,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"stddev\",$", MR_Next},
{"\"iterations\": 4,$", MR_Next}});
ADD_CASES(TC_CSVOut, {{"^\"BM_Repeat/repeats:4\",%csv_report$"},
BENCHMARK(BM_RepeatOnce)->Repetitions(1)->ReportAggregatesOnly();
ADD_CASES(TC_ConsoleOut, {{"^BM_RepeatOnce/repeats:1 %console_report$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_RepeatOnce/repeats:1\",$"},
+ {"\"family_index\": 18,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_RepeatOnce/repeats:1\",$", MR_Next},
- {"\"run_type\": \"iteration\",$", MR_Next}});
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next}});
ADD_CASES(TC_CSVOut, {{"^\"BM_RepeatOnce/repeats:1\",%csv_report$"}});
// Test that non-aggregate data is not reported
ADD_CASES(TC_JSONOut,
{{".*BM_SummaryRepeat/repeats:3 ", MR_Not},
{"\"name\": \"BM_SummaryRepeat/repeats:3_mean\",$"},
+ {"\"family_index\": 19,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_SummaryRepeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"mean\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"name\": \"BM_SummaryRepeat/repeats:3_median\",$"},
+ {"\"family_index\": 19,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_SummaryRepeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"median\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"name\": \"BM_SummaryRepeat/repeats:3_stddev\",$"},
+ {"\"family_index\": 19,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_SummaryRepeat/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"stddev\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next}});
ADD_CASES(TC_CSVOut, {{".*BM_SummaryRepeat/repeats:3 ", MR_Not},
ADD_CASES(TC_JSONOut,
{{".*BM_SummaryDisplay/repeats:2 ", MR_Not},
{"\"name\": \"BM_SummaryDisplay/repeats:2_mean\",$"},
+ {"\"family_index\": 20,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_SummaryDisplay/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"mean\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next},
{"\"name\": \"BM_SummaryDisplay/repeats:2_median\",$"},
+ {"\"family_index\": 20,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_SummaryDisplay/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"median\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next},
{"\"name\": \"BM_SummaryDisplay/repeats:2_stddev\",$"},
+ {"\"family_index\": 20,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_SummaryDisplay/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"stddev\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next}});
ADD_CASES(TC_CSVOut,
ADD_CASES(TC_JSONOut,
{{".*BM_RepeatTimeUnit/repeats:3 ", MR_Not},
{"\"name\": \"BM_RepeatTimeUnit/repeats:3_mean\",$"},
+ {"\"family_index\": 21,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_RepeatTimeUnit/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"mean\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"time_unit\": \"us\",?$"},
{"\"name\": \"BM_RepeatTimeUnit/repeats:3_median\",$"},
+ {"\"family_index\": 21,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_RepeatTimeUnit/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"median\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"time_unit\": \"us\",?$"},
{"\"name\": \"BM_RepeatTimeUnit/repeats:3_stddev\",$"},
+ {"\"family_index\": 21,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_RepeatTimeUnit/repeats:3\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"stddev\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"time_unit\": \"us\",?$"}});
ADD_CASES(
TC_JSONOut,
{{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$"},
+ {"\"family_index\": 22,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$",
MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": 5,$", MR_Next},
{"\"real_time\": 1\\.5(0)*e\\+(0)*2,$", MR_Next},
{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$"},
+ {"\"family_index\": 22,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$",
MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": 5,$", MR_Next},
{"\"real_time\": 1\\.5(0)*e\\+(0)*2,$", MR_Next},
{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$"},
+ {"\"family_index\": 22,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$",
MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"repetition_index\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": 5,$", MR_Next},
{"\"real_time\": 1\\.5(0)*e\\+(0)*2,$", MR_Next},
{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time_mean\",$"},
+ {"\"family_index\": 22,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$",
MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"mean\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"real_time\": 1\\.5(0)*e\\+(0)*2,$", MR_Next},
{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time_median\",$"},
+ {"\"family_index\": 22,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$",
MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"median\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"real_time\": 1\\.5(0)*e\\+(0)*2,$", MR_Next},
{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time_stddev\",$"},
+ {"\"family_index\": 22,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$",
MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"stddev\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time_\",$"},
+ {"\"family_index\": 22,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$",
MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 3,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"\",$", MR_Next},
{"\"iterations\": 3,$", MR_Next},
{"\"real_time\": 1\\.5(0)*e\\+(0)*2,$", MR_Next}});
"manual_time_stddev\",%csv_report$"},
{"^\"BM_UserStats/iterations:5/repeats:3/manual_time_\",%csv_report$"}});
+// ========================================================================= //
+// ------------------------- Testing StrEscape JSON ------------------------ //
+// ========================================================================= //
+#if 0 // enable when csv testing code correctly handles multi-line fields
+void BM_JSON_Format(benchmark::State& state) {
+ state.SkipWithError("val\b\f\n\r\t\\\"with\"es,capes");
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_JSON_Format);
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_JSON_Format\",$"},
+ {"\"family_index\": 23,$", MR_Next},
+{"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_JSON_Format\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"error_occurred\": true,$", MR_Next},
+ {R"("error_message": "val\\b\\f\\n\\r\\t\\\\\\"with\\"es,capes",$)", MR_Next}});
+#endif
+// ========================================================================= //
+// -------------------------- Testing CsvEscape ---------------------------- //
+// ========================================================================= //
+
+void BM_CSV_Format(benchmark::State& state) {
+ state.SkipWithError("\"freedom\"");
+ for (auto _ : state) {
+ }
+}
+BENCHMARK(BM_CSV_Format);
+ADD_CASES(TC_CSVOut, {{"^\"BM_CSV_Format\",,,,,,,,true,\"\"\"freedom\"\"\"$"}});
+
// ========================================================================= //
// --------------------------- TEST CASES END ------------------------------ //
// ========================================================================= //
class TestReporter : public benchmark::ConsoleReporter {
public:
- virtual bool ReportContext(const Context& context) {
+ virtual bool ReportContext(const Context& context) BENCHMARK_OVERRIDE {
return ConsoleReporter::ReportContext(context);
};
- virtual void ReportRuns(const std::vector<Run>& report) {
+ virtual void ReportRuns(const std::vector<Run>& report) BENCHMARK_OVERRIDE {
all_runs_.insert(all_runs_.end(), begin(report), end(report));
ConsoleReporter::ReportRuns(report);
}
} // end namespace
+void BM_error_no_running(benchmark::State& state) {
+ state.SkipWithError("error message");
+}
+BENCHMARK(BM_error_no_running);
+ADD_CASES("BM_error_no_running", {{"", true, "error message"}});
+
void BM_error_before_running(benchmark::State& state) {
state.SkipWithError("error message");
while (state.KeepRunning()) {
for (auto _ : S) {
// CHECK: .L[[LOOP_HEAD:[a-zA-Z0-9_]+]]:
// CHECK-GNU-NEXT: subq $1, %rbx
- // CHECK-CLANG-NEXT: {{(addq \$1,|incq)}} %rax
+ // CHECK-CLANG-NEXT: {{(addq \$1, %rax|incq %rax|addq \$-1, %rbx)}}
// CHECK-NEXT: jne .L[[LOOP_HEAD]]
benchmark::DoNotOptimize(x);
}
TEST(StatisticsTest, StdDev) {
EXPECT_DOUBLE_EQ(benchmark::StatisticsStdDev({101, 101, 101, 101}), 0.0);
EXPECT_DOUBLE_EQ(benchmark::StatisticsStdDev({1, 2, 3}), 1.0);
- EXPECT_FLOAT_EQ(benchmark::StatisticsStdDev({1.5, 2.4, 3.3, 4.2, 5.1}),
- 1.42302495);
+ EXPECT_DOUBLE_EQ(benchmark::StatisticsStdDev({2.5, 2.4, 3.3, 4.2, 5.1}),
+ 1.151086443322134);
}
} // end namespace
//===---------------------------------------------------------------------===//
#include "../src/string_util.h"
+#include "../src/internal_macros.h"
#include "gtest/gtest.h"
namespace {
EXPECT_EQ(0xBEEFul, benchmark::stoul("BEEF", &pos, 16));
EXPECT_EQ(4ul, pos);
}
+#ifndef BENCHMARK_HAS_NO_EXCEPTIONS
{
ASSERT_THROW(benchmark::stoul("this is a test"), std::invalid_argument);
}
+#endif
}
TEST(StringUtilTest, stoi) {
EXPECT_EQ(0xBEEF, benchmark::stoi("BEEF", &pos, 16));
EXPECT_EQ(4ul, pos);
}
+#ifndef BENCHMARK_HAS_NO_EXCEPTIONS
{
ASSERT_THROW(benchmark::stoi("this is a test"), std::invalid_argument);
}
+#endif
}
TEST(StringUtilTest, stod) {
EXPECT_EQ(-1.25e+9, benchmark::stod("-1.25e+9", &pos));
EXPECT_EQ(8ul, pos);
}
+#ifndef BENCHMARK_HAS_NO_EXCEPTIONS
{
ASSERT_THROW(benchmark::stod("this is a test"), std::invalid_argument);
}
+#endif
+}
+
+TEST(StringUtilTest, StrSplit) {
+ EXPECT_EQ(benchmark::StrSplit("", ','), std::vector<std::string>{});
+ EXPECT_EQ(benchmark::StrSplit("hello", ','),
+ std::vector<std::string>({"hello"}));
+ EXPECT_EQ(benchmark::StrSplit("hello,there,is,more", ','),
+ std::vector<std::string>({"hello", "there", "is", "more"}));
}
} // end namespace
// @todo: <jpmag> this checks the full output at once; the rule for
// CounterSet1 was failing because it was not matching "^[-]+$".
// @todo: <jpmag> check that the counters are vertically aligned.
-ADD_CASES(
- TC_ConsoleOut,
- {
- // keeping these lines long improves readability, so:
- // clang-format off
+ADD_CASES(TC_ConsoleOut,
+ {
+ // keeping these lines long improves readability, so:
+ // clang-format off
{"^[-]+$", MR_Next},
{"^Benchmark %s Time %s CPU %s Iterations %s Bar %s Bat %s Baz %s Foo %s Frob %s Lob$", MR_Next},
{"^[-]+$", MR_Next},
- {"^BM_Counters_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
- {"^BM_Counters_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
- {"^BM_Counters_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
- {"^BM_Counters_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
- {"^BM_Counters_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:1 %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:1 %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:1_mean %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:1_median %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:1_stddev %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:2 %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:2 %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:2_mean %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:2_median %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
+ {"^BM_Counters_Tabular/repeats:2/threads:2_stddev %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
{"^BM_CounterRates_Tabular/threads:%int %console_report [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s$", MR_Next},
{"^BM_CounterRates_Tabular/threads:%int %console_report [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s$", MR_Next},
{"^BM_CounterRates_Tabular/threads:%int %console_report [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s$", MR_Next},
{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$"},
- // clang-format on
- });
+ // clang-format on
+ });
ADD_CASES(TC_CSVOut, {{"%csv_header,"
"\"Bar\",\"Bat\",\"Baz\",\"Foo\",\"Frob\",\"Lob\""}});
{"Lob", {32, bm::Counter::kAvgThreads}},
});
}
-BENCHMARK(BM_Counters_Tabular)->ThreadRange(1, 16);
+BENCHMARK(BM_Counters_Tabular)->ThreadRange(1, 2)->Repetitions(2);
ADD_CASES(TC_JSONOut,
- {{"\"name\": \"BM_Counters_Tabular/threads:%int\",$"},
- {"\"run_name\": \"BM_Counters_Tabular/threads:%int\",$", MR_Next},
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:1\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:1\",$",
+ MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
{"\"Frob\": %float,$", MR_Next},
{"\"Lob\": %float$", MR_Next},
{"}", MR_Next}});
-ADD_CASES(TC_CSVOut, {{"^\"BM_Counters_Tabular/threads:%int\",%csv_report,"
- "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:1\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:1\",$",
+ MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"Bar\": %float,$", MR_Next},
+ {"\"Bat\": %float,$", MR_Next},
+ {"\"Baz\": %float,$", MR_Next},
+ {"\"Foo\": %float,$", MR_Next},
+ {"\"Frob\": %float,$", MR_Next},
+ {"\"Lob\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:1_mean\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:1\",$",
+ MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"mean\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"Bar\": %float,$", MR_Next},
+ {"\"Bat\": %float,$", MR_Next},
+ {"\"Baz\": %float,$", MR_Next},
+ {"\"Foo\": %float,$", MR_Next},
+ {"\"Frob\": %float,$", MR_Next},
+ {"\"Lob\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:1_median\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:1\",$",
+ MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"median\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"Bar\": %float,$", MR_Next},
+ {"\"Bat\": %float,$", MR_Next},
+ {"\"Baz\": %float,$", MR_Next},
+ {"\"Foo\": %float,$", MR_Next},
+ {"\"Frob\": %float,$", MR_Next},
+ {"\"Lob\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:1_stddev\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:1\",$",
+ MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"aggregate_name\": \"stddev\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"Bar\": %float,$", MR_Next},
+ {"\"Bat\": %float,$", MR_Next},
+ {"\"Baz\": %float,$", MR_Next},
+ {"\"Foo\": %float,$", MR_Next},
+ {"\"Frob\": %float,$", MR_Next},
+ {"\"Lob\": %float$", MR_Next},
+ {"}", MR_Next}});
+
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:2\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 1,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:2\",$",
+ MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 2,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"Bar\": %float,$", MR_Next},
+ {"\"Bat\": %float,$", MR_Next},
+ {"\"Baz\": %float,$", MR_Next},
+ {"\"Foo\": %float,$", MR_Next},
+ {"\"Frob\": %float,$", MR_Next},
+ {"\"Lob\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:2\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 1,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:2\",$",
+ MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 2,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"Bar\": %float,$", MR_Next},
+ {"\"Bat\": %float,$", MR_Next},
+ {"\"Baz\": %float,$", MR_Next},
+ {"\"Foo\": %float,$", MR_Next},
+ {"\"Frob\": %float,$", MR_Next},
+ {"\"Lob\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:2_median\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 1,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:2\",$",
+ MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 2,$", MR_Next},
+ {"\"aggregate_name\": \"median\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"Bar\": %float,$", MR_Next},
+ {"\"Bat\": %float,$", MR_Next},
+ {"\"Baz\": %float,$", MR_Next},
+ {"\"Foo\": %float,$", MR_Next},
+ {"\"Frob\": %float,$", MR_Next},
+ {"\"Lob\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_Tabular/repeats:2/threads:2_stddev\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 1,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_Tabular/repeats:2/threads:2\",$",
+ MR_Next},
+ {"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 2,$", MR_Next},
+ {"\"aggregate_name\": \"stddev\",$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"Bar\": %float,$", MR_Next},
+ {"\"Bat\": %float,$", MR_Next},
+ {"\"Baz\": %float,$", MR_Next},
+ {"\"Foo\": %float,$", MR_Next},
+ {"\"Frob\": %float,$", MR_Next},
+ {"\"Lob\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:1\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:1\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:1_mean\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:1_median\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:1_stddev\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:2\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:2\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:2_mean\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:2_median\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_Tabular/repeats:2/threads:2_stddev\",%csv_report,"
+ "%float,%float,%float,%float,%float,%float$"}});
// VS2013 does not allow this function to be passed as a lambda argument
// to CHECK_BENCHMARK_RESULTS()
void CheckTabular(Results const& e) {
CHECK_COUNTER_VALUE(e, int, "Frob", EQ, 16);
CHECK_COUNTER_VALUE(e, int, "Lob", EQ, 32);
}
-CHECK_BENCHMARK_RESULTS("BM_Counters_Tabular/threads:%int", &CheckTabular);
+CHECK_BENCHMARK_RESULTS("BM_Counters_Tabular/repeats:2/threads:1$",
+ &CheckTabular);
+CHECK_BENCHMARK_RESULTS("BM_Counters_Tabular/repeats:2/threads:2$",
+ &CheckTabular);
// ========================================================================= //
// -------------------- Tabular+Rate Counters Output ----------------------- //
void BM_CounterRates_Tabular(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
namespace bm = benchmark;
state.counters.insert({
BENCHMARK(BM_CounterRates_Tabular)->ThreadRange(1, 16);
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_CounterRates_Tabular/threads:%int\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_CounterRates_Tabular/threads:%int\",$",
MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
BENCHMARK(BM_CounterSet0_Tabular)->ThreadRange(1, 16);
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_CounterSet0_Tabular/threads:%int\",$"},
+ {"\"family_index\": 2,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_CounterSet0_Tabular/threads:%int\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
BENCHMARK(BM_CounterSet1_Tabular)->ThreadRange(1, 16);
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_CounterSet1_Tabular/threads:%int\",$"},
+ {"\"family_index\": 3,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_CounterSet1_Tabular/threads:%int\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
BENCHMARK(BM_CounterSet2_Tabular)->ThreadRange(1, 16);
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_CounterSet2_Tabular/threads:%int\",$"},
+ {"\"family_index\": 4,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_CounterSet2_Tabular/threads:%int\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
ADD_CASES(TC_ConsoleOut,
{{"^BM_Counters_Simple %console_report bar=%hrfloat foo=%hrfloat$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_Simple\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_Simple\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
}
void BM_Counters_WithBytesAndItemsPSec(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
state.counters["foo"] = 1;
state.counters["bar"] = ++num_calls1;
"foo=%hrfloat items_per_second=%hrfloat/s$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_WithBytesAndItemsPSec\",$"},
+ {"\"family_index\": 1,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_WithBytesAndItemsPSec\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
void BM_Counters_Rate(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
namespace bm = benchmark;
state.counters["foo"] = bm::Counter{1, bm::Counter::kIsRate};
TC_ConsoleOut,
{{"^BM_Counters_Rate %console_report bar=%hrfloat/s foo=%hrfloat/s$"}});
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_Rate\",$"},
+ {"\"family_index\": 2,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_Rate\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
}
CHECK_BENCHMARK_RESULTS("BM_Counters_Rate", &CheckRate);
+// ========================================================================= //
+// ----------------------- Inverted Counters Output ------------------------ //
+// ========================================================================= //
+
+void BM_Invert(benchmark::State& state) {
+ for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
+ }
+ namespace bm = benchmark;
+ state.counters["foo"] = bm::Counter{0.0001, bm::Counter::kInvert};
+ state.counters["bar"] = bm::Counter{10000, bm::Counter::kInvert};
+}
+BENCHMARK(BM_Invert);
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_Invert %console_report bar=%hrfloatu foo=%hrfloatk$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Invert\",$"},
+ {"\"family_index\": 3,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_Invert\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"bar\": %float,$", MR_Next},
+ {"\"foo\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_Invert\",%csv_report,%float,%float$"}});
+// VS2013 does not allow this function to be passed as a lambda argument
+// to CHECK_BENCHMARK_RESULTS()
+void CheckInvert(Results const& e) {
+ CHECK_FLOAT_COUNTER_VALUE(e, "foo", EQ, 10000, 0.0001);
+ CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, 0.0001, 0.0001);
+}
+CHECK_BENCHMARK_RESULTS("BM_Invert", &CheckInvert);
+
+// ========================================================================= //
+// ------------------------- InvertedRate Counters Output
+// -------------------------- //
+// ========================================================================= //
+
+void BM_Counters_InvertedRate(benchmark::State& state) {
+ for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
+ }
+ namespace bm = benchmark;
+ state.counters["foo"] =
+ bm::Counter{1, bm::Counter::kIsRate | bm::Counter::kInvert};
+ state.counters["bar"] =
+ bm::Counter{8192, bm::Counter::kIsRate | bm::Counter::kInvert};
+}
+BENCHMARK(BM_Counters_InvertedRate);
+ADD_CASES(TC_ConsoleOut, {{"^BM_Counters_InvertedRate %console_report "
+ "bar=%hrfloats foo=%hrfloats$"}});
+ADD_CASES(TC_JSONOut,
+ {{"\"name\": \"BM_Counters_InvertedRate\",$"},
+ {"\"family_index\": 4,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
+ {"\"run_name\": \"BM_Counters_InvertedRate\",$", MR_Next},
+ {"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %float,$", MR_Next},
+ {"\"cpu_time\": %float,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"bar\": %float,$", MR_Next},
+ {"\"foo\": %float$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut,
+ {{"^\"BM_Counters_InvertedRate\",%csv_report,%float,%float$"}});
+// VS2013 does not allow this function to be passed as a lambda argument
+// to CHECK_BENCHMARK_RESULTS()
+void CheckInvertedRate(Results const& e) {
+ double t = e.DurationCPUTime(); // this (and not real time) is the time used
+ // check that the values are within 0.1% of the expected values
+ CHECK_FLOAT_COUNTER_VALUE(e, "foo", EQ, t, 0.001);
+ CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, t / 8192.0, 0.001);
+}
+CHECK_BENCHMARK_RESULTS("BM_Counters_InvertedRate", &CheckInvertedRate);
+
// ========================================================================= //
// ------------------------- Thread Counters Output ------------------------ //
// ========================================================================= //
"bar=%hrfloat foo=%hrfloat$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_Threads/threads:%int\",$"},
+ {"\"family_index\": 5,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_Threads/threads:%int\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
"%console_report bar=%hrfloat foo=%hrfloat$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_AvgThreads/threads:%int\",$"},
+ {"\"family_index\": 6,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_AvgThreads/threads:%int\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
void BM_Counters_AvgThreadsRate(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
namespace bm = benchmark;
state.counters["foo"] = bm::Counter{1, bm::Counter::kAvgThreadsRate};
"%console_report bar=%hrfloat/s foo=%hrfloat/s$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_AvgThreadsRate/threads:%int\",$"},
+ {"\"family_index\": 7,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_AvgThreadsRate/threads:%int\",$",
MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
"bar=%hrfloat foo=%hrfloat$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_IterationInvariant\",$"},
+ {"\"family_index\": 8,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_IterationInvariant\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
void BM_Counters_kIsIterationInvariantRate(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
namespace bm = benchmark;
state.counters["foo"] =
"%console_report bar=%hrfloat/s foo=%hrfloat/s$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_kIsIterationInvariantRate\",$"},
+ {"\"family_index\": 9,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_kIsIterationInvariantRate\",$",
MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
"bar=%hrfloat foo=%hrfloat$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_AvgIterations\",$"},
+ {"\"family_index\": 10,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_AvgIterations\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
void BM_Counters_kAvgIterationsRate(benchmark::State& state) {
for (auto _ : state) {
+ // This test requires a non-zero CPU time to avoid divide-by-zero
+ benchmark::DoNotOptimize(state.iterations());
}
namespace bm = benchmark;
state.counters["foo"] = bm::Counter{1, bm::Counter::kAvgIterationsRate};
"%console_report bar=%hrfloat/s foo=%hrfloat/s$"}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_kAvgIterationsRate\",$"},
+ {"\"family_index\": 11,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_kAvgIterationsRate\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 1,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_Thousands/repeats:2\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_Thousands/repeats:2\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 0,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
{"}", MR_Next}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_Thousands/repeats:2\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_Thousands/repeats:2\",$", MR_Next},
{"\"run_type\": \"iteration\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"repetition_index\": 1,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"iterations\": %int,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"\"cpu_time\": %float,$", MR_Next},
{"}", MR_Next}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_Thousands/repeats:2_mean\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_Thousands/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"mean\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"}", MR_Next}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_Thousands/repeats:2_median\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_Thousands/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"median\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
{"}", MR_Next}});
ADD_CASES(TC_JSONOut,
{{"\"name\": \"BM_Counters_Thousands/repeats:2_stddev\",$"},
+ {"\"family_index\": 0,$", MR_Next},
+ {"\"per_family_instance_index\": 0,$", MR_Next},
{"\"run_name\": \"BM_Counters_Thousands/repeats:2\",$", MR_Next},
{"\"run_type\": \"aggregate\",$", MR_Next},
+ {"\"repetitions\": 2,$", MR_Next},
+ {"\"threads\": 1,$", MR_Next},
{"\"aggregate_name\": \"stddev\",$", MR_Next},
{"\"iterations\": 2,$", MR_Next},
{"\"real_time\": %float,$", MR_Next},
--- /dev/null
+load("@py_deps//:requirements.bzl", "requirement")
+
+py_library(
+ name = "gbench",
+ srcs = glob(["gbench/*.py"]),
+ deps = [
+ requirement("numpy"),
+ requirement("scipy"),
+ ],
+)
+
+py_binary(
+ name = "compare",
+ srcs = ["compare.py"],
+ python_version = "PY2",
+ deps = [
+ ":gbench",
+ ],
+)
import argparse
from argparse import ArgumentParser
+import json
import sys
import gbench
from gbench import util, report
"of repetitions. Do note that only the display is affected. "
"Internally, all the actual runs are still used, e.g. for U test.")
+ parser.add_argument(
+ '--no-color',
+ dest='color',
+ default=True,
+ action="store_false",
+ help="Do not use colors in the terminal output"
+ )
+
+ parser.add_argument(
+ '-d',
+ '--dump_to_json',
+ dest='dump_to_json',
+ help="Additionally, dump benchmark comparison output to this file in JSON format.")
+
utest = parser.add_argument_group()
utest.add_argument(
'--no-utest',
options_contender = ['--benchmark_filter=%s' % filter_contender]
# Run the benchmarks and report the results
- json1 = json1_orig = gbench.util.run_or_load_benchmark(
- test_baseline, benchmark_options + options_baseline)
- json2 = json2_orig = gbench.util.run_or_load_benchmark(
- test_contender, benchmark_options + options_contender)
+ json1 = json1_orig = gbench.util.sort_benchmark_results(gbench.util.run_or_load_benchmark(
+ test_baseline, benchmark_options + options_baseline))
+ json2 = json2_orig = gbench.util.sort_benchmark_results(gbench.util.run_or_load_benchmark(
+ test_contender, benchmark_options + options_contender))
# Now, filter the benchmarks so that the difference report can work
if filter_baseline and filter_contender:
json2 = gbench.report.filter_benchmark(
json2_orig, filter_contender, replacement)
- # Diff and output
- output_lines = gbench.report.generate_difference_report(
- json1, json2, args.display_aggregates_only,
- args.utest, args.utest_alpha)
+ diff_report = gbench.report.get_difference_report(
+ json1, json2, args.utest)
+ output_lines = gbench.report.print_difference_report(
+ diff_report,
+ args.display_aggregates_only,
+ args.utest, args.utest_alpha, args.color)
print(description)
for ln in output_lines:
print(ln)
+ # Optionally, diff and output to JSON
+ if args.dump_to_json is not None:
+ with open(args.dump_to_json, 'w') as f_json:
+ json.dump(diff_report, f_json)
class TestParser(unittest.TestCase):
def setUp(self):
"time_unit": "ns"
},
{
- "name": "BM_BadTimeUnit",
+ "name": "MyComplexityTest_BigO",
+ "run_name": "MyComplexityTest",
+ "run_type": "aggregate",
+ "aggregate_name": "BigO",
+ "cpu_coefficient": 4.2749856294592886e+00,
+ "real_coefficient": 6.4789275289789780e+00,
+ "big_o": "N",
+ "time_unit": "ns"
+ },
+ {
+ "name": "MyComplexityTest_RMS",
+ "run_name": "MyComplexityTest",
+ "run_type": "aggregate",
+ "aggregate_name": "RMS",
+ "rms": 4.5097802512472874e-03
+ },
+ {
+ "name": "BM_NotBadTimeUnit",
"iterations": 1000,
"real_time": 0.4,
"cpu_time": 0.5,
"time_unit": "ns"
},
{
- "name": "BM_BadTimeUnit",
+ "name": "MyComplexityTest_BigO",
+ "run_name": "MyComplexityTest",
+ "run_type": "aggregate",
+ "aggregate_name": "BigO",
+ "cpu_coefficient": 5.6215779594361486e+00,
+ "real_coefficient": 5.6288314793554610e+00,
+ "big_o": "N",
+ "time_unit": "ns"
+ },
+ {
+ "name": "MyComplexityTest_RMS",
+ "run_name": "MyComplexityTest",
+ "run_type": "aggregate",
+ "aggregate_name": "RMS",
+ "rms": 3.3128901852342174e-03
+ },
+ {
+ "name": "BM_NotBadTimeUnit",
"iterations": 1000,
"real_time": 0.04,
"cpu_time": 0.6,
--- /dev/null
+{
+ "benchmarks": [
+ {
+ "name": "99 family 0 instance 0 repetition 0",
+ "run_type": "iteration",
+ "family_index": 0,
+ "per_family_instance_index": 0,
+ "repetition_index": 0
+ },
+ {
+ "name": "98 family 0 instance 0 repetition 1",
+ "run_type": "iteration",
+ "family_index": 0,
+ "per_family_instance_index": 0,
+ "repetition_index": 1
+ },
+ {
+ "name": "97 family 0 instance 0 aggregate",
+ "run_type": "aggregate",
+ "family_index": 0,
+ "per_family_instance_index": 0,
+ "aggregate_name": "9 aggregate"
+ },
+
+
+ {
+ "name": "96 family 0 instance 1 repetition 0",
+ "run_type": "iteration",
+ "family_index": 0,
+ "per_family_instance_index": 1,
+ "repetition_index": 0
+ },
+ {
+ "name": "95 family 0 instance 1 repetition 1",
+ "run_type": "iteration",
+ "family_index": 0,
+ "per_family_instance_index": 1,
+ "repetition_index": 1
+ },
+ {
+ "name": "94 family 0 instance 1 aggregate",
+ "run_type": "aggregate",
+ "family_index": 0,
+ "per_family_instance_index": 1,
+ "aggregate_name": "9 aggregate"
+ },
+
+
+
+
+ {
+ "name": "93 family 1 instance 0 repetition 0",
+ "run_type": "iteration",
+ "family_index": 1,
+ "per_family_instance_index": 0,
+ "repetition_index": 0
+ },
+ {
+ "name": "92 family 1 instance 0 repetition 1",
+ "run_type": "iteration",
+ "family_index": 1,
+ "per_family_instance_index": 0,
+ "repetition_index": 1
+ },
+ {
+ "name": "91 family 1 instance 0 aggregate",
+ "run_type": "aggregate",
+ "family_index": 1,
+ "per_family_instance_index": 0,
+ "aggregate_name": "9 aggregate"
+ },
+
+
+ {
+ "name": "90 family 1 instance 1 repetition 0",
+ "run_type": "iteration",
+ "family_index": 1,
+ "per_family_instance_index": 1,
+ "repetition_index": 0
+ },
+ {
+ "name": "89 family 1 instance 1 repetition 1",
+ "run_type": "iteration",
+ "family_index": 1,
+ "per_family_instance_index": 1,
+ "repetition_index": 1
+ },
+ {
+ "name": "88 family 1 instance 1 aggregate",
+ "run_type": "aggregate",
+ "family_index": 1,
+ "per_family_instance_index": 1,
+ "aggregate_name": "9 aggregate"
+ }
+ ]
+}
-import unittest
"""report.py - Utilities for reporting statistics about benchmark results
"""
+
+import unittest
import os
import re
import copy
+import random
from scipy.stats import mannwhitneyu
return [x for x in list1 if x in list2]
+def is_potentially_comparable_benchmark(x):
+ return ('time_unit' in x and 'real_time' in x and 'cpu_time' in x)
+
+
def partition_benchmarks(json1, json2):
"""
While preserving the ordering, find benchmarks with the same names in
names = intersect(json1_unique_names, json2_unique_names)
partitions = []
for name in names:
+ time_unit = None
# Pick the time unit from the first entry of the lhs benchmark.
- time_unit = (x['time_unit']
- for x in json1['benchmarks'] if x['name'] == name).next()
+ # We should be careful not to crash with unexpected input.
+ for x in json1['benchmarks']:
+ if (x['name'] == name and is_potentially_comparable_benchmark(x)):
+ time_unit = x['time_unit']
+ break
+ if time_unit is None:
+ continue
# Filter by name and time unit.
+ # All the repetitions are assumed to be comparable.
lhs = [x for x in json1['benchmarks'] if x['name'] == name and
x['time_unit'] == time_unit]
rhs = [x for x in json2['benchmarks'] if x['name'] == name and
return [lhs, rhs]
-def print_utest(partition, utest_alpha, first_col_width, use_color=True):
- timings_time = extract_field(partition, 'real_time')
- timings_cpu = extract_field(partition, 'cpu_time')
-
+def calc_utest(timings_cpu, timings_time):
min_rep_cnt = min(len(timings_time[0]),
len(timings_time[1]),
len(timings_cpu[0]),
# Does *everything* has at least UTEST_MIN_REPETITIONS repetitions?
if min_rep_cnt < UTEST_MIN_REPETITIONS:
- return []
-
- def get_utest_color(pval):
- return BC_FAIL if pval >= utest_alpha else BC_OKGREEN
+ return False, None, None
time_pvalue = mannwhitneyu(
timings_time[0], timings_time[1], alternative='two-sided').pvalue
cpu_pvalue = mannwhitneyu(
timings_cpu[0], timings_cpu[1], alternative='two-sided').pvalue
+ return (min_rep_cnt >= UTEST_OPTIMAL_REPETITIONS), cpu_pvalue, time_pvalue
+
+def print_utest(bc_name, utest, utest_alpha, first_col_width, use_color=True):
+ def get_utest_color(pval):
+ return BC_FAIL if pval >= utest_alpha else BC_OKGREEN
+
+ # Check if we failed miserably with minimum required repetitions for utest
+ if not utest['have_optimal_repetitions'] and utest['cpu_pvalue'] is None and utest['time_pvalue'] is None:
+ return []
+
dsc = "U Test, Repetitions: {} vs {}".format(
- len(timings_cpu[0]), len(timings_cpu[1]))
+ utest['nr_of_repetitions'], utest['nr_of_repetitions_other'])
dsc_color = BC_OKGREEN
- if min_rep_cnt < UTEST_OPTIMAL_REPETITIONS:
+ # We still got some results to show but issue a warning about it.
+ if not utest['have_optimal_repetitions']:
dsc_color = BC_WARNING
dsc += ". WARNING: Results unreliable! {}+ repetitions recommended.".format(
UTEST_OPTIMAL_REPETITIONS)
special_str = "{}{:<{}s}{endc}{}{:16.4f}{endc}{}{:16.4f}{endc}{} {}"
- last_name = partition[0][0]['name']
return [color_format(use_color,
special_str,
BC_HEADER,
- "{}{}".format(last_name, UTEST_COL_NAME),
+ "{}{}".format(bc_name, UTEST_COL_NAME),
first_col_width,
- get_utest_color(time_pvalue), time_pvalue,
- get_utest_color(cpu_pvalue), cpu_pvalue,
+ get_utest_color(
+ utest['time_pvalue']), utest['time_pvalue'],
+ get_utest_color(
+ utest['cpu_pvalue']), utest['cpu_pvalue'],
dsc_color, dsc,
endc=BC_ENDC)]
-def generate_difference_report(
+def get_difference_report(
json1,
json2,
- display_aggregates_only=False,
+ utest=False):
+ """
+ Calculate and report the difference between each test of two benchmarks
+ runs specified as 'json1' and 'json2'. Output is another json containing
+ relevant details for each test run.
+ """
+ assert utest is True or utest is False
+
+ diff_report = []
+ partitions = partition_benchmarks(json1, json2)
+ for partition in partitions:
+ benchmark_name = partition[0][0]['name']
+ time_unit = partition[0][0]['time_unit']
+ measurements = []
+ utest_results = {}
+ # Careful, we may have different repetition count.
+ for i in range(min(len(partition[0]), len(partition[1]))):
+ bn = partition[0][i]
+ other_bench = partition[1][i]
+ measurements.append({
+ 'real_time': bn['real_time'],
+ 'cpu_time': bn['cpu_time'],
+ 'real_time_other': other_bench['real_time'],
+ 'cpu_time_other': other_bench['cpu_time'],
+ 'time': calculate_change(bn['real_time'], other_bench['real_time']),
+ 'cpu': calculate_change(bn['cpu_time'], other_bench['cpu_time'])
+ })
+
+ # After processing the whole partition, if requested, do the U test.
+ if utest:
+ timings_cpu = extract_field(partition, 'cpu_time')
+ timings_time = extract_field(partition, 'real_time')
+ have_optimal_repetitions, cpu_pvalue, time_pvalue = calc_utest(timings_cpu, timings_time)
+ if cpu_pvalue and time_pvalue:
+ utest_results = {
+ 'have_optimal_repetitions': have_optimal_repetitions,
+ 'cpu_pvalue': cpu_pvalue,
+ 'time_pvalue': time_pvalue,
+ 'nr_of_repetitions': len(timings_cpu[0]),
+ 'nr_of_repetitions_other': len(timings_cpu[1])
+ }
+
+ # Store only if we had any measurements for given benchmark.
+ # E.g. partition_benchmarks will filter out the benchmarks having
+ # time units which are not compatible with other time units in the
+ # benchmark suite.
+ if measurements:
+ run_type = partition[0][0]['run_type'] if 'run_type' in partition[0][0] else ''
+ aggregate_name = partition[0][0]['aggregate_name'] if run_type == 'aggregate' and 'aggregate_name' in partition[0][0] else ''
+ diff_report.append({
+ 'name': benchmark_name,
+ 'measurements': measurements,
+ 'time_unit': time_unit,
+ 'run_type': run_type,
+ 'aggregate_name': aggregate_name,
+ 'utest': utest_results
+ })
+
+ return diff_report
+
+
+def print_difference_report(
+ json_diff_report,
+ include_aggregates_only=False,
utest=False,
utest_alpha=0.05,
use_color=True):
runs specified as 'json1' and 'json2'.
"""
assert utest is True or utest is False
- first_col_width = find_longest_name(json1['benchmarks'])
- def find_test(name):
- for b in json2['benchmarks']:
- if b['name'] == name:
- return b
- return None
+ def get_color(res):
+ if res > 0.05:
+ return BC_FAIL
+ elif res > -0.07:
+ return BC_WHITE
+ else:
+ return BC_CYAN
+ first_col_width = find_longest_name(json_diff_report)
first_col_width = max(
first_col_width,
len('Benchmark'))
'Benchmark', 12 + first_col_width)
output_strs = [first_line, '-' * len(first_line)]
- partitions = partition_benchmarks(json1, json2)
- for partition in partitions:
- # Careful, we may have different repetition count.
- for i in range(min(len(partition[0]), len(partition[1]))):
- bn = partition[0][i]
- other_bench = partition[1][i]
-
- # *If* we were asked to only display aggregates,
- # and if it is non-aggregate, then skip it.
- if display_aggregates_only and 'run_type' in bn and 'run_type' in other_bench:
- assert bn['run_type'] == other_bench['run_type']
- if bn['run_type'] != 'aggregate':
- continue
-
- fmt_str = "{}{:<{}s}{endc}{}{:+16.4f}{endc}{}{:+16.4f}{endc}{:14.0f}{:14.0f}{endc}{:14.0f}{:14.0f}"
-
- def get_color(res):
- if res > 0.05:
- return BC_FAIL
- elif res > -0.07:
- return BC_WHITE
- else:
- return BC_CYAN
-
- tres = calculate_change(bn['real_time'], other_bench['real_time'])
- cpures = calculate_change(bn['cpu_time'], other_bench['cpu_time'])
- output_strs += [color_format(use_color,
- fmt_str,
- BC_HEADER,
- bn['name'],
- first_col_width,
- get_color(tres),
- tres,
- get_color(cpures),
- cpures,
- bn['real_time'],
- other_bench['real_time'],
- bn['cpu_time'],
- other_bench['cpu_time'],
- endc=BC_ENDC)]
-
- # After processing the whole partition, if requested, do the U test.
- if utest:
- output_strs += print_utest(partition,
+ fmt_str = "{}{:<{}s}{endc}{}{:+16.4f}{endc}{}{:+16.4f}{endc}{:14.0f}{:14.0f}{endc}{:14.0f}{:14.0f}"
+ for benchmark in json_diff_report:
+ # *If* we were asked to only include aggregates,
+ # and if it is non-aggregate, then don't print it.
+ if not include_aggregates_only or not 'run_type' in benchmark or benchmark['run_type'] == 'aggregate':
+ for measurement in benchmark['measurements']:
+ output_strs += [color_format(use_color,
+ fmt_str,
+ BC_HEADER,
+ benchmark['name'],
+ first_col_width,
+ get_color(measurement['time']),
+ measurement['time'],
+ get_color(measurement['cpu']),
+ measurement['cpu'],
+ measurement['real_time'],
+ measurement['real_time_other'],
+ measurement['cpu_time'],
+ measurement['cpu_time_other'],
+ endc=BC_ENDC)]
+
+ # After processing the measurements, if requested and
+ # if applicable (e.g. u-test exists for given benchmark),
+ # print the U test.
+ if utest and benchmark['utest']:
+ output_strs += print_utest(benchmark['name'],
+ benchmark['utest'],
utest_alpha=utest_alpha,
first_col_width=first_col_width,
use_color=use_color)
class TestReportDifference(unittest.TestCase):
- def load_results(self):
- import json
- testInputs = os.path.join(
- os.path.dirname(
- os.path.realpath(__file__)),
- 'Inputs')
- testOutput1 = os.path.join(testInputs, 'test1_run1.json')
- testOutput2 = os.path.join(testInputs, 'test1_run2.json')
- with open(testOutput1, 'r') as f:
- json1 = json.load(f)
- with open(testOutput2, 'r') as f:
- json2 = json.load(f)
- return json1, json2
-
- def test_basic(self):
+ @classmethod
+ def setUpClass(cls):
+ def load_results():
+ import json
+ testInputs = os.path.join(
+ os.path.dirname(
+ os.path.realpath(__file__)),
+ 'Inputs')
+ testOutput1 = os.path.join(testInputs, 'test1_run1.json')
+ testOutput2 = os.path.join(testInputs, 'test1_run2.json')
+ with open(testOutput1, 'r') as f:
+ json1 = json.load(f)
+ with open(testOutput2, 'r') as f:
+ json2 = json.load(f)
+ return json1, json2
+
+ json1, json2 = load_results()
+ cls.json_diff_report = get_difference_report(json1, json2)
+
+ def test_json_diff_report_pretty_printing(self):
expect_lines = [
['BM_SameTimes', '+0.0000', '+0.0000', '10', '10', '10', '10'],
['BM_2xFaster', '-0.5000', '-0.5000', '50', '25', '50', '25'],
['BM_10PercentCPUToTime', '+0.1000',
'-0.1000', '100', '110', '100', '90'],
['BM_ThirdFaster', '-0.3333', '-0.3334', '100', '67', '100', '67'],
- ['BM_BadTimeUnit', '-0.9000', '+0.2000', '0', '0', '0', '1'],
+ ['BM_NotBadTimeUnit', '-0.9000', '+0.2000', '0', '0', '0', '1'],
]
- json1, json2 = self.load_results()
- output_lines_with_header = generate_difference_report(
- json1, json2, use_color=False)
+ output_lines_with_header = print_difference_report(
+ self.json_diff_report, use_color=False)
output_lines = output_lines_with_header[2:]
print("\n")
print("\n".join(output_lines_with_header))
self.assertEqual(len(parts), 7)
self.assertEqual(expect_lines[i], parts)
+ def test_json_diff_report_output(self):
+ expected_output = [
+ {
+ 'name': 'BM_SameTimes',
+ 'measurements': [{'time': 0.0000, 'cpu': 0.0000, 'real_time': 10, 'real_time_other': 10, 'cpu_time': 10, 'cpu_time_other': 10}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_2xFaster',
+ 'measurements': [{'time': -0.5000, 'cpu': -0.5000, 'real_time': 50, 'real_time_other': 25, 'cpu_time': 50, 'cpu_time_other': 25}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_2xSlower',
+ 'measurements': [{'time': 1.0000, 'cpu': 1.0000, 'real_time': 50, 'real_time_other': 100, 'cpu_time': 50, 'cpu_time_other': 100}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_1PercentFaster',
+ 'measurements': [{'time': -0.0100, 'cpu': -0.0100, 'real_time': 100, 'real_time_other': 98.9999999, 'cpu_time': 100, 'cpu_time_other': 98.9999999}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_1PercentSlower',
+ 'measurements': [{'time': 0.0100, 'cpu': 0.0100, 'real_time': 100, 'real_time_other': 101, 'cpu_time': 100, 'cpu_time_other': 101}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_10PercentFaster',
+ 'measurements': [{'time': -0.1000, 'cpu': -0.1000, 'real_time': 100, 'real_time_other': 90, 'cpu_time': 100, 'cpu_time_other': 90}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_10PercentSlower',
+ 'measurements': [{'time': 0.1000, 'cpu': 0.1000, 'real_time': 100, 'real_time_other': 110, 'cpu_time': 100, 'cpu_time_other': 110}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_100xSlower',
+ 'measurements': [{'time': 99.0000, 'cpu': 99.0000, 'real_time': 100, 'real_time_other': 10000, 'cpu_time': 100, 'cpu_time_other': 10000}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_100xFaster',
+ 'measurements': [{'time': -0.9900, 'cpu': -0.9900, 'real_time': 10000, 'real_time_other': 100, 'cpu_time': 10000, 'cpu_time_other': 100}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_10PercentCPUToTime',
+ 'measurements': [{'time': 0.1000, 'cpu': -0.1000, 'real_time': 100, 'real_time_other': 110, 'cpu_time': 100, 'cpu_time_other': 90}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_ThirdFaster',
+ 'measurements': [{'time': -0.3333, 'cpu': -0.3334, 'real_time': 100, 'real_time_other': 67, 'cpu_time': 100, 'cpu_time_other': 67}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': 'BM_NotBadTimeUnit',
+ 'measurements': [{'time': -0.9000, 'cpu': 0.2000, 'real_time': 0.4, 'real_time_other': 0.04, 'cpu_time': 0.5, 'cpu_time_other': 0.6}],
+ 'time_unit': 's',
+ 'utest': {}
+ },
+ ]
+ self.assertEqual(len(self.json_diff_report), len(expected_output))
+ for out, expected in zip(
+ self.json_diff_report, expected_output):
+ self.assertEqual(out['name'], expected['name'])
+ self.assertEqual(out['time_unit'], expected['time_unit'])
+ assert_utest(self, out, expected)
+ assert_measurements(self, out, expected)
+
class TestReportDifferenceBetweenFamilies(unittest.TestCase):
- def load_result(self):
- import json
- testInputs = os.path.join(
- os.path.dirname(
- os.path.realpath(__file__)),
- 'Inputs')
- testOutput = os.path.join(testInputs, 'test2_run.json')
- with open(testOutput, 'r') as f:
- json = json.load(f)
- return json
+ @classmethod
+ def setUpClass(cls):
+ def load_result():
+ import json
+ testInputs = os.path.join(
+ os.path.dirname(
+ os.path.realpath(__file__)),
+ 'Inputs')
+ testOutput = os.path.join(testInputs, 'test2_run.json')
+ with open(testOutput, 'r') as f:
+ json = json.load(f)
+ return json
+
+ json = load_result()
+ json1 = filter_benchmark(json, "BM_Z.ro", ".")
+ json2 = filter_benchmark(json, "BM_O.e", ".")
+ cls.json_diff_report = get_difference_report(json1, json2)
- def test_basic(self):
+ def test_json_diff_report_pretty_printing(self):
expect_lines = [
['.', '-0.5000', '-0.5000', '10', '5', '10', '5'],
['./4', '-0.5000', '-0.5000', '40', '20', '40', '20'],
['Prefix/.', '-0.5000', '-0.5000', '20', '10', '20', '10'],
['Prefix/./3', '-0.5000', '-0.5000', '30', '15', '30', '15'],
]
- json = self.load_result()
- json1 = filter_benchmark(json, "BM_Z.ro", ".")
- json2 = filter_benchmark(json, "BM_O.e", ".")
- output_lines_with_header = generate_difference_report(
- json1, json2, use_color=False)
+ output_lines_with_header = print_difference_report(
+ self.json_diff_report, use_color=False)
output_lines = output_lines_with_header[2:]
print("\n")
print("\n".join(output_lines_with_header))
self.assertEqual(len(parts), 7)
self.assertEqual(expect_lines[i], parts)
+ def test_json_diff_report(self):
+ expected_output = [
+ {
+ 'name': u'.',
+ 'measurements': [{'time': -0.5, 'cpu': -0.5, 'real_time': 10, 'real_time_other': 5, 'cpu_time': 10, 'cpu_time_other': 5}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': u'./4',
+ 'measurements': [{'time': -0.5, 'cpu': -0.5, 'real_time': 40, 'real_time_other': 20, 'cpu_time': 40, 'cpu_time_other': 20}],
+ 'time_unit': 'ns',
+ 'utest': {},
+ },
+ {
+ 'name': u'Prefix/.',
+ 'measurements': [{'time': -0.5, 'cpu': -0.5, 'real_time': 20, 'real_time_other': 10, 'cpu_time': 20, 'cpu_time_other': 10}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': u'Prefix/./3',
+ 'measurements': [{'time': -0.5, 'cpu': -0.5, 'real_time': 30, 'real_time_other': 15, 'cpu_time': 30, 'cpu_time_other': 15}],
+ 'time_unit': 'ns',
+ 'utest': {}
+ }
+ ]
+ self.assertEqual(len(self.json_diff_report), len(expected_output))
+ for out, expected in zip(
+ self.json_diff_report, expected_output):
+ self.assertEqual(out['name'], expected['name'])
+ self.assertEqual(out['time_unit'], expected['time_unit'])
+ assert_utest(self, out, expected)
+ assert_measurements(self, out, expected)
+
class TestReportDifferenceWithUTest(unittest.TestCase):
- def load_results(self):
- import json
- testInputs = os.path.join(
- os.path.dirname(
- os.path.realpath(__file__)),
- 'Inputs')
- testOutput1 = os.path.join(testInputs, 'test3_run0.json')
- testOutput2 = os.path.join(testInputs, 'test3_run1.json')
- with open(testOutput1, 'r') as f:
- json1 = json.load(f)
- with open(testOutput2, 'r') as f:
- json2 = json.load(f)
- return json1, json2
-
- def test_utest(self):
- expect_lines = []
+ @classmethod
+ def setUpClass(cls):
+ def load_results():
+ import json
+ testInputs = os.path.join(
+ os.path.dirname(
+ os.path.realpath(__file__)),
+ 'Inputs')
+ testOutput1 = os.path.join(testInputs, 'test3_run0.json')
+ testOutput2 = os.path.join(testInputs, 'test3_run1.json')
+ with open(testOutput1, 'r') as f:
+ json1 = json.load(f)
+ with open(testOutput2, 'r') as f:
+ json2 = json.load(f)
+ return json1, json2
+
+ json1, json2 = load_results()
+ cls.json_diff_report = get_difference_report(
+ json1, json2, utest=True)
+
+ def test_json_diff_report_pretty_printing(self):
expect_lines = [
['BM_One', '-0.1000', '+0.1000', '10', '9', '100', '110'],
['BM_Two', '+0.1111', '-0.0111', '9', '10', '90', '89'],
'recommended.'],
['medium', '-0.3750', '-0.3375', '8', '5', '80', '53'],
]
- json1, json2 = self.load_results()
- output_lines_with_header = generate_difference_report(
- json1, json2, utest=True, utest_alpha=0.05, use_color=False)
+ output_lines_with_header = print_difference_report(
+ self.json_diff_report, utest=True, utest_alpha=0.05, use_color=False)
output_lines = output_lines_with_header[2:]
print("\n")
print("\n".join(output_lines_with_header))
parts = [x for x in output_lines[i].split(' ') if x]
self.assertEqual(expect_lines[i], parts)
+ def test_json_diff_report_pretty_printing_aggregates_only(self):
+ expect_lines = [
+ ['BM_One', '-0.1000', '+0.1000', '10', '9', '100', '110'],
+ ['BM_Two_pvalue',
+ '0.6985',
+ '0.6985',
+ 'U',
+ 'Test,',
+ 'Repetitions:',
+ '2',
+ 'vs',
+ '2.',
+ 'WARNING:',
+ 'Results',
+ 'unreliable!',
+ '9+',
+ 'repetitions',
+ 'recommended.'],
+ ['short', '-0.1250', '-0.0625', '8', '7', '80', '75'],
+ ['short', '-0.4325', '-0.1351', '8', '5', '77', '67'],
+ ['short_pvalue',
+ '0.7671',
+ '0.1489',
+ 'U',
+ 'Test,',
+ 'Repetitions:',
+ '2',
+ 'vs',
+ '3.',
+ 'WARNING:',
+ 'Results',
+ 'unreliable!',
+ '9+',
+ 'repetitions',
+ 'recommended.'],
+ ]
+ output_lines_with_header = print_difference_report(
+ self.json_diff_report, include_aggregates_only=True, utest=True, utest_alpha=0.05, use_color=False)
+ output_lines = output_lines_with_header[2:]
+ print("\n")
+ print("\n".join(output_lines_with_header))
+ self.assertEqual(len(output_lines), len(expect_lines))
+ for i in range(0, len(output_lines)):
+ parts = [x for x in output_lines[i].split(' ') if x]
+ self.assertEqual(expect_lines[i], parts)
+
+ def test_json_diff_report(self):
+ expected_output = [
+ {
+ 'name': u'BM_One',
+ 'measurements': [
+ {'time': -0.1,
+ 'cpu': 0.1,
+ 'real_time': 10,
+ 'real_time_other': 9,
+ 'cpu_time': 100,
+ 'cpu_time_other': 110}
+ ],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': u'BM_Two',
+ 'measurements': [
+ {'time': 0.1111111111111111,
+ 'cpu': -0.011111111111111112,
+ 'real_time': 9,
+ 'real_time_other': 10,
+ 'cpu_time': 90,
+ 'cpu_time_other': 89},
+ {'time': -0.125, 'cpu': -0.16279069767441862, 'real_time': 8,
+ 'real_time_other': 7, 'cpu_time': 86, 'cpu_time_other': 72}
+ ],
+ 'time_unit': 'ns',
+ 'utest': {
+ 'have_optimal_repetitions': False, 'cpu_pvalue': 0.6985353583033387, 'time_pvalue': 0.6985353583033387
+ }
+ },
+ {
+ 'name': u'short',
+ 'measurements': [
+ {'time': -0.125,
+ 'cpu': -0.0625,
+ 'real_time': 8,
+ 'real_time_other': 7,
+ 'cpu_time': 80,
+ 'cpu_time_other': 75},
+ {'time': -0.4325,
+ 'cpu': -0.13506493506493514,
+ 'real_time': 8,
+ 'real_time_other': 4.54,
+ 'cpu_time': 77,
+ 'cpu_time_other': 66.6}
+ ],
+ 'time_unit': 'ns',
+ 'utest': {
+ 'have_optimal_repetitions': False, 'cpu_pvalue': 0.14891467317876572, 'time_pvalue': 0.7670968684102772
+ }
+ },
+ {
+ 'name': u'medium',
+ 'measurements': [
+ {'time': -0.375,
+ 'cpu': -0.3375,
+ 'real_time': 8,
+ 'real_time_other': 5,
+ 'cpu_time': 80,
+ 'cpu_time_other': 53}
+ ],
+ 'time_unit': 'ns',
+ 'utest': {}
+ }
+ ]
+ self.assertEqual(len(self.json_diff_report), len(expected_output))
+ for out, expected in zip(
+ self.json_diff_report, expected_output):
+ self.assertEqual(out['name'], expected['name'])
+ self.assertEqual(out['time_unit'], expected['time_unit'])
+ assert_utest(self, out, expected)
+ assert_measurements(self, out, expected)
+
class TestReportDifferenceWithUTestWhileDisplayingAggregatesOnly(
unittest.TestCase):
- def load_results(self):
- import json
- testInputs = os.path.join(
- os.path.dirname(
- os.path.realpath(__file__)),
- 'Inputs')
- testOutput1 = os.path.join(testInputs, 'test3_run0.json')
- testOutput2 = os.path.join(testInputs, 'test3_run1.json')
- with open(testOutput1, 'r') as f:
- json1 = json.load(f)
- with open(testOutput2, 'r') as f:
- json2 = json.load(f)
- return json1, json2
-
- def test_utest(self):
- expect_lines = []
+ @classmethod
+ def setUpClass(cls):
+ def load_results():
+ import json
+ testInputs = os.path.join(
+ os.path.dirname(
+ os.path.realpath(__file__)),
+ 'Inputs')
+ testOutput1 = os.path.join(testInputs, 'test3_run0.json')
+ testOutput2 = os.path.join(testInputs, 'test3_run1.json')
+ with open(testOutput1, 'r') as f:
+ json1 = json.load(f)
+ with open(testOutput2, 'r') as f:
+ json2 = json.load(f)
+ return json1, json2
+
+ json1, json2 = load_results()
+ cls.json_diff_report = get_difference_report(
+ json1, json2, utest=True)
+
+ def test_json_diff_report_pretty_printing(self):
expect_lines = [
['BM_One', '-0.1000', '+0.1000', '10', '9', '100', '110'],
['BM_Two', '+0.1111', '-0.0111', '9', '10', '90', '89'],
'9+',
'repetitions',
'recommended.'],
+ ['medium', '-0.3750', '-0.3375', '8', '5', '80', '53']
]
- json1, json2 = self.load_results()
- output_lines_with_header = generate_difference_report(
- json1, json2, display_aggregates_only=True,
+ output_lines_with_header = print_difference_report(
+ self.json_diff_report,
utest=True, utest_alpha=0.05, use_color=False)
output_lines = output_lines_with_header[2:]
print("\n")
parts = [x for x in output_lines[i].split(' ') if x]
self.assertEqual(expect_lines[i], parts)
+ def test_json_diff_report(self):
+ expected_output = [
+ {
+ 'name': u'BM_One',
+ 'measurements': [
+ {'time': -0.1,
+ 'cpu': 0.1,
+ 'real_time': 10,
+ 'real_time_other': 9,
+ 'cpu_time': 100,
+ 'cpu_time_other': 110}
+ ],
+ 'time_unit': 'ns',
+ 'utest': {}
+ },
+ {
+ 'name': u'BM_Two',
+ 'measurements': [
+ {'time': 0.1111111111111111,
+ 'cpu': -0.011111111111111112,
+ 'real_time': 9,
+ 'real_time_other': 10,
+ 'cpu_time': 90,
+ 'cpu_time_other': 89},
+ {'time': -0.125, 'cpu': -0.16279069767441862, 'real_time': 8,
+ 'real_time_other': 7, 'cpu_time': 86, 'cpu_time_other': 72}
+ ],
+ 'time_unit': 'ns',
+ 'utest': {
+ 'have_optimal_repetitions': False, 'cpu_pvalue': 0.6985353583033387, 'time_pvalue': 0.6985353583033387
+ }
+ },
+ {
+ 'name': u'short',
+ 'measurements': [
+ {'time': -0.125,
+ 'cpu': -0.0625,
+ 'real_time': 8,
+ 'real_time_other': 7,
+ 'cpu_time': 80,
+ 'cpu_time_other': 75},
+ {'time': -0.4325,
+ 'cpu': -0.13506493506493514,
+ 'real_time': 8,
+ 'real_time_other': 4.54,
+ 'cpu_time': 77,
+ 'cpu_time_other': 66.6}
+ ],
+ 'time_unit': 'ns',
+ 'utest': {
+ 'have_optimal_repetitions': False, 'cpu_pvalue': 0.14891467317876572, 'time_pvalue': 0.7670968684102772
+ }
+ },
+ {
+ 'name': u'medium',
+ 'measurements': [
+ {'real_time_other': 5,
+ 'cpu_time': 80,
+ 'time': -0.375,
+ 'real_time': 8,
+ 'cpu_time_other': 53,
+ 'cpu': -0.3375
+ }
+ ],
+ 'utest': {},
+ 'time_unit': u'ns',
+ 'aggregate_name': ''
+ }
+ ]
+ self.assertEqual(len(self.json_diff_report), len(expected_output))
+ for out, expected in zip(
+ self.json_diff_report, expected_output):
+ self.assertEqual(out['name'], expected['name'])
+ self.assertEqual(out['time_unit'], expected['time_unit'])
+ assert_utest(self, out, expected)
+ assert_measurements(self, out, expected)
+
+
+class TestReportSorting(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ def load_result():
+ import json
+ testInputs = os.path.join(
+ os.path.dirname(
+ os.path.realpath(__file__)),
+ 'Inputs')
+ testOutput = os.path.join(testInputs, 'test4_run.json')
+ with open(testOutput, 'r') as f:
+ json = json.load(f)
+ return json
+
+ cls.json = load_result()
+
+ def test_json_diff_report_pretty_printing(self):
+ import util
+
+ expected_names = [
+ "99 family 0 instance 0 repetition 0",
+ "98 family 0 instance 0 repetition 1",
+ "97 family 0 instance 0 aggregate",
+ "96 family 0 instance 1 repetition 0",
+ "95 family 0 instance 1 repetition 1",
+ "94 family 0 instance 1 aggregate",
+ "93 family 1 instance 0 repetition 0",
+ "92 family 1 instance 0 repetition 1",
+ "91 family 1 instance 0 aggregate",
+ "90 family 1 instance 1 repetition 0",
+ "89 family 1 instance 1 repetition 1",
+ "88 family 1 instance 1 aggregate"
+ ]
+
+ for n in range(len(self.json['benchmarks']) ** 2):
+ random.shuffle(self.json['benchmarks'])
+ sorted_benchmarks = util.sort_benchmark_results(self.json)[
+ 'benchmarks']
+ self.assertEqual(len(expected_names), len(sorted_benchmarks))
+ for out, expected in zip(sorted_benchmarks, expected_names):
+ self.assertEqual(out['name'], expected)
+
+
+def assert_utest(unittest_instance, lhs, rhs):
+ if lhs['utest']:
+ unittest_instance.assertAlmostEqual(
+ lhs['utest']['cpu_pvalue'],
+ rhs['utest']['cpu_pvalue'])
+ unittest_instance.assertAlmostEqual(
+ lhs['utest']['time_pvalue'],
+ rhs['utest']['time_pvalue'])
+ unittest_instance.assertEqual(
+ lhs['utest']['have_optimal_repetitions'],
+ rhs['utest']['have_optimal_repetitions'])
+ else:
+ # lhs is empty. assert if rhs is not.
+ unittest_instance.assertEqual(lhs['utest'], rhs['utest'])
+
+
+def assert_measurements(unittest_instance, lhs, rhs):
+ for m1, m2 in zip(lhs['measurements'], rhs['measurements']):
+ unittest_instance.assertEqual(m1['real_time'], m2['real_time'])
+ unittest_instance.assertEqual(m1['cpu_time'], m2['cpu_time'])
+ # m1['time'] and m1['cpu'] hold values which are being calculated,
+ # and therefore we must use almost-equal pattern.
+ unittest_instance.assertAlmostEqual(m1['time'], m2['time'], places=4)
+ unittest_instance.assertAlmostEqual(m1['cpu'], m2['cpu'], places=4)
+
if __name__ == '__main__':
unittest.main()
import tempfile
import subprocess
import sys
+import functools
# Input file type enumeration
IT_Invalid = 0
return json.load(f)
+def sort_benchmark_results(result):
+ benchmarks = result['benchmarks']
+
+ # From inner key to the outer key!
+ benchmarks = sorted(
+ benchmarks, key=lambda benchmark: benchmark['repetition_index'] if 'repetition_index' in benchmark else -1)
+ benchmarks = sorted(
+ benchmarks, key=lambda benchmark: 1 if 'run_type' in benchmark and benchmark['run_type'] == "aggregate" else 0)
+ benchmarks = sorted(
+ benchmarks, key=lambda benchmark: benchmark['per_family_instance_index'] if 'per_family_instance_index' in benchmark else -1)
+ benchmarks = sorted(
+ benchmarks, key=lambda benchmark: benchmark['family_index'] if 'family_index' in benchmark else -1)
+
+ result['benchmarks'] = benchmarks
+ return result
+
+
def run_benchmark(exe_name, benchmark_flags):
"""
Run a benchmark specified by 'exe_name' with the specified
ftype = check_input_file(filename)
if ftype == IT_JSON:
return load_benchmark_results(filename)
- elif ftype == IT_Executable:
+ if ftype == IT_Executable:
return run_benchmark(filename, benchmark_flags)
- else:
- assert False # This branch is unreachable
+ raise ValueError('Unknown file type %s' % ftype)
--- /dev/null
+scipy>=1.5.0
\ No newline at end of file
#
#===----------------------------------------------------------------------===##
-from argparse import ArgumentParser
+import argparse
import os
-import shutil
-import sys
-import shlex
-import json
import re
-import libcxx.graph as dot
-import libcxx.util
-
-def print_and_exit(msg):
- sys.stderr.write(msg + '\n')
- sys.exit(1)
-
-def libcxx_include_path():
- curr_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- include_dir = os.path.join(curr_dir, 'include')
- return include_dir
-
-def get_libcxx_headers():
- headers = []
- include_dir = libcxx_include_path()
- for fname in os.listdir(include_dir):
- f = os.path.join(include_dir, fname)
- if not os.path.isfile(f):
- continue
- base, ext = os.path.splitext(fname)
- if (ext == '' or ext == '.h') and (not fname.startswith('__') or fname == '__config'):
- headers += [f]
- return headers
-
-
-def rename_headers_and_remove_test_root(graph):
- inc_root = libcxx_include_path()
- to_remove = set()
- for n in graph.nodes:
- assert 'label' in n.attributes
- l = n.attributes['label']
- if not l.startswith('/') and os.path.exists(os.path.join('/', l)):
- l = '/' + l
- if l.endswith('.tmp.cpp'):
- to_remove.add(n)
- if l.startswith(inc_root):
- l = l[len(inc_root):]
- if l.startswith('/'):
- l = l[1:]
- n.attributes['label'] = l
- for n in to_remove:
- graph.removeNode(n)
-
-def remove_non_std_headers(graph):
- inc_root = libcxx_include_path()
- to_remove = set()
- for n in graph.nodes:
- test_file = os.path.join(inc_root, n.attributes['label'])
- if not test_file.startswith(inc_root):
- to_remove.add(n)
- for xn in to_remove:
- graph.removeNode(xn)
-
-class DependencyCommand(object):
- def __init__(self, compile_commands, output_dir, new_std=None):
- output_dir = os.path.abspath(output_dir)
- if not os.path.isdir(output_dir):
- print_and_exit('"%s" must point to a directory' % output_dir)
- self.output_dir = output_dir
- self.new_std = new_std
- cwd,bcmd = self._get_base_command(compile_commands)
- self.cwd = cwd
- self.base_cmd = bcmd
-
- def run_for_headers(self, header_list):
- outputs = []
- for header in header_list:
- header_name = os.path.basename(header)
- out = os.path.join(self.output_dir, ('%s.dot' % header_name))
- outputs += [out]
- cmd = self.base_cmd + ["-fsyntax-only", "-Xclang", "-dependency-dot", "-Xclang", "%s" % out, '-xc++', '-']
- libcxx.util.executeCommandOrDie(cmd, cwd=self.cwd, input='#include <%s>\n\n' % header_name)
- return outputs
-
- def _get_base_command(self, command_file):
- commands = None
- with open(command_file, 'r') as f:
- commands = json.load(f)
- for compile_cmd in commands:
- file = compile_cmd['file']
- if not file.endswith('src/algorithm.cpp'):
- continue
- wd = compile_cmd['directory']
- cmd_str = compile_cmd['command']
- cmd = shlex.split(cmd_str)
- out_arg = cmd.index('-o')
- del cmd[out_arg]
- del cmd[out_arg]
- in_arg = cmd.index('-c')
- del cmd[in_arg]
- del cmd[in_arg]
- if self.new_std is not None:
- for f in cmd:
- if f.startswith('-std='):
- del cmd[cmd.index(f)]
- cmd += [self.new_std]
- break
- return wd, cmd
- print_and_exit("failed to find command to build algorithm.cpp")
-
-def post_process_outputs(outputs, libcxx_only):
- graphs = []
- for dot_file in outputs:
- g = dot.DirectedGraph.fromDotFile(dot_file)
- rename_headers_and_remove_test_root(g)
- if libcxx_only:
- remove_non_std_headers(g)
- graphs += [g]
- g.toDotFile(dot_file)
- return graphs
-
-def build_canonical_names(graphs):
- canonical_names = {}
- next_idx = 0
- for g in graphs:
- for n in g.nodes:
- if n.attributes['label'] not in canonical_names:
- name = 'header_%d' % next_idx
- next_idx += 1
- canonical_names[n.attributes['label']] = name
- return canonical_names
-
-
-
-class CanonicalGraphBuilder(object):
- def __init__(self, graphs):
- self.graphs = list(graphs)
- self.canonical_names = build_canonical_names(graphs)
-
- def build(self):
- self.canonical = dot.DirectedGraph('all_headers')
- for k,v in self.canonical_names.iteritems():
- n = dot.Node(v, edges=[], attributes={'shape': 'box', 'label': k})
- self.canonical.addNode(n)
- for g in self.graphs:
- self._merge_graph(g)
- return self.canonical
-
- def _merge_graph(self, g):
- for n in g.nodes:
- new_name = self.canonical.getNodeByLabel(n.attributes['label']).id
- for e in n.edges:
- to_node = self.canonical.getNodeByLabel(e.attributes['label']).id
- self.canonical.addEdge(new_name, to_node)
-
-
-def main():
- parser = ArgumentParser(
- description="Generate a graph of libc++ header dependencies")
- parser.add_argument(
- '-v', '--verbose', dest='verbose', action='store_true', default=False)
- parser.add_argument(
- '-o', '--output', dest='output', required=True,
- help='The output file. stdout is used if not given',
- type=str, action='store')
- parser.add_argument(
- '--no-compile', dest='no_compile', action='store_true', default=False)
- parser.add_argument(
- '--libcxx-only', dest='libcxx_only', action='store_true', default=False)
- parser.add_argument(
- 'compile_commands', metavar='compile-commands-file',
- help='the compile commands database')
-
- args = parser.parse_args()
- builder = DependencyCommand(args.compile_commands, args.output, new_std='-std=c++2a')
- if not args.no_compile:
- outputs = builder.run_for_headers(get_libcxx_headers())
- graphs = post_process_outputs(outputs, args.libcxx_only)
- else:
- outputs = [os.path.join(args.output, l) for l in os.listdir(args.output) if not l.endswith('all_headers.dot')]
- graphs = [dot.DirectedGraph.fromDotFile(o) for o in outputs]
-
- canon = CanonicalGraphBuilder(graphs).build()
- canon.toDotFile(os.path.join(args.output, 'all_headers.dot'))
- all_graphs = graphs + [canon]
+import sys
- found_cycles = False
- for g in all_graphs:
- cycle_finder = dot.CycleFinder(g)
- all_cycles = cycle_finder.findCyclesInGraph()
- if len(all_cycles):
- found_cycles = True
- print("cycle in graph %s" % g.name)
- for start, path in all_cycles:
- print("Cycle for %s = %s" % (start, path))
- if not found_cycles:
- print("No cycles found")
+def is_config_header(h):
+ return os.path.basename(h) in ['__config', '__libcpp_version', '__undef_macros']
+
+
+def is_experimental_header(h):
+ return ('experimental/' in h) or ('ext/' in h)
+
+
+def is_support_header(h):
+ return '__support/' in h
+
+
+class FileEntry:
+ def __init__(self, includes, individual_linecount):
+ self.includes = includes
+ self.individual_linecount = individual_linecount
+ self.cumulative_linecount = None # documentation: this gets filled in later
+ self.is_graph_root = None # documentation: this gets filled in later
+
+
+def list_all_roots_under(root):
+ result = []
+ for root, _, files in os.walk(root):
+ for fname in files:
+ if os.path.basename(root).startswith('__') or fname.startswith('__'):
+ pass
+ elif ('.' in fname and not fname.endswith('.h')):
+ pass
+ else:
+ result.append(root + '/' + fname)
+ return result
+
+
+def build_file_entry(fname, options):
+ assert os.path.exists(fname)
+
+ def locate_header_file(h, paths):
+ for p in paths:
+ fullname = p + '/' + h
+ if os.path.exists(fullname):
+ return fullname
+ if options.error_on_file_not_found:
+ raise RuntimeError('Header not found: %s, included by %s' % (h, fname))
+ return None
+
+ local_includes = []
+ system_includes = []
+ linecount = 0
+ with open(fname, 'r', encoding='utf-8') as f:
+ for line in f.readlines():
+ linecount += 1
+ m = re.match(r'\s*#\s*include\s+"([^"]*)"', line)
+ if m is not None:
+ local_includes.append(m.group(1))
+ m = re.match(r'\s*#\s*include\s+<([^>]*)>', line)
+ if m is not None:
+ system_includes.append(m.group(1))
+
+ fully_qualified_includes = [
+ locate_header_file(h, options.search_dirs)
+ for h in system_includes
+ ] + [
+ locate_header_file(h, os.path.dirname(fname))
+ for h in local_includes
+ ]
+
+ return FileEntry(
+ # If file-not-found wasn't an error, then skip non-found files
+ includes = [h for h in fully_qualified_includes if h is not None],
+ individual_linecount = linecount,
+ )
+
+
+def transitive_closure_of_includes(graph, h1):
+ visited = set()
+ def explore(graph, h1):
+ if h1 not in visited:
+ visited.add(h1)
+ for h2 in graph[h1].includes:
+ explore(graph, h2)
+ explore(graph, h1)
+ return visited
+
+
+def transitively_includes(graph, h1, h2):
+ return (h1 != h2) and (h2 in transitive_closure_of_includes(graph, h1))
+
+
+def build_graph(roots, options):
+ original_roots = list(roots)
+ graph = {}
+ while roots:
+ frontier = roots
+ roots = []
+ for fname in frontier:
+ if fname not in graph:
+ graph[fname] = build_file_entry(fname, options)
+ graph[fname].is_graph_root = (fname in original_roots)
+ roots += graph[fname].includes
+ for fname, entry in graph.items():
+ entry.cumulative_linecount = sum(graph[h].individual_linecount for h in transitive_closure_of_includes(graph, fname))
+ return graph
+
+
+def get_friendly_id(fname):
+ i = fname.index('include/')
+ assert(i >= 0)
+ result = fname[i+8:]
+ return result
+
+
+def get_graphviz(graph, options):
+
+ def get_decorators(fname, entry):
+ result = ''
+ if entry.is_graph_root:
+ result += ' [style=bold]'
+ if options.show_individual_line_counts and options.show_cumulative_line_counts:
+ result += ' [label="%s\\n%d indiv, %d cumul"]' % (
+ get_friendly_id(fname), entry.individual_linecount, entry.cumulative_linecount
+ )
+ elif options.show_individual_line_counts:
+ result += ' [label="%s\\n%d indiv"]' % (get_friendly_id(fname), entry.individual_linecount)
+ elif options.show_cumulative_line_counts:
+ result += ' [label="%s\\n%d cumul"]' % (get_friendly_id(fname), entry.cumulative_linecount)
+ return result
+
+ result = ''
+ result += 'strict digraph {\n'
+ result += ' rankdir=LR;\n'
+ result += ' layout=dot;\n\n'
+ for fname, entry in graph.items():
+ result += ' "%s"%s;\n' % (get_friendly_id(fname), get_decorators(fname, entry))
+ for h in entry.includes:
+ if any(transitively_includes(graph, i, h) for i in entry.includes) and not options.show_transitive_edges:
+ continue
+ result += ' "%s" -> "%s";\n' % (get_friendly_id(fname), get_friendly_id(h))
+ result += '}\n'
+ return result
if __name__ == '__main__':
- main()
+ parser = argparse.ArgumentParser(
+ description='Produce a dependency graph of libc++ headers, in GraphViz dot format.\n' +
+ 'For example, ./graph_header_deps.py | dot -Tpng > graph.png',
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ )
+ parser.add_argument('--root', default=None, metavar='FILE', help='File or directory to be the root of the dependency graph')
+ parser.add_argument('-I', dest='search_dirs', default=[], action='append', metavar='DIR', help='Path(s) to search for local includes')
+ parser.add_argument('--show-transitive-edges', action='store_true', help='Show edges to headers that are transitively included anyway')
+ parser.add_argument('--show-config-headers', action='store_true', help='Show universally included headers, such as __config')
+ parser.add_argument('--show-experimental-headers', action='store_true', help='Show headers in the experimental/ and ext/ directories')
+ parser.add_argument('--show-support-headers', action='store_true', help='Show headers in the __support/ directory')
+ parser.add_argument('--show-individual-line-counts', action='store_true', help='Include an individual line count in each node')
+ parser.add_argument('--show-cumulative-line-counts', action='store_true', help='Include a total line count in each node')
+ parser.add_argument('--error-on-file-not-found', action='store_true', help="Don't ignore failure to open an #included file")
+
+ options = parser.parse_args()
+
+ if options.root is None:
+ curr_dir = os.path.dirname(os.path.abspath(__file__))
+ options.root = os.path.join(curr_dir, '../include')
+
+ if options.search_dirs == [] and os.path.isdir(options.root):
+ options.search_dirs = [options.root]
+
+ options.root = os.path.abspath(options.root)
+ options.search_dirs = [os.path.abspath(p) for p in options.search_dirs]
+
+ if os.path.isdir(options.root):
+ roots = list_all_roots_under(options.root)
+ elif os.path.isfile(options.root):
+ roots = [options.root]
+ else:
+ raise RuntimeError('--root seems to be invalid')
+
+ graph = build_graph(roots, options)
+
+ # Eliminate certain kinds of "visual noise" headers, if asked for.
+ def should_keep(fname):
+ return all([
+ options.show_config_headers or not is_config_header(fname),
+ options.show_experimental_headers or not is_experimental_header(fname),
+ options.show_support_headers or not is_support_header(fname),
+ ])
+
+ for fname in list(graph.keys()):
+ if should_keep(fname):
+ graph[fname].includes = [h for h in graph[fname].includes if should_keep(h)]
+ else:
+ del graph[fname]
+
+ # Look for cycles.
+ no_cycles_detected = True
+ for fname, entry in graph.items():
+ for h in entry.includes:
+ if h == fname:
+ sys.stderr.write('Cycle detected: %s includes itself\n' % (
+ get_friendly_id(fname)
+ ))
+ no_cycles_detected = False
+ elif transitively_includes(graph, h, fname):
+ sys.stderr.write('Cycle detected between %s and %s\n' % (
+ get_friendly_id(fname), get_friendly_id(h)
+ ))
+ no_cycles_detected = False
+ assert no_cycles_detected
+
+ print(get_graphviz(graph, options))
self.flags = list(flags or [])
self.compile_flags = list(compile_flags or [])
self.link_flags = list(link_flags or [])
- self.link_libcxxabi_flag = '-lc++abi'
self.warning_flags = list(warning_flags or [])
self.verify_supported = verify_supported
self.use_verify = use_verify
with open(filename, 'rb') as f:
magic_bytes = f.read(4)
return magic_bytes in [
- '\xfe\xed\xfa\xce', # MH_MAGIC
- '\xce\xfa\xed\xfe', # MH_CIGAM
- '\xfe\xed\xfa\xcf', # MH_MAGIC_64
- '\xcf\xfa\xed\xfe', # MH_CIGAM_64
- '\xca\xfe\xba\xbe', # FAT_MAGIC
- '\xbe\xba\xfe\xca' # FAT_CIGAM
+ b'\xfe\xed\xfa\xce', # MH_MAGIC
+ b'\xce\xfa\xed\xfe', # MH_CIGAM
+ b'\xfe\xed\xfa\xcf', # MH_MAGIC_64
+ b'\xcf\xfa\xed\xfe', # MH_CIGAM_64
+ b'\xca\xfe\xba\xbe', # FAT_MAGIC
+ b'\xbe\xba\xfe\xca' # FAT_CIGAM
]
import copy
import os
-import platform
import pkgutil
import pipes
+import platform
import re
import shlex
import shutil
from libcxx.test.target_info import make_target_info
import libcxx.util
import libcxx.test.features
+import libcxx.test.newconfig
import libcxx.test.params
+import lit
def loadSiteConfig(lit_config, config, param_name, env_name):
# We haven't loaded the site specific configuration (the user is
self.link_shared = self.get_lit_bool('enable_shared', default=True)
self.debug_build = self.get_lit_bool('debug_build', default=False)
self.exec_env = dict()
- self.use_target = False
- self.use_system_cxx_lib = self.get_lit_bool('use_system_cxx_lib', False)
self.use_clang_verify = False
def get_lit_conf(self, name, default=None):
def make_static_lib_name(self, name):
"""Return the full filename for the specified library name"""
- if self.target_info.is_windows():
+ if self.target_info.is_windows() and not self.target_info.is_mingw():
assert name == 'c++' # Only allow libc++ to use this function for now.
return 'lib' + name + '.lib'
else:
return 'lib' + name + '.a'
def configure(self):
- self.configure_target_info()
- self.configure_executor()
+ self.target_info = make_target_info(self)
+ self.executor = self.get_lit_conf('executor')
self.configure_cxx()
- self.configure_triple()
- self.configure_deployment()
self.configure_src_root()
self.configure_obj_root()
self.cxx_stdlib_under_test = self.get_lit_conf('cxx_stdlib_under_test', 'libc++')
self.cxx_library_root = self.get_lit_conf('cxx_library_root', self.libcxx_obj_root)
- self.abi_library_root = self.get_lit_conf('abi_library_path', None)
+ self.abi_library_root = self.get_lit_conf('abi_library_root') or self.cxx_library_root
self.cxx_runtime_root = self.get_lit_conf('cxx_runtime_root', self.cxx_library_root)
+ self.abi_runtime_root = self.get_lit_conf('abi_runtime_root', self.abi_library_root)
self.configure_compile_flags()
self.configure_link_flags()
self.configure_env()
- self.configure_debug_mode()
- self.configure_warnings()
- self.configure_sanitizer()
self.configure_coverage()
- self.configure_modules()
self.configure_substitutions()
self.configure_features()
- self.configure_new_params()
- self.configure_new_features()
- def configure_new_features(self):
- supportedFeatures = [f for f in libcxx.test.features.features if f.isSupported(self.config)]
- for feature in supportedFeatures:
- feature.enableIn(self.config)
+ libcxx.test.newconfig.configure(
+ libcxx.test.params.DEFAULT_PARAMETERS,
+ libcxx.test.features.DEFAULT_FEATURES,
+ self.config,
+ self.lit_config
+ )
- def configure_new_params(self):
- for param in libcxx.test.params.parameters:
- feature = param.getFeature(self.config, self.lit_config.params)
- if feature:
- feature.enableIn(self.config)
+ self.lit_config.note("All available features: {}".format(self.config.available_features))
def print_config_info(self):
- # Print the final compile and link flags.
- self.lit_config.note('Using compiler: %s' % self.cxx.path)
- self.lit_config.note('Using flags: %s' % self.cxx.flags)
if self.cxx.use_modules:
self.lit_config.note('Using modules flags: %s' %
self.cxx.modules_flags)
- self.lit_config.note('Using compile flags: %s'
- % self.cxx.compile_flags)
if len(self.cxx.warning_flags):
self.lit_config.note('Using warnings: %s' % self.cxx.warning_flags)
- self.lit_config.note('Using link flags: %s' % self.cxx.link_flags)
- # Print as list to prevent "set([...])" from being printed.
- self.lit_config.note('Using available_features: %s' %
- list(sorted(self.config.available_features)))
show_env_vars = {}
for k,v in self.exec_env.items():
if k not in os.environ or os.environ[k] != v:
self.lit_config.note('Adding environment variables: %r' % show_env_vars)
self.lit_config.note("Linking against the C++ Library at {}".format(self.cxx_library_root))
self.lit_config.note("Running against the C++ Library at {}".format(self.cxx_runtime_root))
+ self.lit_config.note("Linking against the ABI Library at {}".format(self.abi_library_root))
+ self.lit_config.note("Running against the ABI Library at {}".format(self.abi_runtime_root))
sys.stderr.flush() # Force flushing to avoid broken output on Windows
def get_test_format(self):
self.executor,
exec_env=self.exec_env)
- def configure_executor(self):
- self.executor = self.get_lit_conf('executor')
- self.lit_config.note("Using executor: {}".format(self.executor))
-
- def configure_target_info(self):
- self.target_info = make_target_info(self)
-
def configure_cxx(self):
# Gather various compiler parameters.
cxx = self.get_lit_conf('cxx_under_test')
self.cxx_is_clang_cl = cxx is not None and \
- os.path.basename(cxx) == 'clang-cl.exe'
+ os.path.basename(cxx).startswith('clang-cl')
# If no specific cxx_under_test was given, attempt to infer it as
# clang++.
if cxx is None or self.cxx_is_clang_cl:
assert self.cxx_is_clang_cl
flags = []
- compile_flags = _prefixed_env_list('INCLUDE', '-isystem')
+ compile_flags = []
link_flags = _prefixed_env_list('LIB', '-L')
- for path in _split_env_var('LIB'):
- self.add_path(self.exec_env, path)
return CXXCompiler(self, clang_path, flags=flags,
compile_flags=compile_flags,
link_flags=link_flags)
self.libcxx_obj_root = self.project_obj_root
def configure_features(self):
- additional_features = self.get_lit_conf('additional_features')
- if additional_features:
- for f in additional_features.split(','):
- self.config.available_features.add(f.strip())
-
- # Write an "available feature" that combines the triple when
- # use_system_cxx_lib is enabled. This is so that we can easily write
- # XFAIL markers for tests that are known to fail with versions of
- # libc++ as were shipped with a particular triple.
- if self.use_system_cxx_lib:
- self.config.available_features.add('with_system_cxx_lib=%s' % self.config.target_triple)
-
- # Add available features for more generic versions of the target
- # triple attached to with_system_cxx_lib.
- if self.use_deployment:
- (_, name, version) = self.config.deployment
- self.config.available_features.add('with_system_cxx_lib=%s' % name)
- self.config.available_features.add('with_system_cxx_lib=%s%s' % (name, version))
-
- # Configure the availability feature. Availability is only enabled
- # with libc++, because other standard libraries do not provide
- # availability markup.
- if self.use_deployment and self.cxx_stdlib_under_test == 'libc++':
- (_, name, version) = self.config.deployment
- self.config.available_features.add('availability=%s' % name)
- self.config.available_features.add('availability=%s%s' % (name, version))
-
if self.target_info.is_windows():
if self.cxx_stdlib_under_test == 'libc++':
# LIBCXX-WINDOWS-FIXME is the feature name used to XFAIL the
# using this feature. (Also see llvm.org/PR32730)
self.config.available_features.add('LIBCXX-WINDOWS-FIXME')
- libcxx_gdb = self.get_lit_conf('libcxx_gdb')
- if libcxx_gdb and 'NOTFOUND' not in libcxx_gdb:
- self.config.available_features.add('libcxx_gdb')
- self.cxx.libcxx_gdb = libcxx_gdb
-
def configure_compile_flags(self):
self.configure_default_compile_flags()
# Configure extra flags
compile_flags_str = self.get_lit_conf('compile_flags', '')
self.cxx.compile_flags += shlex.split(compile_flags_str)
if self.target_info.is_windows():
- # FIXME: Can we remove this?
self.cxx.compile_flags += ['-D_CRT_SECURE_NO_WARNINGS']
+ # Don't warn about using common but nonstandard unprefixed functions
+ # like chdir, fileno.
+ self.cxx.compile_flags += ['-D_CRT_NONSTDC_NO_WARNINGS']
+ # Build the tests in the same configuration as libcxx itself,
+ # to avoid mismatches if linked statically.
+ self.cxx.compile_flags += ['-D_CRT_STDIO_ISO_WIDE_SPECIFIERS']
# Required so that tests using min/max don't fail on Windows,
# and so that those tests don't have to be changed to tolerate
# this insanity.
# Configure include paths
self.configure_compile_flags_header_includes()
self.target_info.add_cxx_compile_flags(self.cxx.compile_flags)
- # Configure feature flags.
- self.configure_compile_flags_rtti()
- enable_32bit = self.get_lit_bool('enable_32bit', False)
- if enable_32bit:
- self.cxx.flags += ['-m32']
+ self.target_info.add_cxx_flags(self.cxx.flags)
# Use verbose output for better errors
self.cxx.flags += ['-v']
sysroot = self.get_lit_conf('sysroot')
# being elided.
if self.target_info.is_windows() and self.debug_build:
self.cxx.compile_flags += ['-D_DEBUG']
- if self.use_target:
- if not self.cxx.addFlagIfSupported(
- ['--target=' + self.config.target_triple]):
- self.lit_config.warning('use_target is true but --target is '\
- 'not supported by the compiler')
- if self.use_deployment:
- arch, name, version = self.config.deployment
- self.cxx.flags += ['-arch', arch]
- self.cxx.flags += ['-m' + name + '-version-min=' + version]
# Add includes for support headers used in the tests.
support_path = os.path.join(self.libcxx_src_root, 'test/support')
def configure_compile_flags_header_includes(self):
support_path = os.path.join(self.libcxx_src_root, 'test', 'support')
- self.configure_config_site_header()
if self.cxx_stdlib_under_test != 'libstdc++' and \
- not self.target_info.is_windows():
+ not self.target_info.is_windows() and \
+ not self.target_info.is_zos():
self.cxx.compile_flags += [
'-include', os.path.join(support_path, 'nasty_macros.h')]
if self.cxx_stdlib_under_test == 'msvc':
'set_windows_crt_report_mode.h')
]
cxx_headers = self.get_lit_conf('cxx_headers')
- if cxx_headers == '' or (cxx_headers is None
- and self.cxx_stdlib_under_test != 'libc++'):
+ if cxx_headers is None and self.cxx_stdlib_under_test != 'libc++':
self.lit_config.note('using the system cxx headers')
return
self.cxx.compile_flags += ['-nostdinc++']
- if cxx_headers is None:
- cxx_headers = os.path.join(self.libcxx_src_root, 'include')
if not os.path.isdir(cxx_headers):
- self.lit_config.fatal("cxx_headers='%s' is not a directory."
- % cxx_headers)
+ self.lit_config.fatal("cxx_headers='{}' is not a directory.".format(cxx_headers))
+ (path, version) = os.path.split(cxx_headers)
+ (path, cxx) = os.path.split(path)
+ triple = self.get_lit_conf('target_triple', None)
+ if triple is not None:
+ cxx_target_headers = os.path.join(path, triple, cxx, version)
+ if os.path.isdir(cxx_target_headers):
+ self.cxx.compile_flags += ['-I' + cxx_target_headers]
self.cxx.compile_flags += ['-I' + cxx_headers]
if self.libcxx_obj_root is not None:
cxxabi_headers = os.path.join(self.libcxx_obj_root, 'include',
if os.path.isdir(cxxabi_headers):
self.cxx.compile_flags += ['-I' + cxxabi_headers]
- def configure_config_site_header(self):
- # Check for a possible __config_site in the build directory. We
- # use this if it exists.
- if self.libcxx_obj_root is None:
- return
- config_site_header = os.path.join(self.libcxx_obj_root, '__config_site')
- if not os.path.isfile(config_site_header):
- return
- self.cxx.compile_flags += ['-include', config_site_header]
-
- def configure_compile_flags_rtti(self):
- enable_rtti = self.get_lit_bool('enable_rtti', True)
- if not enable_rtti:
- self.config.available_features.add('-fno-rtti')
- self.cxx.compile_flags += ['-fno-rtti']
-
def configure_link_flags(self):
# Configure library path
self.configure_link_flags_cxx_library_path()
# Configure libraries
if self.cxx_stdlib_under_test == 'libc++':
- self.cxx.link_flags += ['-nodefaultlibs']
+ if self.target_info.is_mingw():
+ self.cxx.link_flags += ['-nostdlib++']
+ else:
+ self.cxx.link_flags += ['-nodefaultlibs']
# FIXME: Handle MSVCRT as part of the ABI library handling.
- if self.target_info.is_windows():
+ if self.target_info.is_windows() and not self.target_info.is_mingw():
self.cxx.link_flags += ['-nostdlib']
self.configure_link_flags_cxx_library()
self.configure_link_flags_abi_library()
# Configure ABI library paths.
if self.abi_library_root:
self.cxx.link_flags += ['-L' + self.abi_library_root]
+ if self.abi_runtime_root:
if not self.target_info.is_windows():
- self.cxx.link_flags += ['-Wl,-rpath,' + self.abi_library_root]
+ self.cxx.link_flags += ['-Wl,-rpath,' + self.abi_runtime_root]
else:
- self.add_path(self.exec_env, self.abi_library_root)
+ self.add_path(self.exec_env, self.abi_runtime_root)
def configure_link_flags_cxx_library(self):
if self.link_shared:
if self.abi_library_root:
libname = self.make_static_lib_name('c++abi')
abs_path = os.path.join(self.abi_library_root, libname)
- self.cxx.link_libcxxabi_flag = abs_path
self.cxx.link_flags += [abs_path]
else:
self.cxx.link_flags += ['-lc++abi']
self.cxx.link_flags += ['-lcxxrt']
elif cxx_abi == 'vcruntime':
debug_suffix = 'd' if self.debug_build else ''
+ # This matches the set of libraries linked in the toplevel
+ # libcxx CMakeLists.txt if building targeting msvc.
self.cxx.link_flags += ['-l%s%s' % (lib, debug_suffix) for lib in
- ['vcruntime', 'ucrt', 'msvcrt']]
+ ['vcruntime', 'ucrt', 'msvcrt', 'msvcprt']]
+ # The compiler normally links in oldnames.lib too, but we've
+ # specified -nostdlib above, so we need to specify it manually.
+ self.cxx.link_flags += ['-loldnames']
elif cxx_abi == 'none' or cxx_abi == 'default':
if self.target_info.is_windows():
debug_suffix = 'd' if self.debug_build else ''
self.cxx.link_flags += ['-lc++external_threads']
self.target_info.add_cxx_link_flags(self.cxx.link_flags)
- def configure_debug_mode(self):
- debug_level = self.get_lit_conf('debug_level', None)
- if not debug_level:
- return
- if debug_level not in ['0', '1']:
- self.lit_config.fatal('Invalid value for debug_level "%s".'
- % debug_level)
- self.cxx.compile_flags += ['-D_LIBCPP_DEBUG=%s' % debug_level]
-
- def configure_warnings(self):
- # Turn on warnings by default for Clang based compilers
- default_enable_warnings = self.cxx.type in ['clang', 'apple-clang']
- enable_warnings = self.get_lit_bool('enable_warnings',
- default_enable_warnings)
- self.cxx.useWarnings(enable_warnings)
- self.cxx.warning_flags += ['-Werror', '-Wall', '-Wextra']
- # On GCC, the libc++ headers cause errors due to throw() decorators
- # on operator new clashing with those from the test suite, so we
- # don't enable warnings in system headers on GCC.
- if self.cxx.type != 'gcc':
- self.cxx.warning_flags += ['-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER']
- self.cxx.addWarningFlagIfSupported('-Wshadow')
- self.cxx.addWarningFlagIfSupported('-Wno-unused-command-line-argument')
- self.cxx.addWarningFlagIfSupported('-Wno-attributes')
- self.cxx.addWarningFlagIfSupported('-Wno-pessimizing-move')
- self.cxx.addWarningFlagIfSupported('-Wno-c++11-extensions')
- self.cxx.addWarningFlagIfSupported('-Wno-user-defined-literals')
- self.cxx.addWarningFlagIfSupported('-Wno-noexcept-type')
- self.cxx.addWarningFlagIfSupported('-Wno-aligned-allocation-unavailable')
- self.cxx.addWarningFlagIfSupported('-Wno-atomic-alignment')
- # These warnings should be enabled in order to support the MSVC
- # team using the test suite; They enable the warnings below and
- # expect the test suite to be clean.
- self.cxx.addWarningFlagIfSupported('-Wsign-compare')
- self.cxx.addWarningFlagIfSupported('-Wunused-variable')
- self.cxx.addWarningFlagIfSupported('-Wunused-parameter')
- self.cxx.addWarningFlagIfSupported('-Wunreachable-code')
- self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')
-
- def configure_sanitizer(self):
- san = self.get_lit_conf('use_sanitizer', '').strip()
- if san:
- # Search for llvm-symbolizer along the compiler path first
- # and then along the PATH env variable.
- symbolizer_search_paths = os.environ.get('PATH', '')
- cxx_path = libcxx.util.which(self.cxx.path)
- if cxx_path is not None:
- symbolizer_search_paths = (
- os.path.dirname(cxx_path) +
- os.pathsep + symbolizer_search_paths)
- llvm_symbolizer = libcxx.util.which('llvm-symbolizer',
- symbolizer_search_paths)
-
- def add_ubsan():
- self.cxx.flags += ['-fsanitize=undefined',
- '-fno-sanitize=float-divide-by-zero',
- '-fno-sanitize-recover=all']
- self.exec_env['UBSAN_OPTIONS'] = 'print_stacktrace=1'
- self.config.available_features.add('ubsan')
-
- # Setup the sanitizer compile flags
- self.cxx.flags += ['-g', '-fno-omit-frame-pointer']
- if san == 'Address' or san == 'Address;Undefined' or san == 'Undefined;Address':
- self.cxx.flags += ['-fsanitize=address']
- if llvm_symbolizer is not None:
- self.exec_env['ASAN_SYMBOLIZER_PATH'] = llvm_symbolizer
- # FIXME: Turn ODR violation back on after PR28391 is resolved
- # https://bugs.llvm.org/show_bug.cgi?id=28391
- self.exec_env['ASAN_OPTIONS'] = 'detect_odr_violation=0'
- self.config.available_features.add('asan')
- self.config.available_features.add('sanitizer-new-delete')
- self.cxx.compile_flags += ['-O1']
- if san == 'Address;Undefined' or san == 'Undefined;Address':
- add_ubsan()
- elif san == 'Memory' or san == 'MemoryWithOrigins':
- self.cxx.flags += ['-fsanitize=memory']
- if san == 'MemoryWithOrigins':
- self.cxx.compile_flags += [
- '-fsanitize-memory-track-origins']
- if llvm_symbolizer is not None:
- self.exec_env['MSAN_SYMBOLIZER_PATH'] = llvm_symbolizer
- self.config.available_features.add('msan')
- self.config.available_features.add('sanitizer-new-delete')
- self.cxx.compile_flags += ['-O1']
- elif san == 'Undefined':
- add_ubsan()
- self.cxx.compile_flags += ['-O2']
- elif san == 'Thread':
- self.cxx.flags += ['-fsanitize=thread']
- self.config.available_features.add('tsan')
- self.config.available_features.add('sanitizer-new-delete')
- elif san == 'DataFlow':
- self.cxx.flags += ['-fsanitize=dataflow']
- else:
- self.lit_config.fatal('unsupported value for '
- 'use_sanitizer: {0}'.format(san))
- san_lib = self.get_lit_conf('sanitizer_library')
- if san_lib:
- self.cxx.link_flags += [
- san_lib, '-Wl,-rpath,%s' % os.path.dirname(san_lib)]
-
def configure_coverage(self):
self.generate_coverage = self.get_lit_bool('generate_coverage', False)
if self.generate_coverage:
self.cxx.flags += ['-g', '--coverage']
self.cxx.compile_flags += ['-O0']
- def configure_modules(self):
- modules_flags = ['-fmodules', '-Xclang', '-fmodules-local-submodule-visibility']
- supports_modules = self.cxx.hasCompileFlag(modules_flags)
- enable_modules = self.get_lit_bool('enable_modules', default=False,
- env_var='LIBCXX_ENABLE_MODULES')
- if enable_modules and not supports_modules:
- self.lit_config.fatal(
- '-fmodules is enabled but not supported by the compiler')
- if not supports_modules:
- return
- module_cache = os.path.join(self.config.test_exec_root,
- 'modules.cache')
- module_cache = os.path.realpath(module_cache)
- if os.path.isdir(module_cache):
- shutil.rmtree(module_cache)
- os.makedirs(module_cache)
- self.cxx.modules_flags += modules_flags + \
- ['-fmodules-cache-path=' + module_cache]
- if enable_modules:
- self.config.available_features.add('-fmodules')
- self.cxx.useModules()
+ def quote(self, s):
+ if platform.system() == 'Windows':
+ return lit.TestRunner.quote_windows_command([s])
+ return pipes.quote(s)
def configure_substitutions(self):
sub = self.config.substitutions
- sub.append(('%{cxx}', pipes.quote(self.cxx.path)))
+ sub.append(('%{cxx}', self.quote(self.cxx.path)))
flags = self.cxx.flags + (self.cxx.modules_flags if self.cxx.use_modules else [])
compile_flags = self.cxx.compile_flags + (self.cxx.warning_flags if self.cxx.use_warnings else [])
- sub.append(('%{flags}', ' '.join(map(pipes.quote, flags))))
- sub.append(('%{compile_flags}', ' '.join(map(pipes.quote, compile_flags))))
- sub.append(('%{link_flags}', ' '.join(map(pipes.quote, self.cxx.link_flags))))
- sub.append(('%{link_libcxxabi}', pipes.quote(self.cxx.link_libcxxabi_flag)))
+ sub.append(('%{flags}', ' '.join(map(self.quote, flags))))
+ sub.append(('%{compile_flags}', ' '.join(map(self.quote, compile_flags))))
+ sub.append(('%{link_flags}', ' '.join(map(self.quote, self.cxx.link_flags))))
+
codesign_ident = self.get_lit_conf('llvm_codesign_identity', '')
- env_vars = ' '.join('%s=%s' % (k, pipes.quote(v)) for (k, v) in self.exec_env.items())
+ env_vars = ' '.join('%s=%s' % (k, self.quote(v)) for (k, v) in self.exec_env.items())
exec_args = [
'--execdir %T',
'--codesign_identity "{}"'.format(codesign_ident),
'--env {}'.format(env_vars)
]
sub.append(('%{exec}', '{} {} -- '.format(self.executor, ' '.join(exec_args))))
- if self.get_lit_conf('libcxx_gdb'):
- sub.append(('%{libcxx_gdb}', self.get_lit_conf('libcxx_gdb')))
-
- def can_use_deployment(self):
- # Check if the host is on an Apple platform using clang.
- if not self.target_info.is_darwin():
- return False
- if not self.target_info.is_host_macosx():
- return False
- if not self.cxx.type.endswith('clang'):
- return False
- return True
-
- def configure_triple(self):
- # Get or infer the target triple.
- target_triple = self.get_lit_conf('target_triple')
- self.use_target = self.get_lit_bool('use_target', False)
- if self.use_target and target_triple:
- self.lit_config.warning('use_target is true but no triple is specified')
-
- # Use deployment if possible.
- self.use_deployment = not self.use_target and self.can_use_deployment()
- if self.use_deployment:
- return
-
- # Save the triple (and warn on Apple platforms).
- self.config.target_triple = target_triple
- if self.use_target and 'apple' in target_triple:
- self.lit_config.warning('consider using arch and platform instead'
- ' of target_triple on Apple platforms')
-
- # If no target triple was given, try to infer it from the compiler
- # under test.
- if not self.config.target_triple:
- target_triple = self.cxx.getTriple()
- # Drop sub-major version components from the triple, because the
- # current XFAIL handling expects exact matches for feature checks.
- # Example: x86_64-apple-darwin14.0.0 -> x86_64-apple-darwin14
- # The 5th group handles triples greater than 3 parts
- # (ex x86_64-pc-linux-gnu).
- target_triple = re.sub(r'([^-]+)-([^-]+)-([^.]+)([^-]*)(.*)',
- r'\1-\2-\3\5', target_triple)
- # linux-gnu is needed in the triple to properly identify linuxes
- # that use GLIBC. Handle redhat and opensuse triples as special
- # cases and append the missing `-gnu` portion.
- if (target_triple.endswith('redhat-linux') or
- target_triple.endswith('suse-linux')):
- target_triple += '-gnu'
- self.config.target_triple = target_triple
- self.lit_config.note(
- "inferred target_triple as: %r" % self.config.target_triple)
-
- def configure_deployment(self):
- assert not self.use_deployment is None
- assert not self.use_target is None
- if not self.use_deployment:
- # Warn about ignored parameters.
- if self.get_lit_conf('arch'):
- self.lit_config.warning('ignoring arch, using target_triple')
- if self.get_lit_conf('platform'):
- self.lit_config.warning('ignoring platform, using target_triple')
- return
-
- assert not self.use_target
- assert self.target_info.is_host_macosx()
-
- # Always specify deployment explicitly on Apple platforms, since
- # otherwise a platform is picked up from the SDK. If the SDK version
- # doesn't match the system version, tests that use the system library
- # may fail spuriously.
- arch = self.get_lit_conf('arch')
- if not arch:
- arch = self.cxx.getTriple().split('-', 1)[0]
- self.lit_config.note("inferred arch as: %r" % arch)
-
- inferred_platform, name, version = self.target_info.get_platform()
- if inferred_platform:
- self.lit_config.note("inferred platform as: %r" % (name + version))
- self.config.deployment = (arch, name, version)
-
- # Set the target triple for use by lit.
- self.config.target_triple = arch + '-apple-' + name + version
- self.lit_config.note(
- "computed target_triple as: %r" % self.config.target_triple)
-
- # If we're testing a system libc++ as opposed to the upstream LLVM one,
- # take the version of the system libc++ into account to compute which
- # features are enabled/disabled. Otherwise, disable availability markup,
- # which is not relevant for non-shipped flavors of libc++.
- if self.use_system_cxx_lib:
- # Dylib support for shared_mutex was added in macosx10.12.
- if name == 'macosx' and version in ('10.%s' % v for v in range(9, 12)):
- self.config.available_features.add('dylib-has-no-shared_mutex')
- self.lit_config.note("shared_mutex is not supported by the deployment target")
- # Throwing bad_optional_access, bad_variant_access and bad_any_cast is
- # supported starting in macosx10.13.
- if name == 'macosx' and version in ('10.%s' % v for v in range(9, 13)):
- self.config.available_features.add('dylib-has-no-bad_optional_access')
- self.lit_config.note("throwing bad_optional_access is not supported by the deployment target")
-
- self.config.available_features.add('dylib-has-no-bad_variant_access')
- self.lit_config.note("throwing bad_variant_access is not supported by the deployment target")
-
- self.config.available_features.add('dylib-has-no-bad_any_cast')
- self.lit_config.note("throwing bad_any_cast is not supported by the deployment target")
- else:
- self.cxx.compile_flags += ['-D_LIBCPP_DISABLE_AVAILABILITY']
def configure_env(self):
self.config.environment = dict(os.environ)
#
#===----------------------------------------------------------------------===##
-import libcxx.test.format
-import lit
-import lit.util
import os
+import pickle
import pipes
import platform
import re
import tempfile
-def _memoize(f):
- cache = dict()
- def memoized(x):
- if x not in cache:
- cache[x] = f(x)
- return cache[x]
- return memoized
+import libcxx.test.format
+import lit
+import lit.LitConfig
+import lit.Test
+import lit.TestRunner
+import lit.util
+
+
+def _memoizeExpensiveOperation(extractCacheKey):
+ """
+ Allows memoizing a very expensive operation.
+
+ We pickle the cache key to make sure we store an immutable representation
+ of it. If we stored an object and the object was referenced elsewhere, it
+ could be changed from under our feet, which would break the cache.
+ """
+ def decorator(function):
+ cache = {}
+ def f(*args, **kwargs):
+ cacheKey = pickle.dumps(extractCacheKey(*args, **kwargs))
+ if cacheKey not in cache:
+ cache[cacheKey] = function(*args, **kwargs)
+ return cache[cacheKey]
+ return f
+ return decorator
def _executeScriptInternal(test, commands):
"""
res = ('', '', 127, None)
return res
-def _makeConfigTest(config):
+def _makeConfigTest(config, testPrefix=''):
sourceRoot = os.path.join(config.test_exec_root, '__config_src__')
execRoot = os.path.join(config.test_exec_root, '__config_exec__')
suite = lit.Test.TestSuite('__config__', sourceRoot, execRoot, config)
if not os.path.exists(sourceRoot):
os.makedirs(sourceRoot)
- tmp = tempfile.NamedTemporaryFile(dir=sourceRoot, delete=False, suffix='.cpp')
+ tmp = tempfile.NamedTemporaryFile(dir=sourceRoot, delete=False, suffix='.cpp',
+ prefix=testPrefix)
tmp.close()
pathInSuite = [os.path.relpath(tmp.name, sourceRoot)]
class TestWrapper(lit.Test.Test):
def __exit__(self, *args): os.remove(tmp.name)
return TestWrapper(suite, pathInSuite, config)
+@_memoizeExpensiveOperation(lambda c, s: (c.substitutions, c.environment, s))
def sourceBuilds(config, source):
"""
Return whether the program in the given string builds successfully.
with _makeConfigTest(config) as test:
with open(test.getSourcePath(), 'w') as sourceFile:
sourceFile.write(source)
- out, err, exitCode, timeoutInfo = _executeScriptInternal(test, [
- "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe"
- ])
+ out, err, exitCode, timeoutInfo = _executeScriptInternal(test, ['%{build}'])
_executeScriptInternal(test, ['rm %t.exe'])
return exitCode == 0
-def programOutput(config, program, args=[]):
+@_memoizeExpensiveOperation(lambda c, p, args=None, testPrefix='': (c.substitutions, c.environment, p, args))
+def programOutput(config, program, args=None, testPrefix=''):
"""
Compiles a program for the test target, run it on the test target and return
the output.
execution of the program is done through the %{exec} substitution, which means
that the program may be run on a remote host depending on what %{exec} does.
"""
- with _makeConfigTest(config) as test:
+ if args is None:
+ args = []
+ with _makeConfigTest(config, testPrefix=testPrefix) as test:
with open(test.getSourcePath(), 'w') as source:
source.write(program)
try:
- _, _, exitCode, _ = _executeScriptInternal(test, [
- "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe",
- ])
+ _, _, exitCode, _ = _executeScriptInternal(test, ['%{build}'])
if exitCode != 0:
return None
- out, err, exitCode, _ = _executeScriptInternal(test, [
- "%{{exec}} %t.exe {}".format(' '.join(args))
- ])
+ out, err, exitCode, _ = _executeScriptInternal(test, ["%{{run}} {}".format(' '.join(args))])
if exitCode != 0:
return None
finally:
_executeScriptInternal(test, ['rm %t.exe'])
+@_memoizeExpensiveOperation(lambda c, f: (c.substitutions, c.environment, f))
def hasCompileFlag(config, flag):
"""
Return whether the compiler in the configuration supports a given compiler flag.
])
return exitCode == 0
-def hasLocale(config, locale):
+@_memoizeExpensiveOperation(lambda c, l: (c.substitutions, c.environment, l))
+def hasAnyLocale(config, locales):
"""
Return whether the runtime execution environment supports a given locale.
+ Different systems may use different names for a locale, so this function checks
+ whether any of the passed locale names is supported by setlocale() and returns
+ true if one of them works.
This is done by executing a program that tries to set the given locale using
%{exec} -- this means that the command may be executed on a remote host
"""
program = """
#include <locale.h>
- int main(int, char** argv) {
- if (::setlocale(LC_ALL, argv[1]) != NULL) return 0;
- else return 1;
+ #include <stdio.h>
+ int main(int argc, char** argv) {
+ // For debugging purposes print which locales are (not) supported.
+ for (int i = 1; i < argc; i++) {
+ if (::setlocale(LC_ALL, argv[i]) != NULL) {
+ printf("%s is supported.\\n", argv[i]);
+ return 0;
+ }
+ printf("%s is not supported.\\n", argv[i]);
+ }
+ return 1;
}
"""
- return programOutput(config, program, args=[pipes.quote(locale)]) != None
+ return programOutput(config, program, args=[pipes.quote(l) for l in locales],
+ testPrefix="check_locale_" + locales[0]) is not None
+@_memoizeExpensiveOperation(lambda c, flags='': (c.substitutions, c.environment, flags))
def compilerMacros(config, flags=''):
"""
Return a dictionary of predefined compiler macros.
be added to the compiler invocation when generating the macros.
"""
with _makeConfigTest(config) as test:
+ with open(test.getSourcePath(), 'w') as sourceFile:
+ # Make sure files like <__config> are included, since they can define
+ # additional macros.
+ sourceFile.write("#include <cstddef>")
unparsedOutput, err, exitCode, timeoutInfo = _executeScriptInternal(test, [
- "%{{cxx}} -xc++ {} -dM -E %{{flags}} %{{compile_flags}} {}".format(os.devnull, flags)
+ "%{{cxx}} %s -dM -E %{{flags}} %{{compile_flags}} {}".format(flags)
])
parsedMacros = dict()
defines = (l.strip() for l in unparsedOutput.split('\n') if l.startswith('#define '))
allMacros = compilerMacros(config, flags)
return {m: int(v.rstrip('LlUu')) for (m, v) in allMacros.items() if m.startswith('__cpp_')}
+def _appendToSubstitution(substitutions, key, value):
+ return [(k, v + ' ' + value) if k == key else (k, v) for (k, v) in substitutions]
+
+def _prependToSubstitution(substitutions, key, value):
+ return [(k, value + ' ' + v) if k == key else (k, v) for (k, v) in substitutions]
+
+
+class ConfigAction(object):
+ """
+ This class represents an action that can be performed on a Lit TestingConfig
+ object.
+
+ Examples of such actions are adding or modifying substitutions, Lit features,
+ etc. This class only provides the interface of such actions, and it is meant
+ to be subclassed appropriately to create new actions.
+ """
+ def applyTo(self, config):
+ """
+ Applies the action to the given configuration.
+
+ This should modify the configuration object in place, and return nothing.
+
+ If applying the action to the configuration would yield an invalid
+ configuration, and it is possible to diagnose it here, this method
+ should produce an error. For example, it should be an error to modify
+ a substitution in a way that we know for sure is invalid (e.g. adding
+ a compiler flag when we know the compiler doesn't support it). Failure
+ to do so early may lead to difficult-to-diagnose issues down the road.
+ """
+ pass
+
+ def pretty(self, config, litParams):
+ """
+ Returns a short and human-readable string describing what this action does.
+
+ This is used for logging purposes when running the test suite, so it should
+ be kept concise.
+ """
+ pass
+
+
+class AddFeature(ConfigAction):
+ """
+ This action defines the given Lit feature when running the test suite.
+
+ The name of the feature can be a string or a callable, in which case it is
+ called with the configuration to produce the feature name (as a string).
+ """
+ def __init__(self, name):
+ self._name = name
+
+ def _getName(self, config):
+ name = self._name(config) if callable(self._name) else self._name
+ if not isinstance(name, str):
+ raise ValueError("Lit feature did not resolve to a string (got {})".format(name))
+ return name
+
+ def applyTo(self, config):
+ config.available_features.add(self._getName(config))
+
+ def pretty(self, config, litParams):
+ return 'add Lit feature {}'.format(self._getName(config))
+
+
+class AddFlag(ConfigAction):
+ """
+ This action adds the given flag to the %{flags} substitution.
+
+ The flag can be a string or a callable, in which case it is called with the
+ configuration to produce the actual flag (as a string).
+ """
+ def __init__(self, flag):
+ self._getFlag = lambda config: flag(config) if callable(flag) else flag
+
+ def applyTo(self, config):
+ flag = self._getFlag(config)
+ assert hasCompileFlag(config, flag), "Trying to enable flag {}, which is not supported".format(flag)
+ config.substitutions = _appendToSubstitution(config.substitutions, '%{flags}', flag)
+
+ def pretty(self, config, litParams):
+ return 'add {} to %{{flags}}'.format(self._getFlag(config))
+
+
+class AddFlagIfSupported(ConfigAction):
+ """
+ This action adds the given flag to the %{flags} substitution, only if
+ the compiler supports the flag.
+
+ The flag can be a string or a callable, in which case it is called with the
+ configuration to produce the actual flag (as a string).
+ """
+ def __init__(self, flag):
+ self._getFlag = lambda config: flag(config) if callable(flag) else flag
+
+ def applyTo(self, config):
+ flag = self._getFlag(config)
+ if hasCompileFlag(config, flag):
+ config.substitutions = _appendToSubstitution(config.substitutions, '%{flags}', flag)
+
+ def pretty(self, config, litParams):
+ return 'add {} to %{{flags}}'.format(self._getFlag(config))
+
+
+class AddCompileFlag(ConfigAction):
+ """
+ This action adds the given flag to the %{compile_flags} substitution.
+
+ The flag can be a string or a callable, in which case it is called with the
+ configuration to produce the actual flag (as a string).
+ """
+ def __init__(self, flag):
+ self._getFlag = lambda config: flag(config) if callable(flag) else flag
+
+ def applyTo(self, config):
+ flag = self._getFlag(config)
+ assert hasCompileFlag(config, flag), "Trying to enable compile flag {}, which is not supported".format(flag)
+ config.substitutions = _appendToSubstitution(config.substitutions, '%{compile_flags}', flag)
+
+ def pretty(self, config, litParams):
+ return 'add {} to %{{compile_flags}}'.format(self._getFlag(config))
+
+
+class AddLinkFlag(ConfigAction):
+ """
+ This action appends the given flag to the %{link_flags} substitution.
+
+ The flag can be a string or a callable, in which case it is called with the
+ configuration to produce the actual flag (as a string).
+ """
+ def __init__(self, flag):
+ self._getFlag = lambda config: flag(config) if callable(flag) else flag
+
+ def applyTo(self, config):
+ flag = self._getFlag(config)
+ assert hasCompileFlag(config, flag), "Trying to enable link flag {}, which is not supported".format(flag)
+ config.substitutions = _appendToSubstitution(config.substitutions, '%{link_flags}', flag)
+
+ def pretty(self, config, litParams):
+ return 'append {} to %{{link_flags}}'.format(self._getFlag(config))
+
+
+class PrependLinkFlag(ConfigAction):
+ """
+ This action prepends the given flag to the %{link_flags} substitution.
+
+ The flag can be a string or a callable, in which case it is called with the
+ configuration to produce the actual flag (as a string).
+ """
+ def __init__(self, flag):
+ self._getFlag = lambda config: flag(config) if callable(flag) else flag
+
+ def applyTo(self, config):
+ flag = self._getFlag(config)
+ assert hasCompileFlag(config, flag), "Trying to enable link flag {}, which is not supported".format(flag)
+ config.substitutions = _prependToSubstitution(config.substitutions, '%{link_flags}', flag)
+
+ def pretty(self, config, litParams):
+ return 'prepend {} to %{{link_flags}}'.format(self._getFlag(config))
+
+
+class AddOptionalWarningFlag(ConfigAction):
+ """
+ This action adds the given warning flag to the %{compile_flags} substitution,
+ if it is supported by the compiler.
+
+ The flag can be a string or a callable, in which case it is called with the
+ configuration to produce the actual flag (as a string).
+ """
+ def __init__(self, flag):
+ self._getFlag = lambda config: flag(config) if callable(flag) else flag
+
+ def applyTo(self, config):
+ flag = self._getFlag(config)
+ # Use -Werror to make sure we see an error about the flag being unsupported.
+ if hasCompileFlag(config, '-Werror ' + flag):
+ config.substitutions = _appendToSubstitution(config.substitutions, '%{compile_flags}', flag)
+
+ def pretty(self, config, litParams):
+ return 'add {} to %{{compile_flags}}'.format(self._getFlag(config))
+
+
+class AddSubstitution(ConfigAction):
+ """
+ This action adds the given substitution to the Lit configuration.
+
+ The substitution can be a string or a callable, in which case it is called
+ with the configuration to produce the actual substitution (as a string).
+ """
+ def __init__(self, key, substitution):
+ self._key = key
+ self._getSub = lambda config: substitution(config) if callable(substitution) else substitution
+
+ def applyTo(self, config):
+ key = self._key
+ sub = self._getSub(config)
+ config.substitutions.append((key, sub))
+
+ def pretty(self, config, litParams):
+ return 'add substitution {} = {}'.format(self._key, self._getSub(config))
+
class Feature(object):
"""
control whether a Feature is enabled -- it should be enabled whenever it
is supported.
"""
- def __init__(self, name, compileFlag=None, linkFlag=None, when=lambda _: True):
+ def __init__(self, name, actions=None, when=lambda _: True):
"""
Create a Lit feature for consumption by a test suite.
callable, in which case it is passed the TestingConfig and should
generate a string representing the name of the feature.
- - compileFlag
- An optional compile flag to add when this feature is added to a
- TestingConfig. If provided, this must be a string representing a
- compile flag that will be appended to the end of the %{compile_flags}
- substitution of the TestingConfig.
-
- - linkFlag
- An optional link flag to add when this feature is added to a
- TestingConfig. If provided, this must be a string representing a
- link flag that will be appended to the end of the %{link_flags}
- substitution of the TestingConfig.
+ - actions
+ An optional list of ConfigActions to apply when the feature is supported.
+ An AddFeature action is always created regardless of any actions supplied
+ here -- these actions are meant to perform more than setting a corresponding
+ Lit feature (e.g. adding compiler flags). If 'actions' is a callable, it
+ is called with the current configuration object to generate the actual
+ list of actions.
- when
A callable that gets passed a TestingConfig and should return a
supported.
"""
self._name = name
- self._compileFlag = compileFlag
- self._linkFlag = linkFlag
+ self._actions = [] if actions is None else actions
self._isSupported = when
- def isSupported(self, config):
- """
- Return whether the feature is supported by the given TestingConfig.
- """
- return self._isSupported(config)
+ def _getName(self, config):
+ name = self._name(config) if callable(self._name) else self._name
+ if not isinstance(name, str):
+ raise ValueError("Feature did not resolve to a name that's a string, got {}".format(name))
+ return name
- def enableIn(self, config):
+ def getActions(self, config):
"""
- Enable a feature in a TestingConfig.
+ Return the list of actions associated to this feature.
- The name of the feature is added to the set of available features of
- `config`, and any compile or link flags provided upon construction of
- the Feature are added to the end of the corresponding substitution in
- the config.
-
- It is an error to call `f.enableIn(cfg)` if the feature `f` is not
- supported in that TestingConfig (i.e. if `not f.isSupported(cfg)`).
+ If the feature is not supported, an empty list is returned.
+ If the feature is supported, an `AddFeature` action is automatically added
+ to the returned list of actions, in addition to any actions provided on
+ construction.
"""
- assert self.isSupported(config), \
- "Trying to enable feature {} that is not supported in the given configuration".format(self._name)
-
- addTo = lambda subs, sub, flag: [(s, x + ' ' + flag) if s == sub else (s, x) for (s, x) in subs]
- if self._compileFlag:
- compileFlag = self._compileFlag(config) if callable(self._compileFlag) else self._compileFlag
- config.substitutions = addTo(config.substitutions, '%{compile_flags}', compileFlag)
- if self._linkFlag:
- linkFlag = self._linkFlag(config) if callable(self._linkFlag) else self._linkFlag
- config.substitutions = addTo(config.substitutions, '%{link_flags}', linkFlag)
+ if not self._isSupported(config):
+ return []
+ else:
+ actions = self._actions(config) if callable(self._actions) else self._actions
+ return [AddFeature(self._getName(config))] + actions
- name = self._name(config) if callable(self._name) else self._name
- if not isinstance(name, str):
- raise ValueError("Feature did not resolve to a name that's a string, got {}".format(name))
- config.available_features.add(name)
+ def pretty(self, config):
+ """
+ Returns the Feature's name.
+ """
+ return self._getName(config)
def _str_to_bool(s):
else:
raise ValueError("Got string '{}', which isn't a valid boolean".format(s))
+def _parse_parameter(s, type):
+ if type is bool and isinstance(s, str):
+ return _str_to_bool(s)
+ elif type is list and isinstance(s, str):
+ return [x.strip() for x in s.split(',') if x.strip()]
+ return type(s)
+
class Parameter(object):
"""
that use that `config` object.
Parameters can have multiple possible values, and they can have a default
- value when left unspecified. They can also have a Feature associated to them,
- in which case the Feature is added to the TestingConfig if the parameter is
- enabled. It is an error if the Parameter is enabled but the Feature associated
- to it is not supported, for example trying to set the compilation standard to
- C++17 when `-std=c++17` is not supported by the compiler.
-
- One important point is that Parameters customize the behavior of the test
- suite in a bounded way, i.e. there should be a finite set of possible choices
- for `<VALUE>`. While this may appear to be an aggressive restriction, this
- is actually a very important constraint that ensures that the set of
- configurations supported by a test suite is finite. Otherwise, a test
- suite could have an unbounded number of supported configurations, and
- nobody wants to be stuck maintaining that. If it's not possible for an
- option to have a finite set of possible values (e.g. the path to the
- compiler), it can be handled in the `lit.cfg`, but it shouldn't be
- represented with a Parameter.
- """
- def __init__(self, name, choices, type, help, feature, default=None):
+ value when left unspecified. They can also have any number of ConfigActions
+ associated to them, in which case the actions will be performed on the
+ TestingConfig if the parameter is enabled. Depending on the actions
+ associated to a Parameter, it may be an error to enable the Parameter
+ if some actions are not supported in the given configuration. For example,
+ trying to set the compilation standard to C++23 when `-std=c++23` is not
+ supported by the compiler would be an error.
+ """
+ def __init__(self, name, type, help, actions, choices=None, default=None):
"""
Create a Lit parameter to customize the behavior of a test suite.
when running Lit. This must be non-empty.
- choices
- A non-empty set of possible values for this parameter. This must be
- anything that can be iterated. It is an error if the parameter is
- given a value that is not in that set, whether explicitly or through
- a default value.
+ An optional non-empty set of possible values for this parameter. If provided,
+ this must be anything that can be iterated. It is an error if the parameter
+ is given a value that is not in that set, whether explicitly or through a
+ default value.
- type
A callable that can be used to parse the value of the parameter given
on the command-line. As a special case, using the type `bool` also
- allows parsing strings with boolean-like contents.
+ allows parsing strings with boolean-like contents, and the type `list`
+ will parse a string delimited by commas into a list of the substrings.
- help
A string explaining the parameter, for documentation purposes.
TODO: We should be able to surface those from the Lit command-line.
- - feature
+ - actions
A callable that gets passed the parsed value of the parameter (either
the one passed on the command-line or the default one), and that returns
- either None or a Feature.
+ a list of ConfigAction to perform given the value of the parameter.
+ All the ConfigAction must be supported in the given configuration.
- default
An optional default value to use for the parameter when no value is
if len(self._name) == 0:
raise ValueError("Parameter name must not be the empty string")
- self._choices = list(choices) # should be finite
- if len(self._choices) == 0:
- raise ValueError("Parameter '{}' must be given at least one possible value".format(self._name))
+ if choices is not None:
+ self._choices = list(choices) # should be finite
+ if len(self._choices) == 0:
+ raise ValueError("Parameter '{}' must be given at least one possible value".format(self._name))
+ else:
+ self._choices = None
- self._parse = lambda x: (_str_to_bool(x) if type is bool and isinstance(x, str)
- else type(x))
+ self._parse = lambda x: _parse_parameter(x, type)
self._help = help
- self._feature = feature
+ self._actions = actions
self._default = default
+ def _getValue(self, config, litParams):
+ """
+ Return the value of the parameter given the configuration objects.
+ """
+ param = getattr(config, self.name, None)
+ param = litParams.get(self.name, param)
+ if param is None and self._default is None:
+ raise ValueError("Parameter {} doesn't have a default value, but it was not specified in the Lit parameters or in the Lit config".format(self.name))
+ getDefault = lambda: self._default(config) if callable(self._default) else self._default
+
+ if param is not None:
+ (pretty, value) = (param, self._parse(param))
+ else:
+ value = getDefault()
+ pretty = '{} (default)'.format(value)
+
+ if self._choices and value not in self._choices:
+ raise ValueError("Got value '{}' for parameter '{}', which is not in the provided set of possible choices: {}".format(value, self.name, self._choices))
+ return (pretty, value)
+
@property
def name(self):
"""
"""
return self._name
- def getFeature(self, config, litParams):
- param = getattr(config, self.name, None)
- param = litParams.get(self.name, param)
- if param is None and self._default is None:
- raise ValueError("Parameter {} doesn't have a default value, but it was not specified in the Lit parameters or in the Lit config".format(self.name))
- getDefault = lambda: self._default(config) if callable(self._default) else self._default
- value = self._parse(param) if param is not None else getDefault()
- if value not in self._choices:
- raise ValueError("Got value '{}' for parameter '{}', which is not in the provided set of possible choices: {}".format(value, self.name, self._choices))
- return self._feature(value)
+ def getActions(self, config, litParams):
+ """
+ Return the list of actions associated to this value of the parameter.
+ """
+ (_, parameterValue) = self._getValue(config, litParams)
+ return self._actions(parameterValue)
+
+ def pretty(self, config, litParams):
+ """
+ Return a pretty representation of the parameter's name and value.
+ """
+ (prettyParameterValue, _) = self._getValue(config, litParams)
+ return "{}={}".format(self.name, prettyParameterValue)
#===----------------------------------------------------------------------===##
from libcxx.test.dsl import *
+import re
+import shutil
import sys
_isClang = lambda cfg: '__clang__' in compilerMacros(cfg) and '__apple_build_version__' not in compilerMacros(cfg)
_isAppleClang = lambda cfg: '__apple_build_version__' in compilerMacros(cfg)
_isGCC = lambda cfg: '__GNUC__' in compilerMacros(cfg) and '__clang__' not in compilerMacros(cfg)
+_isMSVC = lambda cfg: '_MSC_VER' in compilerMacros(cfg)
+_msvcVersion = lambda cfg: (int(compilerMacros(cfg)['_MSC_VER']) // 100, int(compilerMacros(cfg)['_MSC_VER']) % 100)
-features = [
- Feature(name='fcoroutines-ts', compileFlag='-fcoroutines-ts',
+DEFAULT_FEATURES = [
+ Feature(name='fcoroutines-ts',
when=lambda cfg: hasCompileFlag(cfg, '-fcoroutines-ts') and
- featureTestMacros(cfg, flags='-fcoroutines-ts').get('__cpp_coroutines', 0) >= 201703),
+ featureTestMacros(cfg, flags='-fcoroutines-ts').get('__cpp_coroutines', 0) >= 201703,
+ actions=[AddCompileFlag('-fcoroutines-ts')]),
+
+ Feature(name='thread-safety',
+ when=lambda cfg: hasCompileFlag(cfg, '-Werror=thread-safety'),
+ actions=[AddCompileFlag('-Werror=thread-safety')]),
+
+ Feature(name='diagnose-if-support',
+ when=lambda cfg: hasCompileFlag(cfg, '-Wuser-defined-warnings'),
+ actions=[AddCompileFlag('-Wuser-defined-warnings')]),
- Feature(name='thread-safety', when=lambda cfg: hasCompileFlag(cfg, '-Werror=thread-safety'), compileFlag='-Werror=thread-safety'),
Feature(name='has-fblocks', when=lambda cfg: hasCompileFlag(cfg, '-fblocks')),
Feature(name='-fsized-deallocation', when=lambda cfg: hasCompileFlag(cfg, '-fsized-deallocation')),
Feature(name='-faligned-allocation', when=lambda cfg: hasCompileFlag(cfg, '-faligned-allocation')),
Feature(name='libcpp-no-if-constexpr', when=lambda cfg: '__cpp_if_constexpr' not in featureTestMacros(cfg)),
Feature(name='libcpp-no-structured-bindings', when=lambda cfg: '__cpp_structured_bindings' not in featureTestMacros(cfg)),
Feature(name='libcpp-no-deduction-guides', when=lambda cfg: featureTestMacros(cfg).get('__cpp_deduction_guides', 0) < 201611),
- Feature(name='libcpp-no-concepts', when=lambda cfg: featureTestMacros(cfg).get('__cpp_concepts', 0) < 201811),
+ Feature(name='libcpp-no-concepts', when=lambda cfg: featureTestMacros(cfg).get('__cpp_concepts', 0) < 201907),
Feature(name='has-fobjc-arc', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc') and
sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.
Feature(name='objective-c++', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc')),
- Feature(name='diagnose-if-support', when=lambda cfg: hasCompileFlag(cfg, '-Wuser-defined-warnings'), compileFlag='-Wuser-defined-warnings'),
- Feature(name='modules-support', when=lambda cfg: hasCompileFlag(cfg, '-fmodules')),
- Feature(name='non-lockfree-atomics', when=lambda cfg: sourceBuilds(cfg, """
- #include <atomic>
- struct Large { int storage[100]; };
- std::atomic<Large> x;
- int main(int, char**) { return x.load(), x.is_lock_free(); }
- """)),
+ Feature(name='no-noexcept-function-type', when=lambda cfg: featureTestMacros(cfg).get('__cpp_noexcept_function_type', 0) < 201510),
+
+ Feature(name='non-lockfree-atomics',
+ when=lambda cfg: sourceBuilds(cfg, """
+ #include <atomic>
+ struct Large { int storage[100]; };
+ std::atomic<Large> x;
+ int main(int, char**) { (void)x.load(); return 0; }
+ """)),
+ # TODO: Remove this feature once compiler-rt includes __atomic_is_lockfree()
+ # on all supported platforms.
+ Feature(name='is-lockfree-runtime-function',
+ when=lambda cfg: sourceBuilds(cfg, """
+ #include <atomic>
+ struct Large { int storage[100]; };
+ std::atomic<Large> x;
+ int main(int, char**) { return x.is_lock_free(); }
+ """)),
Feature(name='apple-clang', when=_isAppleClang),
Feature(name=lambda cfg: 'apple-clang-{__clang_major__}'.format(**compilerMacros(cfg)), when=_isAppleClang),
Feature(name=lambda cfg: 'apple-clang-{__clang_major__}.{__clang_minor__}'.format(**compilerMacros(cfg)), when=_isAppleClang),
Feature(name=lambda cfg: 'apple-clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}'.format(**compilerMacros(cfg)), when=_isAppleClang),
- Feature(name='clang', when=_isClang),
+ Feature(name='clang', when=_isClang,
+ actions=[AddCompileFlag('-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER')]),
Feature(name=lambda cfg: 'clang-{__clang_major__}'.format(**compilerMacros(cfg)), when=_isClang),
Feature(name=lambda cfg: 'clang-{__clang_major__}.{__clang_minor__}'.format(**compilerMacros(cfg)), when=_isClang),
Feature(name=lambda cfg: 'clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}'.format(**compilerMacros(cfg)), when=_isClang),
Feature(name=lambda cfg: 'gcc-{__GNUC__}'.format(**compilerMacros(cfg)), when=_isGCC),
Feature(name=lambda cfg: 'gcc-{__GNUC__}.{__GNUC_MINOR__}'.format(**compilerMacros(cfg)), when=_isGCC),
Feature(name=lambda cfg: 'gcc-{__GNUC__}.{__GNUC_MINOR__}.{__GNUC_PATCHLEVEL__}'.format(**compilerMacros(cfg)), when=_isGCC),
+
+ Feature(name='msvc', when=_isMSVC),
+ Feature(name=lambda cfg: 'msvc-{}'.format(*_msvcVersion(cfg)), when=_isMSVC),
+ Feature(name=lambda cfg: 'msvc-{}.{}'.format(*_msvcVersion(cfg)), when=_isMSVC),
]
# Deduce and add the test features that that are implied by the #defines in
'_LIBCPP_HAS_THREAD_API_PTHREAD': 'libcpp-has-thread-api-pthread',
'_LIBCPP_NO_VCRUNTIME': 'libcpp-no-vcruntime',
'_LIBCPP_ABI_VERSION': 'libcpp-abi-version',
- '_LIBCPP_ABI_UNSTABLE': 'libcpp-abi-unstable'
+ '_LIBCPP_ABI_UNSTABLE': 'libcpp-abi-unstable',
+ '_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY': 'libcpp-has-no-filesystem-library',
+ '_LIBCPP_HAS_NO_RANDOM_DEVICE': 'libcpp-has-no-random-device',
+ '_LIBCPP_HAS_NO_LOCALIZATION': 'libcpp-has-no-localization',
+ '_LIBCPP_HAS_NO_INCOMPLETE_FORMAT': 'libcpp-has-no-incomplete-format',
+ '_LIBCPP_HAS_NO_INCOMPLETE_RANGES': 'libcpp-has-no-incomplete-ranges',
}
for macro, feature in macros.items():
- features += [
+ DEFAULT_FEATURES += [
Feature(name=lambda cfg, m=macro, f=feature: f + (
'={}'.format(compilerMacros(cfg)[m]) if compilerMacros(cfg)[m] else ''
),
# FIXME: This is a hack that should be fixed using module maps.
# If modules are enabled then we have to lift all of the definitions
# in <__config_site> onto the command line.
- compileFlag=lambda cfg, m=macro: '-Wno-macro-redefined -D{}'.format(m) + (
- '={}'.format(compilerMacros(cfg)[m]) if compilerMacros(cfg)[m] else ''
- )
+ actions=lambda cfg, m=macro: [
+ AddCompileFlag('-Wno-macro-redefined -D{}'.format(m) + (
+ '={}'.format(compilerMacros(cfg)[m]) if compilerMacros(cfg)[m] else ''
+ ))
+ ]
)
]
'cs_CZ.ISO8859-2': ['cs_CZ.ISO8859-2', 'Czech_Czech Republic.1250']
}
for locale, alts in locales.items():
- features += [
- Feature(name='locale.{}'.format(locale),
- when=lambda cfg: any(hasLocale(cfg, alt) for alt in alts))
- ]
+ # Note: Using alts directly in the lambda body here will bind it to the value at the
+ # end of the loop. Assigning it to a default argument works around this issue.
+ DEFAULT_FEATURES.append(Feature(name='locale.{}'.format(locale),
+ when=lambda cfg, alts=alts: hasAnyLocale(cfg, alts)))
# Add features representing the platform name: darwin, linux, windows, etc...
-features += [
+DEFAULT_FEATURES += [
Feature(name='darwin', when=lambda cfg: '__APPLE__' in compilerMacros(cfg)),
Feature(name='windows', when=lambda cfg: '_WIN32' in compilerMacros(cfg)),
+ Feature(name='windows-dll', when=lambda cfg: '_WIN32' in compilerMacros(cfg) and not '_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS' in compilerMacros(cfg)),
Feature(name='linux', when=lambda cfg: '__linux__' in compilerMacros(cfg)),
- Feature(name='netbsd', when=lambda cfg: '__NetBSD__' in compilerMacros(cfg))
+ Feature(name='netbsd', when=lambda cfg: '__NetBSD__' in compilerMacros(cfg)),
+ Feature(name='freebsd', when=lambda cfg: '__FreeBSD__' in compilerMacros(cfg))
+]
+
+
+# Detect whether GDB is on the system, and if so add a substitution to access it.
+DEFAULT_FEATURES += [
+ Feature(name='host-has-gdb',
+ when=lambda cfg: shutil.which('gdb') is not None,
+ actions=[AddSubstitution('%{gdb}', lambda cfg: shutil.which('gdb'))]
+ )
]
tmpBase = os.path.join(tmpDir, 't')
return tmpDir, tmpBase
+def _checkBaseSubstitutions(substitutions):
+ substitutions = [s for (s, _) in substitutions]
+ for s in ['%{cxx}', '%{compile_flags}', '%{link_flags}', '%{flags}', '%{exec}']:
+ assert s in substitutions, "Required substitution {} was not provided".format(s)
+
def parseScript(test, preamble):
"""
Extract the script from a test, with substitutions applied.
# Get the default substitutions
tmpDir, tmpBase = _getTempPaths(test)
- useExternalSh = True
- substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase,
- normalize_slashes=useExternalSh)
+ substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase)
- # Add the %{build} and %{run} convenience substitutions
+ # Check base substitutions and add the %{build} and %{run} convenience substitutions
+ _checkBaseSubstitutions(substitutions)
substitutions.append(('%{build}', '%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe'))
substitutions.append(('%{run}', '%{exec} %t.exe'))
FOO.pass.cpp - Compiles, links and runs successfully
FOO.pass.mm - Same as .pass.cpp, but for Objective-C++
- FOO.run.fail.cpp - Compiles and links successfully, but fails at runtime
FOO.compile.pass.cpp - Compiles successfully, link and run not attempted
FOO.compile.fail.cpp - Does not compile successfully
in conjunction with the %{build} substitution.
"""
def getTestsInDirectory(self, testSuite, pathInSuite, litConfig, localConfig):
- SUPPORTED_SUFFIXES = ['[.]pass[.]cpp$', '[.]pass[.]mm$', '[.]run[.]fail[.]cpp$',
+ SUPPORTED_SUFFIXES = ['[.]pass[.]cpp$', '[.]pass[.]mm$',
'[.]compile[.]pass[.]cpp$', '[.]compile[.]fail[.]cpp$',
'[.]link[.]pass[.]cpp$', '[.]link[.]fail[.]cpp$',
'[.]sh[.][^.]+$',
if any([re.search(ext, filename) for ext in SUPPORTED_SUFFIXES]):
yield lit.Test.Test(testSuite, pathInSuite + (filename,), localConfig)
- def _checkBaseSubstitutions(self, substitutions):
- substitutions = [s for (s, _) in substitutions]
- for s in ['%{cxx}', '%{compile_flags}', '%{link_flags}', '%{flags}', '%{exec}']:
- assert s in substitutions, "Required substitution {} was not provided".format(s)
-
def _disableWithModules(self, test):
with open(test.getSourcePath(), 'rb') as f:
contents = f.read()
return b'#define _LIBCPP_ASSERT' in contents
def execute(self, test, litConfig):
- self._checkBaseSubstitutions(test.config.substitutions)
VERIFY_FLAGS = '-Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0'
supportsVerify = _supportsVerify(test.config)
filename = test.path_in_suite[-1]
# split the part that does a death test outside of the
# test, and only disable that part when modules are
# enabled.
- if '-fmodules' in test.config.available_features and self._disableWithModules(test):
+ if 'modules-build' in test.config.available_features and self._disableWithModules(test):
return lit.Test.Result(lit.Test.UNSUPPORTED, 'Test {} is unsupported when modules are enabled')
if re.search('[.]sh[.][^.]+$', filename):
"%dbg(LINKED WITH) ! %{cxx} %t.o %{flags} %{link_flags} -o %t.exe"
]
return self._executeShTest(test, litConfig, steps)
- elif filename.endswith('.run.fail.cpp'):
- steps = [
- "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe",
- "%dbg(EXECUTED AS) %{exec} ! %t.exe"
- ]
- return self._executeShTest(test, litConfig, steps)
elif filename.endswith('.verify.cpp'):
if not supportsVerify:
return lit.Test.Result(lit.Test.UNSUPPORTED,
return lit.Test.Result(lit.Test.XFAIL if test.isExpectedToFail() else lit.Test.PASS)
else:
_, tmpBase = _getTempPaths(test)
- useExternalSh = True
+ useExternalSh = False
return lit.TestRunner._runShTest(test, litConfig, useExternalSh, script, tmpBase)
--- /dev/null
+#===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===----------------------------------------------------------------------===##
+
+def _getSubstitution(substitution, config):
+ for (orig, replacement) in config.substitutions:
+ if orig == substitution:
+ return replacement
+ raise ValueError('Substitution {} is not in the config.'.format(substitution))
+
+def configure(parameters, features, config, lit_config):
+ # Apply the actions supplied by parameters to the configuration first, since
+ # parameters are things that we request explicitly and which might influence
+ # what features are implicitly made available next.
+ for param in parameters:
+ actions = param.getActions(config, lit_config.params)
+ for action in actions:
+ action.applyTo(config)
+ lit_config.note("Applied '{}' as a result of parameter '{}'".format(
+ action.pretty(config, lit_config.params),
+ param.pretty(config, lit_config.params)))
+
+ # Then, apply the automatically-detected features.
+ for feature in features:
+ actions = feature.getActions(config)
+ for action in actions:
+ action.applyTo(config)
+ lit_config.note("Applied '{}' as a result of implicitly detected feature '{}'".format(
+ action.pretty(config, lit_config.params),
+ feature.pretty(config)))
+
+ # Print the basic substitutions
+ for sub in ('%{cxx}', '%{flags}', '%{compile_flags}', '%{link_flags}', '%{exec}'):
+ lit_config.note("Using {} substitution: '{}'".format(sub, _getSubstitution(sub, config)))
#===----------------------------------------------------------------------===##
from libcxx.test.dsl import *
+from libcxx.test.features import _isMSVC
-_allStandards = ['c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++2a']
+_warningFlags = [
+ '-Werror',
+ '-Wall',
+ '-Wextra',
+ '-Wshadow',
+ '-Wundef',
+ '-Wno-unused-command-line-argument',
+ '-Wno-attributes',
+ '-Wno-pessimizing-move',
+ '-Wno-c++11-extensions',
+ '-Wno-user-defined-literals',
+ '-Wno-noexcept-type',
+ '-Wno-aligned-allocation-unavailable',
+ '-Wno-atomic-alignment',
+
+ # GCC warns about places where we might want to add sized allocation/deallocation
+ # functions, but we know better what we're doing/testing in the test suite.
+ '-Wno-sized-deallocation',
+
+ # These warnings should be enabled in order to support the MSVC
+ # team using the test suite; They enable the warnings below and
+ # expect the test suite to be clean.
+ '-Wsign-compare',
+ '-Wunused-variable',
+ '-Wunused-parameter',
+ '-Wunreachable-code',
+ '-Wno-unused-local-typedef',
+]
+
+_allStandards = ['c++03', 'c++11', 'c++14', 'c++17', 'c++20', 'c++2b']
+def getStdFlag(cfg, std):
+ fallbacks = {
+ 'c++11': 'c++0x',
+ 'c++14': 'c++1y',
+ 'c++17': 'c++1z',
+ 'c++20': 'c++2a',
+ }
+ if hasCompileFlag(cfg, '-std='+std):
+ return '-std='+std
+ if std in fallbacks and hasCompileFlag(cfg, '-std='+fallbacks[std]):
+ return '-std='+fallbacks[std]
+ return None
+
+DEFAULT_PARAMETERS = [
+ Parameter(name='target_triple', type=str,
+ help="The target triple to compile the test suite for. This must be "
+ "compatible with the target that the tests will be run on.",
+ actions=lambda triple: filter(None, [
+ AddFeature('target={}'.format(triple)),
+ AddFlagIfSupported('--target={}'.format(triple)),
+ ])),
-parameters = [
- # Core parameters of the test suite
Parameter(name='std', choices=_allStandards, type=str,
help="The version of the standard to compile the test suite with.",
- default=lambda cfg: next(s for s in reversed(_allStandards) if hasCompileFlag(cfg, '-std='+s)),
- feature=lambda std:
- Feature(name=std, compileFlag='-std={}'.format(std),
- when=lambda cfg: hasCompileFlag(cfg, '-std={}'.format(std)))),
+ default=lambda cfg: next(s for s in reversed(_allStandards) if getStdFlag(cfg, s)),
+ actions=lambda std: [
+ AddFeature(std),
+ AddCompileFlag(lambda cfg: getStdFlag(cfg, std)),
+ ]),
+
+ Parameter(name='enable_modules', choices=[True, False], type=bool, default=False,
+ help="Whether to build the test suite with Clang modules enabled.",
+ actions=lambda modules: [
+ AddFeature('modules-build'),
+ AddCompileFlag('-fmodules'),
+ AddCompileFlag('-Xclang -fmodules-local-submodule-visibility'),
+ ] if modules else []),
Parameter(name='enable_exceptions', choices=[True, False], type=bool, default=True,
help="Whether to enable exceptions when compiling the test suite.",
- feature=lambda exceptions: None if exceptions else
- Feature(name='no-exceptions', compileFlag='-fno-exceptions')),
+ actions=lambda exceptions: [] if exceptions else [
+ AddFeature('no-exceptions'),
+ AddCompileFlag('-fno-exceptions')
+ ]),
+
+ Parameter(name='enable_rtti', choices=[True, False], type=bool, default=True,
+ help="Whether to enable RTTI when compiling the test suite.",
+ actions=lambda rtti: [] if rtti else [
+ AddFeature('no-rtti'),
+ AddCompileFlag('-fno-rtti')
+ ]),
Parameter(name='stdlib', choices=['libc++', 'libstdc++', 'msvc'], type=str, default='libc++',
help="The C++ Standard Library implementation being tested.",
- feature=lambda stdlib: Feature(name=stdlib)),
+ actions=lambda stdlib: [
+ AddFeature(stdlib)
+ ]),
+
+ Parameter(name='enable_warnings', choices=[True, False], type=bool, default=True,
+ help="Whether to enable warnings when compiling the test suite.",
+ actions=lambda warnings: [] if not warnings else [
+ AddOptionalWarningFlag(w) for w in _warningFlags
+ ]),
+
+ Parameter(name='debug_level', choices=['', '0', '1'], type=str, default='',
+ help="The debugging level to enable in the test suite.",
+ actions=lambda debugLevel: [] if debugLevel == '' else [
+ AddFeature('debug_level={}'.format(debugLevel)),
+ AddCompileFlag('-D_LIBCPP_DEBUG={}'.format(debugLevel))
+ ]),
+
+ Parameter(name='use_sanitizer', choices=['', 'Address', 'Undefined', 'Memory', 'MemoryWithOrigins', 'Thread', 'DataFlow', 'Leaks'], type=str, default='',
+ help="An optional sanitizer to enable when building and running the test suite.",
+ actions=lambda sanitizer: filter(None, [
+ AddFlag('-g -fno-omit-frame-pointer') if sanitizer else None,
+
+ AddFlag('-fsanitize=undefined -fno-sanitize=float-divide-by-zero -fno-sanitize-recover=all') if sanitizer == 'Undefined' else None,
+ AddFeature('ubsan') if sanitizer == 'Undefined' else None,
+
+ AddFlag('-fsanitize=address') if sanitizer == 'Address' else None,
+ AddFeature('asan') if sanitizer == 'Address' else None,
- # Parameters to enable or disable parts of the test suite
- Parameter(name='enable_filesystem', choices=[True, False], type=bool, default=True,
- help="Whether to enable tests for the C++ <filesystem> library.",
- feature=lambda filesystem: None if filesystem else
- Feature(name='c++filesystem-disabled')),
+ AddFlag('-fsanitize=memory') if sanitizer in ['Memory', 'MemoryWithOrigins'] else None,
+ AddFeature('msan') if sanitizer in ['Memory', 'MemoryWithOrigins'] else None,
+ AddFlag('-fsanitize-memory-track-origins') if sanitizer == 'MemoryWithOrigins' else None,
- Parameter(name='enable_experimental', choices=[True, False], type=bool, default=False,
- help="Whether to enable tests for experimental C++ libraries (typically Library Fundamentals TSes).",
- feature=lambda experimental: None if not experimental else
- Feature(name='c++experimental', linkFlag='-lc++experimental')),
+ AddFlag('-fsanitize=thread') if sanitizer == 'Thread' else None,
+ AddFeature('tsan') if sanitizer == 'Thread' else None,
+
+ AddFlag('-fsanitize=dataflow') if sanitizer == 'DataFlow' else None,
+ AddFlag('-fsanitize=leaks') if sanitizer == 'Leaks' else None,
+
+ AddFeature('sanitizer-new-delete') if sanitizer in ['Address', 'Memory', 'MemoryWithOrigins', 'Thread'] else None,
+ ])),
+
+ Parameter(name='enable_experimental', choices=[True, False], type=bool, default=True,
+ help="Whether to enable tests for experimental C++ libraries (typically Library Fundamentals TSes).",
+ actions=lambda experimental: [] if not experimental else [
+ AddFeature('c++experimental'),
+ # When linking in MSVC mode via the Clang driver, a -l<foo>
+ # maps to <foo>.lib, so we need to use -llibc++experimental here
+ # to make it link against the static libc++experimental.lib.
+ # We can't check for the feature 'msvc' in available_features
+ # as those features are added after processing parameters.
+ PrependLinkFlag(lambda config: '-llibc++experimental' if _isMSVC(config) else '-lc++experimental')
+ ]),
Parameter(name='long_tests', choices=[True, False], type=bool, default=True,
- help="Whether to tests that take longer to run. This can be useful when running on a very slow device.",
- feature=lambda enabled: Feature(name='long_tests') if enabled else None),
+ help="Whether to enable tests that take longer to run. This can be useful when running on a very slow device.",
+ actions=lambda enabled: [] if not enabled else [
+ AddFeature('long_tests')
+ ]),
+
+ Parameter(name='enable_debug_tests', choices=[True, False], type=bool, default=True,
+ help="Whether to enable tests that exercise the libc++ debugging mode.",
+ actions=lambda enabled: [] if enabled else [
+ AddFeature('libcxx-no-debug-mode')
+ ]),
+
+ Parameter(name='enable_32bit', choices=[True, False], type=bool, default=False,
+ help="Whether to build the test suite in 32 bit mode even on a 64 bit target. This basically controls "
+ "whether -m32 is used when building the test suite.",
+ actions=lambda enabled: [] if not enabled else [
+ AddFlag('-m32')
+ ]),
+
+ Parameter(name='additional_features', type=list, default=[],
+ help="A comma-delimited list of additional features that will be enabled when running the tests. "
+ "This should be used sparingly since specifying ad-hoc features manually is error-prone and "
+ "brittle in the long run as changes are made to the test suite.",
+ actions=lambda features: [AddFeature(f) for f in features]),
+]
+
+DEFAULT_PARAMETERS += [
+ Parameter(name='use_system_cxx_lib', choices=[True, False], type=bool, default=False,
+ help="""
+ Whether the test suite is being *run* against the library shipped on the
+ target triple in use, as opposed to the trunk library.
+
+ When vendor-specific availability annotations are enabled, we add the
+ 'use_system_cxx_lib' Lit feature to allow writing XFAIL or UNSUPPORTED
+ markup for tests that are known to fail on a particular triple.
+
+ That feature can be used to XFAIL a test that fails when deployed on (or is
+ compiled for) an older system. For example, if the test exhibits a bug in the
+ libc on a particular system version, or if the test uses a symbol that is not
+ available on an older version of the dylib, it can be marked as XFAIL with
+ the above feature.
+
+ It is sometimes useful to check that a test fails specifically when compiled
+ for a given deployment target. For example, this is the case when testing
+ availability markup, where we want to make sure that using the annotated
+ facility on a deployment target that doesn't support it will fail at compile
+ time, not at runtime. This can be achieved by creating a `.compile.pass.cpp`
+ and XFAILing it for the right deployment target. If the test doesn't fail at
+ compile-time like it's supposed to, the test will XPASS. Another option is to
+ create a `.verify.cpp` test that checks for the right errors, and mark that
+ test as requiring `use_system_cxx_lib && <target>`.
+ """,
+ actions=lambda useSystem: [
+ AddFeature('use_system_cxx_lib')
+ ] if useSystem else [
+ # If we're testing upstream libc++, disable availability markup,
+ # which is not relevant for non-shipped flavors of libc++.
+ AddCompileFlag('-D_LIBCPP_DISABLE_AVAILABILITY')
+ ])
]
self.full_config = full_config
self.executor = None
- def platform(self):
- return sys.platform.lower().strip()
-
def is_windows(self):
- return self.platform() == 'win32'
+ return False
+
+ def is_zos(self):
+ return False
- def is_darwin(self):
- return self.platform() == 'darwin'
+ def is_mingw(self):
+ return False
+ def add_cxx_flags(self, flags): pass
def add_cxx_compile_flags(self, flags): pass
def add_cxx_link_flags(self, flags): pass
def allow_cxxabi_link(self): return True
def __init__(self, full_config):
super(DarwinLocalTI, self).__init__(full_config)
- def is_host_macosx(self):
- name = lit.util.to_string(subprocess.check_output(['sw_vers', '-productName'])).strip()
- return name == "Mac OS X"
-
- def get_macosx_version(self):
- assert self.is_host_macosx()
- version = lit.util.to_string(subprocess.check_output(['sw_vers', '-productVersion'])).strip()
- version = re.sub(r'([0-9]+\.[0-9]+)(\..*)?', r'\1', version)
- return version
-
- def get_sdk_version(self, name):
- assert self.is_host_macosx()
- cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
- try:
- out = subprocess.check_output(cmd).strip()
- except OSError:
- pass
-
- if not out:
- self.full_config.lit_config.fatal(
- "cannot infer sdk version with: %r" % cmd)
-
- return re.sub(r'.*/[^0-9]+([0-9.]+)\.sdk', r'\1', out)
-
- def get_platform(self):
- platform = self.full_config.get_lit_conf('platform')
- if platform:
- platform = re.sub(r'([^0-9]+)([0-9\.]*)', r'\1-\2', platform)
- name, version = tuple(platform.split('-', 1))
- else:
- name = 'macosx'
- version = None
-
- if version:
- return (False, name, version)
-
- # Infer the version, either from the SDK or the system itself. For
- # macosx, ignore the SDK version; what matters is what's at
- # /usr/lib/libc++.dylib.
- if name == 'macosx':
- version = self.get_macosx_version()
- else:
- version = self.get_sdk_version(name)
- return (True, name, version)
-
- def add_cxx_compile_flags(self, flags):
- if self.full_config.use_deployment:
- _, name, _ = self.full_config.config.deployment
- cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
- else:
- cmd = ['xcrun', '--show-sdk-path']
- out, err, exit_code = executeCommand(cmd)
+ def add_cxx_flags(self, flags):
+ out, err, exit_code = executeCommand(['xcrun', '--show-sdk-path'])
if exit_code != 0:
self.full_config.lit_config.warning("Could not determine macOS SDK path! stderr was " + err)
if exit_code == 0 and out:
def __init__(self, full_config):
super(LinuxLocalTI, self).__init__(full_config)
- def platform(self):
- return 'linux'
-
- def _distribution(self):
- try:
- # linux_distribution is not available since Python 3.8
- # However, this function is only used to detect SLES 11,
- # which is quite an old distribution that doesn't have
- # Python 3.8.
- return platform.linux_distribution()
- except AttributeError:
- return '', '', ''
-
- def platform_name(self):
- name, _, _ = self._distribution()
- # Some distros have spaces, e.g. 'SUSE Linux Enterprise Server'
- # lit features can't have spaces
- name = name.lower().strip().replace(' ', '-')
- return name # Permitted to be None
-
- def platform_ver(self):
- _, ver, _ = self._distribution()
- ver = ver.lower().strip().replace(' ', '-')
- return ver # Permitted to be None.
-
def add_cxx_compile_flags(self, flags):
flags += ['-D__STDC_FORMAT_MACROS',
'-D__STDC_LIMIT_MACROS',
def __init__(self, full_config):
super(WindowsLocalTI, self).__init__(full_config)
+ def is_windows(self):
+ return True
+
+class ZOSLocalTI(DefaultTargetInfo):
+ def __init__(self, full_config):
+ super(ZOSLocalTI, self).__init__(full_config)
+
+ def is_zos(self):
+ return True
+
+class MingwLocalTI(WindowsLocalTI):
+ def __init__(self, full_config):
+ super(MingwLocalTI, self).__init__(full_config)
+
+ def is_mingw(self):
+ return True
+
def make_target_info(full_config):
default = "libcxx.test.target_info.LocalTI"
info_str = full_config.get_lit_conf('target_info', default)
if target_system == 'NetBSD': return NetBSDLocalTI(full_config)
if target_system == 'Linux': return LinuxLocalTI(full_config)
if target_system == 'Windows': return WindowsLocalTI(full_config)
+ if target_system == 'OS/390': return ZOSLocalTI(full_config)
return DefaultTargetInfo(full_config)
parser.add_argument(
'-L', dest='search_paths',
help='Paths to search for the libraries along', action='append',
- nargs=1)
+ nargs=1, default=[])
parser.add_argument(
'--ar', dest='ar_exe', required=False,
help='The ar executable to use, finds \'ar\' in the path if not given',
if args.use_libtool:
files = [f for f in files if not f.startswith('__.SYMDEF')]
- execute_command_verbose([libtool_exe, '-static', '-o', args.output, '-s'] + files,
+ execute_command_verbose([libtool_exe, '-static', '-o', args.output] + files,
cwd=temp_directory_root, verbose=args.verbose)
else:
execute_command_verbose([ar_exe, 'rcs', args.output] + files,
"""
import argparse
+import os
+import platform
import subprocess
import sys
parser.add_argument('--execdir', type=str, required=True)
parser.add_argument('--codesign_identity', type=str, required=False, default=None)
parser.add_argument('--env', type=str, nargs='*', required=False, default=dict())
- (args, remaining) = parser.parse_known_args(sys.argv[1:])
-
- if len(remaining) < 2:
- sys.stderr.write('Missing actual commands to run')
- exit(1)
- commandLine = remaining[1:] # Skip the '--'
-
- # Do any necessary codesigning.
+ parser.add_argument("command", nargs=argparse.ONE_OR_MORE)
+ args = parser.parse_args()
+ commandLine = args.command
+
+ # HACK:
+ # If an argument is a file that ends in `.tmp.exe`, assume it is the name
+ # of an executable generated by a test file. We call these test-executables
+ # below. This allows us to do custom processing like codesigning test-executables.
+ # It's also possible for there to be no such executable, for example in the case
+ # of a .sh.cpp test.
+ isTestExe = lambda exe: exe.endswith('.tmp.exe') and os.path.exists(exe)
+
+ # Do any necessary codesigning of test-executables found in the command line.
if args.codesign_identity:
- exe = commandLine[0]
- rc = subprocess.call(['xcrun', 'codesign', '-f', '-s', args.codesign_identity, exe], env={})
- if rc != 0:
- sys.stderr.write('Failed to codesign: ' + exe)
- return rc
+ for exe in filter(isTestExe, commandLine):
+ subprocess.check_call(['xcrun', 'codesign', '-f', '-s', args.codesign_identity, exe], env={})
# Extract environment variables into a dictionary
env = {k : v for (k, v) in map(lambda s: s.split('=', 1), args.env)}
+ if platform.system() == 'Windows':
+ # Pass some extra variables through on Windows:
+ # COMSPEC is needed for running subprocesses via std::system().
+ if 'COMSPEC' in os.environ:
+ env['COMSPEC'] = os.environ.get('COMSPEC')
+ # TEMP is needed for placing temp files in a sensible directory.
+ if 'TEMP' in os.environ:
+ env['TEMP'] = os.environ.get('TEMP')
# Run the command line with the given environment in the execution directory.
- return subprocess.call(subprocess.list2cmdline(commandLine), cwd=args.execdir, env=env, shell=True)
+ return subprocess.call(commandLine, cwd=args.execdir, env=env, shell=False)
if __name__ == '__main__':
import argparse
import os
import posixpath
+import shlex
import subprocess
import sys
import tarfile
import tempfile
+try:
+ from shlex import quote as cmd_quote
+except ImportError:
+ # for Python 2 compatibility
+ from pipes import quote as cmd_quote
+
+def ssh(args, command):
+ cmd = ['ssh', '-oBatchMode=yes']
+ if args.extra_ssh_args is not None:
+ cmd.extend(shlex.split(args.extra_ssh_args))
+ return cmd + [args.host, command]
+
+
+def scp(args, src, dst):
+ cmd = ['scp', '-q', '-oBatchMode=yes']
+ if args.extra_scp_args is not None:
+ cmd.extend(shlex.split(args.extra_scp_args))
+ return cmd + [src, '{}:{}'.format(args.host, dst)]
+
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--host', type=str, required=True)
parser.add_argument('--execdir', type=str, required=True)
+ parser.add_argument('--tempdir', type=str, required=False, default='/tmp')
+ parser.add_argument('--extra-ssh-args', type=str, required=False)
+ parser.add_argument('--extra-scp-args', type=str, required=False)
parser.add_argument('--codesign_identity', type=str, required=False, default=None)
parser.add_argument('--env', type=str, nargs='*', required=False, default=dict())
- (args, remaining) = parser.parse_known_args(sys.argv[1:])
-
- if len(remaining) < 2:
- sys.stderr.write('Missing actual commands to run')
- return 1
-
- commandLine = remaining[1:] # Skip the '--'
-
- ssh = lambda command: ['ssh', '-oBatchMode=yes', args.host, command]
- scp = lambda src, dst: ['scp', '-q', '-oBatchMode=yes', src, '{}:{}'.format(args.host, dst)]
+ parser.add_argument("command", nargs=argparse.ONE_OR_MORE)
+ args = parser.parse_args()
+ commandLine = args.command
# Create a temporary directory where the test will be run.
# That is effectively the value of %T on the remote host.
- tmp = subprocess.check_output(ssh('mktemp -d /tmp/libcxx.XXXXXXXXXX'), universal_newlines=True).strip()
+ tmp = subprocess.check_output(ssh(args, 'mktemp -d {}/libcxx.XXXXXXXXXX'.format(args.tempdir)), universal_newlines=True).strip()
# HACK:
# If an argument is a file that ends in `.tmp.exe`, assume it is the name
# the temporary file while still open doesn't work on Windows.
tmpTar.close()
remoteTarball = pathOnRemote(tmpTar.name)
- subprocess.check_call(scp(tmpTar.name, remoteTarball))
+ subprocess.check_call(scp(args, tmpTar.name, remoteTarball))
finally:
# Make sure we close the file in case an exception happens before
# we've closed it above -- otherwise close() is idempotent.
commandLine = (pathOnRemote(x) if isTestExe(x) else x for x in commandLine)
remoteCommands.append('cd {}'.format(tmp))
if args.env:
- remoteCommands.append('export {}'.format(' '.join(args.env)))
+ remoteCommands.append('export {}'.format(cmd_quote(' '.join(args.env))))
remoteCommands.append(subprocess.list2cmdline(commandLine))
# Finally, SSH to the remote host and execute all the commands.
- rc = subprocess.call(ssh(' && '.join(remoteCommands)))
+ rc = subprocess.call(ssh(args, ' && '.join(remoteCommands)))
return rc
finally:
# Make sure the temporary directory is removed when we're done.
- subprocess.check_call(ssh('rm -r {}'.format(tmp)))
+ subprocess.check_call(ssh(args, 'rm -r {}'.format(tmp)))
if __name__ == '__main__':